From: nhmall Date: Sat, 10 Jul 2021 11:42:27 +0000 (-0400) Subject: get rid of some recent signed/unsigned mismatches X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4711739c011f6ec6f6d54261600eb693f6755cf;p=nethack get rid of some recent signed/unsigned mismatches src/mkroom.c(529): warning C4389: '!=': signed/unsigned mismatch src/sp_lev.c(981): warning C4389: '==': signed/unsigned mismatch src/sp_lev.c(983): warning C4389: '==': signed/unsigned mismatch src/sp_lev.c(985): warning C4389: '==': signed/unsigned mismatch src/sp_lev.c(987): warning C4389: '==': signed/unsigned mismatch src/sp_lev.c(989): warning C4389: '==': signed/unsigned mismatch --- diff --git a/src/mkroom.c b/src/mkroom.c index 1a791e08f..652b9abb4 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -526,7 +526,7 @@ mkswamp(void) /* Michiel Huisjes & Fred de Wilde */ sroom->rtype = SWAMP; for (sx = sroom->lx; sx <= sroom->hx; sx++) for (sy = sroom->ly; sy <= sroom->hy; sy++) { - if (!IS_ROOM(levl[sx][sy].typ) || levl[sx][sy].roomno != rmno) + if (!IS_ROOM(levl[sx][sy].typ) || (int) levl[sx][sy].roomno != rmno) continue; if (!OBJ_AT(sx, sy) && !MON_AT(sx, sy) && !t_at(sx, sy) && !nexttodoor(sx, sy)) { diff --git a/src/sp_lev.c b/src/sp_lev.c index e4a7095d7..d50d83741 100755 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -978,15 +978,15 @@ shared_with_room(int x, int y, struct mkroom *droom) if (!isok(x,y)) return FALSE; - if (levl[x][y].roomno == rmno && !levl[x][y].edge) + if ((int) levl[x][y].roomno == rmno && !levl[x][y].edge) return FALSE; - if (isok(x-1, y) && levl[x-1][y].roomno == rmno) + if (isok(x-1, y) && (int) levl[x-1][y].roomno == rmno) return TRUE; - if (isok(x+1, y) && levl[x+1][y].roomno == rmno) + if (isok(x+1, y) && (int) levl[x+1][y].roomno == rmno) return TRUE; - if (isok(x, y-1) && levl[x][y-1].roomno == rmno) + if (isok(x, y-1) && (int) levl[x][y-1].roomno == rmno) return TRUE; - if (isok(x, y+1) && levl[x][y+1].roomno == rmno) + if (isok(x, y+1) && (int) levl[x][y+1].roomno == rmno) return TRUE; return FALSE; } @@ -997,7 +997,7 @@ maybe_add_door(int x, int y, struct mkroom* droom) { if (droom->hx >= 0 && g.doorindex < DOORMAX && ((!droom->irregular && inside_room(droom, x, y)) - || levl[x][y].roomno == (droom - g.rooms) + ROOMOFFSET + || (int) levl[x][y].roomno == (droom - g.rooms) + ROOMOFFSET || shared_with_room(x, y, droom))) { add_door(x, y, droom); }