mirror of
https://github.com/IllusionMan1212/C2048.git
synced 2026-10-24 02:12:31 +00:00
zephr/ui: introduce IDs to ui elements to track the active element
This commit is contained in:
@@ -31,3 +31,33 @@ _Noreturn uintptr_t _core_abort(const char* file, int line, const char* message,
|
||||
/* fprintf(stderr, "stacktrace:\n%s\n\n", stacktrace); */
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////
|
||||
//
|
||||
//
|
||||
// Hash
|
||||
//
|
||||
//
|
||||
///////////////////////////
|
||||
|
||||
u32 core_fnv_hash32(const void* bytes, uptr size, u32 hash) {
|
||||
const u8* b = bytes;
|
||||
for (uptr idx = 0; idx < size; idx++) {
|
||||
hash ^= b[idx];
|
||||
hash *= CORE_FNV_HASH32_PRIME;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
u64 core_fnv_hash64(const void* bytes, uptr size, u64 hash) {
|
||||
const u8* b = bytes;
|
||||
for(uptr idx = 0; idx < size; idx++) {
|
||||
hash ^= b[idx];
|
||||
hash *= CORE_FNV_HASH64_PRIME;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user