fixed warning "var not used"
authorJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 21 Oct 2011 20:56:29 +0000 (20:56 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 21 Oct 2011 20:56:29 +0000 (20:56 +0000)
src/Makefile.am
src/Makefile.in
src/lp_json.c

index dd085c6..fb3ce06 100644 (file)
@@ -1,5 +1,5 @@
 
-AM_CPPFLAGS = -Wall -std=gnu99\
+AM_CPPFLAGS = -Wall -std=gnu99 -Werror\
         -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
        $(CURL_CFLAGS) $(JSON_CFLAGS)
 
index 50303ba..b8d1898 100644 (file)
@@ -184,7 +184,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -Wall -std=gnu99\
+AM_CPPFLAGS = -Wall -std=gnu99 -Werror\
         -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
        $(CURL_CFLAGS) $(JSON_CFLAGS)
 
index 7cd0a86..f6bbbcd 100644 (file)
@@ -174,9 +174,13 @@ json_object_to_daily_download_total(const char *d, json_object *o_c)
 static int json_object_get_fields_count(json_object *o)
 {
        int n = 0;
+       struct lh_entry *entry;
 
-       json_object_object_foreach(o, key, val)
+       entry = json_object_get_object(o)->head;
+       while (entry) {
+               entry = entry->next;
                n++;
+       }
 
        return n;
 }