* Don't use this as a variable, so we can compile with a C++ compiler

* Add casts from void* to type of assignment when using malloc 
  * Add #ifdef __cplusplus guards to all of the headers
  * Add typedefs for json_object, json_tokener, array_list, printbuf, lh_table
    Michael Clark, <michael@metaparadigm.com>


git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@33 327403b1-1117-474d-bef2-5cb71233fd97
This commit is contained in:
Michael Clark
2009-02-25 02:31:32 +00:00
parent 266a3fd301
commit aaec1ef3c5
17 changed files with 101 additions and 27 deletions

View File

@@ -62,11 +62,11 @@ struct json_object* json_object_from_file(char *filename)
if((fd = open(filename, O_RDONLY)) < 0) {
MC_ERROR("json_object_from_file: error reading file %s: %s\n",
filename, strerror(errno));
return error_ptr(-1);
return (struct json_object*)error_ptr(-1);
}
if(!(pb = printbuf_new())) {
MC_ERROR("json_object_from_file: printbuf_new failed\n");
return error_ptr(-1);
return (struct json_object*)error_ptr(-1);
}
while((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0) {
printbuf_memappend(pb, buf, ret);
@@ -76,7 +76,7 @@ struct json_object* json_object_from_file(char *filename)
MC_ABORT("json_object_from_file: error reading file %s: %s\n",
filename, strerror(errno));
printbuf_free(pb);
return error_ptr(-1);
return (struct json_object*)error_ptr(-1);
}
obj = json_tokener_parse(pb->buf);
printbuf_free(pb);