From 1d348318f216d28b8140c0f8dadf3a9607a52a9b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 20 Feb 2025 13:23:23 +0000 Subject: [PATCH] Use `PtrMap` temporarily --- src/checker.cpp | 6 +++--- src/checker.hpp | 2 +- src/common.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/checker.cpp b/src/checker.cpp index f1f1b2556dd..6781260942c 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1651,7 +1651,7 @@ gb_internal isize type_info_index(CheckerInfo *info, TypeInfoPair pair, bool err mutex_lock(&info->minimum_dependency_type_info_mutex); isize entry_index = -1; - uintptr hash = cast(uintptr)pair.hash; + u64 hash = pair.hash; isize *found_entry_index = map_get(&info->minimum_dependency_type_info_index_map, hash); if (found_entry_index) { entry_index = *found_entry_index; @@ -6744,12 +6744,12 @@ gb_internal void check_parsed_files(Checker *c) { for_array(i, c->info.type_info_types) { auto const &tt = c->info.type_info_types[i]; - bool exists = map_set_if_not_previously_exists(&c->info.minimum_dependency_type_info_index_map, cast(uintptr)tt.hash, i); + bool exists = map_set_if_not_previously_exists(&c->info.minimum_dependency_type_info_index_map, tt.hash, i); if (!exists) { continue; } for (auto const &entry : c->info.minimum_dependency_type_info_index_map) { - if (entry.key != cast(uintptr)tt.hash) { + if (entry.key != tt.hash) { continue; } auto const &other = c->info.type_info_types[entry.value]; diff --git a/src/checker.hpp b/src/checker.hpp index c89a1bc9c46..3d1e5b6ebc4 100644 --- a/src/checker.hpp +++ b/src/checker.hpp @@ -429,7 +429,7 @@ struct CheckerInfo { Entity * entry_point; PtrSet minimum_dependency_set; BlockingMutex minimum_dependency_type_info_mutex; - PtrMap minimum_dependency_type_info_index_map; + PtrMap minimum_dependency_type_info_index_map; TypeSet min_dep_type_info_set; Array type_info_types; // sorted after filled diff --git a/src/common.cpp b/src/common.cpp index ad1e5a851da..77a82a1717f 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -387,7 +387,7 @@ gb_global Arena string_intern_arena = {}; gb_internal char const *string_intern(char const *text, isize len) { u64 hash = gb_fnv64a(text, len); - uintptr key = cast(uintptr)(hash ? hash : 1); + u64 key = hash ? hash : 1; StringIntern **found = map_get(&string_intern_map, key); if (found) { for (StringIntern *it = *found; it != nullptr; it = it->next) {