mirror of
https://github.com/scummvm/scummvm.git
synced 2026-05-21 05:40:43 +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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user