Andrew Talbot : mshtml: Avoid signed-unsigned integer comparisons.

Alexandre Julliard julliard at winehq.org
Mon Feb 18 13:27:05 CST 2013


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

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Sat Feb 16 21:09:13 2013 +0000

mshtml: Avoid signed-unsigned integer comparisons.

---

 dlls/mshtml/htmlbody.c  |    3 ++-
 dlls/mshtml/htmlevent.c |   13 ++++++++-----
 dlls/mshtml/main.c      |    2 +-
 dlls/mshtml/nsio.c      |    2 +-
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c
index e427fc0..f02264e 100644
--- a/dlls/mshtml/htmlbody.c
+++ b/dlls/mshtml/htmlbody.c
@@ -127,7 +127,8 @@ static int loose_hex_to_rgb(const WCHAR *hex)
 
 static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
 {
-    int i, rgb = -1;
+    unsigned int i;
+    int rgb = -1;
 
     static const WCHAR formatW[] = {'#','%','0','2','x','%','0','2','x','%','0','2','x',0};
 
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 98e592d..ea0201f 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -929,7 +929,6 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
     const BOOL cancelable = event_info[eid].flags & EVENT_CANCELABLE;
     handler_vector_t *handler_vector = NULL;
     VARIANT v;
-    int i;
     HRESULT hres;
 
     if(event_target)
@@ -966,6 +965,7 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
     if(handler_vector && handler_vector->handler_cnt) {
         VARIANTARG arg;
         DISPPARAMS dp = {&arg, NULL, 1, 0};
+        int i;
 
         V_VT(&arg) = VT_DISPATCH;
         V_DISPATCH(&arg) = (IDispatch*)event_obj;
@@ -1009,16 +1009,18 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
 
         for(cp = cp_container->cp_list; cp; cp = cp->next) {
             if(cp->sinks_size && is_cp_event(cp->data, event_info[eid].dispid)) {
+                unsigned int i;
+
                 for(i=0; doc->nsevent_listener && i < cp->sinks_size; i++) {
                     if(!cp->sinks[i].disp)
                         continue;
 
                     V_VT(&v) = VT_EMPTY;
 
-                    TRACE("cp %s [%d] >>>\n", debugstr_w(event_info[eid].name), i);
+                    TRACE("cp %s [%u] >>>\n", debugstr_w(event_info[eid].name), i);
                     hres = call_cp_func(cp->sinks[i].disp, event_info[eid].dispid, &v);
                     if(hres == S_OK) {
-                        TRACE("cp %s [%d] <<<\n", debugstr_w(event_info[eid].name), i);
+                        TRACE("cp %s [%u] <<<\n", debugstr_w(event_info[eid].name), i);
 
                         if(cancelable) {
                             if(V_VT(&v) == VT_BOOL) {
@@ -1030,7 +1032,7 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
                         }
                         VariantClear(&v);
                     }else {
-                        WARN("cp %s [%d] <<< %08x\n", debugstr_w(event_info[eid].name), i, hres);
+                        WARN("cp %s [%u] <<< %08x\n", debugstr_w(event_info[eid].name), i, hres);
                     }
                 }
 
@@ -1558,7 +1560,8 @@ HRESULT doc_init_events(HTMLDocumentNode *doc)
 
 void release_event_target(event_target_t *event_target)
 {
-    int i, j;
+    int i;
+    unsigned int j;
 
     for(i=0; i < EVENTID_LAST; i++) {
         if(event_target->event_table[i]) {
diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c
index 8468f5c..503d738 100644
--- a/dlls/mshtml/main.c
+++ b/dlls/mshtml/main.c
@@ -67,7 +67,7 @@ static void thread_detach(void)
 
 static void free_strings(void)
 {
-    int i;
+    unsigned int i;
     for(i = 0; i < sizeof(status_strings)/sizeof(*status_strings); i++)
         heap_free(status_strings[i]);
 }
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index 96191f7..1e8f1bb 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -3229,7 +3229,7 @@ static nsresult NSAPI nsIOService_GetProtocolFlags(nsIIOService *iface, const ch
 static BOOL is_gecko_special_uri(const char *spec)
 {
     static const char *special_schemes[] = {"chrome:", "jar:", "moz-safe-about", "resource:", "javascript:", "wyciwyg:"};
-    int i;
+    unsigned int i;
 
     for(i=0; i < sizeof(special_schemes)/sizeof(*special_schemes); i++) {
         if(!strncasecmp(spec, special_schemes[i], strlen(special_schemes[i])))




More information about the wine-cvs mailing list