Handle explicitly enum vals in switch [-Wswitch-enum]

This commit is contained in:
Philippe Teuwen 2019-04-13 22:46:08 +02:00
parent b6ee94ec8e
commit ce606b51fc
6 changed files with 43 additions and 17 deletions

View file

@ -243,8 +243,7 @@ static int CmdFlashMemLoad(const char *Cmd) {
data[1] = (keycount >> 8) & 0xFF;
datalen += 2;
break;
default:
case DICTIONARY_NONE:
res = loadFile(filename, "bin", data, FLASH_MEM_MAX_SIZE, &datalen);
//int res = loadFileEML( filename, "eml", data, &datalen);
if (res) {

View file

@ -53,9 +53,15 @@ uint8_t mifare_CRC_check(bool isResponse, uint8_t *data, uint8_t len) {
case masNone:
case masError:
return iso14443A_CRC_check(isResponse, data, len);
default:
return 2;
case masNt:
case masNrAr:
case masAt:
case masAuthComplete:
case masFirstData:
case masData:
break;
}
return 2;
}
/**
@ -1024,7 +1030,11 @@ void annotateMifare(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, uint8
MifareAuthState = masError;
}
break;
default:
case masNone:
case masError:
case masAuthComplete:
case masFirstData:
case masData:
break;
}

View file

@ -550,9 +550,10 @@ static int CmdLFHitagReader(const char *Cmd) {
// No additional parameters needed
break;
}
default: {
case WHTSF_CHALLENGE:
case WHTSF_KEY:
case WHT2F_CRYPTO:
return usage_hitag_reader();
}
}
c.arg[0] = htf;
@ -661,9 +662,14 @@ static int CmdLFHitagWriter(const char *Cmd) {
num_to_bytes(param_get32ex(Cmd, 3, 0, 16), 4, htd->crypto.data);
break;
}
default: {
case RHTSF_CHALLENGE:
case RHTSF_KEY:
case RHT2F_PASSWORD:
case RHT2F_AUTHENTICATE:
case RHT2F_CRYPTO:
case RHT2F_TEST_AUTH_ATTEMPTS:
case RHT2F_UID_ONLY:
return usage_hitag_writer();
}
}
c.arg[0] = htf;

View file

@ -238,7 +238,11 @@ static int ndefDecodePayload(NDEFHeader_t *ndef) {
PrintAndLogEx(NORMAL, "\ttype: %.*s", ndef->TypeLen, ndef->Type);
PrintAndLogEx(NORMAL, "\tpayload: %.*s", ndef->PayloadLen, ndef->Payload);
break;
default:
case tnfEmptyRecord:
case tnfMIMEMediaRecord:
case tnfExternalRecord:
case tnfUnchangedRecord:
case tnfUnknownRecord:
break;
}
return 0;

View file

@ -81,7 +81,8 @@ void PrintAndLogEx(logLevel_t level, const char *fmt, ...) {
case WARNING:
strncpy(prefix, _CYAN_("[!]"), sizeof(prefix) - 1);
break;
default:
case NORMAL:
case INFO:
strncpy(prefix, prefixes[level], sizeof(prefix) - 1);
break;
}