Commit 4210cafc authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

riched20: Rename the wrappers around HeapAlloc() &Co to use the new standard naming.

parent 4051a09e
......@@ -77,7 +77,7 @@ static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
if(!ref) {
GlobalFree(This->fmtetc);
richedit_free(This);
heap_free(This);
}
return ref;
......@@ -152,7 +152,7 @@ static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT fmtetc_cnt, I
EnumFormatImpl *ret;
TRACE("\n");
ret = richedit_alloc(sizeof(EnumFormatImpl));
ret = heap_alloc(sizeof(EnumFormatImpl));
ret->lpVtbl = &VT_EnumFormatImpl;
ret->ref = 1;
ret->cur = 0;
......@@ -195,7 +195,7 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
if(This->unicode) GlobalFree(This->unicode);
if(This->rtf) GlobalFree(This->rtf);
if(This->fmtetc) GlobalFree(This->fmtetc);
richedit_free(This);
heap_free(This);
}
return ref;
......@@ -388,7 +388,7 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const CHARRANGE *lpchrg, LPDATAO
DataObjectImpl *obj;
TRACE("(%p,%d,%d)\n", editor, lpchrg->cpMin, lpchrg->cpMax);
obj = richedit_alloc(sizeof(DataObjectImpl));
obj = heap_alloc(sizeof(DataObjectImpl));
if(cfRTF == 0)
cfRTF = RegisterClipboardFormatA("Rich Text Format");
......
......@@ -2013,8 +2013,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
LPWSTR bufferW = NULL;
if (unicode)
bufferW = richedit_alloc((wParam + 2) * sizeof(WCHAR));
else bufferA = richedit_alloc(wParam + 2);
bufferW = heap_alloc((wParam + 2) * sizeof(WCHAR));
else
bufferA = heap_alloc(wParam + 2);
ex.cb = wParam + (unicode ? 2*sizeof(WCHAR) : 2);
ex.flags = GT_USECRLF;
......@@ -2033,8 +2034,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
memcpy((LPSTR)lParam, bufferA, wParam);
if (strlen(bufferA) >= wParam) rc = 0;
}
if (bufferA != NULL) richedit_free(bufferA);
if (bufferW != NULL) richedit_free(bufferW);
heap_free(bufferA);
heap_free(bufferW);
return rc;
}
case EM_GETTEXTEX:
......@@ -2066,7 +2067,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
/* potentially each char may be a CR, why calculate the exact value with O(N) when
we can just take a bigger buffer? :) */
int crlfmul = (ex->flags & GT_USECRLF) ? 2 : 1;
LPWSTR buffer = richedit_alloc((crlfmul*nCount + 1) * sizeof(WCHAR));
LPWSTR buffer = heap_alloc((crlfmul*nCount + 1) * sizeof(WCHAR));
DWORD buflen = ex->cb;
LRESULT rc;
DWORD flags = 0;
......@@ -2075,7 +2076,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
rc = WideCharToMultiByte(ex->codepage, flags, buffer, -1, (LPSTR)lParam, ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar);
if (rc) rc--; /* do not count 0 terminator */
richedit_free(buffer);
heap_free(buffer);
return rc;
}
}
......
......@@ -23,24 +23,24 @@
extern HANDLE me_heap;
static inline void *richedit_alloc( size_t len )
static inline void *heap_alloc( size_t len )
{
return HeapAlloc( me_heap, 0, len );
}
static inline BOOL richedit_free( void *ptr )
static inline BOOL heap_free( void *ptr )
{
return HeapFree( me_heap, 0, ptr );
}
static inline void *richedit_realloc( void *ptr, size_t len )
static inline void *heap_realloc( void *ptr, size_t len )
{
return HeapReAlloc( me_heap, 0, ptr, len );
}
#define ALLOC_OBJ(type) richedit_alloc(sizeof(type))
#define ALLOC_N_OBJ(type, count) richedit_alloc((count)*sizeof(type))
#define FREE_OBJ(ptr) richedit_free(ptr)
#define ALLOC_OBJ(type) heap_alloc(sizeof(type))
#define ALLOC_N_OBJ(type, count) heap_alloc((count)*sizeof(type))
#define FREE_OBJ(ptr) heap_free(ptr)
#define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \
&& (run)->style->fmt.dwEffects & CFE_HIDDEN)
......
......@@ -85,9 +85,9 @@ static void RTFPutCodePageChar(RTF_Info *info, int c);
* Return pointer to block of size bytes, or NULL if there's
* not enough memory available.
*/
#define RTFAlloc(size) richedit_alloc(size)
#define RTFReAlloc(ptr, size) richedit_realloc(ptr, size)
#define RTFFree(ptr) richedit_free(ptr)
#define RTFAlloc(size) heap_alloc(size)
#define RTFReAlloc(ptr, size) heap_realloc(ptr, size)
#define RTFFree(ptr) heap_free(ptr)
/*
* Saves a string on the heap and returns a pointer to it.
......
......@@ -112,7 +112,7 @@ IRichEditOle_fnRelease(IRichEditOle *me)
if (!ref)
{
TRACE ("Destroying %p\n", This);
richedit_free(This);
heap_free(This);
}
return ref;
}
......@@ -529,7 +529,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
{
IRichEditOleImpl *reo;
reo = richedit_alloc(sizeof(IRichEditOleImpl));
reo = heap_alloc(sizeof(IRichEditOleImpl));
if (!reo)
return 0;
......
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