GLK: AGT: Fix Missing Default Switch Cases

These are flagged by GCC if -Wswitch-default is enabled.
This commit is contained in:
D G Turner 2019-12-16 07:36:33 +00:00
parent 63789ac698
commit fc813901ff
4 changed files with 18 additions and 0 deletions

View File

@ -182,6 +182,8 @@ static void var_edit(int vtype)
case 2:
writeln("Flags ( f=false [OFF] and t=true [ON] )");
break;
default:
break;
}
writeln("");
for (i = 0; i <= imax; i++) {
@ -195,6 +197,8 @@ static void var_edit(int vtype)
case 2:
sprintf(sbuff, "%3d%c", i, flag[i] ? 't' : 'f');
break;
default:
break;
}
writetbl(sbuff, (vtype == 2) ? 5 : 20);
}
@ -211,6 +215,8 @@ static void var_edit(int vtype)
case 2:
writestr("Flag to toggle");
break;
default:
break;
}
writestr(" (-1 to quit): ");
i = read_number();
@ -301,6 +307,8 @@ static void writegender(const char *gendername, uchar genderval) {
case 0:
writestr("Thing");
break;
default:
break;
}
next_col();
}

View File

@ -106,6 +106,8 @@ void set_statline() {
case 5:
sprintf(r_stat, "Score: %ld", tscore);
break;
default:
break;
}
}
@ -204,6 +206,7 @@ static word it_pronoun(int item, rbool ind_form)
if (tcreat(item))
switch (creature[item - first_creat].gender) {
case 0:
default:
return ext_code[wit];
case 1:
return (ind_form ? ext_code[wher] : ext_code[wshe]);
@ -484,6 +487,7 @@ static char *wordvar_match(const char **pvarname, char match_type,
/* Now need to fix capitalization */
switch (capstate(start)) {
case 0:
default:
break; /* $word$ */
case 1: /* $WORD$ */
for (i = 0; fill_buff[i] != '\0'; i++)
@ -1243,6 +1247,8 @@ static void set_pronoun(int item) {
case 2:
last_he = item;
break;
default:
break;
}
}

View File

@ -1038,6 +1038,7 @@ int scan_metacommand(integer m_actor, int vcode,
/* We are doing disambiguation and reached
an action token */
case 0:
default:
break; /* Go onto next metacommand */
case 1:
rfree(substack);

View File

@ -598,6 +598,9 @@ static void obj_act(int op_, int obj) {
case 3: /* lock and unlock */
if (tnoun(obj))
noun[obj - first_noun].locked = (op_ == 2);
break;
default:
break;
}
}