diff --git a/cocos2dx/textures/CCTexturePVR.cpp b/cocos2dx/textures/CCTexturePVR.cpp index 379194b662..db67856711 100644 --- a/cocos2dx/textures/CCTexturePVR.cpp +++ b/cocos2dx/textures/CCTexturePVR.cpp @@ -442,7 +442,7 @@ bool CCTexturePVR::unpackPVRv3Data(unsigned char* dataPointer, unsigned int data m_uNumberOfMipmaps = header->numberOfMipmaps; CCAssert(m_uNumberOfMipmaps < CC_PVRMIPMAP_MAX, @"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value"); - for (int i = 0; i < m_uNumberOfMipmaps; i++) + for (unsigned int i = 0; i < m_uNumberOfMipmaps; i++) { switch (pixelFormat) { diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index 43ee135e62..15104a0c04 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -1085,7 +1085,7 @@ CCArray* jsval_to_ccarray(JSContext* cx, jsval v) { uint32_t len = 0; JS_GetArrayLength(cx, arr, &len); CCArray* ret = CCArray::createWithCapacity(len); - for (int i=0; i < len; i++) { + for (uint32_t i=0; i < len; i++) { jsval elt; JSObject *elto; if (JS_GetElement(cx, arr, i, &elt) && JS_ValueToObject(cx, elt, &elto)) { @@ -1106,7 +1106,7 @@ jsval ccarray_to_jsval(JSContext* cx, CCArray *arr) { JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL); - for(int i = 0; i < arr->count(); ++i) { + for(unsigned int i = 0; i < arr->count(); ++i) { jsval arrElement; CCObject *obj = arr->objectAtIndex(i); const char *type = typeid(*obj).name(); diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp b/scripting/javascript/bindings/cocos2d_specifics.cpp index 550cb51d72..76c7ff82f6 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp @@ -173,7 +173,7 @@ JSBool js_cocos2dx_CCNode_getChildren(JSContext *cx, uint32_t argc, jsval *vp) JSObject *jsarr = JS_NewArrayObject(cx, children->count(), NULL); - for (int i=0; i < children->count(); i++) { + for (unsigned int i=0; i < children->count(); i++) { cocos2d::CCNode *child = (cocos2d::CCNode*)children->objectAtIndex(i); js_proxy_t *childProxy = js_get_or_create_proxy(cx, child); jsval childVal = OBJECT_TO_JSVAL(childProxy->obj); @@ -192,7 +192,7 @@ JSBool js_cocos2dx_CCMenu_create(JSContext *cx, uint32_t argc, jsval *vp) jsval *argv = JS_ARGV(cx, vp); if (argc > 0) { cocos2d::CCArray* array = cocos2d::CCArray::create(); - int i = 0; + uint32_t i = 0; while (i < argc) { js_proxy_t *proxy; JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); @@ -251,7 +251,7 @@ JSBool js_cocos2dx_CCSequence_create(JSContext *cx, uint32_t argc, jsval *vp) jsval *argv = JS_ARGV(cx, vp); if (argc > 0) { cocos2d::CCArray* array = cocos2d::CCArray::create(); - int i = 0; + uint32_t i = 0; while (i < argc) { js_proxy_t *proxy; JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); @@ -289,7 +289,7 @@ JSBool js_cocos2dx_CCSpawn_create(JSContext *cx, uint32_t argc, jsval *vp) jsval *argv = JS_ARGV(cx, vp); if (argc > 0) { cocos2d::CCArray* array = cocos2d::CCArray::create(); - int i = 0; + uint32_t i = 0; while (i < argc) { js_proxy_t *proxy; JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); @@ -511,9 +511,8 @@ JSBool js_cocos2dx_CCMenuItemToggle_create(JSContext *cx, uint32_t argc, jsval * if (argc >= 1) { jsval *argv = JS_ARGV(cx, vp); cocos2d::CCMenuItemToggle* ret = cocos2d::CCMenuItemToggle::create(); - - - for (int i=0; i < argc; i++) { + + for (uint32_t i=0; i < argc; i++) { js_proxy_t *proxy; JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); JS_GET_NATIVE_PROXY(proxy, tmpObj); @@ -2442,7 +2441,7 @@ JSBool js_cocos2dx_CCDrawNode_drawPolygon(JSContext *cx, uint32_t argc, jsval *v CCPoint* verts = new CCPoint[ l ]; CCPoint p; - for( int i=0; i