libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: HEAD: shut up innocent compiler warnings


From: Ralf Wildenhues
Subject: FYI: HEAD: shut up innocent compiler warnings
Date: Fri, 7 Sep 2007 04:44:49 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

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  <address@hidden>

        * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]