bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [PATCH] fix build warnings due to DEBUG_MALLOC


From: Mike Frysinger
Subject: [Bug-wget] [PATCH] fix build warnings due to DEBUG_MALLOC
Date: Mon, 21 May 2012 19:05:59 -0400

The current cleanup_html_url code warns because it's marked static
but no one calls it.  Reading the code base, we see it only gets
called when DEBUG_MALLOC is defined, so change the static markings
to check that ifdef.

The spider_cleanup has a similar problem.

Signed-off-by: Mike Frysinger <address@hidden>
---
 src/html-url.c |    4 +++-
 src/init.c     |    2 ++
 src/spider.c   |    4 +++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/html-url.c b/src/html-url.c
index 55563e2..8a3dc6c 100644
--- a/src/html-url.c
+++ b/src/html-url.c
@@ -830,7 +830,8 @@ get_urls_file (const char *file)
   return head;
 }
 
-static void
+#ifdef DEBUG_MALLOC
+void
 cleanup_html_url (void)
 {
   /* Destroy the hash tables.  The hash table keys and values are not
@@ -840,3 +841,4 @@ cleanup_html_url (void)
   if (interesting_attributes)
     hash_table_destroy (interesting_attributes);
 }
+#endif
diff --git a/src/init.c b/src/init.c
index 57a4f00..0a3c25b 100644
--- a/src/init.c
+++ b/src/init.c
@@ -1657,6 +1657,7 @@ decode_string (const char *val, const struct decode_item 
*items, int itemcount,
 
 
 void cleanup_html_url (void);
+void spider_cleanup (void);
 
 
 /* Free the memory allocated by global variables.  */
@@ -1683,6 +1684,7 @@ cleanup (void)
   res_cleanup ();
   http_cleanup ();
   cleanup_html_url ();
+  spider_cleanup ();
   host_cleanup ();
   log_cleanup ();
 
diff --git a/src/spider.c b/src/spider.c
index dad9a23..bd35f75 100644
--- a/src/spider.c
+++ b/src/spider.c
@@ -45,12 +45,14 @@ static struct hash_table *nonexisting_urls_set;
 
 /* Cleanup the data structures associated with this file.  */
 
-static void
+#ifdef DEBUG_MALLOC
+void
 spider_cleanup (void)
 {
   if (nonexisting_urls_set)
     string_set_free (nonexisting_urls_set);
 }
+#endif
 
 /* Remembers broken links.  */
 void
-- 
1.7.8.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]