OSDN Git Service

[Fix] #40340 switch case文における意図しないfall through
authorHabu <habu@users.sourceforge.jp>
Fri, 15 Jan 2021 14:00:21 +0000 (23:00 +0900)
committerHabu <habu@users.sourceforge.jp>
Fri, 15 Jan 2021 14:00:21 +0000 (23:00 +0900)
src/main-x11.c
src/monster-floor/special-death-switcher.c
src/object/warning.c
src/store/service-checker.c

index 7dabb41..0c01061 100644 (file)
@@ -2593,8 +2593,8 @@ errr init_x11(int argc, char *argv[])
                        use_graphics = TRUE;
                        pict_wid = pict_hgt = 8;
                        ANGBAND_GRAF = "old";
-                       break;
                }
+               break;
        case GRAPHICS_ADAM_BOLT:
                path_build(filename, sizeof(filename), ANGBAND_DIR_XTRA, "graf/16x16.bmp");
                if (0 == fd_close(fd_open(filename, O_RDONLY)))
@@ -2602,8 +2602,8 @@ errr init_x11(int argc, char *argv[])
                        use_graphics = TRUE;
                        pict_wid = pict_hgt = 16;
                        ANGBAND_GRAF = "new";
-                       break;
                }
+               break;
        }
 
        if (use_graphics)
index b73c3d5..c7693cd 100644 (file)
@@ -410,8 +410,10 @@ void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr)
         return;
     case MON_CAIT_SITH:
         drop_specific_item_on_dead(player_ptr, md_ptr, kind_is_boots);
+        return;
     case MON_BIG_RAVEN:
         on_dead_big_raven(player_ptr, md_ptr);
+        return;
     default:
         on_dead_mimics(player_ptr, md_ptr);
         return;
index e68633b..c7689c1 100644 (file)
@@ -115,11 +115,10 @@ static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_I
 
     case GF_FIRE:
         if (has_immune_fire(target_ptr)) {
-            dam = 0;
             ignore_wraith_form = TRUE;
-            break;
         }
         dam = dam * calc_fire_damage_rate(target_ptr) / 100;
+        break;
 
     case GF_PSY_SPEAR:
         ignore_wraith_form = TRUE;
index 4f5b4a7..eac0ecc 100644 (file)
@@ -31,6 +31,7 @@ static bool check_store_general(object_type *o_ptr)
     case TV_POTION:
         if (o_ptr->sval != SV_POTION_WATER)
             return FALSE;
+        /* Fall through */
     case TV_WHISTLE:
     case TV_FOOD:
     case TV_LITE: