mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-02 15:16:46 +00:00
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:
parent
94cef883b3
commit
dcf3bf3a1d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user