Merge pull request #494 from walzer/master

fix a typo in CC_SWAP32 marco, change CCZHeader.version from unsigned char to unsigned short
This commit is contained in:
Walzer 2011-08-30 00:33:48 -07:00
commit 81c230e5de
2 changed files with 10 additions and 10 deletions

View File

@ -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) )

View File

@ -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);