From: NHOrus Date: Sun, 16 Jul 2017 13:00:19 +0000 (+0300) Subject: Deal with more agressive gcov 7.1; Reindent X-Git-Tag: 1.3~76 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8d9c8e4d5c035213bb41abc64c59fb25672e8e50;p=open-adventure.git Deal with more agressive gcov 7.1; Reindent --- diff --git a/actions.c b/actions.c index c4d86b4..efa52a6 100644 --- a/actions.c +++ b/actions.c @@ -101,11 +101,10 @@ static int attack(struct command_t *command) * fixed), move rug there (not fixed), and move him there, * too. Then do a null motion to get new description. */ rspeak(BARE_HANDS_QUERY); - if (!silent_yes()) - { - speak(arbitrary_messages[NASTY_DRAGON]); - return GO_MOVE; - } + if (!silent_yes()) { + speak(arbitrary_messages[NASTY_DRAGON]); + return GO_MOVE; + } state_change(DRAGON, DRAGON_DEAD); game.prop[RUG] = RUG_FLOOR; /* Hardcoding LOC_SECRET5 as the dragon's death location is ugly. @@ -417,8 +416,8 @@ static int chain(verb_t verb) game.prop[BEAR] = CONTENTED_BEAR; switch (game.prop[BEAR]) { + // LCOV_EXCL_START case BEAR_DEAD: - // LCOV_EXCL_START /* 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 * exclude from coverage testing. */ @@ -545,7 +544,7 @@ static int discard(verb_t verb, obj_t obj) } else rspeak(OK_MAN); - game.prop[BIRD] = FOREST(game.loc) ? BIRD_FOREST_UNCAGED : BIRD_UNCAGED; + game.prop[BIRD] = FOREST(game.loc) ? BIRD_FOREST_UNCAGED : BIRD_UNCAGED; drop(obj, game.loc); return GO_CLEAROBJ; } @@ -1001,12 +1000,12 @@ static int lock(verb_t verb, obj_t obj) case OYSTER: if (verb == LOCK) rspeak(HUH_MAN); - else if (TOTING(OYSTER)) - rspeak(DROP_OYSTER); + else if (TOTING(OYSTER)) + rspeak(DROP_OYSTER); else if (!TOTING(TRIDENT)) rspeak(OYSTER_OPENER); - else - rspeak(OYSTER_OPENS); + else + rspeak(OYSTER_OPENS); break; case DOOR: rspeak((game.prop[DOOR] == DOOR_UNRUSTED) ? OK_MAN : RUSTY_DOOR); @@ -1448,7 +1447,7 @@ int action(struct command_t *command) return listen(); case PART: return reservoir(); - default: + default: // 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: return reservoir(); - default: + default: // LCOV_EXCL_LINE BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE } case unknown: /* Unknown verb, couldn't deduce object - might need hint */ sspeak(WHAT_DO, command->raw1); return GO_CHECKHINT; - default: + default: // LCOV_EXCL_LINE BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN); // LCOV_EXCL_LINE } } diff --git a/main.c b/main.c index af11a4b..f8bf8a1 100644 --- a/main.c +++ b/main.c @@ -223,9 +223,8 @@ static void checkhints(void) break; game.hintlc[hint] = 0; return; - default: + default: // LCOV_EXCL_LINE BUG(HINT_NUMBER_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE - break; } /* Fall through to hint display */ @@ -756,7 +755,7 @@ static void playermove( int motion) croak(); return; } - default: + default: // LCOV_EXCL_LINE BUG(SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE } } @@ -1122,28 +1121,26 @@ Lclearobj: } if (command.id1 == ENTER && command.id2 != WORD_NOT_FOUND && command.id2 != WORD_EMPTY) { command.id1 = command.id2; - command.type1 = command.type2; - strncpy(command.raw1, command.raw2, LINESIZE - 1); + command.type1 = command.type2; + strncpy(command.raw1, command.raw2, LINESIZE - 1); command.id2 = WORD_EMPTY; - command.type2 = NO_WORD_TYPE; - strncpy(command.raw2, "", LINESIZE - 1); + command.type2 = NO_WORD_TYPE; + strncpy(command.raw2, "", LINESIZE - 1); } else { if (!((command.id1 != WATER && command.id1 != OIL) || (command.id2 != PLANT && command.id2 != DOOR))) { - if (AT(command.id2)) - { - command.id2 = POUR; - command.type2 = ACTION; - strncpy(command.raw2, "POUR", LINESIZE - 1); + if (AT(command.id2)) { + command.id2 = POUR; + command.type2 = ACTION; + strncpy(command.raw2, "POUR", LINESIZE - 1); command.wd2 = token_to_packed("POUR"); - } + } } - if (command.id1 == CAGE && command.id2 == BIRD && HERE(CAGE) && HERE(BIRD)) - { - command.id1 = CARRY; - command.type1 = ACTION; - strncpy(command.raw2, "CATCH", LINESIZE - 1); + if (command.id1 == CAGE && command.id2 == BIRD && HERE(CAGE) && HERE(BIRD)) { + command.id1 = CARRY; + command.type1 = ACTION; + strncpy(command.raw2, "CATCH", LINESIZE - 1); command.wd1 = token_to_packed("CATCH"); - } + } } Lookup: if (strncasecmp(command.raw1, "west", sizeof("west")) == 0) { @@ -1155,9 +1152,9 @@ Lookup: rspeak(GO_UNNEEDED); } packed_to_token(command.wd1, word1); - long defn; - enum wordtype type; - get_vocab_metadata(word1, &defn, &type); + long defn; + enum wordtype type; + get_vocab_metadata(word1, &defn, &type); if (command.id1 == WORD_NOT_FOUND) { if (fallback_handler(command)) continue; @@ -1181,7 +1178,7 @@ Lookup: case SPECIAL: speak(specials[command.id1].message); goto Lclearobj; - default: + default: // LCOV_EXCL_LINE BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE } @@ -1197,13 +1194,13 @@ Lookup: goto Lookup; case GO_WORD2: /* Get second word for analysis. */ - command.id1 = command.id2; - command.type1 = command.type2; - strncpy(command.raw1, command.raw2, LINESIZE - 1); - command.wd1 = command.wd2; - command.id2 = WORD_EMPTY; - command.type2 = NO_WORD_TYPE; - command.raw2[0] = '\0'; + command.id1 = command.id2; + command.type1 = command.type2; + strncpy(command.raw1, command.raw2, LINESIZE - 1); + command.wd1 = command.wd2; + command.id2 = WORD_EMPTY; + command.type2 = NO_WORD_TYPE; + command.raw2[0] = '\0'; wordclear(&command.wd2); goto Lookup; case GO_UNKNOWN: @@ -1220,7 +1217,7 @@ Lookup: /* Oh dear, he's disturbed the dwarves. */ rspeak(DWARVES_AWAKEN); terminate(endgame); - default: + default: // LCOV_EXCL_LINE BUG(ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH); // LCOV_EXCL_LINE } }