GRAPHICS: Fix GCC Compiler Warnings on Realloc Usage in Freetype Interface

Calling realloc() with a size of 0 is implementation dependent and thus
should be avoided for portability.
This commit is contained in:
D G Turner 2023-09-04 14:31:34 +01:00
parent 94cef883b3
commit dcf3bf3a1d

View File

@ -36,11 +36,12 @@ namespace Graphics {
namespace FreeType {
void *Alloc_Callback(FT_Memory memory, long size) {
return realloc(nullptr, static_cast<size_t>(size));
return malloc(static_cast<size_t>(size));
}
void Free_Callback(FT_Memory memory, void *block) {
realloc(block, 0);
free(block);
block = nullptr;
}
void *Realloc_Callback(FT_Memory memory, long cur_size, long new_size, void *block) {