diff options
Diffstat (limited to 'core/include/fxcrt')
-rw-r--r-- | core/include/fxcrt/fx_basic.h | 11 | ||||
-rw-r--r-- | core/include/fxcrt/fx_memory.h | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 6e092dd540..006b2b377d 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -315,13 +315,12 @@ class CFX_ArrayTemplate : public CFX_BasicArray { TYPE* GetData() { return (TYPE*)m_pData; } FX_BOOL SetAtGrow(int nIndex, TYPE newElement) { - if (nIndex < 0) { + if (nIndex < 0) return FALSE; - } - if (nIndex >= m_nSize) - if (!SetSize(nIndex + 1)) { - return FALSE; - } + + if (nIndex >= m_nSize && !SetSize(nIndex + 1)) + return FALSE; + ((TYPE*)m_pData)[nIndex] = newElement; return TRUE; } diff --git a/core/include/fxcrt/fx_memory.h b/core/include/fxcrt/fx_memory.h index d64844e743..b9b1888930 100644 --- a/core/include/fxcrt/fx_memory.h +++ b/core/include/fxcrt/fx_memory.h @@ -98,7 +98,7 @@ class CFX_GrowOnlyPool { void* Realloc(void* p, size_t new_size) { return NULL; } - void Free(void*) {} + void Free(void* mem) {} void FreeAll(); |