Browse Source

Minor clean up

gingerBill 3 years ago
parent
commit
3439139b1c
2 changed files with 4 additions and 3 deletions
  1. 3 2
      src/check_expr.cpp
  2. 1 1
      src/check_stmt.cpp

+ 3 - 2
src/check_expr.cpp

@@ -6961,7 +6961,9 @@ struct TypeAndToken {
 	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) {
 		return;
 	}
@@ -7002,7 +7004,6 @@ void add_constant_switch_case(CheckerContext *ctx, PtrMap<uintptr, TypeAndToken>
 	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) {
 	if (is_type_enum(x.type)) {

+ 1 - 1
src/check_stmt.cpp

@@ -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());
 	defer (map_destroy(&seen));