[kaffe] CVS kaffe (guilhem): Fixlets.
Kaffe CVS
cvs-commits at kaffe.org
Fri Dec 31 03:13:07 PST 2004
PatchSet 5733
Date: 2004/12/31 11:07:05
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Fixlets.
* include/Makefile.am
(NOINSTALL_DERIVED_HDRS): Added java_lang_VMClassLoader.h.
* configure.ac: Removed the detection of broken setsockopt.
* kaffe/kaffevm/jni/jni-string.c
(KaffeJNI_NewStringUTF): If data is NULL we should return NULL
directly.
* kaffe/kaffevm/systems/unix-pthreads/syscalls.c
(jthreadedAccept): Use the old implementation using select all the
time. It looks like being the only really working way of handling
timeouts.
* libraries/clib/native/ClassLoader.c: Include
java_lang_VMClassLoader.h to fix some warnings.
* configure, include/Makefile.in, config/config.h.in,
libltdl/ltdl.c: Regenerated.
Members:
ChangeLog:1.3277->1.3278
configure:1.407->1.408
configure.ac:1.98->1.99
config/config.h.in:1.131->1.132
include/Makefile.am:1.81->1.82
include/Makefile.in:1.201->1.202
kaffe/kaffevm/jni/jni-string.c:1.6->1.7
kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.26->1.27
libltdl/ltdl.c:1.43->1.44
libraries/clib/native/ClassLoader.c:1.41->1.42
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3277 kaffe/ChangeLog:1.3278
--- kaffe/ChangeLog:1.3277 Thu Dec 30 10:35:39 2004
+++ kaffe/ChangeLog Fri Dec 31 11:07:05 2004
@@ -1,5 +1,27 @@
2004-12-30 Guilhem Lavaux <guilhem at kaffe.org>
+ * include/Makefile.am
+ (NOINSTALL_DERIVED_HDRS): Added java_lang_VMClassLoader.h.
+
+ * configure.ac: Removed the detection of broken setsockopt.
+
+ * kaffe/kaffevm/jni/jni-string.c
+ (KaffeJNI_NewStringUTF): If data is NULL we should return NULL
+ directly.
+
+ * kaffe/kaffevm/systems/unix-pthreads/syscalls.c
+ (jthreadedAccept): Use the old implementation using select all the
+ time. It looks like being the only really working way of handling
+ timeouts.
+
+ * libraries/clib/native/ClassLoader.c: Include
+ java_lang_VMClassLoader.h to fix some warnings.
+
+ * configure, include/Makefile.in, config/config.h.in,
+ libltdl/ltdl.c: Regenerated.
+
+2004-12-30 Guilhem Lavaux <guilhem at kaffe.org>
+
* kaffe/kaffevm/systems/unix-jthreads/jsignal.h,
kaffe/kaffevm/systems/unix-jthreads/signal.c:
Brought back ignoreSignal as a global symbol but renamed it to
Index: kaffe/configure
diff -u kaffe/configure:1.407 kaffe/configure:1.408
--- kaffe/configure:1.407 Sat Dec 25 19:09:03 2004
+++ kaffe/configure Fri Dec 31 11:07:07 2004
@@ -42737,7 +42737,10 @@
;;
linux*)
if test "$ac_cv_c_compile_value_glibc" -le "2"; then
- BOEHMGC_SPECIFIC_FLAGS="$BOEHMGC_SPECIFIC_FLAGS -DGC_LINUX_THREADS -DTHREAD_LOCAL_ALLOC"
+ BOEHMGC_SPECIFIC_FLAGS="$BOEHMGC_SPECIFIC_FLAGS -DGC_LINUX_THREADS"
+ if test "$Khost_cpu" = "i386"; then
+ BOEHMGC_SPECIFIC_FLAGS="$BOEHMGC_SPECIFIC_FLAGS -DTHREAD_LOCAL_ALLOC"
+ fi
fi
;;
*)
@@ -51889,84 +51892,6 @@
fi
-echo "$as_me:$LINENO: checking whether setsockopt(SO_RCVTIMEO) is broken" >&5
-echo $ECHO_N "checking whether setsockopt(SO_RCVTIMEO) is broken... $ECHO_C" >&6
-if test "${ac_cv_so_rcvtimeo_broken+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_so_rcvtimeo_broken=cross
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#if defined(HAVE_SYS_TYPES_H)
-#include <sys/types.h>
-#endif
-
-#if defined(HAVE_SYS_SOCKET_H)
-#include <sys/socket.h>
-#endif
-
-#if defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-int main(void) {
- int fd;
- int ret;
- struct timeval new_tv;
-
- /* Open the socket (INET/TCP).*/
- fd = socket(AF_INET, SOCK_STREAM, 0);
-
- /* set the timeout for the incoming queue */
- /* 1 second for example */
- new_tv.tv_sec = 1;
- new_tv.tv_usec = 0;
-
- ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &new_tv, sizeof(new_tv));
- return ret;
-}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_so_rcvtimeo_broken=no
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_so_rcvtimeo_broken=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_so_rcvtimeo_broken" >&5
-echo "${ECHO_T}$ac_cv_so_rcvtimeo_broken" >&6
-if test x"$ac_cv_so_rcvtimeo_broken" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_SO_RCVTIMEO 1
-_ACEOF
-
-fi
-
if test "$ac_cv_c_compile_value_glibc" -le "2"; then
if test "$ac_cv_c_compile_value_glibc_minor" -le "2"; then
@@ -56851,7 +56776,7 @@
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
- echo "configure: 56858: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
+ echo "configure: 56779: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@@ -56969,7 +56894,7 @@
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
-/* #line 56976 "configure" */
+/* #line 56897 "configure" */
public class Test {
}
EOF
@@ -57006,7 +56931,7 @@
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
-/* [#]line 57013 "configure" */
+/* [#]line 56934 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.98 kaffe/configure.ac:1.99
--- kaffe/configure.ac:1.98 Sat Dec 25 19:09:10 2004
+++ kaffe/configure.ac Fri Dec 31 11:07:10 2004
@@ -1519,45 +1519,6 @@
AC_DEFINE(HAVE_DECLARED_SWAB, 1, [Is function swab declared])
fi
-dnl =========================================================
-dnl Test whether SO_RCVTIMEO is broken
-dnl =========================================================
-AC_CACHE_CHECK([whether setsockopt(SO_RCVTIMEO) is broken],
- ac_cv_so_rcvtimeo_broken, [dnl
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#if defined(HAVE_SYS_TYPES_H)
-#include <sys/types.h>
-#endif
-
-#if defined(HAVE_SYS_SOCKET_H)
-#include <sys/socket.h>
-#endif
-
-#if defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-int main(void) {
- int fd;
- int ret;
- struct timeval new_tv;
-
- /* Open the socket (INET/TCP).*/
- fd = socket(AF_INET, SOCK_STREAM, 0);
-
- /* set the timeout for the incoming queue */
- /* 1 second for example */
- new_tv.tv_sec = 1;
- new_tv.tv_usec = 0;
-
- ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &new_tv, sizeof(new_tv));
- return ret;
-}
-]])],[ac_cv_so_rcvtimeo_broken=no],[ac_cv_so_rcvtimeo_broken=yes],[ac_cv_so_rcvtimeo_broken=cross])])
-if test x"$ac_cv_so_rcvtimeo_broken" = x"yes"; then
- AC_DEFINE(HAVE_BROKEN_SO_RCVTIMEO, 1, [Define if setsockopt(SO_RCVTIMEO) is broken])
-fi
-
dnl ------------------------------------------------------------
dnl Check for old linux threads (glibc <= 2.2)
dnl ------------------------------------------------------------
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.131 kaffe/config/config.h.in:1.132
--- kaffe/config/config.h.in:1.131 Wed Dec 1 02:41:49 2004
+++ kaffe/config/config.h.in Fri Dec 31 11:07:14 2004
@@ -64,9 +64,6 @@
/* Do we have bool */
#undef HAVE_BOOL
-/* Define if setsockopt(SO_RCVTIMEO) is broken */
-#undef HAVE_BROKEN_SO_RCVTIMEO
-
/* Define to 1 if you have the <bsd/libc.h> header file. */
#undef HAVE_BSD_LIBC_H
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.81 kaffe/include/Makefile.am:1.82
--- kaffe/include/Makefile.am:1.81 Sat Dec 25 19:09:12 2004
+++ kaffe/include/Makefile.am Fri Dec 31 11:07:14 2004
@@ -38,6 +38,7 @@
NOINSTALL_DERIVED_HDRS = \
java_lang_Object.h \
java_lang_VMObject.h \
+ java_lang_VMClassLoader.h \
java_lang_String.h \
java_lang_StackTraceElement.h \
java_lang_Thread.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.201 kaffe/include/Makefile.in:1.202
--- kaffe/include/Makefile.in:1.201 Sat Dec 25 19:09:12 2004
+++ kaffe/include/Makefile.in Fri Dec 31 11:07:14 2004
@@ -397,6 +397,7 @@
NOINSTALL_DERIVED_HDRS = \
java_lang_Object.h \
java_lang_VMObject.h \
+ java_lang_VMClassLoader.h \
java_lang_String.h \
java_lang_StackTraceElement.h \
java_lang_Thread.h \
Index: kaffe/kaffe/kaffevm/jni/jni-string.c
diff -u kaffe/kaffe/kaffevm/jni/jni-string.c:1.6 kaffe/kaffe/kaffevm/jni/jni-string.c:1.7
--- kaffe/kaffe/kaffevm/jni/jni-string.c:1.6 Tue Dec 21 08:06:37 2004
+++ kaffe/kaffe/kaffevm/jni/jni-string.c Fri Dec 31 11:07:15 2004
@@ -83,6 +83,12 @@
BEGIN_EXCEPTION_HANDLING(NULL);
+ /* We cannot construct the string if data is NULL. So as JNI says
+ * we return NULL.
+ */
+ if (data == NULL)
+ return NULL;
+
len = strlen(data);
if (!utf8ConstIsValidUtf8(data, len)) {
str = NULL;
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.26 kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.27
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.26 Wed Dec 29 16:27:43 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c Fri Dec 31 11:07:15 2004
@@ -470,40 +470,6 @@
int timeout, int* out)
{
/* absolute time at which time out is reached */
-#if defined(SO_RCVTIMEO) && !defined(HAVE_BROKEN_SO_RCVTIMEO)
- int ret;
- struct timeval old_tv;
- struct timeval new_tv;
- int old_tv_sz = sizeof (old_tv);
- getsockopt (fd, SOL_SOCKET, SO_RCVTIMEO, &old_tv, &old_tv_sz);
- new_tv.tv_sec = 0;
- /* Guessed according to the former behaviour of jthreadedAccept
- * Even if it is wrong
- */
- if (timeout == NOTIMEOUT) {
- new_tv.tv_sec = 0;
- new_tv.tv_usec = 0;
- } else {
- new_tv.tv_sec = timeout / 1000;
- new_tv.tv_usec = (timeout % 1000) * 1000;
- }
- ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &new_tv, sizeof(new_tv));
- if (!ret) {
- ret = accept (fd, addr, len);
- setsockopt (fd, SOL_SOCKET, SO_RCVTIMEO, &old_tv, sizeof (old_tv));
- if( ret < 0 )
- {
- switch( errno )
- {
- case EAGAIN:
- errno = ETIMEDOUT;
- break;
- }
- }
- }
- SET_RETURN_OUT(ret, out, ret)
- return ret;
-#else
int r=-1, ret;
ret = waitForTimeout(fd,timeout);
if (ret > 0) {
@@ -518,7 +484,6 @@
SET_RETURN_OUT(r, out, r)
return (r);
-#endif
}
/*
Index: kaffe/libltdl/ltdl.c
diff -u kaffe/libltdl/ltdl.c:1.43 kaffe/libltdl/ltdl.c:1.44
--- kaffe/libltdl/ltdl.c:1.43 Tue Dec 21 08:57:38 2004
+++ kaffe/libltdl/ltdl.c Fri Dec 31 11:07:16 2004
@@ -249,7 +249,7 @@
#endif
#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \
- if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = NULL; } \
+ if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \
} LT_STMT_END
@@ -265,7 +265,7 @@
strdup(str)
const char *str;
{
- char *tmp = NULL;
+ char *tmp = 0;
if (str)
{
@@ -820,7 +820,7 @@
lt_dlerror_table
#undef LT_ERROR
- NULL
+ 0
};
/* This structure is used for the list of registered loaders. */
@@ -897,11 +897,11 @@
/* The mutex functions stored here are global, and are necessarily the
same for all threads that wish to share access to libltdl. */
-static lt_dlmutex_lock *lt_dlmutex_lock_func = NULL;
-static lt_dlmutex_unlock *lt_dlmutex_unlock_func = NULL;
-static lt_dlmutex_seterror *lt_dlmutex_seterror_func = NULL;
-static lt_dlmutex_geterror *lt_dlmutex_geterror_func = NULL;
-static const char *lt_dllast_error = NULL;
+static lt_dlmutex_lock *lt_dlmutex_lock_func = 0;
+static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0;
+static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0;
+static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0;
+static const char *lt_dllast_error = 0;
/* Either set or reset the mutex functions. Either all the arguments must
@@ -950,7 +950,7 @@
/* --- ERROR HANDLING --- */
-static const char **user_error_strings = NULL;
+static const char **user_error_strings = 0;
static int errorcount = LT_ERROR_MAX;
int
@@ -959,7 +959,7 @@
{
int errindex = 0;
int result = -1;
- const char **temp = NULL;
+ const char **temp = (const char **) 0;
assert (diagnostic);
@@ -1151,9 +1151,9 @@
# ifdef NEED_USCORE
"_",
# else
- NULL,
+ 0,
# endif
- sys_dl_open, sys_dl_close, sys_dl_sym, NULL, NULL };
+ sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 };
#endif /* HAVE_LIBDL */
@@ -1940,8 +1940,8 @@
const lt_dlsymlist *syms;
} lt_dlsymlists_t;
-static const lt_dlsymlist *default_preloaded_symbols = NULL;
-static lt_dlsymlists_t *preloaded_symbols = NULL;
+static const lt_dlsymlist *default_preloaded_symbols = 0;
+static lt_dlsymlists_t *preloaded_symbols = 0;
static int
presym_init (loader_data)
@@ -1951,7 +1951,7 @@
LT_DLMUTEX_LOCK ();
- preloaded_symbols = NULL;
+ preloaded_symbols = 0;
if (default_preloaded_symbols)
{
errors = lt_dlpreload (default_preloaded_symbols);
@@ -1977,7 +1977,7 @@
lists = lists->next;
LT_DLFREE (tmp);
}
- preloaded_symbols = NULL;
+ preloaded_symbols = 0;
LT_DLMUTEX_UNLOCK ();
@@ -2086,7 +2086,7 @@
lt_module module;
{
/* Just to silence gcc -Wall */
- module = NULL;
+ module = 0;
return 0;
}
@@ -2111,11 +2111,11 @@
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- return NULL;
+ return 0;
}
static struct lt_user_dlloader presym = {
- NULL, presym_open, presym_close, presym_sym, presym_exit, NULL
+ 0, presym_open, presym_close, presym_sym, presym_exit, 0
};
@@ -2189,9 +2189,9 @@
size_t *pargz_len));
static int file_not_found LT_PARAMS((void));
-static char *user_search_path= NULL;
-static lt_dlloader *loaders = NULL;
-static lt_dlhandle handles = NULL;
+static char *user_search_path= 0;
+static lt_dlloader *loaders = 0;
+static lt_dlhandle handles = 0;
static int initialized = 0;
/* Initialize libltdl. */
@@ -2205,20 +2205,20 @@
/* Initialize only at first call. */
if (++initialized == 1)
{
- handles = NULL;
- user_search_path = NULL; /* empty search path */
+ handles = 0;
+ user_search_path = 0; /* empty search path */
#if HAVE_LIBDL
- errors += lt_dlloader_add (lt_dlloader_next (NULL), &sys_dl, "dlopen");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
#endif
#if HAVE_SHL_LOAD
- errors += lt_dlloader_add (lt_dlloader_next (NULL), &sys_shl, "dlopen");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
#endif
#ifdef __WINDOWS__
- errors += lt_dlloader_add (lt_dlloader_next (NULL), &sys_wll, "dlopen");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen");
#endif
#ifdef __BEOS__
- errors += lt_dlloader_add (lt_dlloader_next (NULL), &sys_bedl, "dlopen");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen");
#endif
#if HAVE_DLD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld");
@@ -2227,7 +2227,7 @@
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld");
errors += sys_dyld_init();
#endif
- errors += lt_dlloader_add (lt_dlloader_next (NULL), &presym, "dlpreload");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload");
if (presym_init (presym.dlloader_data))
{
@@ -2345,7 +2345,7 @@
LT_DLMEM_REASSIGN (loader, next);
}
- loaders = NULL;
+ loaders = 0;
}
done:
@@ -2418,7 +2418,7 @@
}
else
{
- cur->info.filename = NULL;
+ cur->info.filename = 0;
}
while (loader)
@@ -2427,7 +2427,7 @@
cur->module = loader->module_open (data, filename);
- if (cur->module != NULL)
+ if (cur->module != 0)
{
break;
}
@@ -2458,7 +2458,7 @@
const char *dlname;
{
int error = 0;
- char *filename = NULL;
+ char *filename = 0;
size_t filename_len = 0;
size_t dirname_len = LT_STRLEN (dirname);
@@ -2553,7 +2553,7 @@
const char *path;
char **pcanonical;
{
- char *canonical = NULL;
+ char *canonical = 0;
assert (path && *path);
assert (pcanonical);
@@ -2657,9 +2657,9 @@
int filenamesize = 0;
size_t lenbase = LT_STRLEN (base_name);
size_t argz_len = 0;
- char *argz = NULL;
- char *filename = NULL;
- char *canonical = NULL;
+ char *argz = 0;
+ char *filename = 0;
+ char *canonical = 0;
LT_DLMUTEX_LOCK ();
@@ -2676,7 +2676,7 @@
goto cleanup;
{
- char *dir_name = NULL;
+ char *dir_name = 0;
while ((dir_name = argz_next (argz, argz_len, dir_name)))
{
size_t lendir = LT_STRLEN (dir_name);
@@ -2755,7 +2755,7 @@
const char *base_name;
char **pdir;
{
- FILE *file = NULL;
+ FILE *file = 0;
foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file);
@@ -2778,7 +2778,7 @@
/* Try to dlopen the file, but do not continue searching in any
case. */
if (tryall_dlopen (handle, filename) != 0)
- *handle = NULL;
+ *handle = 0;
return 1;
}
@@ -2792,11 +2792,11 @@
lt_dlhandle *handle;
{
if (!search_path)
- return NULL;
+ return 0;
if (!foreach_dirinpath (search_path, base_name, find_handle_callback,
- handle, NULL))
- return NULL;
+ handle, 0))
+ return 0;
return handle;
}
@@ -2807,10 +2807,10 @@
char *deplibs;
{
#if LTDL_DLOPEN_DEPLIBS
- char *p, *save_search_path = NULL;
+ char *p, *save_search_path = 0;
int depcount = 0;
int i;
- char **names = NULL;
+ char **names = 0;
#endif
int errors = 0;
@@ -3009,7 +3009,7 @@
}
else
{
- *dest = NULL;
+ *dest = 0;
}
return 0;
@@ -3035,17 +3035,17 @@
lt_dlhandle *phandle;
const char *filename;
{
- const char * ext = NULL;
- const char * saved_error = NULL;
- char * canonical = NULL;
- char * base_name = NULL;
- char * dir = NULL;
- char * name = NULL;
+ const char * ext = 0;
+ const char * saved_error = 0;
+ char * canonical = 0;
+ char * base_name = 0;
+ char * dir = 0;
+ char * name = 0;
int errors = 0;
lt_dlhandle newhandle;
assert (phandle);
- assert (*phandle == NULL);
+ assert (*phandle == 0);
LT_DLMUTEX_GETERROR (saved_error);
@@ -3053,7 +3053,7 @@
if (!filename)
{
*phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
- if (*phandle == NULL)
+ if (*phandle == 0)
return 1;
memset (*phandle, 0, sizeof(struct lt_dlhandle_struct));
@@ -3062,7 +3062,7 @@
/* lt_dlclose()ing yourself is very bad! Disallow it. */
LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG);
- if (tryall_dlopen (&newhandle, NULL) != 0)
+ if (tryall_dlopen (&newhandle, 0) != 0)
{
LT_DLFREE (*phandle);
return 1;
@@ -3110,12 +3110,12 @@
if (ext && strcmp (ext, archive_ext) == 0)
{
/* this seems to be a libtool module */
- FILE * file = NULL;
- char * dlname = NULL;
- char * old_name = NULL;
- char * libdir = NULL;
- char * deplibs = NULL;
- char * line = NULL;
+ FILE * file = 0;
+ char * dlname = 0;
+ char * old_name = 0;
+ char * libdir = 0;
+ char * deplibs = 0;
+ char * line = 0;
size_t line_len;
/* if we can't find the installed flag, it is probably an
@@ -3410,12 +3410,12 @@
lt_dlopen (filename)
const char *filename;
{
- lt_dlhandle handle = NULL;
+ lt_dlhandle handle = 0;
/* Just incase we missed a code path in try_dlopen() that reports
an error, but forgets to reset handle... */
if (try_dlopen (&handle, filename) != 0)
- return NULL;
+ return 0;
return handle;
}
@@ -3425,7 +3425,7 @@
static int
file_not_found ()
{
- const char *error = NULL;
+ const char *error = 0;
LT_DLMUTEX_GETERROR (error);
if (error == LT_DLSTRERROR (FILE_NOT_FOUND))
@@ -3442,9 +3442,9 @@
lt_dlopenext (filename)
const char *filename;
{
- lt_dlhandle handle = NULL;
- char * tmp = NULL;
- char * ext = NULL;
+ lt_dlhandle handle = 0;
+ char * tmp = 0;
+ char * ext = 0;
size_t len;
int errors = 0;
@@ -3472,7 +3472,7 @@
/* First try appending ARCHIVE_EXT. */
tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1);
if (!tmp)
- return NULL;
+ return 0;
strcpy (tmp, filename);
strcat (tmp, archive_ext);
@@ -3496,7 +3496,7 @@
LT_DLFREE (tmp);
tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1);
if (!tmp)
- return NULL;
+ return 0;
strcpy (tmp, filename);
}
@@ -3521,7 +3521,7 @@
names we tried. */
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
LT_DLFREE (tmp);
- return NULL;
+ return 0;
}
@@ -3557,7 +3557,7 @@
size_t *pargz_len;
const char *entry;
{
- char *before = NULL;
+ char *before = 0;
assert (pargz);
assert (pargz_len);
@@ -3582,9 +3582,9 @@
const char *dirnam;
struct dirent *dp;
{
- char *buf = NULL;
+ char *buf = 0;
size_t buf_len = 0;
- char *end = NULL;
+ char *end = 0;
size_t end_offset = 0;
size_t dir_len = 0;
int errors = 0;
@@ -3647,7 +3647,7 @@
char **pargz;
size_t *pargz_len;
{
- DIR *dirp = NULL;
+ DIR *dirp = 0;
int errors = 0;
assert (dirnam && *dirnam);
@@ -3658,7 +3658,7 @@
dirp = opendir (dirnam);
if (dirp)
{
- struct dirent *dp = NULL;
+ struct dirent *dp = 0;
while ((dp = readdir (dirp)))
if (dp->d_name[0] != '.')
@@ -3689,7 +3689,7 @@
= (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1;
int is_done = 0;
- char *argz = NULL;
+ char *argz = 0;
size_t argz_len = 0;
if (list_files_by_dir (dirname, &argz, &argz_len) != 0)
@@ -3698,7 +3698,7 @@
goto cleanup;
{
- char *filename = NULL;
+ char *filename = 0;
while ((filename = argz_next (argz, argz_len, filename)))
if ((is_done = (*func) (filename, data2)))
break;
@@ -3729,31 +3729,31 @@
{
/* If a specific path was passed, search only the directories
listed in it. */
- is_done = foreach_dirinpath (search_path, NULL,
+ is_done = foreach_dirinpath (search_path, 0,
foreachfile_callback, func, data);
}
else
{
/* Otherwise search the default paths. */
- is_done = foreach_dirinpath (user_search_path, NULL,
+ is_done = foreach_dirinpath (user_search_path, 0,
foreachfile_callback, func, data);
if (!is_done)
{
- is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), NULL,
+ is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0,
foreachfile_callback, func, data);
}
#ifdef LTDL_SHLIBPATH_VAR
if (!is_done)
{
- is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), NULL,
+ is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0,
foreachfile_callback, func, data);
}
#endif
#ifdef LTDL_SYSSEARCHPATH
if (!is_done)
{
- is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), NULL,
+ is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0,
foreachfile_callback, func, data);
}
#endif
@@ -3844,13 +3844,13 @@
if (!handle)
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- return NULL;
+ return 0;
}
if (!symbol)
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- return NULL;
+ return 0;
}
lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix)
@@ -3866,7 +3866,7 @@
if (!sym)
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW));
- return NULL;
+ return 0;
}
}
@@ -3930,7 +3930,7 @@
const char *error;
LT_DLMUTEX_GETERROR (error);
- LT_DLMUTEX_SETERROR (NULL);
+ LT_DLMUTEX_SETERROR (0);
return error ? error : NULL;
}
@@ -3942,8 +3942,8 @@
const char *dir;
{
int errors = 0;
- char *canonical = NULL;
- char *argz = NULL;
+ char *canonical = 0;
+ char *argz = 0;
size_t argz_len = 0;
assert (ppath);
@@ -4016,7 +4016,7 @@
if (search_dir && *search_dir)
{
LT_DLMUTEX_LOCK ();
- if (lt_dlpath_insertdir (&user_search_path, NULL, search_dir) != 0)
+ if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0)
++errors;
LT_DLMUTEX_UNLOCK ();
}
@@ -4137,7 +4137,7 @@
if (!handle)
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- return NULL;
+ return 0;
}
return &(handle->info);
@@ -4227,7 +4227,7 @@
if (!temp)
{
- stale = NULL;
+ stale = 0;
goto done;
}
@@ -4287,7 +4287,7 @@
const char *loader_name;
{
int errors = 0;
- lt_dlloader *node = NULL, *ptr = NULL;
+ lt_dlloader *node = 0, *ptr = 0;
if ((dlloader == 0) /* diagnose null parameters */
|| (dlloader->module_open == 0)
@@ -4303,7 +4303,7 @@
if (!node)
return 1;
- node->next = NULL;
+ node->next = 0;
node->loader_name = loader_name;
node->sym_prefix = dlloader->sym_prefix;
node->dlloader_exit = dlloader->dlloader_exit;
@@ -4439,12 +4439,12 @@
lt_dlloader_name (place)
lt_dlloader *place;
{
- const char *name = NULL;
+ const char *name = 0;
if (place)
{
LT_DLMUTEX_LOCK ();
- name = place ? place->loader_name : NULL;
+ name = place ? place->loader_name : 0;
LT_DLMUTEX_UNLOCK ();
}
else
@@ -4459,12 +4459,12 @@
lt_dlloader_data (place)
lt_dlloader *place;
{
- lt_user_data *data = NULL;
+ lt_user_data *data = 0;
if (place)
{
LT_DLMUTEX_LOCK ();
- data = place ? &(place->dlloader_data) : NULL;
+ data = place ? &(place->dlloader_data) : 0;
LT_DLMUTEX_UNLOCK ();
}
else
@@ -4479,7 +4479,7 @@
*** Patch too long, truncated ***
More information about the kaffe
mailing list