diff options
Diffstat (limited to 'src/data.c')
| -rwxr-xr-x | src/data.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -57,8 +57,8 @@ DistanceBetweenSquares(COOR a, COOR b) ASSERT(IS_ON_BOARD(b)); ASSERT((i >= 0) && (i < 256)); ASSERT(g_uDistance[i] == REAL_DISTANCE(a, b)); - ASSERT(g_pDistance[a - b] == g_uDistance[i]); - ASSERT(g_pDistance[b - a] == g_uDistance[i]); + ASSERT(g_pDistance[(int)a - (int)b] == g_uDistance[i]); + ASSERT(g_pDistance[(int)b - (int)a] == g_uDistance[i]); ASSERT(g_uDistance[j] == REAL_DISTANCE(a, b)); return(REAL_DISTANCE(a, b)); } @@ -586,12 +586,12 @@ InitializeDistanceTable(void) if (!IS_ON_BOARD(y)) continue; i = (int)x - (int)y + 128; ASSERT(g_uDistance[i] == REAL_DISTANCE(x, y)); - ASSERT(g_pDistance[x - y] == g_uDistance[i]); - ASSERT(&(g_pDistance[x - y]) == &(g_uDistance[i])); + ASSERT(g_pDistance[(int)x - (int)y] == g_uDistance[i]); + ASSERT(&(g_pDistance[(int)x - (int)y]) == &(g_uDistance[i])); j = (int)y - (int)x + 128; ASSERT(g_uDistance[j] == REAL_DISTANCE(x, y)); - ASSERT(g_pDistance[y - x] == g_uDistance[j]); - ASSERT(&(g_pDistance[y - x]) == &(g_uDistance[j])); + ASSERT(g_pDistance[(int)y - (int)x] == g_uDistance[j]); + ASSERT(&(g_pDistance[(int)y - (int)x]) == &(g_uDistance[j])); } } #endif |
