]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
syntax-check: fix violations and re-enable sc_cast_of_argument_to_free.
authorGary V. Vaughan <gary@gnu.org>
Wed, 26 Oct 2011 08:11:45 +0000 (15:11 +0700)
committerGary V. Vaughan <gary@gnu.org>
Thu, 17 Nov 2011 12:11:12 +0000 (19:11 +0700)
* cfg.mk (local-checks-to-fix): Remove
sc_cast_of_argument_to_free from list of disabled checks.
* build-aux/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
libltdl/lt__dirent.c: Casting argument to free is never
necessary.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
build-aux/ltmain.m4sh
cfg.mk
libltdl/libltdl/lt__alloc.h
libltdl/lt__dirent.c
libltdl/ltdl.c

index 5501a4db9178fceaa435a2335197b0335fb58fcc..ff3a52f8083cc9fe5bc378178b165a0dd3828c7d 100644 (file)
@@ -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 46a1a96c8c9cf04196cb77ed5640fe883b50f400..cffea223c039fd7e86c0984183c63fd5d7e5df6f 100644 (file)
--- 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
index 45f7b523cbef4a0199e1328f34d3dc0f18f2c181..a1d7b3772f2cee6a50b10619245665c2c5b69488 100644 (file)
@@ -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
index 30dc072c136be6ca6fed979f5979f84de9a1e34d..1ff205110739d87b69732ae2e74a774bded16e23 100644 (file)
@@ -42,7 +42,7 @@ closedir (DIR *entry)
 {
   assert (entry != (DIR *) NULL);
   FindClose (entry->hSearch);
-  free ((void *) entry);
+  free (entry);
 }
 
 
index 01853e05832b7c1d152bdc937e94b6664513996f..85f84521731497959fb02da34bb1ec5a29172dcf 100644 (file)
@@ -2281,7 +2281,7 @@ lt_dlisresident   (lt_dlhandle handle)
 /* --- MODULE INFORMATION --- */
 
 typedef struct {
-  const char *id_string;
+  char *id_string;
   lt_dlhandle_interface *iface;
 } lt__interface_id;