Commit 1250af49 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

gdiplus: Use helper function for HeapReAlloc calls.

parent ff1b209b
...@@ -420,12 +420,10 @@ BOOL lengthen_path(GpPath *path, INT len) ...@@ -420,12 +420,10 @@ BOOL lengthen_path(GpPath *path, INT len)
while(path->datalen - path->pathdata.Count < len) while(path->datalen - path->pathdata.Count < len)
path->datalen *= 2; path->datalen *= 2;
path->pathdata.Points = HeapReAlloc(GetProcessHeap(), 0, path->pathdata.Points = heap_realloc(path->pathdata.Points, path->datalen * sizeof(PointF));
path->pathdata.Points, path->datalen * sizeof(PointF));
if(!path->pathdata.Points) return FALSE; if(!path->pathdata.Points) return FALSE;
path->pathdata.Types = HeapReAlloc(GetProcessHeap(), 0, path->pathdata.Types = heap_realloc(path->pathdata.Types, path->datalen);
path->pathdata.Types, path->datalen);
if(!path->pathdata.Types) return FALSE; if(!path->pathdata.Types) return FALSE;
} }
......
...@@ -60,6 +60,12 @@ static inline void *heap_alloc_zero(size_t len) ...@@ -60,6 +60,12 @@ static inline void *heap_alloc_zero(size_t len)
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
} }
static void *heap_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2);
static inline void *heap_realloc(void *mem, size_t len)
{
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
}
static inline BOOL heap_free(void *mem) static inline BOOL heap_free(void *mem)
{ {
return HeapFree(GetProcessHeap(), 0, mem); return HeapFree(GetProcessHeap(), 0, mem);
......
...@@ -291,7 +291,7 @@ GpStatus WINGDIPAPI GdipSetStringFormatTabStops(GpStringFormat *format, REAL fir ...@@ -291,7 +291,7 @@ GpStatus WINGDIPAPI GdipSetStringFormatTabStops(GpStringFormat *format, REAL fir
/* reallocation */ /* reallocation */
if((format->tabcount < count) && (format->tabcount > 0)){ if((format->tabcount < count) && (format->tabcount > 0)){
REAL *ptr; REAL *ptr;
ptr = HeapReAlloc(GetProcessHeap(), 0, format->tabs, sizeof(REAL)*count); ptr = heap_realloc(format->tabs, sizeof(REAL)*count);
if(!ptr) if(!ptr)
return OutOfMemory; return OutOfMemory;
format->tabs = ptr; format->tabs = ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment