From: Jean-Philippe Orsini Date: Fri, 21 Oct 2011 20:56:29 +0000 (+0000) Subject: fixed warning "var not used" X-Git-Tag: v1.3.0~120 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=ppastats.git;a=commitdiff_plain;h=9d12e96806e0833e6b859f622a29474ba01d54b3 fixed warning "var not used" --- diff --git a/src/Makefile.am b/src/Makefile.am index dd085c6..fb3ce06 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ -AM_CPPFLAGS = -Wall -std=gnu99\ +AM_CPPFLAGS = -Wall -std=gnu99 -Werror\ -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\ $(CURL_CFLAGS) $(JSON_CFLAGS) diff --git a/src/Makefile.in b/src/Makefile.in index 50303ba..b8d1898 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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) diff --git a/src/lp_json.c b/src/lp_json.c index 7cd0a86..f6bbbcd 100644 --- a/src/lp_json.c +++ b/src/lp_json.c @@ -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; }