Move default action from after switch to within
Move from this type of constructions: switch (val) { case 1: something; break; } default-action; into following: switch (val) { case 1: something; break; default: default-action; break } for cases where the switch statement is not expected to contain a full set of enum values and as such, does not lose value from not having the default target. This makes the intent of default behavior clearer for static analyzers like gcc with -Wswitch-default. Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
This commit is contained in:
parent
7614fcebe0
commit
f8a05de669
11 changed files with 49 additions and 36 deletions
|
@ -5551,8 +5551,9 @@ static const char * openssl_pkey_type_str(const EVP_PKEY *pkey)
|
|||
return "DH";
|
||||
case EVP_PKEY_EC:
|
||||
return "EC";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue