issue #1603: fixed some warnings.

This commit is contained in:
James Chen 2012-12-20 17:18:49 +08:00
parent 1562658bd8
commit 9a0a5e6b31
3 changed files with 10 additions and 11 deletions

View File

@ -442,7 +442,7 @@ bool CCTexturePVR::unpackPVRv3Data(unsigned char* dataPointer, unsigned int data
m_uNumberOfMipmaps = header->numberOfMipmaps; m_uNumberOfMipmaps = header->numberOfMipmaps;
CCAssert(m_uNumberOfMipmaps < CC_PVRMIPMAP_MAX, @"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value"); 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) switch (pixelFormat)
{ {

View File

@ -1085,7 +1085,7 @@ CCArray* jsval_to_ccarray(JSContext* cx, jsval v) {
uint32_t len = 0; uint32_t len = 0;
JS_GetArrayLength(cx, arr, &len); JS_GetArrayLength(cx, arr, &len);
CCArray* ret = CCArray::createWithCapacity(len); CCArray* ret = CCArray::createWithCapacity(len);
for (int i=0; i < len; i++) { for (uint32_t i=0; i < len; i++) {
jsval elt; jsval elt;
JSObject *elto; JSObject *elto;
if (JS_GetElement(cx, arr, i, &elt) && JS_ValueToObject(cx, elt, &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); 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; jsval arrElement;
CCObject *obj = arr->objectAtIndex(i); CCObject *obj = arr->objectAtIndex(i);
const char *type = typeid(*obj).name(); const char *type = typeid(*obj).name();

View File

@ -173,7 +173,7 @@ JSBool js_cocos2dx_CCNode_getChildren(JSContext *cx, uint32_t argc, jsval *vp)
JSObject *jsarr = JS_NewArrayObject(cx, children->count(), NULL); 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); cocos2d::CCNode *child = (cocos2d::CCNode*)children->objectAtIndex(i);
js_proxy_t *childProxy = js_get_or_create_proxy<cocos2d::CCNode>(cx, child); js_proxy_t *childProxy = js_get_or_create_proxy<cocos2d::CCNode>(cx, child);
jsval childVal = OBJECT_TO_JSVAL(childProxy->obj); 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); jsval *argv = JS_ARGV(cx, vp);
if (argc > 0) { if (argc > 0) {
cocos2d::CCArray* array = cocos2d::CCArray::create(); cocos2d::CCArray* array = cocos2d::CCArray::create();
int i = 0; uint32_t i = 0;
while (i < argc) { while (i < argc) {
js_proxy_t *proxy; js_proxy_t *proxy;
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); 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); jsval *argv = JS_ARGV(cx, vp);
if (argc > 0) { if (argc > 0) {
cocos2d::CCArray* array = cocos2d::CCArray::create(); cocos2d::CCArray* array = cocos2d::CCArray::create();
int i = 0; uint32_t i = 0;
while (i < argc) { while (i < argc) {
js_proxy_t *proxy; js_proxy_t *proxy;
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); 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); jsval *argv = JS_ARGV(cx, vp);
if (argc > 0) { if (argc > 0) {
cocos2d::CCArray* array = cocos2d::CCArray::create(); cocos2d::CCArray* array = cocos2d::CCArray::create();
int i = 0; uint32_t i = 0;
while (i < argc) { while (i < argc) {
js_proxy_t *proxy; js_proxy_t *proxy;
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); 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) { if (argc >= 1) {
jsval *argv = JS_ARGV(cx, vp); jsval *argv = JS_ARGV(cx, vp);
cocos2d::CCMenuItemToggle* ret = cocos2d::CCMenuItemToggle::create(); cocos2d::CCMenuItemToggle* ret = cocos2d::CCMenuItemToggle::create();
for (uint32_t i=0; i < argc; i++) {
for (int i=0; i < argc; i++) {
js_proxy_t *proxy; js_proxy_t *proxy;
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]); JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);
JS_GET_NATIVE_PROXY(proxy, tmpObj); 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* verts = new CCPoint[ l ];
CCPoint p; CCPoint p;
for( int i=0; i<l; i++ ) { for( uint32_t i=0; i<l; i++ ) {
jsval pointvp; jsval pointvp;
if( ! JS_GetElement(cx, argArray, i, &pointvp) ) if( ! JS_GetElement(cx, argArray, i, &pointvp) )
return JS_FALSE; return JS_FALSE;