diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-01-30 10:06:29 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-31 15:15:42 -0500 |
| commit | bde30e78cb27fba58ca7107bcb25cc0b2685b826 (patch) | |
| tree | 97dffefafaa55a83ea6c959dcd85050886706519 /lib/command_match.c | |
| parent | a98701f0531c54e425ef4ffa5f3f2c67aad2ae17 (diff) | |
lib: Add missing enum's to switch statement
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/command_match.c')
| -rw-r--r-- | lib/command_match.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/lib/command_match.c b/lib/command_match.c index ce2dbc9528..6c1d05d926 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -437,7 +437,7 @@ enum matcher_rv command_complete(struct graph *graph, vector vline, add_nexthops(next, gstack[0], gstack, idx + 1, neg); break; - default: + case no_match: trace_matcher("no_match\n"); break; } @@ -544,9 +544,22 @@ static enum match_type min_match_level(enum cmd_token_type type) // allowing words to partly match enables command abbreviation case WORD_TKN: return partly_match; - default: + case RANGE_TKN: + case IPV4_TKN: + case IPV4_PREFIX_TKN: + case IPV6_TKN: + case IPV6_PREFIX_TKN: + case MAC_TKN: + case MAC_PREFIX_TKN: + case FORK_TKN: + case JOIN_TKN: + case END_TKN: + case NEG_ONLY_TKN: + case VARIABLE_TKN: return exact_match; } + + assert(!"Reached end of function we should never hit"); } /** @@ -572,9 +585,15 @@ static int score_precedence(enum cmd_token_type type) return 3; case VARIABLE_TKN: return 4; - default: + case JOIN_TKN: + case START_TKN: + case END_TKN: + case NEG_ONLY_TKN: + case SPECIAL_TKN: return 10; } + + assert(!"Reached end of function we should never hit"); } /** @@ -695,9 +714,14 @@ static enum match_type match_token(struct cmd_token *token, char *input_token) case MAC_PREFIX_TKN: return match_mac(input_token, true); case END_TKN: - default: + case FORK_TKN: + case JOIN_TKN: + case START_TKN: + case NEG_ONLY_TKN: return no_match; } + + assert(!"Reached end of function we should never hit"); } #define IPV4_ADDR_STR "0123456789." |
