libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 03/25] syntax-check: fix violations and re-enable sc_cast_of_argu


From: Gary V. Vaughan
Subject: [PATCH 03/25] syntax-check: fix violations and re-enable sc_cast_of_argument_to_free.
Date: Tue, 15 Nov 2011 19:53:41 +0700

* cfg.mk (local-checks-to-fix): Remove
sc_cast_of_argument_to_free from list of disabled checks.
* libltdl/config/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
libltdl/lt__dirent.c: Casting argument to free is never
necessary.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 build-aux/ltmain.m4sh       |    2 +-
 cfg.mk                      |    4 +---
 libltdl/libltdl/lt__alloc.h |    2 +-
 libltdl/lt__dirent.c        |    2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 24491a9..5266b01 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -3517,7 +3517,7 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
 #if defined(LT_DEBUGWRAPPER)
diff --git a/cfg.mk b/cfg.mk
index 46a1a96..cffea22 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -63,7 +63,6 @@ local-checks-to-skip =                                \
        $(local-checks-to-fix)                  \
        sc_GPL_version                          \
        sc_bindtextdomain                       \
-       sc_cast_of_argument_to_free             \
        sc_cast_of_x_alloc_return_value         \
        sc_error_message_uppercase              \
        sc_program_name                         \
@@ -71,8 +70,7 @@ local-checks-to-skip =                                \
 
 # GPL_version: checks for GPLv3, which we don't use
 # bindtextdomain: libtool isn't internationalized
-# cast_of_argument_to_free: we don't use gnulib alloc modules
-# cast_of_x_alloc_return_value: ditto
+# cast_of_x_alloc_return_value: we don't use gnulib alloc modules
 # error_message_uppercase: we like our error messages
 # program_name: libtool has no programs!
 # unmarked_diagnostics: libtool isn't internationalized
diff --git a/libltdl/libltdl/lt__alloc.h b/libltdl/libltdl/lt__alloc.h
index 45f7b52..a1d7b37 100644
--- a/libltdl/libltdl/lt__alloc.h
+++ b/libltdl/libltdl/lt__alloc.h
@@ -38,7 +38,7 @@ LT_BEGIN_C_DECLS
 #define MALLOC(tp, n)          (tp*) lt__malloc((n) * sizeof(tp))
 #define REALLOC(tp, mem, n)    (tp*) lt__realloc((mem), (n) * sizeof(tp))
 #define FREE(mem)                              LT_STMT_START { \
-       free ((void *)mem); mem = NULL;                 } LT_STMT_END
+       free (mem); mem = NULL;                                 } LT_STMT_END
 #define MEMREASSIGN(p, q)                      LT_STMT_START { \
        if ((p) != (q)) { free (p); (p) = (q); (q) = 0; }       \
                                                                } LT_STMT_END
diff --git a/libltdl/lt__dirent.c b/libltdl/lt__dirent.c
index 30dc072..1ff2051 100644
--- a/libltdl/lt__dirent.c
+++ b/libltdl/lt__dirent.c
@@ -42,7 +42,7 @@ closedir (DIR *entry)
 {
   assert (entry != (DIR *) NULL);
   FindClose (entry->hSearch);
-  free ((void *) entry);
+  free (entry);
 }
 
 
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



reply via email to

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