mshtml: Avoid signed-unsigned integer comparisons.

This commit is contained in:
Andrew Talbot 2013-02-16 21:09:13 +00:00 committed by Alexandre Julliard
parent 40f3a9fa59
commit a9200aa99d
4 changed files with 12 additions and 8 deletions

View File

@ -127,7 +127,8 @@ static int loose_hex_to_rgb(const WCHAR *hex)
static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) 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}; static const WCHAR formatW[] = {'#','%','0','2','x','%','0','2','x','%','0','2','x',0};

View File

@ -929,7 +929,6 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
const BOOL cancelable = event_info[eid].flags & EVENT_CANCELABLE; const BOOL cancelable = event_info[eid].flags & EVENT_CANCELABLE;
handler_vector_t *handler_vector = NULL; handler_vector_t *handler_vector = NULL;
VARIANT v; VARIANT v;
int i;
HRESULT hres; HRESULT hres;
if(event_target) if(event_target)
@ -966,6 +965,7 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
if(handler_vector && handler_vector->handler_cnt) { if(handler_vector && handler_vector->handler_cnt) {
VARIANTARG arg; VARIANTARG arg;
DISPPARAMS dp = {&arg, NULL, 1, 0}; DISPPARAMS dp = {&arg, NULL, 1, 0};
int i;
V_VT(&arg) = VT_DISPATCH; V_VT(&arg) = VT_DISPATCH;
V_DISPATCH(&arg) = (IDispatch*)event_obj; 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) { for(cp = cp_container->cp_list; cp; cp = cp->next) {
if(cp->sinks_size && is_cp_event(cp->data, event_info[eid].dispid)) { 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++) { for(i=0; doc->nsevent_listener && i < cp->sinks_size; i++) {
if(!cp->sinks[i].disp) if(!cp->sinks[i].disp)
continue; continue;
V_VT(&v) = VT_EMPTY; 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); hres = call_cp_func(cp->sinks[i].disp, event_info[eid].dispid, &v);
if(hres == S_OK) { 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(cancelable) {
if(V_VT(&v) == VT_BOOL) { if(V_VT(&v) == VT_BOOL) {
@ -1030,7 +1032,7 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
} }
VariantClear(&v); VariantClear(&v);
}else { }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) void release_event_target(event_target_t *event_target)
{ {
int i, j; int i;
unsigned int j;
for(i=0; i < EVENTID_LAST; i++) { for(i=0; i < EVENTID_LAST; i++) {
if(event_target->event_table[i]) { if(event_target->event_table[i]) {

View File

@ -67,7 +67,7 @@ static void thread_detach(void)
static void free_strings(void) static void free_strings(void)
{ {
int i; unsigned int i;
for(i = 0; i < sizeof(status_strings)/sizeof(*status_strings); i++) for(i = 0; i < sizeof(status_strings)/sizeof(*status_strings); i++)
heap_free(status_strings[i]); heap_free(status_strings[i]);
} }

View File

@ -3229,7 +3229,7 @@ static nsresult NSAPI nsIOService_GetProtocolFlags(nsIIOService *iface, const ch
static BOOL is_gecko_special_uri(const char *spec) static BOOL is_gecko_special_uri(const char *spec)
{ {
static const char *special_schemes[] = {"chrome:", "jar:", "moz-safe-about", "resource:", "javascript:", "wyciwyg:"}; 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++) { for(i=0; i < sizeof(special_schemes)/sizeof(*special_schemes); i++) {
if(!strncasecmp(spec, special_schemes[i], strlen(special_schemes[i]))) if(!strncasecmp(spec, special_schemes[i], strlen(special_schemes[i])))