SOURCES: ascal-gcc.patch - no-no-no, don't make local variable global

qboosh qboosh at pld-linux.org
Sat Jan 5 17:13:04 CET 2008


Author: qboosh                       Date: Sat Jan  5 16:13:04 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- no-no-no, don't make local variable global

---- Files affected:
SOURCES:
   ascal-gcc.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/ascal-gcc.patch
diff -u SOURCES/ascal-gcc.patch:1.1 SOURCES/ascal-gcc.patch:1.2
--- SOURCES/ascal-gcc.patch:1.1	Thu Nov  1 02:16:36 2007
+++ SOURCES/ascal-gcc.patch	Sat Jan  5 17:12:59 2008
@@ -1,12 +1,18 @@
---- ascal-0.1.1/src/gui_board.cpp	2007-11-01 02:13:40.488264786 +0100
-+++ ascal-0.1.1/src/gui_board.cpp-new	2007-11-01 02:12:21.644640775 +0100
-@@ -305,8 +305,8 @@
- }
- 
- 
-+ko_t ko; //the calculated coordinates
- ko_t gui_board::find_circle(int field) const {
--	ko_t ko; //the calculated coordinates
- 	
- 	//you should draw the board for yourself to understand this!
- 	/* Okay here is one... ;)	
+--- ascal-0.1.1/src/gui_board.cpp.orig	2006-12-30 00:45:08.000000000 +0100
++++ ascal-0.1.1/src/gui_board.cpp	2008-01-05 16:46:56.475221055 +0100
+@@ -335,6 +335,7 @@
+ 				ko.x=4;
+ 			break;
+ 		case 2:
++		default: // stupid gcc, avoid "uninitialized variable" warning
+ 			if(field<15)
+ 				ko.x=2;
+ 			else
+@@ -357,6 +358,7 @@
+ 				ko.y=5;
+ 			break;
+ 		case 3:
++		default: // stupid gcc, avoid "uninitialized variable" warning
+ 			if(field<4)
+ 				ko.y=0;
+ 			else
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/ascal-gcc.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list