From: Gary V. Vaughan Date: Mon, 2 Jul 2001 01:21:30 +0000 (+0000) Subject: Cleanup of libltdl: X-Git-Tag: release-1-4b~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63a4771533ffa556ca8c6c54050babab49047856;p=thirdparty%2Flibtool.git 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. --- diff --git a/ChangeLog b/ChangeLog index d8504d4b8..2f6daefc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2001-07-02 Gary V. Vaughan + 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. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index cae492cd7..77c03737f 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -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; diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h index 1ec0d1a0b..82979daad 100644 --- a/libltdl/ltdl.h +++ b/libltdl/ltdl.h @@ -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,