fix a warning in CCRenderTexture.

This commit is contained in:
James Chen 2012-11-26 22:11:56 +08:00
parent be914811fb
commit d7ebd681ec
1 changed files with 16 additions and 16 deletions

View File

@ -50,23 +50,23 @@ I found that it's not work in C++. So it keep what it's look like in version 1.0
*/ */
#define CCARRAY_FOREACH(__array__, __object__) \ #define CCARRAY_FOREACH(__array__, __object__) \
if ((__array__) && (__array__)->data->num > 0) \ if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** arr = (__array__)->data->arr, **end = (__array__)->data->arr + (__array__)->data->num-1; \ for(CCObject** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \
arr <= end && (((__object__) = *arr) != NULL/* || true*/); \ __arr__ <= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \
arr++) __arr__++)
#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ #define CCARRAY_FOREACH_REVERSE(__array__, __object__) \
if ((__array__) && (__array__)->data->num > 0) \ if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** arr = (__array__)->data->arr + (__array__)->data->num-1, **end = (__array__)->data->arr; \ for(CCObject** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \
arr >= end && (((__object__) = *arr) != NULL/* || true*/); \ __arr__ >= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \
arr--) __arr__--)
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) #if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
#define CCARRAY_VERIFY_TYPE(__array__, __type__) \ #define CCARRAY_VERIFY_TYPE(__array__, __type__) \
do { \ do { \
if ((__array__) && (__array__)->data->num > 0) \ if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** arr = (__array__)->data->arr, \ for(CCObject** __arr__ = (__array__)->data->arr, \
**end = (__array__)->data->arr + (__array__)->data->num-1; arr <= end; arr++) \ **__end__ = (__array__)->data->arr + (__array__)->data->num-1; __arr__ <= __end__; __arr__++) \
CCAssert(dynamic_cast<__type__>(*arr), "element type is wrong!"); \ CCAssert(dynamic_cast<__type__>(*__arr__), "element type is wrong!"); \
} while(false) } while(false)
#else #else
#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) #define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0)