summaryrefslogtreecommitdiff
path: root/pathfind.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-10 22:14:35 +0000
committertron <tron@openttd.org>2005-01-10 22:14:35 +0000
commit05a3a83b6ce2d8d993900b1741ec26c61fa7a5e8 (patch)
tree6883287048b8258867d42f07df628238162411dc /pathfind.c
parent46d0e2f892bdb7a17deb7b5e2847db458967bf14 (diff)
downloadopenttd-05a3a83b6ce2d8d993900b1741ec26c61fa7a5e8.tar.xz
(svn r1475) Fix some more signed/unsigned comparison warnings
Diffstat (limited to 'pathfind.c')
-rw-r--r--pathfind.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pathfind.c b/pathfind.c
index befb45f4c..337bdcff7 100644
--- a/pathfind.c
+++ b/pathfind.c
@@ -450,7 +450,7 @@ typedef struct {
HashLink *new_link;
uint num_links_left;
- int nstack;
+ uint nstack;
StackedItem stack[256]; // priority queue of stacked items
uint16 hash_head[0x400]; // hash heads. 0 means unused. 0xFFC0 = length, 0x3F = type
@@ -484,7 +484,10 @@ static inline void HeapifyDown(NewTrackPathFinder *tpf)
{
StackedItem si;
int i = 1, j;
- int n = --tpf->nstack;
+ int n;
+
+ assert(tpf->nstack > 0);
+ n = --tpf->nstack;
if (n == 0) return; // heap is empty so nothing to do?