From 0b0ae8e16e50fd60ad86f4f14ec05cfc50e7eae5 Mon Sep 17 00:00:00 2001 From: markm Date: Fri, 5 Mar 2004 08:10:19 +0000 Subject: Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror) that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii ('\0') was needed, and a few were just "other". Tested on: i386 sparc64 --- libexec/rtld-elf/rtld.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libexec') diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7981fa9..7b1394b 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -331,7 +331,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) obj_tail = &obj_main->next; obj_count++; /* Make sure we don't call the main program's init and fini functions. */ - obj_main->init = obj_main->fini = NULL; + obj_main->init = obj_main->fini = (Elf_Addr)NULL; /* Initialize a fake symbol for resolving undefined weak references. */ sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE); @@ -1068,11 +1068,11 @@ initlist_add_objects(Obj_Entry *obj, Obj_Entry **tail, Objlist *list) initlist_add_neededs(obj->needed, list); /* Add the object to the init list. */ - if (obj->init != NULL) + if (obj->init != (Elf_Addr)NULL) objlist_push_tail(list, obj); /* Add the object to the global fini list in the reverse order. */ - if (obj->fini != NULL) + if (obj->fini != (Elf_Addr)NULL) objlist_push_head(&list_fini, obj); } @@ -1132,7 +1132,7 @@ load_preload_objects(void) static const char delim[] = " \t:;"; if (p == NULL) - return NULL; + return 0; p += strspn(p, delim); while (*p != '\0') { -- cgit v1.1