summaryrefslogtreecommitdiff
path: root/src/rufl_init.c
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2021-08-15 23:22:44 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2021-08-15 23:22:44 +0100
commit0358488cc592f217158a8c4ea9adacf652ee85ce (patch)
treeea6a77ea134b98708d37c8507a36b9b1e575e5a4 /src/rufl_init.c
parentd4468833b85b8c8f340bc9c3bb6572a245fd5982 (diff)
downloadlibrufl-0358488cc592f217158a8c4ea9adacf652ee85ce.tar.gz
librufl-0358488cc592f217158a8c4ea9adacf652ee85ce.tar.bz2
Don't assume pointers are 32bits wide
Use uintptr_t to cast between pointers and integers, instead of assuming that uint32_t will suffice.
Diffstat (limited to 'src/rufl_init.c')
-rw-r--r--src/rufl_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rufl_init.c b/src/rufl_init.c
index 4005203..7915b9a 100644
--- a/src/rufl_init.c
+++ b/src/rufl_init.c
@@ -1045,7 +1045,7 @@ rufl_code rufl_init_scan_font_in_encoding(const char *font_name,
* a reset. As there are no "good" outcomes here, and we do
* not have a time machine to go back and fix long-ago released
* Font Managers, ensure we ignore UCS fonts here. */
- if ((uint32_t) umap->encoding > 256) {
+ if ((uintptr_t) umap->encoding > 256) {
static os_error err = {
error_FONT_TOO_MANY_CHUNKS, "Rejecting UCS font"};
LOG("%s", "Rejecting UCS font");
@@ -1131,7 +1131,7 @@ static rufl_code rufl_init_umap_cb(void *pw, uint32_t glyph_idx, uint32_t ucs4)
/* Stash the total number of encoding file entries so that
* rufl_init_scan_font_in_encoding can detect the presence of a
* UCS font on a non-UCS capable system. It will clean up for us. */
- umap->encoding = (void *) (((uint32_t) umap->encoding) + 1);
+ umap->encoding = (void *) (((uintptr_t) umap->encoding) + 1);
return result;
}