Bug 722215 - dist\include\jsapi.h(3526) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data. r=luke

This commit is contained in:
Makoto Kato 2014-06-19 18:54:19 +09:00
parent ec00b3a785
commit b45dcdc221
2 changed files with 4 additions and 4 deletions

View File

@ -2099,9 +2099,9 @@ JS_IdArrayLength(JSContext *cx, JSIdArray *ida)
}
JS_PUBLIC_API(jsid)
JS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index)
JS_IdArrayGet(JSContext *cx, JSIdArray *ida, unsigned index)
{
JS_ASSERT(index >= 0 && index < ida->length);
JS_ASSERT(index < unsigned(ida->length));
return ida->vector[index];
}

View File

@ -2215,7 +2215,7 @@ extern JS_PUBLIC_API(int)
JS_IdArrayLength(JSContext *cx, JSIdArray *ida);
extern JS_PUBLIC_API(jsid)
JS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);
JS_IdArrayGet(JSContext *cx, JSIdArray *ida, unsigned index);
extern JS_PUBLIC_API(void)
JS_DestroyIdArray(JSContext *cx, JSIdArray *ida);
@ -2240,7 +2240,7 @@ class AutoIdArray : private AutoGCRooter
}
jsid operator[](size_t i) const {
JS_ASSERT(idArray);
return JS_IdArrayGet(context, idArray, i);
return JS_IdArrayGet(context, idArray, unsigned(i));
}
size_t length() const {
return JS_IdArrayLength(context, idArray);