While revisiting all of them, clear a few oddities as well:
- There's no point in marking empty fall through cases: They are easy to
spot and a common concept when using switch().
- Fix indenting of break statement in one occasion.
- Drop needless braces around one case which doesn't declare variables.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
}
switch (key) {
- case NFT_CT_SRC: /* fallthrough */
+ case NFT_CT_SRC:
case NFT_CT_DST:
desc = proto_find_upper(&proto_inet, nfproto);
if (desc)
map->mappings->set->flags |=
map->mappings->set->init->set_flags;
+ /* fall through */
case EXPR_SYMBOL:
if (expr_evaluate(ctx, &map->mappings) < 0)
return -1;
switch (expr->hash.type) {
case NFT_HASH_SYM:
nft_print(octx, "symhash");
- break;
+ break;
case NFT_HASH_JENKINS:
default:
nft_print(octx, "jhash ");
case OP_NEQ:
if (right->ops->type != EXPR_SET && right->ops->type != EXPR_SET_REF)
break;
+ /* fall through */
case OP_LOOKUP:
expr_set_type(right, left->dtype, left->byteorder);
break;
}
}
break;
- case NFT_OBJECT_CT_HELPER: {
+ case NFT_OBJECT_CT_HELPER:
nft_print(octx, "ct helper %s {\n", obj->handle.obj);
nft_print(octx, "\t\ttype \"%s\" protocol ",
obj->ct_helper.name);
nft_print(octx, "\t\tl3proto %s",
family2str(obj->ct_helper.l3proto));
break;
- }
case NFT_OBJECT_LIMIT: {
bool inv = obj->limit.flags & NFT_LIMIT_F_INV;
const char *data_unit;
switch (cmd->obj) {
case CMD_OBJ_COUNTERS:
dump = true;
+ /* fall through */
case CMD_OBJ_COUNTER:
type = NFT_OBJECT_COUNTER;
break;
case CMD_OBJ_QUOTAS:
dump = true;
+ /* fall through */
case CMD_OBJ_QUOTA:
type = NFT_OBJECT_QUOTA;
break;