use only generic structures

This commit is contained in:
Alessandro Mauri 2023-03-07 23:05:58 +01:00
parent 440e4499c7
commit 6503897ece
No known key found for this signature in database
GPG key ID: 2B7BF9531FF03BE8
7 changed files with 35 additions and 121 deletions

View file

@ -12,8 +12,14 @@
#include "util.h"
// generic cache type
static unsigned int hash(unsigned int code)
{
// identity map the ascii range
if (code < 128) return code;
return (uint32_t)((uint64_t)(code*2654435761)>>32);
}
#include "generic_cache.h"
CACHE_DECL(cache, struct font_glyph)
CACHE_DECL(cache, struct font_glyph, hash, hash_cp_u32)
#define UTF8(c) (c&0x80)