oj 3.9.1 → 3.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/oj/parse.c +4 -0
- data/ext/oj/sparse.c +4 -0
- data/ext/oj/util.c +5 -5
- data/lib/oj/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52a998aa9f2273e995d9ef52e26df3f8998aae1a98d7d088f6973cf8234a444f
|
4
|
+
data.tar.gz: 26647fb39df6d357074e5798bf263ca708a361cf910eba43c7c7a3d1ba905f51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dffec2bd8c447ca172aa4a647a719c1cc62eeedab91ea30b79943fa212e4b78a10b3e3ddfd69e873e632c3bdddce2d955d34aa106dfa7e4f43618ea842aa829
|
7
|
+
data.tar.gz: 5dd30d0dcaf87e9b57c16ad13f0e7654ab8b8b02d8b3709f20614025283101bc44cedf4470bb2bb887b41a280d2e4b131f77a26a65a8e79447771a6bc5cca42d
|
data/ext/oj/parse.c
CHANGED
@@ -1049,6 +1049,10 @@ CLEANUP:
|
|
1049
1049
|
msg = rb_str_append(msg, oj_encode(rb_str_new2(pi->json)));
|
1050
1050
|
}
|
1051
1051
|
args[0] = msg;
|
1052
|
+
if (pi->err.clas == oj_parse_error_class) {
|
1053
|
+
// The error was an Oj::ParseError so change to a JSON::ParseError.
|
1054
|
+
pi->err.clas = oj_json_parser_error_class;
|
1055
|
+
}
|
1052
1056
|
rb_exc_raise(rb_class_new_instance(1, args, pi->err.clas));
|
1053
1057
|
} else {
|
1054
1058
|
oj_err_raise(&pi->err);
|
data/ext/oj/sparse.c
CHANGED
@@ -898,6 +898,10 @@ CLEANUP:
|
|
898
898
|
// idea.
|
899
899
|
VALUE args[] = { oj_encode(rb_str_new2(pi->err.msg)) };
|
900
900
|
|
901
|
+
if (pi->err.clas == oj_parse_error_class) {
|
902
|
+
// The error was an Oj::ParseError so change to a JSON::ParseError.
|
903
|
+
pi->err.clas = oj_json_parser_error_class;
|
904
|
+
}
|
901
905
|
rb_exc_raise(rb_class_new_instance(1, args, pi->err.clas));
|
902
906
|
} else {
|
903
907
|
oj_err_raise(&pi->err);
|
data/ext/oj/util.c
CHANGED
@@ -110,7 +110,7 @@ sec_as_time(int64_t secs, TimeInfo ti) {
|
|
110
110
|
}
|
111
111
|
}
|
112
112
|
}
|
113
|
-
ti->year = (qc - shift) * 400 + c * 100 + qy * 4 + y;
|
113
|
+
ti->year = (int)((qc - (int64_t)shift) * 400 + c * 100 + qy * 4 + y);
|
114
114
|
if (leap) {
|
115
115
|
ms = eom_leap_secs;
|
116
116
|
} else {
|
@@ -125,12 +125,12 @@ sec_as_time(int64_t secs, TimeInfo ti) {
|
|
125
125
|
break;
|
126
126
|
}
|
127
127
|
}
|
128
|
-
ti->day = secs / 86400LL;
|
128
|
+
ti->day = (int)(secs / 86400LL);
|
129
129
|
secs = secs - (int64_t)ti->day * 86400LL;
|
130
130
|
ti->day++;
|
131
|
-
ti->hour = secs / 3600LL;
|
131
|
+
ti->hour = (int)(secs / 3600LL);
|
132
132
|
secs = secs - (int64_t)ti->hour * 3600LL;
|
133
|
-
ti->min = secs / 60LL;
|
133
|
+
ti->min = (int)(secs / 60LL);
|
134
134
|
secs = secs - (int64_t)ti->min * 60LL;
|
135
|
-
ti->sec = secs;
|
135
|
+
ti->sec = (int)secs;
|
136
136
|
}
|
data/lib/oj/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|