Minor clean up

This commit is contained in:
gingerBill
2022-02-05 14:34:29 +00:00
parent cf246f65ff
commit 3439139b1c
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -6961,7 +6961,9 @@ struct TypeAndToken {
Token token; Token token;
}; };
void add_constant_switch_case(CheckerContext *ctx, PtrMap<uintptr, TypeAndToken> *seen, Operand operand, bool use_expr = true) { typedef PtrMap<uintptr, TypeAndToken> SeenMap;
void add_constant_switch_case(CheckerContext *ctx, SeenMap *seen, Operand operand, bool use_expr = true) {
if (operand.mode != Addressing_Constant) { if (operand.mode != Addressing_Constant) {
return; return;
} }
@@ -7002,7 +7004,6 @@ void add_constant_switch_case(CheckerContext *ctx, PtrMap<uintptr, TypeAndToken>
multi_map_insert(seen, key, tap); multi_map_insert(seen, key, tap);
} }
typedef PtrMap<uintptr, TypeAndToken> SeenMap;
void add_to_seen_map(CheckerContext *ctx, SeenMap *seen, TokenKind upper_op, Operand const &x, Operand const &lhs, Operand const &rhs) { void add_to_seen_map(CheckerContext *ctx, SeenMap *seen, TokenKind upper_op, Operand const &x, Operand const &lhs, Operand const &rhs) {
if (is_type_enum(x.type)) { if (is_type_enum(x.type)) {
+1 -1
View File
@@ -921,7 +921,7 @@ void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) {
} }
} }
PtrMap<uintptr, TypeAndToken> seen = {}; // NOTE(bill): Multimap, Key: ExactValue SeenMap seen = {}; // NOTE(bill): Multimap, Key: ExactValue
map_init(&seen, heap_allocator()); map_init(&seen, heap_allocator());
defer (map_destroy(&seen)); defer (map_destroy(&seen));