-AM_CFLAGS = -Wall -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT
+AM_CFLAGS = -Wall -Werror -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-but-set-variable -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-AM_CFLAGS = -Wall -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT
+AM_CFLAGS = -Wall -Werror -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT
EXTRA_DIST = README.html README-WIN32.html config.h.win32 doc json-c.vcproj
SUBDIRS = . tests
lib_LTLIBRARIES = libjson-c.la
return (jso->o_type == type);
}
-enum json_type _json_object_get_type(struct json_object *jso)
+enum json_type json_object_get_type(struct json_object *jso)
{
if (!jso)
return json_type_null;
json_type_array,
json_type_string,
*/
-#define json_object_get_type _json_object_get_type
extern enum json_type json_object_get_type(struct json_object *obj);
/* Handle a 4-byte sequence, or two sequences if a surrogate pair */
while(1) {
- if( c && strchr(json_hex_chars, c)) {
+ if(strchr(json_hex_chars, c)) {
tok->ucs_char += ((unsigned int)hexdigit(c) << ((3-tok->st_pos++)*4));
if(tok->st_pos == 4) {
unsigned char unescaped_utf[4];
*/
got_hi_surrogate = tok->ucs_char;
/* Not at end, and the next two chars should be "\u" */
- if ((len == -1 || len > (tok->char_offset + 2)) &&
- // str[0] != '0' && // implied by json_hex_chars, above.
+ if ((tok->char_offset+1 != len) &&
+ (tok->char_offset+2 != len) &&
(str[1] == '\\') &&
(str[2] == 'u'))
{
* still catch it and complain. The masking trick does make the hash
* noticably faster for short strings (like English words).
*/
-#if !defined(VALGRIND) && !defined(__SANITIZE_ADDRESS__)
+#ifndef VALGRIND
switch(length)
{
-%if "%{run_tests}" == "1"
+%if "%{run_tests}" == "1"
%define check %%check
%endif
Name: json-c
-Version: 0.12
+Version: 0.12.1
Release: 0
License: MIT
Summary: JSON implementation in C
%__make -j1
%check
-chmod +x run_test.sh
-sh -c "%__make check || exit 0"
+%__make check || exit 0
%install
%make_install
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-AM_CFLAGS = -Wall -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT
+AM_CFLAGS = -Wall -Werror -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT
LDADD = $(LIBJSON_LA)
LIBJSON_LA = $(top_builddir)/libjson-c.la
TESTS = test1.test test2.test test4.test testReplaceExisting.test \
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);
- // Test with a "short" high surrogate
- new_obj = json_tokener_parse("[9,'\\uDAD");
- printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
- json_object_put(new_obj);
-
new_obj = json_tokener_parse("null");
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);
new_obj.to_string()="foo"
new_obj.to_string()="ABC"
new_obj.to_string()=null
-new_obj.to_string()=null
new_obj.to_string()=NaN
new_obj.to_string()=null
new_obj.to_string()=null