pgcc warns about using 0 rather than NULL in the last argument of the
ternary `?:' operator, when the second is of pointer type. Let's be
nice, I've applied this to HEAD.
Cheers,
Ralf
2007-09-07 Ralf Wildenhues <[EMAIL PROTECTED]>
* libltdl/lt_dlloader.c (loader_callback, lt_dlloader_get): Use
NULL, not 0, for the benefit of too picky compilers like PGI.
* slist.c (slist_tail): Likewise. Include stddef.h, for NULL.
Report by Jeff Squyres.
Index: libltdl/lt_dlloader.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/lt_dlloader.c,v
retrieving revision 1.12
diff -u -r1.12 lt_dlloader.c
--- libltdl/lt_dlloader.c 4 Sep 2007 18:01:33 -0000 1.12
+++ libltdl/lt_dlloader.c 7 Sep 2007 02:42:57 -0000
@@ -52,7 +52,7 @@
assert (vtable);
- return streq (vtable->name, name) ? (void *) item : 0;
+ return streq (vtable->name, name) ? (void *) item : NULL;
}
@@ -139,7 +139,7 @@
const lt_dlvtable *
lt_dlloader_get (lt_dlloader loader)
{
- return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : 0);
+ return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL);
}
Index: libltdl/slist.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/slist.c,v
retrieving revision 1.9
diff -u -r1.9 slist.c
--- libltdl/slist.c 29 Aug 2007 21:01:20 -0000 1.9
+++ libltdl/slist.c 7 Sep 2007 02:42:57 -0000
@@ -31,6 +31,7 @@
#include <assert.h>
#include "slist.h"
+#include <stddef.h>
static SList * slist_sort_merge (SList *left, SList *right,
SListCompare *compare, void *userdata);
@@ -177,7 +178,7 @@
SList *
slist_tail (SList *slist)
{
- return slist ? slist->next : 0;
+ return slist ? slist->next : NULL;
}
/* Return a list starting at the Nth item of SLIST. If SLIST is less