After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 52646 - Compiler cleanups
Compiler cleanups
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
unspecified
Other IRIX
: High normal
: ---
Assigned To: GNOME Games maintainers
Gregory Leblanc
: 16866 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-03-29 20:07 UTC by drk
Modified: 2012-01-31 23:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description drk 2001-03-29 20:07:23 UTC
I recently built gnome-games/1.4.0 for SGI IRIX 6.2, and had to
make a few changes to placate the compilers.  The most far-reaching
was an enum/int confusion.  The rest are pretty obvious:

--- ./xbill/MCursor.cc	Thu Mar  8 08:26:17 2001
+++ ../gnome-games-1.4.0/./xbill/MCursor.cc	Thu Mar 22 18:04:12 2001
@@ -2,7 +2,7 @@
 #include "objects.h"
 
 void MCursor::load(const char *name, int masked) {
-	static char *dir = NULL;
+	static char *dir = (char*)NULL;
 	GdkPixmap *pixmap, *bitmap, *mask;
 	int width, height;
 	char file[255];
@@ -11,7 +11,7 @@
 
 	sprintf (file, "%s/%s.xpm", dir, name);
 	pixmap = gdk_pixmap_colormap_create_from_xpm(ui.display, ui.colormap,
-						     &bitmap, NULL, file);
+						     &bitmap, (GdkColor*)NULL, file);
 	if (pixmap == NULL) {
 		printf ("cannot open %s\n", file);
 		exit(1);
@@ -20,7 +20,7 @@
 	if (masked == SEP_MASK) {
 	  sprintf(file, "%s/%s_mask.xpm", dir, name);
 	  pixmap = gdk_pixmap_colormap_create_from_xpm(ui.display, ui.colormap,
-						       &mask, NULL, file);
+						       &mask, (GdkColor*)NULL, file);
 	  if (pixmap == NULL) {
 	    printf("cannot open %s\n", file);
 	    exit(1);
--- ./xbill/UI.cc	Thu Mar  8 08:26:17 2001
+++ ../gnome-games-1.4.0/./xbill/UI.cc	Thu Mar 22 18:24:06 2001
@@ -126,10 +126,10 @@
 
 void UI::popup_dialog (int dialog) {
 	GtkWidget *w;
-	switch (dialog) {
-		case game.SCORE: w = scorebox; break;
-		case game.ENDGAME: w = endgamebox; break;
-	}
+	if (dialog == game.SCORE)
+		w = scorebox;
+	else if (dialog == game.ENDGAME)
+		w = endgamebox;
 	popup (NULL, &w);
 }
 
@@ -138,16 +138,14 @@
 /*********************/
 
 void UI::set_cursor(int cursor) {
-	switch (cursor) {
-	case game.BUCKETC:
-	        gdk_window_set_cursor(window, bucket.cursor.cursor); break;
-	case game.DOWNC:
-		gdk_window_set_cursor(window, downcursor.cursor); break;
-	case game.DEFAULTC:
-		gdk_window_set_cursor(window, defaultcursor.cursor); break;
-	default:
-		gdk_window_set_cursor(window, OS.cursor[cursor].cursor);
-	}
+	if (cursor == game.BUCKETC)
+	        gdk_window_set_cursor(window, bucket.cursor.cursor);
+	else if (cursor == game.DOWNC)
+		gdk_window_set_cursor(window, downcursor.cursor);
+	else if (cursor == game.DEFAULTC)
+		gdk_window_set_cursor(window, defaultcursor.cursor);
+	else
+ 		gdk_window_set_cursor(window, OS.cursor[cursor].cursor);
 }
 
 void UI::load_cursors() {
--- ./xbill/Game.cc	Thu Mar  8 08:26:17 2001
+++ ../gnome-games-1.4.0/./xbill/Game.cc	Thu Mar 22 18:24:32 2001
@@ -61,10 +61,10 @@
 }
   
 void Game::update_score (int action) {
-	switch (action){
-		case ENDLEVEL: score+=(level*efficiency/iteration); break;
-		default: score+=(action*action*BILLPOINTS);
-	}
+	if (action == ENDLEVEL)
+		score+=(level*efficiency/iteration);
+	else
+		score+=(action*action*BILLPOINTS);
 }
 
 void Game::warp_to_level (unsigned int lev) {
Comment 1 Gregory Leblanc 2001-11-16 06:30:54 UTC
Are these the same as the ones in our really old patch set from GNOME
Games 1.2?  Do they superceed those? 
Comment 2 drk 2001-11-16 18:34:13 UTC
They are probably very similar, but may not be exactly the same.
I was trying to solve the same problem (make the sources build
with strict ANSI compilers), but was using a newer compiler on
the local system.
Comment 3 Luis Villa 2002-02-14 01:49:41 UTC
Greg, did these ever get applied? Are they at all relevant for 2.0?
Marking high because there is a patch and because portability is
important.
Comment 4 Gregory Leblanc 2002-02-14 03:28:03 UTC
I never applied them, so I assume that they're not yet in CVS.  I'm
pretty sure that I'm not the right person to apply these, but I'll
hound some people on IRC and such. 
Comment 5 Bastien Nocera 2002-04-15 18:20:26 UTC
In CVS, thanks for the patch.


2002-04-15  Bastien Nocera  <hadess@hadess.net>

        * Game.cc, MCursor.cc, UI.cc: patch from drk@sgi.com to get
        gnome-xbill compiled with a strict ansi compiler
Comment 6 Bastien Nocera 2002-04-25 14:52:12 UTC
*** Bug 16866 has been marked as a duplicate of this bug. ***
Comment 7 Robert Ancell 2012-01-31 23:24:47 UTC
This bug is being reassigned to the "general" component so we can close the gnome-xbill bugzilla component.  Apologies for the mass email!