ext/oj/object.c in oj-2.10.1 vs ext/oj/object.c in oj-2.10.2
- old
+ new
@@ -283,11 +283,11 @@
rb_mutex_lock(oj_cache_mutex);
#endif
if (0 == (var_id = oj_attr_hash_get(key, klen, &slot))) {
char attr[256];
- if (sizeof(attr) <= klen + 2) {
+ if ((int)sizeof(attr) <= klen + 2) {
char *buf = ALLOC_N(char, klen + 2);
if ('~' == *key) {
strncpy(buf, key + 1, klen - 1);
buf[klen - 1] = '\0';
@@ -352,11 +352,11 @@
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "%s is not an odd class", rb_class2name(rb_obj_class(parent->val)));
return;
} else if (0 != oj_odd_set_arg(parent->odd_args, kval->key, kval->klen, str_to_value(pi, str, len, orig))) {
char buf[256];
- if (sizeof(buf) - 1 <= klen) {
+ if ((int)sizeof(buf) - 1 <= klen) {
klen = sizeof(buf) - 2;
}
memcpy(buf, key, klen);
buf[klen] = '\0';
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "%s is not an attribute of %s", buf, rb_class2name(rb_obj_class(parent->val)));
@@ -399,11 +399,11 @@
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "%s is not an odd class", rb_class2name(rb_obj_class(parent->val)));
return;
} else if (0 != oj_odd_set_arg(parent->odd_args, key, klen, oj_num_as_value(ni))) {
char buf[256];
- if (sizeof(buf) - 1 <= klen) {
+ if ((int)sizeof(buf) - 1 <= klen) {
klen = sizeof(buf) - 2;
}
memcpy(buf, key, klen);
buf[klen] = '\0';
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "%s is not an attribute of %s", buf, rb_class2name(rb_obj_class(parent->val)));
@@ -468,10 +468,10 @@
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "%s is not an odd class", rb_class2name(rb_obj_class(parent->val)));
return;
} else if (0 != oj_odd_set_arg(parent->odd_args, key, klen, value)) {
char buf[256];
- if (sizeof(buf) - 1 <= klen) {
+ if ((int)sizeof(buf) - 1 <= klen) {
klen = sizeof(buf) - 2;
}
memcpy(buf, key, klen);
buf[klen] = '\0';
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "%s is not an attribute of %s", buf, rb_class2name(rb_obj_class(parent->val)));