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_graph.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_graph.c')
| -rw-r--r-- | lib/command_graph.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/lib/command_graph.c b/lib/command_graph.c index e940685250..766d7e9371 100644 --- a/lib/command_graph.c +++ b/lib/command_graph.c @@ -267,9 +267,22 @@ static bool cmd_nodes_equal(struct graph_node *ga, struct graph_node *gb) return false; return cmd_subgraph_equal(ga, gb, a->forkjoin); - default: + case VARIABLE_TKN: + case IPV4_TKN: + case IPV4_PREFIX_TKN: + case IPV6_PREFIX_TKN: + case IPV6_TKN: + case MAC_TKN: + case MAC_PREFIX_TKN: + case JOIN_TKN: + case START_TKN: + case END_TKN: + case NEG_ONLY_TKN: + case WORD_TKN: return true; } + + assert(!"Reached end of function we should never hit"); } static void cmd_fork_bump_attr(struct graph_node *gn, struct graph_node *join, @@ -477,7 +490,7 @@ void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf) char nbuf[512]; struct cmd_token *tok = gn->data; - const char *color; + const char *color = NULL; if (wasend) { wasend = false; @@ -526,10 +539,23 @@ void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf) case WORD_TKN: color = "#ffffff"; break; - 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 END_TKN: + case VARIABLE_TKN: color = "#ffffff"; break; } + + /* + * Some compilers have the mistaken belief that we can + * get here without initializing color. + */ snprintf(nbuf, sizeof(nbuf), ">, style = filled, fillcolor = \"%s\" ];\n", color); buffer_putstr(buf, nbuf); |
