From 8ef53b7e30cb706ea81bd40dac28504613cf2557 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Tue, 15 Jan 2002 03:37:36 +0000 Subject: [PATCH] Get rid of a compiler warning that has been there forever. This finally gets the entire build process warning-free under MSVC. --- util/lev_main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/util/lev_main.c b/util/lev_main.c index 2634d50de..bf9aae25d 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1163,8 +1163,19 @@ specialmaze *maze; Write(fd, &(pt->ysize), sizeof(pt->ysize)); for(j=0;jysize;j++) { if(!maze->init_lev.init_present || - pt->xsize > 1 || pt->ysize > 1) - Write(fd, pt->map[j], pt->xsize * sizeof *pt->map[j]); + pt->xsize > 1 || pt->ysize > 1) { +#ifndef _MSC_VER + Write(fd, pt->map[j], pt->xsize * sizeof *pt->map[j]); +#else + /* + * On MSVC compiler the Write macro above caused: + * warning '!=' : signed/unsigned mismatch + */ + unsigned reslt, sz = pt->xsize * sizeof *pt->map[j]; + reslt = write(fd, (genericptr_t)(pt->map[j]), sz); + if (reslt != sz) return FALSE; +#endif + } Free(pt->map[j]); } Free(pt->map);