Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/riched20/reader.c | 8 ++++---- dlls/riched20/rtf.h | 7 ------- 2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index e73b8b87e9d..b17d6835f25 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -813,7 +813,7 @@ static void ReadFontTbl(RTF_Info *info) if (info->rtfClass == rtfEOF) break; } - fp = New (RTFFont); + fp = heap_alloc(sizeof(*fp)); if (fp == NULL) { ERR ("cannot allocate font entry\n"); break; @@ -986,7 +986,7 @@ static void ReadColorTbl(RTF_Info *info) continue; }
- cp = New (RTFColor); + cp = heap_alloc(sizeof(*cp)); if (cp == NULL) { ERR ("cannot allocate color entry\n"); break; @@ -1036,7 +1036,7 @@ static void ReadStyleSheet(RTF_Info *info) break; if (RTFCheckCM (info, rtfGroup, rtfEndGroup)) break; - sp = New (RTFStyle); + sp = heap_alloc(sizeof(*sp)); if (sp == NULL) { ERR ("cannot allocate stylesheet entry\n"); break; @@ -1104,7 +1104,7 @@ static void ReadStyleSheet(RTF_Info *info) sp->rtfSNextPar = info->rtfParam; continue; } - sep = New (RTFStyleElt); + sep = heap_alloc(sizeof(*sep)); if (sep == NULL) { ERR ("cannot allocate style element\n"); diff --git a/dlls/riched20/rtf.h b/dlls/riched20/rtf.h index 35a0ee878e9..9f15d5ba8e1 100644 --- a/dlls/riched20/rtf.h +++ b/dlls/riched20/rtf.h @@ -1078,13 +1078,6 @@ struct RTFTable # define RTFBorderCellBottom 0x32 # define RTFBorderCellRight 0x33
-/* - * Return pointer to new element of type t, or NULL - * if no memory available. - */ - -# define New(t) (heap_alloc (sizeof (t))) - /* Parser stack size */
# define maxStack 32
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/riched20/txthost.c | 4 ++-- dlls/riched20/txtsrv.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index e18ec9490c0..af4d37d9fd2 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -93,7 +93,7 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) { struct host *texthost;
- texthost = CoTaskMemAlloc(sizeof(*texthost)); + texthost = heap_alloc(sizeof(*texthost)); if (!texthost) return NULL;
texthost->ITextHost_iface.lpVtbl = &textHostVtbl; @@ -158,7 +158,7 @@ static ULONG WINAPI ITextHostImpl_Release( ITextHost2 *iface ) { SetWindowLongPtrW( host->window, 0, 0 ); ITextServices_Release( host->text_srv ); - CoTaskMemFree( host ); + heap_free( host ); } return ref; } diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index 73b8d3ea7e9..fb7fc754bb5 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -81,7 +81,7 @@ static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface) { richole_release_children( services ); ME_DestroyEditor( services->editor ); - CoTaskMemFree( services ); + heap_free( services ); } return ref; } @@ -580,7 +580,7 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown ** TRACE( "%p %p --> %p\n", outer, text_host, unk ); if (text_host == NULL) return E_POINTER;
- services = CoTaskMemAlloc( sizeof(*services) ); + services = heap_alloc( sizeof(*services) ); if (services == NULL) return E_OUTOFMEMORY; services->ref = 1; services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
Signed-off-by: Huw Davies huw@codeweavers.com