Replace uintptr_t with lv_uintptr_t

uintptr_t is not supported by the 16 bit PIC's compiler (e.g. dsPIC33)
This commit is contained in:
Gabor Kiss-Vamosi
2019-07-03 10:07:12 +02:00
parent 3a8a004e8b
commit 6c59216b46
2 changed files with 7 additions and 5 deletions

View File

@@ -6,9 +6,9 @@
/*********************
* INCLUDES
*********************/
#include "lv_font.h"
#include "lv_font_fmt_txt.h"
#include "../lv_misc/lv_types.h"
#include "../lv_misc/lv_log.h"
#include "../lv_misc/lv_utils.h"
@@ -134,7 +134,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter)
uint8_t * p = lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare);
if(p) {
uint32_t ofs = (uintptr_t)p - (uintptr_t) fdsc->cmaps[i].unicode_list;
uint32_t ofs = (lv_uintptr_t)p - (lv_uintptr_t) fdsc->cmaps[i].unicode_list;
ofs = ofs >> 1; /*The list stores `uint16_t` so the get the index divide by 2*/
glyph_id = fdsc->cmaps[i].glyph_id_start + ofs;
}
@@ -143,7 +143,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter)
uint8_t * p = lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare);
if(p) {
uint32_t ofs = (uintptr_t)p - (uintptr_t) fdsc->cmaps[i].unicode_list;
uint32_t ofs = (lv_uintptr_t)p - (lv_uintptr_t) fdsc->cmaps[i].unicode_list;
ofs = ofs >> 1; /*The list stores `uint16_t` so the get the index divide by 2*/
const uint8_t * gid_ofs_16 = fdsc->cmaps[i].glyph_id_ofs_list;
glyph_id = fdsc->cmaps[i].glyph_id_start + gid_ofs_16[ofs];
@@ -180,7 +180,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t
/*If the `g_id_both` were found get its index from the pointer*/
if(kid_p) {
uintptr_t ofs = (uintptr_t)kid_p - (uintptr_t)g_ids;
uint32_t ofs = (lv_uintptr_t)kid_p - (lv_uintptr_t)g_ids;
ofs = ofs >> 1; /*ofs is for pair, divide by 2 to refer as a single value*/
value = kdsc->values[ofs];
}
@@ -193,7 +193,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t
/*If the `g_id_both` were found get its index from the pointer*/
if(kid_p) {
uintptr_t ofs = (uintptr_t)kid_p - (uintptr_t)g_ids;
uint32_t ofs = (lv_uintptr_t)kid_p - (lv_uintptr_t)g_ids;
ofs = ofs >> 4; /*ofs is 4 byte pairs, divide by 4 to refer as a single value*/
value = kdsc->values[ofs];
}

View File

@@ -32,6 +32,8 @@ enum {
};
typedef uint8_t lv_res_t;
typedef unsigned long int lv_uintptr_t;
/**********************
* GLOBAL PROTOTYPES
**********************/