OSDN Git Service

#37287 (2.2.0.89) C4706警告にエンバグを修正しつつ対応。 / Fix C4706 warning with correcting new bug.
authorDeskull <desull@users.sourceforge.jp>
Tue, 5 Dec 2017 13:32:08 +0000 (22:32 +0900)
committerDeskull <desull@users.sourceforge.jp>
Tue, 5 Dec 2017 13:32:08 +0000 (22:32 +0900)
src/readdib.c
src/util.c
src/xtra2.c

index aacf4f1..b3a493d 100644 (file)
@@ -273,7 +273,8 @@ BOOL ReadDIB(HWND hWnd, LPSTR lpFileName, DIBINIT *pInfo)
                        goto ErrExit;
        }
 
-       if (!(nNumColors == (WORD)lpbi->biClrUsed))
+       nNumColors = (WORD)lpbi->biClrUsed;
+       if (!nNumColors)
        {
                /* no color table for 24-bit, default size otherwise */
                if (lpbi->biBitCount != 24)
index 77758d6..26f8ff1 100644 (file)
@@ -1322,7 +1322,7 @@ static bool trigger_ascii_to_text(char **bufptr, cptr *strptr)
                switch(ch)
                {
                case '&':
-                       while ((tmp = my_strchr(macro_modifier_chr, *str)))
+                       while ((tmp = my_strchr(macro_modifier_chr, *str)) != 0)
                        {
                                j = (int)(tmp - macro_modifier_chr);
                                tmp = macro_modifier_name[j];
index a80ceff..0882e5c 100644 (file)
@@ -3889,7 +3889,7 @@ bool target_set(int mode)
                        strcpy(info, _("q止 t決 p自 m近 +次 -前", "q,t,p,m,+,-,<dir>"));
 
                        /* Describe and Prompt (enable "TARGET_LOOK") */
-                       while (!(query = target_set_aux(y, x, mode | TARGET_LOOK, info)));
+                       while ((query = target_set_aux(y, x, mode | TARGET_LOOK, info)) == 0);
 
                        /* Cancel tracking */
                        /* health_track(0); */