gnome-core 1.0.3 ANSI C patch



Since the README doesn't say where to send this, I suppose someone will
pick it up from here. The patch is against gnome-core 1.0.3 and it
doesn't fix everything, since the compilation stops on a file generated
by orbit-idl. I don't have IDL source, so I can't rebuild it with
patched ORBit.

Patched things include:

a) removing non-constant initializations
b) removing -Wall from Makefile.am & Makefile.in. It's nice that
   people want to use it, but it's gcc specific and shouldn't be
   in the distribution. Or configure script can be used to add it
   if gcc is used.
c) switching order of -L and -l linking directives. GNU ld doesn't
   mind the order, but some of the other linkers must have -L directive
   before -l. It's supposed to be a feature.
d) adding `#include <alloca.h>' where alloca() is used. This should
   really be handled by configure script, since the patched version
   would break on systems without that include file.
e) adding semicolons after `default: }' things. Some kind of statement
   must be there.
f) removing lvalue cast. This is a nasty one. Repeat after me: I must
   not use lvalue casts in C. Lvalue casts are evil.

That would be all for now.



--- gsm/manager.c.orig	Wed Mar 17 19:28:40 1999
+++ gsm/manager.c	Wed Mar 17 19:43:35 1999
@@ -197,10 +197,19 @@
 static void
 broadcast_restart_style (Client *client, char style)
 {
-  char value[2] = { style, '\0' };
-  SmPropValue val = { 1, &value };
-  SmProp hint = { SmRestartStyleHint, SmCARD8, 1, &val };
+  char value[2];
+  SmPropValue val;
+  SmProp hint;
   SmProp *prop = &hint;
+
+  value[0] = style;
+  value[1] = '\0';
+  val.length = 1;
+  val.value = (SmPointer)&value;
+  hint.name = SmRestartStyleHint;
+  hint.type = SmCARD8;
+  hint.num_vals = 1;
+  hint.vals = &val;
   
   client_property (client->handle, 1, &prop);    
 }
--- gsm/command.c.orig	Wed Mar 17 19:59:00 1999
+++ gsm/command.c	Wed Mar 17 20:00:46 1999
@@ -445,9 +445,16 @@
 	  if (purged)
 	    {
 	      char value[2] = { SmRestartAnyway, '\0' };
-	      SmPropValue val = { 1, &value };
-	      SmProp hint = { SmRestartStyleHint, SmCARD8, 1, &val };
+	      SmPropValue val;
+	      SmProp hint;
 	      SmProp *prop = &hint;
+
+	      val.length = 1;
+	      val.value = (SmPointer)&value;
+	      hint.name = SmRestartStyleHint;
+	      hint.type = SmCARD8;
+	      hint.num_vals = 1;
+	      hint.vals = &val;
 
 	      if (purge_drop)
 		value[0] = SmRestartNever;
--- gsm/gsm-client-row.c.orig	Wed Mar 17 20:01:38 1999
+++ gsm/gsm-client-row.c	Wed Mar 17 20:02:40 1999
@@ -112,8 +112,10 @@
       GtkCList* clist = (GtkCList*)client_list;
       guint row;
       char temp[3];
-      char* text[] = { temp, NULL, NULL, NULL };  
+      char* text[4];  
 
+      text[0] = temp;
+      text[1] = text[2] = text[3] = NULL;
       snprintf (temp, 3, "%.02d", client->order);
       text[3] = client->command;
       client_row->row = gtk_clist_append (clist, text);
--- help-browser/gnome-man2html/Makefile.in.orig	Wed Mar 17 23:50:30 1999
+++ help-browser/gnome-man2html/Makefile.in	Wed Mar 17 23:50:42 1999
@@ -163,7 +163,7 @@
 
 gnome_man2html_SOURCES = gnome-man2html.c
 
-CFLAGS = @CFLAGS@ -Wall
+CFLAGS = @CFLAGS@
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../../config.h
 CONFIG_CLEAN_FILES = 
--- help-browser/gnome-man2html/Makefile.am.orig	Wed Mar 17 23:48:28 1999
+++ help-browser/gnome-man2html/Makefile.am	Wed Mar 17 23:49:07 1999
@@ -14,5 +14,3 @@
 
 gnome_man2html_SOURCES = gnome-man2html.c
 
-CFLAGS += -Wall
-
--- help-browser/gnome-info2html/Makefile.in.orig	Wed Mar 17 20:05:23 1999
+++ help-browser/gnome-info2html/Makefile.in	Wed Mar 17 20:05:31 1999
@@ -163,7 +163,7 @@
 
 gnome_info2html_SOURCES = main.c parse.c utils.c html.c data.h html.h parse.h utils.h version.h
 
-CFLAGS = @CFLAGS@ -Wall
+CFLAGS = @CFLAGS@
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../../config.h
 CONFIG_CLEAN_FILES = 
--- help-browser/gnome-info2html/Makefile.am.orig	Wed Mar 17 23:49:50 1999
+++ help-browser/gnome-info2html/Makefile.am	Wed Mar 17 23:50:03 1999
@@ -14,6 +14,3 @@
 
 gnome_info2html_SOURCES = main.c parse.c utils.c html.c data.h html.h parse.h utils.h version.h
 
-CFLAGS += -Wall
-
-
--- help-browser/Makefile.in.orig	Wed Mar 17 20:45:23 1999
+++ help-browser/Makefile.in	Wed Mar 17 20:45:25 1999
@@ -159,7 +159,7 @@
 INCLUDES =  	-I$(includedir)							-I$(top_srcdir)/intl -I$(top_builddir)/intl			$(GNOME_INCLUDEDIR)						-DGNOMEHELPPATH=\""$(datadir)/gnome/help\"" 		-DGNOMELOCALEDIR=\""$(datadir)/locale\""		-DVERSION=\""$(VERSION)"\"
 
 
-LDADD =  	-lgnorba                                        	$(GNOMEUI_LIBS)						$(GNOME_LIBDIR)						$(ORBIT_LIBS)                                           $(INTLLIBS)
+LDADD = $(GNOME_LIBDIR) -lgnorba $(GNOMEUI_LIBS) $(ORBIT_LIBS) $(INTLLIBS)
 
 
 bin_PROGRAMS = gnome-help-browser  gnome-help-caller
--- help-browser/mime.c.orig	Wed Mar 17 20:46:29 1999
+++ help-browser/mime.c	Wed Mar 17 20:47:06 1999
@@ -13,6 +13,7 @@
 #include <sys/wait.h>
 #include <errno.h>
 #include <string.h>
+#include <alloca.h>
 
 #include <glib.h>
 
--- help-browser/gnome-help-browser.c.orig	Wed Mar 17 20:46:41 1999
+++ help-browser/gnome-help-browser.c	Wed Mar 17 20:47:25 1999
@@ -29,6 +29,7 @@
 #include <orb/orbit.h>
 #include <libgnorba/gnorba.h>
 #include <errno.h>
+#include <alloca.h>
 
 #include "window.h"
 #include "history.h"
--- help-browser/gnome-helpwin.c.orig	Wed Mar 17 20:46:52 1999
+++ help-browser/gnome-helpwin.c	Wed Mar 17 20:47:40 1999
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <fcntl.h>
 #include <sys/wait.h>
+#include <alloca.h>
 
 #include <glib.h>
 #include <gnome.h>
--- help-browser/Makefile.am.orig	Wed Mar 17 23:53:56 1999
+++ help-browser/Makefile.am	Wed Mar 17 23:54:43 1999
@@ -11,9 +11,9 @@
 	-DVERSION=\""$(VERSION)"\"
 
 LDADD = \
+	$(GNOME_LIBDIR)					\
 	-lgnorba                                        \
 	$(GNOMEUI_LIBS)					\
-	$(GNOME_LIBDIR)					\
 	$(ORBIT_LIBS)                                   \
         $(INTLLIBS)
 
--- gnome-terminal/Makefile.in.orig	Wed Mar 17 20:48:33 1999
+++ gnome-terminal/Makefile.in	Wed Mar 17 20:48:43 1999
@@ -172,7 +172,7 @@
 
 gnome_terminal_LDADD = $(LDADD)
 
-CFLAGS = @CFLAGS@ -Wall
+CFLAGS = @CFLAGS@
 
 utildir = $(datadir)/gnome/apps/Utilities
 util_DATA = gnome-terminal.desktop
--- gnome-terminal/gnome-terminal.c.orig	Wed Mar 17 20:49:20 1999
+++ gnome-terminal/gnome-terminal.c	Wed Mar 17 20:50:05 1999
@@ -2046,7 +2046,7 @@
 	case TITLE_KEY:
 	        cfg->window_title = g_strdup(arg);
                 break;
-	default:
+	default:;
 	}
 }
 
--- gnome-terminal/Makefile.am.orig	Wed Mar 17 23:51:03 1999
+++ gnome-terminal/Makefile.am	Wed Mar 17 23:51:15 1999
@@ -28,7 +28,5 @@
 
 gnome_terminal_LDADD = $(LDADD)
 
-CFLAGS += -Wall
-
 utildir = $(datadir)/gnome/apps/Utilities
 util_DATA = gnome-terminal.desktop
--- gnome-edit/Makefile.in.orig	Wed Mar 17 20:51:13 1999
+++ gnome-edit/Makefile.in	Wed Mar 17 20:51:40 1999
@@ -154,7 +154,7 @@
 cxxflags_set = @cxxflags_set@
 l = @l@
 
-INCLUDES = $(GTK_CFLAGS) -Wall -ansi		$(GNOME_INCLUDEDIR)
+INCLUDES = $(GTK_CFLAGS) $(GNOME_INCLUDEDIR)
 
 
 bin_PROGRAMS = gnome-edit
--- gnome-edit/Makefile.am.orig	Wed Mar 17 23:51:47 1999
+++ gnome-edit/Makefile.am	Wed Mar 17 23:52:10 1999
@@ -1,4 +1,4 @@
-INCLUDES = $(GTK_CFLAGS) -Wall -ansi	\
+INCLUDES = $(GTK_CFLAGS) 	\
 	$(GNOME_INCLUDEDIR)
 
 bin_PROGRAMS = gnome-edit
--- panel/applet-widget.c.orig	Wed Mar 17 20:52:59 1999
+++ panel/applet-widget.c	Wed Mar 17 23:45:51 1999
@@ -691,7 +691,8 @@
 
 	applet = APPLET_WIDGET (gtk_type_new (applet_widget_get_type ()));
 
-	CD(applet) = corbadat = gnome_panel_applet_corba_init(applet,goad_id);
+	APPLET_WIDGET(applet)->corbadat = corbadat =
+	                       gnome_panel_applet_corba_init(applet,goad_id);
 
 	g_return_val_if_fail(corbadat!=NULL,NULL);
 
@@ -962,7 +963,7 @@
   case GNOME_Panel_BACK_PIXMAP:
     pptr = backing->_u.pmap;
     break;
-  default:
+  default:;
   }
 
   gtk_signal_emit(GTK_OBJECT(servant->appwidget),
   

-- 
 .-.   .-.    Life is a sexually transmitted disease.
(_  \ /  _)
     |        dave@srce.hr
     |        dave@fly.cc.fer.hr



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