msxml3: Use the existing READYSTAT type instead of creating our own enum READYSTAT (and mixing the two).

Gerald Pfeifer gerald at pfeifer.com
Fri Oct 1 18:05:23 CDT 2010


If there _is_ a reason to keep the two separate, I strongly suggest to
use different names (having a typedef READYSTAT as well as an enum by
that name is tricky) and someone needs to look in the mixing of types
that happens in line 277.

Gerald

PS: In case of followups, I'll likely be offline for a week starting
soon.

---
 dlls/msxml3/httprequest.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c
index e0f7701..b5aefbc 100644
--- a/dlls/msxml3/httprequest.c
+++ b/dlls/msxml3/httprequest.c
@@ -48,15 +48,6 @@ struct reqheader
     BSTR value;
 };
 
-enum READYSTATE
-{
-    STATE_UNINITIALIZED = 0,
-    STATE_LOADING       = 1,
-    STATE_LOADED        = 2,
-    STATE_INTERACTIVE   = 3,
-    STATE_COMPLETED     = 4
-};
-
 typedef struct _httprequest
 {
     const struct IXMLHTTPRequestVtbl *lpVtbl;
@@ -261,7 +252,7 @@ static HRESULT WINAPI httprequest_open(IXMLHTTPRequest *iface, BSTR method, BSTR
     if (hr == S_OK)
         This->password = V_BSTR(&str);
 
-    httprequest_setreadystate(This, STATE_LOADING);
+    httprequest_setreadystate(This, READYSTATE_LOADING);
 
     return S_OK;
 }
@@ -274,7 +265,7 @@ static HRESULT WINAPI httprequest_setRequestHeader(IXMLHTTPRequest *iface, BSTR
     TRACE("(%p)->(%s %s)\n", This, debugstr_w(header), debugstr_w(value));
 
     if (!header || !*header) return E_INVALIDARG;
-    if (This->state != STATE_LOADING) return E_FAIL;
+    if (This->state != READYSTATE_LOADING) return E_FAIL;
     if (!value) return E_INVALIDARG;
 
     /* replace existing header value if already added */
@@ -451,7 +442,7 @@ HRESULT XMLHTTPRequest_create(IUnknown *pUnkOuter, LPVOID *ppObj)
     req->async = FALSE;
     req->verb = -1;
     req->url = req->user = req->password = NULL;
-    req->state = STATE_UNINITIALIZED;
+    req->state = READYSTATE_UNINITIALIZED;
     list_init(&req->reqheaders);
 
     *ppObj = &req->lpVtbl;
-- 
1.7.2.2



More information about the wine-patches mailing list