From 4815772fdaf2a9c4980c0d76aff78faebdbda17a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 Jul 2022 13:48:09 +1000 Subject: Cleanup: quiet warnings in recent BLF and rna_ui changes --- source/blender/blenfont/intern/blf_font.c | 16 ++++++++-------- source/blender/blenfont/intern/blf_internal.h | 4 ++-- source/blender/makesrna/intern/rna_ui.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index fed01d90314..eb974f33994 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -1375,10 +1375,10 @@ static const eFaceDetails static_face_details[] = { }; /* Create a new font from filename OR from passed memory pointer. */ -FontBLF *blf_font_new_ex(const char *name, - const char *filepath, - const unsigned char *mem, - int mem_size) +static FontBLF *blf_font_new_ex(const char *name, + const char *filepath, + const unsigned char *mem, + const size_t mem_size) { FontBLF *font = (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new"); @@ -1393,7 +1393,7 @@ FontBLF *blf_font_new_ex(const char *name, /* If we have static details about this font we don't need to load the Face. */ const eFaceDetails *static_details = NULL; char filename[256]; - for (int i = 0; i < ARRAY_SIZE(static_face_details); i++) { + for (int i = 0; i < (int)ARRAY_SIZE(static_face_details); i++) { BLI_split_file_part(font->filepath, filename, sizeof(filename)); if (STREQ(static_face_details[i].name, filename)) { static_details = &static_face_details[i]; @@ -1426,18 +1426,18 @@ FontBLF *blf_font_new(const char *name, const char *filename) return blf_font_new_ex(name, filename, NULL, 0); } -FontBLF *blf_font_new_from_mem(const char *name, const unsigned char *mem, int mem_size) +FontBLF *blf_font_new_from_mem(const char *name, const unsigned char *mem, const size_t mem_size) { return blf_font_new_ex(name, NULL, mem, mem_size); } -void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size) +void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, const size_t mem_size) { FT_Open_Args open; open.flags = FT_OPEN_MEMORY; open.memory_base = (const FT_Byte *)mem; - open.memory_size = mem_size; + open.memory_size = (FT_Long)mem_size; FT_Attach_Stream(font->face, &open); } diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h index 4a194825cf7..6207edb0107 100644 --- a/source/blender/blenfont/intern/blf_internal.h +++ b/source/blender/blenfont/intern/blf_internal.h @@ -45,8 +45,8 @@ void blf_draw_buffer__start(struct FontBLF *font); void blf_draw_buffer__end(void); struct FontBLF *blf_font_new(const char *name, const char *filepath); -struct FontBLF *blf_font_new_from_mem(const char *name, const unsigned char *mem, int mem_size); -void blf_font_attach_from_mem(struct FontBLF *font, const unsigned char *mem, int mem_size); +struct FontBLF *blf_font_new_from_mem(const char *name, const unsigned char *mem, size_t mem_size); +void blf_font_attach_from_mem(struct FontBLF *font, const unsigned char *mem, size_t mem_size); /** * Change font's output size. Returns true if successful in changing the size. diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index d3d827de3e5..adb959944b5 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -527,7 +527,7 @@ static void uilist_draw_filter(uiList *ui_list, const bContext *C, uiLayout *lay } static void uilist_filter_items(uiList *ui_list, - bContext *C, + const bContext *C, PointerRNA *dataptr, const char *propname) { -- cgit v1.2.3