From: nethack.allison Date: Tue, 15 Jan 2002 03:37:36 +0000 (+0000) Subject: Get rid of a compiler warning that has been there forever. X-Git-Tag: MOVE2GIT~3472 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ef53b7e30cb706ea81bd40dac28504613cf2557;p=nethack Get rid of a compiler warning that has been there forever. This finally gets the entire build process warning-free under MSVC. --- 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);