[Patch] Warning fixes for glib



Hija,

while compiling on ppc-linux with gcc-3.1 (CVS) I fixed some warnings.

OK to commit?

===================================================================
2001-10-29  Daniel Egger  <degger fhm edu>

       * glib/gbacktrace.h: Fix non-Intel/-Alpha version of the 
       G_BREAKPOINT macro to include <signal.h> and use SIGTRAP.

       * glib/gmessages.c: Conditionalise definition of args2
       depending on the definition of HAVE_VSNPRINTF to avoid 
       compiler warning.

       * gobject/testgruntime.c
       * tests/patterntest.c: Include <string.h> to avoid warnings.

-- 
Servus,
       Daniel
===================================================================
RCS file: /cvs/gnome/glib/glib/gbacktrace.h,v
retrieving revision 1.3
diff -u -r1.3 gbacktrace.h
--- glib/gbacktrace.h	2001/06/26 16:01:14	1.3
+++ glib/gbacktrace.h	2001/10/29 14:15:33
@@ -53,7 +53,8 @@
 #elif defined (__alpha__) && defined (__GNUC__) && __GNUC__ >= 2
 #  define G_BREAKPOINT()	G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
 #else	/* !__i386__ && !__alpha__ */
-#  define G_BREAKPOINT()	G_STMT_START{ raise (5 /* SIGTRAP */); }G_STMT_END
+#include <signal.h> /* For prototype and signal name definition */ 
+#  define G_BREAKPOINT()	G_STMT_START{ raise (SIGTRAP); }G_STMT_END
 #endif	/* __i386__ */
 
 G_END_DECLS
Index: glib/gmessages.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gmessages.c,v
retrieving revision 1.36
diff -u -r1.36 gmessages.c
--- glib/gmessages.c	2001/10/11 03:06:49	1.36
+++ glib/gmessages.c	2001/10/29 14:15:34
@@ -473,9 +473,12 @@
 	const gchar   *format,
 	va_list	       args1)
 {
-  va_list args2;
   gchar buffer[1025];
   register gint i;
+
+#ifndef  HAVE_VSNPRINTF
+  va_list args2;
+#endif	/* !HAVE_VSNPRINTF */
   
   log_level &= G_LOG_LEVEL_MASK;
   if (!log_level)
Index: gobject/testgruntime.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/testgruntime.c,v
retrieving revision 1.4
diff -u -r1.4 testgruntime.c
--- gobject/testgruntime.c	2001/09/10 18:03:31	1.4
+++ gobject/testgruntime.c	2001/10/29 14:15:35
@@ -20,6 +20,7 @@
 #define	G_LOG_DOMAIN "TestObject"
 #include	<glib-object.h>
 
+#include <string.h>
 
 /* --- TestIface --- */
 #define TEST_TYPE_IFACE           (test_iface_get_type ())
Index: tests/patterntest.c
===================================================================
RCS file: /cvs/gnome/glib/tests/patterntest.c,v
retrieving revision 1.1
diff -u -r1.1 patterntest.c
--- tests/patterntest.c	2001/10/13 05:54:10	1.1
+++ tests/patterntest.c	2001/10/29 14:15:35
@@ -16,8 +16,10 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
 #include "glib.h"
 
+#include <string.h>
 
 /* keep enum and structure of gpattern.c and patterntest.c in sync */
 typedef enum


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