diff --git a/cocos2dx/include/ccMacros.h b/cocos2dx/include/ccMacros.h index 8c4f95d2b2..3c65b602d0 100644 --- a/cocos2dx/include/ccMacros.h +++ b/cocos2dx/include/ccMacros.h @@ -174,7 +174,7 @@ It should work same as apples CFSwapInt32LittleToHost(..) /// when define returns true it means that our architecture uses big endian #define CC_HOST_IS_BIG_ENDIAN (bool)(*(unsigned short *)"\0\xff" < 0x100) -#define CC_SWAP32(i) ((i & 0x000000ff) << 24 | (i & 0x0000ff00 << 8) | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24) +#define CC_SWAP32(i) ((i & 0x000000ff) << 24 | (i & 0x0000ff00) << 8 | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24) #define CC_SWAP16(i) ((i & 0x00ff) << 8 | (i &0xff00) >> 8) #define CC_SWAP_INT32_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true)? CC_SWAP32(i) : (i) ) #define CC_SWAP_INT16_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true)? CC_SWAP16(i) : (i) ) diff --git a/cocos2dx/support/zip_support/ZipUtils.h b/cocos2dx/support/zip_support/ZipUtils.h index 133315db43..8825a197bc 100644 --- a/cocos2dx/support/zip_support/ZipUtils.h +++ b/cocos2dx/support/zip_support/ZipUtils.h @@ -32,7 +32,7 @@ namespace cocos2d struct CCZHeader { unsigned char sig[4]; // signature. Should be 'CCZ!' 4 bytes unsigned short compression_type; // should 0 - unsigned char version; // should be 2 (although version type==1 is also supported) + unsigned short version; // should be 2 (although version type==1 is also supported) unsigned int reserved; // Reserverd for users. unsigned int len; // size of the uncompressed file }; @@ -47,14 +47,14 @@ namespace cocos2d class ZipUtils { public: - /** - * Inflates either zlib or gzip deflated memory. The inflated memory is - * expected to be freed by the caller. - * - * It will allocate 256k for the destination buffer. If it is not enought it will multiply the previous buffer size per 2, until there is enough memory. - * @returns the length of the deflated buffer - * - @since v0.8.1 + /** + * Inflates either zlib or gzip deflated memory. The inflated memory is + * expected to be freed by the caller. + * + * It will allocate 256k for the destination buffer. If it is not enought it will multiply the previous buffer size per 2, until there is enough memory. + * @returns the length of the deflated buffer + * + @since v0.8.1 */ static int ccInflateMemory(unsigned char *in, unsigned int inLength, unsigned char **out);