Jacek Caban : mshtml: Don't use PRInt32 in htmlelem*.

Alexandre Julliard julliard at winehq.org
Fri Jan 18 12:07:37 CST 2013


Module: wine
Branch: master
Commit: c55b777c7c3ea609bed8c99cb12e3baae39fb18e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c55b777c7c3ea609bed8c99cb12e3baae39fb18e

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jan 18 14:05:31 2013 +0100

mshtml: Don't use PRInt32 in htmlelem*.

---

 dlls/mshtml/htmlelem.c  |   16 +++---------
 dlls/mshtml/htmlelem2.c |   58 +++++++++++++++++------------------------------
 2 files changed, 25 insertions(+), 49 deletions(-)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 2e7b18c..8fba26d 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -846,72 +846,64 @@ static HRESULT WINAPI HTMLElement_get_lang(IHTMLElement *iface, BSTR *p)
 static HRESULT WINAPI HTMLElement_get_offsetLeft(IHTMLElement *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement(iface);
-    PRInt32 off_left = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetOffsetLeft(This->nselem, &off_left);
+    nsres = nsIDOMHTMLElement_GetOffsetLeft(This->nselem, p);
     if(NS_FAILED(nsres)) {
         ERR("GetOffsetLeft failed: %08x\n", nsres);
         return E_FAIL;
     }
 
-    *p = off_left;
     return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement_get_offsetTop(IHTMLElement *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement(iface);
-    PRInt32 top = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetOffsetTop(This->nselem, &top);
+    nsres = nsIDOMHTMLElement_GetOffsetTop(This->nselem, p);
     if(NS_FAILED(nsres)) {
         ERR("GetOffsetTop failed: %08x\n", nsres);
         return E_FAIL;
     }
 
-    *p = top;
     return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement_get_offsetWidth(IHTMLElement *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement(iface);
-    PRInt32 offset = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetOffsetWidth(This->nselem, &offset);
+    nsres = nsIDOMHTMLElement_GetOffsetWidth(This->nselem, p);
     if(NS_FAILED(nsres)) {
         ERR("GetOffsetWidth failed: %08x\n", nsres);
         return E_FAIL;
     }
 
-    *p = offset;
     return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement_get_offsetHeight(IHTMLElement *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement(iface);
-    PRInt32 offset = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetOffsetHeight(This->nselem, &offset);
+    nsres = nsIDOMHTMLElement_GetOffsetHeight(This->nselem, p);
     if(NS_FAILED(nsres)) {
         ERR("GetOffsetHeight failed: %08x\n", nsres);
         return E_FAIL;
     }
 
-    *p = offset;
     return S_OK;
 }
 
diff --git a/dlls/mshtml/htmlelem2.c b/dlls/mshtml/htmlelem2.c
index 2877a78..16d5056 100644
--- a/dlls/mshtml/htmlelem2.c
+++ b/dlls/mshtml/htmlelem2.c
@@ -17,6 +17,7 @@
  */
 
 #include <stdarg.h>
+#include <assert.h>
 #include <math.h>
 
 #define COBJMACROS
@@ -674,7 +675,7 @@ static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 index = 0;
+    LONG index;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
@@ -807,42 +808,37 @@ static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *
 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 height=0;
+    nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsIDOMHTMLElement_GetClientHeight(This->nselem, &height);
-
-    *p = height;
+    nsres = nsIDOMHTMLElement_GetClientHeight(This->nselem, p);
+    assert(nsres == NS_OK);
     return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 width=0;
+    nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsIDOMHTMLElement_GetClientWidth(This->nselem, &width);
-
-    *p = width;
+    nsres = nsIDOMHTMLElement_GetClientWidth(This->nselem, p);
+    assert(nsres == NS_OK);
     return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 client_top = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetClientTop(This->nselem, &client_top);
-    if(NS_FAILED(nsres))
-        ERR("GetScrollHeight failed: %08x\n", nsres);
+    nsres = nsIDOMHTMLElement_GetClientTop(This->nselem, p);
+    assert(nsres == NS_OK);
 
-    *p = client_top;
     TRACE("*p = %d\n", *p);
     return S_OK;
 }
@@ -850,16 +846,13 @@ static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, LONG *p)
 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 client_left = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetClientLeft(This->nselem, &client_left);
-    if(NS_FAILED(nsres))
-        ERR("GetScrollHeight failed: %08x\n", nsres);
+    nsres = nsIDOMHTMLElement_GetClientLeft(This->nselem, p);
+    assert(nsres == NS_OK);
 
-    *p = client_left;
     TRACE("*p = %d\n", *p);
     return S_OK;
 }
@@ -1003,16 +996,13 @@ static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDis
 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 height = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetScrollHeight(This->nselem, &height);
-    if(NS_FAILED(nsres))
-        ERR("GetScrollHeight failed: %08x\n", nsres);
+    nsres = nsIDOMHTMLElement_GetScrollHeight(This->nselem, p);
+    assert(nsres == NS_OK);
 
-    *p = height;
     TRACE("*p = %d\n", *p);
     return S_OK;
 }
@@ -1020,16 +1010,13 @@ static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, LONG *
 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 width = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetScrollWidth(This->nselem, &width);
-    if(NS_FAILED(nsres))
-        ERR("GetScrollWidth failed: %08x\n", nsres);
+    nsres = nsIDOMHTMLElement_GetScrollWidth(This->nselem, p);
+    assert(nsres == NS_OK);
 
-    *p = width;
     TRACE("*p = %d\n", *p);
     return S_OK;
 }
@@ -1052,16 +1039,13 @@ static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, LONG v)
 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 top = 0;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    nsres = nsIDOMHTMLElement_GetScrollTop(This->nselem, &top);
-    if(NS_FAILED(nsres))
-        ERR("GetScrollTop failed: %08x\n", nsres);
+    nsres = nsIDOMHTMLElement_GetScrollTop(This->nselem, p);
+    assert(nsres == NS_OK);
 
-    *p = top;
     TRACE("*p = %d\n", *p);
     return S_OK;
 }
@@ -1084,7 +1068,7 @@ static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, LONG v)
 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, LONG *p)
 {
     HTMLElement *This = impl_from_IHTMLElement2(iface);
-    PRInt32 left = 0;
+    nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
@@ -1097,9 +1081,9 @@ static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, LONG *p)
         return E_NOTIMPL;
     }
 
-    nsIDOMHTMLElement_GetScrollLeft(This->nselem, &left);
+    nsres = nsIDOMHTMLElement_GetScrollLeft(This->nselem, p);
+    assert(nsres == NS_OK);
 
-    *p = left;
     TRACE("*p = %d\n", *p);
     return S_OK;
 }




More information about the wine-cvs mailing list