[Bf-blender-cvs] [4815772fdaf] master: Cleanup: quiet warnings in recent BLF and rna_ui changes
Campbell Barton
noreply at git.blender.org
Fri Jul 29 05:49:06 CEST 2022
Commit: 4815772fdaf2a9c4980c0d76aff78faebdbda17a
Author: Campbell Barton
Date: Fri Jul 29 13:48:09 2022 +1000
Branches: master
https://developer.blender.org/rB4815772fdaf2a9c4980c0d76aff78faebdbda17a
Cleanup: quiet warnings in recent BLF and rna_ui changes
===================================================================
M source/blender/blenfont/intern/blf_font.c
M source/blender/blenfont/intern/blf_internal.h
M source/blender/makesrna/intern/rna_ui.c
===================================================================
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)
{
More information about the Bf-blender-cvs
mailing list