]> granicus.if.org Git - json-c/commitdiff
Patch allows for json-c compile with -Werror and not fail due to
authorMichael Clark <michael@metaparadigm.com>
Fri, 7 Dec 2007 02:50:42 +0000 (02:50 +0000)
committerMichael Clark <michael@metaparadigm.com>
Fri, 7 Dec 2007 02:50:42 +0000 (02:50 +0000)
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
Geoffrey Young, geoff at modperlcookbook dot org

git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@20 327403b1-1117-474d-bef2-5cb71233fd97

ChangeLog
debug.h
json_object.c
json_object.h
json_tokener.h
linkhash.h
printbuf.h

index 002c995e599dd0326324df1eb1ed2a05cd325a76..0c964d67e9898b0b4487553bbc7b8b765a61d5f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
   * Fix bug with use of capital E in numbers with exponents
     Mateusz Loskot, mateusz at loskot dot net
   * Add stddef.h include
+  * Patch allows for json-c compile with -Werror and not fail due to
+    -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
+    Geoffrey Young, geoff at modperlcookbook dot org
 
 0.7
   * Add escaping of backslash to json output
diff --git a/debug.h b/debug.h
index 8c183e1abdbcfa0661cf413ab385aa8da545a0d3..951e994adcb2590215d75c0876908888b148f7ed 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -13,7 +13,7 @@
 #define _DEBUG_H_
 
 extern void mc_set_debug(int debug);
-extern int mc_get_debug();
+extern int mc_get_debug(void);
 
 extern void mc_set_syslog(int syslog);
 extern void mc_abort(const char *msg, ...);
index c1ffb0aafdb4e9d768f92ecdf6ddc8fe3c26e9e8..c702c26739c19c78d65cb111698d23427fc50c5c 100644 (file)
@@ -55,14 +55,14 @@ static struct json_object* json_object_new(enum json_type o_type);
 
 static struct lh_table *json_object_table;
 
-static void json_object_init() __attribute__ ((constructor));
-static void json_object_init() {
+static void json_object_init(void) __attribute__ ((constructor));
+static void json_object_init(void) {
   MC_DEBUG("json_object_init: creating object table\n");
   json_object_table = lh_kptr_table_new(128, "json_object_table", NULL);
 }
 
-static void json_object_fini() __attribute__ ((destructor));
-static void json_object_fini() {
+static void json_object_fini(void) __attribute__ ((destructor));
+static void json_object_fini(void) {
   struct lh_entry *ent;
   if(MC_GET_DEBUG()) {
     if (json_object_table->count) {
index 5c25968dbaf0e09c3c637e513090ca7216a981b7..d4fc8875ad1c3ff3c41dd0b25b7ed005003ed9a9 100644 (file)
@@ -98,7 +98,7 @@ extern char* json_object_to_json_string(struct json_object *obj);
 /** Create a new empty object
  * @returns a json_object of type json_type_object
  */
-extern struct json_object* json_object_new_object();
+extern struct json_object* json_object_new_object(void);
 
 /** Get the hashtable of a json_object of type json_type_object
  * @param obj the json_object instance
@@ -167,7 +167,7 @@ extern void json_object_object_del(struct json_object* obj, char *key);
 /** Create a new empty json_object of type json_type_array
  * @returns a json_object of type json_type_array
  */
-extern struct json_object* json_object_new_array();
+extern struct json_object* json_object_new_array(void);
 
 /** Get the arraylist of a json_object of type json_type_array
  * @param obj the json_object instance
index 2c7ea690a6eeb5266c82a7b5a1043ea4b57e5d70..350b1c1cdba3ff7db1856894e8c9147107bc14e1 100644 (file)
@@ -79,7 +79,7 @@ struct json_tokener
 
 extern const char* json_tokener_errors[];
 
-extern struct json_tokener* json_tokener_new();
+extern struct json_tokener* json_tokener_new(void);
 extern void json_tokener_free(struct json_tokener *tok);
 extern void json_tokener_reset(struct json_tokener *tok);
 extern struct json_object* json_tokener_parse(char *str);
index 5c9fa852d8efba088164e22f4203cd935d0cc5bb..785ddf43adcd01a7305278128f3d3c9803c71354 100644 (file)
@@ -258,4 +258,7 @@ extern int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e);
 extern int lh_table_delete(struct lh_table *t, void *k);
 
 
+void lh_abort(const char *msg, ...);
+void lh_table_resize(struct lh_table *t, int new_size);
+
 #endif
index bc1669bd194c7fe53ef232bd4b43d67d884d7a38..4591a58799c7ce9e93231f362eeb43c1c57b39bd 100644 (file)
@@ -21,7 +21,7 @@ struct printbuf {
 };
 
 extern struct printbuf*
-printbuf_new();
+printbuf_new(void);
 
 extern int
 printbuf_memappend(struct printbuf *p, char *buf, int size);