mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-04 20:17:48 +00:00
Add sanity casts for 32/64 bit correctness
This commit is contained in:
@@ -91,7 +91,7 @@ gb_inline void ptr_set_grow(PtrSet<T> *s) {
|
||||
|
||||
template <typename T>
|
||||
void ptr_set_rehash(PtrSet<T> *s, isize new_count) {
|
||||
PtrSetIndex i, j;
|
||||
isize i, j;
|
||||
PtrSet<T> ns = {};
|
||||
ptr_set_init(&ns, s->hashes.allocator);
|
||||
array_resize(&ns.hashes, new_count);
|
||||
@@ -108,9 +108,9 @@ void ptr_set_rehash(PtrSet<T> *s, isize new_count) {
|
||||
fr = ptr_set__find(&ns, e->ptr);
|
||||
j = ptr_set__add_entry(&ns, e->ptr);
|
||||
if (fr.entry_prev == PTR_SET_SENTINEL) {
|
||||
ns.hashes.data[fr.hash_index] = j;
|
||||
ns.hashes.data[fr.hash_index] = cast(PtrSetIndex)j;
|
||||
} else {
|
||||
ns.entries.data[fr.entry_prev].next = j;
|
||||
ns.entries.data[fr.entry_prev].next = cast(PtrSetIndex)j;
|
||||
}
|
||||
ns.entries.data[j].next = fr.entry_index;
|
||||
if (ptr_set__full(&ns)) {
|
||||
@@ -185,7 +185,7 @@ void ptr_set__erase(PtrSet<T> *s, PtrSetFindResult fr) {
|
||||
} else {
|
||||
s->entries.data[fr.entry_prev].next = s->entries.data[fr.entry_index].next;
|
||||
}
|
||||
if (fr.entry_index == s->entries.count-1) {
|
||||
if (cast(isize)fr.entry_index == s->entries.count-1) {
|
||||
array_pop(&s->entries);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user