From 3f37ee017da75fc1f3a0c187dcac8aabd00c82ea Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 14 Jan 2013 19:32:54 +0100 Subject: [PATCH] Fix compiler warnings about signedness in comparisson. Change-Id: I1883d6f5f8c2bbedd07ba8791057eeb788b5b938 Reviewed-by: Simon Hausmann --- qmljs_runtime.cpp | 2 +- qv4array.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 8833f7b..f5853d9 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -558,7 +558,7 @@ Value __qmljs_get_element(ExecutionContext *ctx, Value object, Value index) { uint idx = index.asArrayIndex(); if (object.isString() && idx < UINT_MAX) { - if (idx >= object.stringValue()->toQString().length()) + if (idx > INT_MAX || (int) idx >= object.stringValue()->toQString().length()) return Value::undefinedValue(); const QString s = object.stringValue()->toQString().mid(idx, 1); return Value::fromString(ctx, s); diff --git a/qv4array.cpp b/qv4array.cpp index a190c78..dd34a7c 100644 --- a/qv4array.cpp +++ b/qv4array.cpp @@ -526,7 +526,7 @@ Value Array::indexOf(Value v, uint fromIndex, uint endIndex, ExecutionContext *c return Value::fromDouble(n->key()); } } else { - if (endIndex > values.size()) + if ((int) endIndex > values.size()) endIndex = values.size(); PropertyDescriptor *pd = values.data() + offset; PropertyDescriptor *end = pd + endIndex; -- 2.7.4