pathfind.c
changeset 3017 915fae59d5e0
parent 2952 6a26eeda9679
child 3019 a09d8f7b48be
--- a/pathfind.c	Sun Feb 12 14:31:33 2006 +0000
+++ b/pathfind.c	Mon Feb 13 21:15:00 2006 +0000
@@ -558,12 +558,12 @@
 		uint offs = tpf->hash_tile[hash];
 		do {
 			link = NTP_GET_LINK_PTR(tpf, offs);
-			if (tile == link->tile && (uint)(link->typelength & 0x3) == dir) {
-				if (length >= (uint)(link->typelength >> 2)) return false;
+			if (tile == link->tile && (link->typelength & 0x3U) == dir) {
+				if (length >= link->typelength >> 2) return false;
 				link->typelength = dir | (length << 2);
 				return true;
 			}
-		} while ((offs=link->next) != 0xFFFF);
+		} while ((offs = link->next) != 0xFFFF);
 	}
 
 	/* get here if we need to add a new link to link,
@@ -611,9 +611,9 @@
 	offs = tpf->hash_tile[hash];
 	for (;;) {
 		link = NTP_GET_LINK_PTR(tpf, offs);
-		if (tile == link->tile && (uint)(link->typelength & 0x3) == dir) {
-			assert( (uint)(link->typelength >> 2) <= length);
-			return length == (uint)(link->typelength >> 2);
+		if (tile == link->tile && (link->typelength & 0x3U) == dir) {
+			assert(link->typelength >> 2 <= length);
+			return length == link->typelength >> 2;
 		}
 		offs = link->next;
 		assert(offs != 0xffff);