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.
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 ();
}
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]);
}
else
{
- const char *errormsg = 0;
-
presym_free_symlists();
LT_DLMUTEX_LOCK ();
{
/* shut down libltdl */
lt_dlloader *loader;
- const char *errormsg;
int errors = 0;
LT_DLMUTEX_LOCK ();
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 ();
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;
}
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;
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,