Skip to content

Commit

Permalink
Even more fallthrough cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
elunna committed Dec 2, 2024
1 parent 7d50505 commit 66e152e
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 33 deletions.
2 changes: 1 addition & 1 deletion include/tradstdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#define FALLTHROUGH __attribute__((fallthrough))
#endif /* __clang_major__ greater than or equal to 9 */
#endif /* __clang_major__ is defined */
#endif /* FALLTHROUGH */
#endif /*FALLTHRU*/
#if !defined(DO_DEFINE_NONNULLS)
#define DO_DEFINE_NONNULLS
#endif
Expand Down
5 changes: 2 additions & 3 deletions outdated/sys/wince/mhdlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hWnd, IDC_GETLIN_EDIT, WM_GETTEXT,
(WPARAM) sizeof(wbuf), (LPARAM) wbuf);
NH_W2A(wbuf, data->result, data->result_size);

/* Fall through. */
/*FALLTHRU*/

/* cancel button was pressed */
case IDCANCEL:
Expand Down Expand Up @@ -244,7 +243,7 @@ ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
hWnd, IDC_EXTCMD_LIST, LB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
if (*data->selection == LB_ERR)
*data->selection = -1;
/* Fall through. */
/*FALLTHRU*/

/* CANCEL button ws clicked */
case IDCANCEL:
Expand Down
2 changes: 1 addition & 1 deletion outdated/win/gem/wingem.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ const char *str;

case NHW_MENU:
mar_change_menu_2_text(window);
/* Fallthru */
/*FALLTHRU*/
case NHW_TEXT:
mar_putstr_text(window, attr, str);
break;
Expand Down
6 changes: 3 additions & 3 deletions src/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -3199,7 +3199,7 @@ use_stone(struct obj *tstone)
if (tstone->otyp == FLINT)
make_sparks = TRUE;
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
default:
/* Objects passing the is_flimsy() test will not
scratch a stone. They will leave streaks on
Expand Down Expand Up @@ -4783,7 +4783,7 @@ doapply(void)
return ECMD_OK;
}
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case CREDIT_CARD:
case SKELETON_KEY:
/* Lockpicking requires a free hand. */
Expand Down Expand Up @@ -4922,7 +4922,7 @@ doapply(void)
break;
}
FALLTHROUGH;
/* FALLTHROUGH */
/*FALLTHRU*/
case LUCKSTONE:
case HEALTHSTONE:
case LOADSTONE:
Expand Down
2 changes: 1 addition & 1 deletion src/dothrow.c
Original file line number Diff line number Diff line change
Expand Up @@ -2767,7 +2767,7 @@ breaktest(struct obj *obj)
if (Role_if(PM_CARTOMANCER))
return 0;
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case POT_WATER: /* really, all potions */
case CREAM_PIE:
case MELON:
Expand Down
3 changes: 2 additions & 1 deletion src/mhitm.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ hitmm(
weaphitmsg(mwep, magr));
break;
}
/* FALLTHRU */
FALLTHROUGH;
/*FALLTHRU*/
case AT_CLAW: {
const char *verb = barehitmsg(magr);
Snprintf(buf, sizeof(buf), "%s %s", magr_name,
Expand Down
4 changes: 2 additions & 2 deletions src/muse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,8 +2474,8 @@ rnd_offensive_item(struct monst *mtmp)
|| passes_walls(pm) || noncorporeal(pm) || unsolid(pm))
return SCR_EARTH;
}
FALLTHROUGH;
/* FALLTHRU */
FALLTHROUGH;
/*FALLTHRU*/
case 1:
return WAN_STRIKING;
case 2:
Expand Down
3 changes: 2 additions & 1 deletion src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,8 @@ add_obj_info(winid datawin, struct obj *obj, short otyp, char *usr_text)
break;
case LIFESAVED:
effect = "life saving";
/* FALLTHRU */
FALLTHROUGH;
/*FALLTHRU*/
/* for things that don't work with "Makes you" */
case GLIB:
case WOUNDED_LEGS:
Expand Down
3 changes: 2 additions & 1 deletion src/pline.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ vpline(const char *line, va_list the_args)
switch (msgtyp) {
case MSGTYP_ALERT:
iflags.msg_is_alert = TRUE; /* <TAB> */
/* FALLTHRU */
FALLTHROUGH;
/*FALLTHRU*/
case MSGTYP_STOP:
display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
break;
Expand Down
3 changes: 2 additions & 1 deletion src/potion.c
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,8 @@ potionbreathe(struct obj *obj)
break;
case POT_GAIN_LEVEL:
more_experienced(5, 0);
/* FALLTHRU */
FALLTHROUGH;
/*FALLTHRU*/
case POT_LEVITATION:
You_feel("slightly elevated.");
/* Strictly speaking, this is only unambiguous if the player has showexp
Expand Down
2 changes: 1 addition & 1 deletion src/questpgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ convert_line(char *in_line, char *out_line)
break;
}
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
default:
*cc++ = *c;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/rumors.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ outrumor(
case BY_COOKIE:
pline(fortune_msg);
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case BY_PAPER:
pline("It reads:");
break;
Expand Down
4 changes: 2 additions & 2 deletions src/sounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ domonnoise(struct monst *mtmp)
(void) demon_talk(mtmp);
break;
}
FALLTHROUGH;
/* FALLTHRU */
FALLTHROUGH;
/*FALLTHRU*/
case MS_CUSS:
if (!mtmp->mpeaceful)
cuss(mtmp);
Expand Down
2 changes: 1 addition & 1 deletion src/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -7227,7 +7227,7 @@ chest_trap(
}
/* No mon data was made, so just... */
}
/* FALLTHROUGH*/
/*FALLTHRU*/
case 3: {
/* Cream pie in the face */
struct obj pseudo;
Expand Down
5 changes: 3 additions & 2 deletions src/uhitm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7411,7 +7411,7 @@ passive_obj(
break;
}
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
default:
break;
}
Expand Down Expand Up @@ -7746,7 +7746,8 @@ bite_monster(struct monst *mon)
You("don't feel very well.");
Slimed = 10L;
}
/* Fall through */
FALLTHROUGH;
/*FALLTHRU*/
default:
if (acidic(mon->data) && Stoned)
fix_petrification();
Expand Down
6 changes: 3 additions & 3 deletions src/weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ weapon_hit_bonus(struct obj *weapon)
default:
impossible(bad_skill, P_SKILL(type));
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case P_ISRESTRICTED:
case P_UNSKILLED:
bonus = -4;
Expand All @@ -1853,7 +1853,7 @@ weapon_hit_bonus(struct obj *weapon)
default:
impossible(bad_skill, skill);
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case P_ISRESTRICTED:
case P_UNSKILLED:
bonus = -9;
Expand Down Expand Up @@ -1928,7 +1928,7 @@ weapon_dam_bonus(struct obj *weapon)
default:
impossible("weapon_dam_bonus: bad skill %d", P_SKILL(type));
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case P_ISRESTRICTED:
case P_UNSKILLED:
bonus = -2;
Expand Down
2 changes: 1 addition & 1 deletion src/wizard.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ strategy(struct monst *mtmp)
if (mtmp->data != &mons[PM_WIZARD_OF_YENDOR])
return (unsigned long) STRAT_HEAL;
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case 2:
dstrat = STRAT_HEAL;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/zap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3177,7 +3177,7 @@ zapyourself(struct obj *obj, boolean ordinary)
break;
case WAN_DRAINING: /* KMH */
makeknown(obj->otyp);
/* FALLTHROUGH */
/*FALLTHRU*/
case SPE_DRAIN_LIFE:
if (!Drain_resistance) {
learn_it = TRUE; /* (no effect for spells...) */
Expand Down
2 changes: 1 addition & 1 deletion sys/share/pcmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ process_options(int argc, char *argv[])
break;
} else
raw_printf("\nUnknown switch: %s", argv[0]);
/* FALL THROUGH */
/*FALLTHRU*/
case '?':
nhusage();
nethack_exit(EXIT_SUCCESS);
Expand Down
2 changes: 1 addition & 1 deletion sys/windows/consoletty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ xputc_core(int ch)
if (console.cursor.Y < console.height - 1)
console.cursor.Y++;
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case '\r':
console.cursor.X = 1;
break;
Expand Down
2 changes: 1 addition & 1 deletion sys/windows/windmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ process_options(int argc, char * argv[])
} else
raw_printf("\nUnknown switch: %s", argv[0]);
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case '?':
nhusage();
nethack_exit(EXIT_SUCCESS);
Expand Down
2 changes: 1 addition & 1 deletion util/makedefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ do_grep_control(char *buf)
case '!': /* if not ID */
isif = 0;
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/
case '?': /* if ID */
if (grep_sp == GREP_STACK_SIZE - 2) {
Fprintf(stderr, "stack overflow at line %d.", grep_lineno);
Expand Down
4 changes: 2 additions & 2 deletions win/win32/mhdlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
NH_W2A(wbuf2, data->result, data->result_size);

FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/

/* cancel button was pressed */
case IDCANCEL:
Expand Down Expand Up @@ -248,7 +248,7 @@ ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (*data->selection == LB_ERR)
*data->selection = -1;
FALLTHROUGH;
/* FALLTHRU */
/*FALLTHRU*/

/* CANCEL button ws clicked */
case IDCANCEL:
Expand Down

0 comments on commit 66e152e

Please sign in to comment.