Jacek Caban : mshtml: Wrap more Heap* function by inline functions.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jul 18 05:13:27 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: a4cc5bf299f7b998e300aa08a8961355ec360c8c
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a4cc5bf299f7b998e300aa08a8961355ec360c8c
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Jul 17 21:21:21 2006 +0200
mshtml: Wrap more Heap* function by inline functions.
---
dlls/mshtml/htmlbody.c | 4 ++--
dlls/mshtml/htmldoc.c | 6 +++---
dlls/mshtml/htmlelem.c | 26 +++++++++++++-------------
dlls/mshtml/htmlinput.c | 4 ++--
dlls/mshtml/htmlnode.c | 4 ++--
dlls/mshtml/htmlselect.c | 4 ++--
dlls/mshtml/htmltextarea.c | 4 ++--
7 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c
index 0ad554e..b557906 100644
--- a/dlls/mshtml/htmlbody.c
+++ b/dlls/mshtml/htmlbody.c
@@ -385,7 +385,7 @@ static void HTMLBodyElement_destructor(I
HTMLBodyElement *This = HTMLBODY_THIS(iface);
nsIDOMHTMLBodyElement_Release(This->nsbody);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This);
}
static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
@@ -435,7 +435,7 @@ static const IHTMLBodyElementVtbl HTMLBo
void HTMLBodyElement_Create(HTMLElement *element)
{
- HTMLBodyElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLBodyElement));
+ HTMLBodyElement *ret = mshtml_alloc(sizeof(HTMLBodyElement));
nsresult nsres;
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 2bf8522..e3c7e32 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -162,7 +162,7 @@ static ULONG WINAPI HTMLDocument_Release
if(This->nscontainer)
NSContainer_Release(This->nscontainer);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This);
UNLOCK_MODULE();
}
@@ -1066,7 +1066,7 @@ HRESULT HTMLDocument_Create(IUnknown *pU
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
- ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLDocument));
+ ret = mshtml_alloc(sizeof(HTMLDocument));
ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
ret->ref = 0;
ret->nscontainer = NULL;
@@ -1074,7 +1074,7 @@ HRESULT HTMLDocument_Create(IUnknown *pU
hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
if(FAILED(hres)) {
- HeapFree(GetProcessHeap(), 0, ret);
+ mshtml_free(ret);
return hres;
}
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index c49555c..48a073a 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -48,7 +48,7 @@ static void elem_vector_add(elem_vector
{
if(buf->len == buf->size) {
buf->size <<= 1;
- buf->buf = HeapReAlloc(GetProcessHeap(), 0, buf->buf, buf->size*sizeof(HTMLElement**));
+ buf->buf = mshtml_realloc(buf->buf, buf->size*sizeof(HTMLElement**));
}
buf->buf[buf->len++] = elem;
@@ -158,7 +158,7 @@ static HRESULT WINAPI HTMLElement_getAtt
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&value_str, &value, NULL);
V_VT(AttributeValue) = VT_BSTR;
- V_BSTR(AttributeValue) = SysAllocString(value);;
+ V_BSTR(AttributeValue) = SysAllocString(value);
TRACE("attr_value=%s\n", debugstr_w(V_BSTR(AttributeValue)));
}else {
ERR("GetAttribute failed: %08lx\n", nsres);
@@ -804,15 +804,15 @@ static HRESULT WINAPI HTMLElement_get_al
TRACE("(%p)->(%p)\n", This, p);
- buf.buf = HeapAlloc(GetProcessHeap(), 0, buf.size*sizeof(HTMLElement**));
+ buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement**));
create_all_list(This->node->doc, This, &buf);
if(!buf.len) {
- HeapFree(GetProcessHeap(), 0, buf.buf);
+ mshtml_free(buf.buf);
buf.buf = NULL;
}else if(buf.size > buf.len) {
- buf.buf = HeapReAlloc(GetProcessHeap(), 0, buf.buf, buf.len*sizeof(HTMLElement**));
+ buf.buf = mshtml_realloc(buf.buf, buf.len*sizeof(HTMLElement**));
}
return HTMLElementCollection_Create((IUnknown*)HTMLELEM(This), buf.buf, buf.len, p);
@@ -828,7 +828,7 @@ static void HTMLElement_destructor(IUnkn
if(This->nselem)
nsIDOMHTMLElement_Release(This->nselem);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This);
}
#undef HTMLELEM_THIS
@@ -968,7 +968,7 @@ void HTMLElement_Create(HTMLDOMNode *nod
static const WCHAR wszSELECT[] = {'S','E','L','E','C','T',0};
static const WCHAR wszTEXTAREA[] = {'T','E','X','T','A','R','E','A',0};
- ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLElement));
+ ret = mshtml_alloc(sizeof(HTMLElement));
ret->lpHTMLElementVtbl = &HTMLElementVtbl;
ret->node = node;
ret->impl = NULL;
@@ -1061,8 +1061,8 @@ static ULONG WINAPI HTMLElementCollectio
if(!ref) {
IUnknown_Release(This->ref_unk);
- HeapFree(GetProcessHeap(), 0, This->elems);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This->elems);
+ mshtml_free(This);
}
return ref;
@@ -1177,7 +1177,7 @@ static HRESULT WINAPI HTMLElementCollect
TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp);
- buf.buf = HeapAlloc(GetProcessHeap(), 0, buf.size*sizeof(HTMLElement*));
+ buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement*));
nsAString_Init(&tag_str, NULL);
@@ -1198,10 +1198,10 @@ static HRESULT WINAPI HTMLElementCollect
TRACE("fount %ld tags\n", buf.len);
if(!buf.len) {
- HeapFree(GetProcessHeap(), 0, buf.buf);
+ mshtml_free(buf.buf);
buf.buf = NULL;
}else if(buf.size > buf.len) {
- buf.buf = HeapReAlloc(GetProcessHeap(), 0, buf.buf, buf.len);
+ buf.buf = mshtml_realloc(buf.buf, buf.len*sizeof(HTMLElement*));
}
return HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len, pdisp);
@@ -1228,7 +1228,7 @@ static const IHTMLElementCollectionVtbl
static HRESULT HTMLElementCollection_Create(IUnknown *ref_unk, HTMLElement **elems, DWORD len,
IDispatch **p)
{
- HTMLElementCollection *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLElementCollection));
+ HTMLElementCollection *ret = mshtml_alloc(sizeof(HTMLElementCollection));
ret->lpHTMLElementCollectionVtbl = &HTMLElementCollectionVtbl;
ret->ref = 1;
diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c
index 1b1f6d5..531288a 100644
--- a/dlls/mshtml/htmlinput.c
+++ b/dlls/mshtml/htmlinput.c
@@ -657,7 +657,7 @@ static void HTMLInputElement_destructor(
HTMLInputElement *This = HTMLINPUT_THIS(iface);
nsIDOMHTMLInputElement_Release(This->nsinput);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This);
}
#undef HTMLINPUT_THIS
@@ -739,7 +739,7 @@ static const IHTMLInputElementVtbl HTMLI
void HTMLInputElement_Create(HTMLElement *element)
{
- HTMLInputElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLInputElement));
+ HTMLInputElement *ret = mshtml_alloc(sizeof(HTMLInputElement));
nsresult nsres;
ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c
index 6e16454..513d99b 100644
--- a/dlls/mshtml/htmlnode.c
+++ b/dlls/mshtml/htmlnode.c
@@ -333,7 +333,7 @@ HTMLDOMNode *get_node(HTMLDocument *This
if(iter)
return iter;
- ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLDOMNode));
+ ret = mshtml_alloc(sizeof(HTMLDOMNode));
ret->lpHTMLDOMNodeVtbl = &HTMLDOMNodeVtbl;
ret->node_type = NT_UNKNOWN;
ret->impl.unk = NULL;
@@ -367,6 +367,6 @@ void release_nodes(HTMLDocument *This)
if(iter->destructor)
iter->destructor(iter->impl.unk);
nsIDOMNode_Release(iter->nsnode);
- HeapFree(GetProcessHeap(), 0, iter);
+ mshtml_free(iter);
}
}
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c
index 639e26f..607cc41 100644
--- a/dlls/mshtml/htmlselect.c
+++ b/dlls/mshtml/htmlselect.c
@@ -342,7 +342,7 @@ static void HTMLSelectElement_destructor
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
nsIDOMHTMLSelectElement_Release(This->nsselect);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This);
}
static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = {
@@ -381,7 +381,7 @@ static const IHTMLSelectElementVtbl HTML
void HTMLSelectElement_Create(HTMLElement *element)
{
- HTMLSelectElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLSelectElement));
+ HTMLSelectElement *ret = mshtml_alloc(sizeof(HTMLSelectElement));
nsresult nsres;
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c
index 1bc8ecc..26d1061 100644
--- a/dlls/mshtml/htmltextarea.c
+++ b/dlls/mshtml/htmltextarea.c
@@ -354,7 +354,7 @@ static void HTMLTextAreaElement_destruct
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
- HeapFree(GetProcessHeap(), 0, This);
+ mshtml_free(This);
}
#undef HTMLTXTAREA_THIS
@@ -397,7 +397,7 @@ static const IHTMLTextAreaElementVtbl HT
void HTMLTextAreaElement_Create(HTMLElement *element)
{
- HTMLTextAreaElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLTextAreaElement));
+ HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement));
nsresult nsres;
ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
More information about the wine-cvs
mailing list