]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Cleanup of libltdl:
authorGary V. Vaughan <gary@gnu.org>
Mon, 2 Jul 2001 01:21:30 +0000 (01:21 +0000)
committerGary V. Vaughan <gary@gnu.org>
Mon, 2 Jul 2001 01:21:30 +0000 (01:21 +0000)
* ltdl.c (lt_dladderror): Don't use `index' as a variable name,
since it is a function on BSD based boxes.
(lt_dlseterror): Ditto.
(lt_dlexit): Remove unused errormsg declaration.
(foreach_dirinpath):  Make sure filename is initialised.
(find_handle):  Return NULL for a failed search.
(foreachfile_callback): Don't reuse data2 symbol from prototype
in func declaration to prevent symbol shadowing.
* ltdl.h (lt_dlmutex_seterror): Don't use `error' as a parameter
name, since it is a function on glibc boxes.

ChangeLog
libltdl/ltdl.c
libltdl/ltdl.h

index d8504d4b88de569496ffa8ae543e32a4398d980e..2f6daefc07d2b26129cb72df79a354f117183d60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2001-07-02  Gary V. Vaughan  <gary@gnu.org>
 
+       Cleanup of libltdl:
+       * ltdl.c (lt_dladderror): Don't use `index' as a variable name,
+       since it is a function on BSD based boxes.
+       (lt_dlseterror): Ditto.
+       (lt_dlexit): Remove unused errormsg declaration.
+       (foreach_dirinpath):  Make sure filename is initialised.
+       (find_handle):  Return NULL for a failed search.
+       (foreachfile_callback): Don't reuse data2 symbol from prototype
+       in func declaration to prevent symbol shadowing.
+       * ltdl.h (lt_dlmutex_seterror): Don't use `error' as a parameter
+       name, since it is a function on glibc boxes.
+
        * libtoolize.in:  Display --version in the same format as
        autoconf and automake.
        * ltmain.in: Ditto.
index cae492cd797169654168909ca879ab32b9d344fa..77c03737fd2832b57c234f18ab56007a06751ff3 100644 (file)
@@ -302,23 +302,23 @@ int
 lt_dladderror (diagnostic)
      const char *diagnostic;
 {
-  int          index    = 0;
+  int          errindex = 0;
   int          result   = -1;
   const char  **temp     = (const char **) 0;
 
   LT_DLMUTEX_LOCK ();
 
-  index         = errorcount - LT_ERROR_MAX;
-  temp = LT_DLREALLOC (const char *, user_error_strings, 1 + index);
+  errindex = errorcount - LT_ERROR_MAX;
+  temp = LT_DLREALLOC (const char *, user_error_strings, 1 + errindex);
   if (temp == 0)
     {
       LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
     }
   else
     {
-      user_error_strings       = temp;
-      user_error_strings[index] = diagnostic;
-      result                   = errorcount++;
+      user_error_strings               = temp;
+      user_error_strings[errindex]     = diagnostic;
+      result                           = errorcount++;
     }
 
   LT_DLMUTEX_UNLOCK ();
@@ -327,20 +327,20 @@ lt_dladderror (diagnostic)
 }
 
 int
-lt_dlseterror (index)
-     int index;
+lt_dlseterror (errindex)
+     int errindex;
 {
   int          errors   = 0;
 
   LT_DLMUTEX_LOCK ();
 
-  if (index >= errorcount || index < 0)
+  if (errindex >= errorcount || errindex < 0)
     {
       /* Ack!  Error setting the error message! */
       LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE));
       ++errors;
     }
-  else if (index < LT_ERROR_MAX)
+  else if (errindex < LT_ERROR_MAX)
     {
       /* No error setting the error message! */
       LT_DLMUTEX_SETERROR (lt_dlerror_strings[errorcount]);
@@ -1392,8 +1392,6 @@ lt_dlpreload (preloaded)
     }
   else
     {
-      const char *errormsg = 0;
-
       presym_free_symlists();
   
       LT_DLMUTEX_LOCK ();
@@ -1422,7 +1420,6 @@ lt_dlexit ()
 {
   /* shut down libltdl */
   lt_dlloader *loader;
-  const char  *errormsg;
   int         errors   = 0;
 
   LT_DLMUTEX_LOCK ();
@@ -1720,7 +1717,8 @@ foreach_dirinpath (search_path, base_name, func, data1, data2)
   int  result          = 0;
   int  filenamesize    = 0;
   int  lenbase         = LT_DLSTRLEN (base_name);
-  char *filename, *canonical, *next;
+  char *filename       = 0;
+  char *canonical, *next;
 
   LT_DLMUTEX_LOCK ();
 
@@ -1865,7 +1863,10 @@ find_handle (search_path, base_name, handle)
      const char *base_name;
      lt_dlhandle *handle;
 {
-  foreach_dirinpath (search_path, base_name, find_handle_callback, handle, 0);
+  if (!foreach_dirinpath (search_path, base_name, find_handle_callback,
+                         handle, 0))
+    return 0;
+
   return handle;
 }
 
@@ -2552,8 +2553,8 @@ foreachfile_callback (dirname, data1, data2)
      lt_ptr data1;
      lt_ptr data2;
 {
-  int (*func) LT_PARAMS((const char *filename, lt_ptr data2))
-       = (int (*) LT_PARAMS((const char *filename, lt_ptr data2))) data1;
+  int (*func) LT_PARAMS((const char *filename, lt_ptr data))
+       = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1;
 
   char *filename       = 0;
   int  filenamesize    = 0;
index 1ec0d1a0baa842fb64cd9ffd3b53fab3230f0b8c..82979daad4f6a17e88827e84a44d70f56d3cf41a 100644 (file)
@@ -175,7 +175,7 @@ extern      int         lt_dlisresident     LT_PARAMS((lt_dlhandle handle));
 
 typedef void   lt_dlmutex_lock         LT_PARAMS((void));
 typedef void   lt_dlmutex_unlock       LT_PARAMS((void));
-typedef void   lt_dlmutex_seterror     LT_PARAMS((const char *error));
+typedef void   lt_dlmutex_seterror     LT_PARAMS((const char *errmsg));
 typedef const char *lt_dlmutex_geterror        LT_PARAMS((void));
 
 extern int     lt_dlmutex_register     LT_PARAMS((lt_dlmutex_lock *lock,