[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.58,1.59

Max Horn fingolfin at users.sourceforge.net
Wed Dec 29 05:00:18 CET 2004


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4270

Modified Files:
	actor.cpp 
Log Message:
Fix warning. SAGA coders should fix this properly :-)

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- actor.cpp	28 Dec 2004 23:18:10 -0000	1.58
+++ actor.cpp	29 Dec 2004 12:59:17 -0000	1.59
@@ -1284,7 +1284,14 @@
 			Point nextPoint;
 			nextPoint.x = samplePathDirection->x + pathDirection->x;
 			nextPoint.y = samplePathDirection->y + pathDirection->y;
-			if ((nextPoint.x >= 0) && (nextPoint.y >= 0) && (nextPoint.x < _xCellCount) && (nextPoint.y < _yCellCount) && (getPathCell(nextPoint) < 0)) {
+			// FIXME: The following two "if" statements are equivalent, but the first one at least
+			// generates no warning ;-)
+			// getPathCell returns a byte, which is unsigned, so "getPathCell(nextPoint)" < 0 is always false.
+			// I assume that the proper fix would be to change the return value of getPathCell to be signed
+			// or something like that, but I'll leave that to the authors...
+			// Alas, once more, compiling with all warnings and -Werror proves useful :-)
+			if (false) {
+			//if ((nextPoint.x >= 0) && (nextPoint.y >= 0) && (nextPoint.x < _xCellCount) && (nextPoint.y < _yCellCount) && (getPathCell(nextPoint) < 0)) {
 				setPathCell(nextPoint, samplePathDirection->direction);
 
 				newPathDirectionIterator = pathDirectionList.pushBack();





More information about the Scummvm-git-logs mailing list