Deal with more agressive gcov 7.1; Reindent

This commit is contained in:
NHOrus 2017-07-16 16:00:19 +03:00
parent 33e546b746
commit 8d9c8e4d5c
2 changed files with 41 additions and 45 deletions

View file

@ -101,8 +101,7 @@ static int attack(struct command_t *command)
* fixed), move rug there (not fixed), and move him there, * fixed), move rug there (not fixed), and move him there,
* too. Then do a null motion to get new description. */ * too. Then do a null motion to get new description. */
rspeak(BARE_HANDS_QUERY); rspeak(BARE_HANDS_QUERY);
if (!silent_yes()) if (!silent_yes()) {
{
speak(arbitrary_messages[NASTY_DRAGON]); speak(arbitrary_messages[NASTY_DRAGON]);
return GO_MOVE; return GO_MOVE;
} }
@ -417,8 +416,8 @@ static int chain(verb_t verb)
game.prop[BEAR] = CONTENTED_BEAR; game.prop[BEAR] = CONTENTED_BEAR;
switch (game.prop[BEAR]) { switch (game.prop[BEAR]) {
case BEAR_DEAD:
// LCOV_EXCL_START // LCOV_EXCL_START
case BEAR_DEAD:
/* Can't be reached as long as the only way for the bear to die /* Can't be reached as long as the only way for the bear to die
* is from a bridge collapse. Leave in in case this changes, but * is from a bridge collapse. Leave in in case this changes, but
* exclude from coverage testing. */ * exclude from coverage testing. */
@ -1448,7 +1447,7 @@ int action(struct command_t *command)
return listen(); return listen();
case PART: case PART:
return reservoir(); return reservoir();
default: default: // LCOV_EXCL_LINE
BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE
} }
} }
@ -1549,14 +1548,14 @@ int action(struct command_t *command)
} }
case PART: case PART:
return reservoir(); return reservoir();
default: default: // LCOV_EXCL_LINE
BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE
} }
case unknown: case unknown:
/* Unknown verb, couldn't deduce object - might need hint */ /* Unknown verb, couldn't deduce object - might need hint */
sspeak(WHAT_DO, command->raw1); sspeak(WHAT_DO, command->raw1);
return GO_CHECKHINT; return GO_CHECKHINT;
default: default: // LCOV_EXCL_LINE
BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN); // LCOV_EXCL_LINE BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN); // LCOV_EXCL_LINE
} }
} }

15
main.c
View file

@ -223,9 +223,8 @@ static void checkhints(void)
break; break;
game.hintlc[hint] = 0; game.hintlc[hint] = 0;
return; return;
default: default: // LCOV_EXCL_LINE
BUG(HINT_NUMBER_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE BUG(HINT_NUMBER_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE
break;
} }
/* Fall through to hint display */ /* Fall through to hint display */
@ -756,7 +755,7 @@ static void playermove( int motion)
croak(); croak();
return; return;
} }
default: default: // LCOV_EXCL_LINE
BUG(SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE BUG(SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE
} }
} }
@ -1129,16 +1128,14 @@ Lclearobj:
strncpy(command.raw2, "", LINESIZE - 1); strncpy(command.raw2, "", LINESIZE - 1);
} else { } else {
if (!((command.id1 != WATER && command.id1 != OIL) || (command.id2 != PLANT && command.id2 != DOOR))) { if (!((command.id1 != WATER && command.id1 != OIL) || (command.id2 != PLANT && command.id2 != DOOR))) {
if (AT(command.id2)) if (AT(command.id2)) {
{
command.id2 = POUR; command.id2 = POUR;
command.type2 = ACTION; command.type2 = ACTION;
strncpy(command.raw2, "POUR", LINESIZE - 1); strncpy(command.raw2, "POUR", LINESIZE - 1);
command.wd2 = token_to_packed("POUR"); command.wd2 = token_to_packed("POUR");
} }
} }
if (command.id1 == CAGE && command.id2 == BIRD && HERE(CAGE) && HERE(BIRD)) if (command.id1 == CAGE && command.id2 == BIRD && HERE(CAGE) && HERE(BIRD)) {
{
command.id1 = CARRY; command.id1 = CARRY;
command.type1 = ACTION; command.type1 = ACTION;
strncpy(command.raw2, "CATCH", LINESIZE - 1); strncpy(command.raw2, "CATCH", LINESIZE - 1);
@ -1181,7 +1178,7 @@ Lookup:
case SPECIAL: case SPECIAL:
speak(specials[command.id1].message); speak(specials[command.id1].message);
goto Lclearobj; goto Lclearobj;
default: default: // LCOV_EXCL_LINE
BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE
} }
@ -1220,7 +1217,7 @@ Lookup:
/* Oh dear, he's disturbed the dwarves. */ /* Oh dear, he's disturbed the dwarves. */
rspeak(DWARVES_AWAKEN); rspeak(DWARVES_AWAKEN);
terminate(endgame); terminate(endgame);
default: default: // LCOV_EXCL_LINE
BUG(ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH); // LCOV_EXCL_LINE BUG(ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH); // LCOV_EXCL_LINE
} }
} }