From 44531e4aeea23ba4aab423d5bc1f9d6e09d0c6a0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Dec 2004 12:59:17 +0000 Subject: Fix warning. SAGA coders should fix this properly :-) svn-id: r16367 --- saga/actor.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/saga/actor.cpp b/saga/actor.cpp index 9d65c8dfd7..e2269c6372 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -1284,7 +1284,14 @@ int Actor::fillPathArray(const Point &pointFrom, const Point &pointTo, Point &be 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(); -- cgit v1.2.3