From c279262556b2ffb4324cc6e52b4d4dd9cd1bd91a Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 7 Oct 2015 22:52:07 +0800 Subject: Make the compiler happy (Remove warnings). --- extensions/smanim.cpp | 1 + extensions/smbmfont.cpp | 2 ++ extensions/smdatapack.cpp | 18 +++++++++++------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/extensions/smanim.cpp b/extensions/smanim.cpp index d57292b..69bf8e0 100644 --- a/extensions/smanim.cpp +++ b/extensions/smanim.cpp @@ -111,6 +111,7 @@ bool smAnmFile::loadAnmFromMemory(const char* ptr,DWORD size) DWORD msez=anm.getFileSize("content.meta"); parseMeta(mptr,msez); anm.releaseFilePtr("content.meta"); + return true; } void smAnmFile::close() { diff --git a/extensions/smbmfont.cpp b/extensions/smbmfont.cpp index 22f9280..97b7fdb 100644 --- a/extensions/smbmfont.cpp +++ b/extensions/smbmfont.cpp @@ -55,6 +55,7 @@ bool smBMFont::loadAnmFromMemory(const char* ptr,DWORD size) anm.releaseFilePtr("content.meta"); setBlend(BLEND_ALPHABLEND); setColor(0xFFFFFFFF); + return true; } void smBMFont::close() { @@ -155,6 +156,7 @@ bool smBMFontw::loadAnmFromMemory(char* ptr,DWORD size) DWORD msez=anm.getFileSize("content.meta"); parseMeta(mptr,msez); anm.releaseFilePtr("content.meta"); + return true; } void smBMFontw::close() { diff --git a/extensions/smdatapack.cpp b/extensions/smdatapack.cpp index 3138ccd..8b2c12b 100644 --- a/extensions/smdatapack.cpp +++ b/extensions/smdatapack.cpp @@ -11,9 +11,11 @@ #include "smdatapack.hpp" #include #include -#define gzgetDWORD(f) (((gzgetc(f))<<24)|((gzgetc(f))<<16)|((gzgetc(f))<<8)|(gzgetc(f)))&0xFFFFFFFF -#define gch ((*(cp++))&0xFF) -#define mmgetDWORD ((gch<<24)|(gch<<16)|(gch<<8)|(gch))&0xFFFFFFFF +inline int gzgch(gzFile f){return gzgetc(f);} +inline DWORD gzgetDWORD(gzFile f) +{return ((gzgch(f)<<24)|(gzgch(f)<<16)|(gzgch(f)<<8)|gzgch(f))&0xFFFFFFFF;} +inline DWORD gch(const char *&cp){return (DWORD)((*(cp++))&0xFF);} +inline DWORD mmgetDWORD(const char *&cp){return ((gch(cp)<<24)|(gch(cp)<<16)|(gch(cp)<<8)|(gch(cp)))&0xFFFFFFFF;} #define gzputDWORD(f,a) gzputc(f,a>>24);gzputc(f,(a>>16)&0xFF);gzputc(f,(a>>8)&0xFF);gzputc(f,a&0xFF); bool smDtpFileR::openDtp(const char* path) { @@ -35,6 +37,7 @@ bool smDtpFileR::openDtp(const char* path) f.crc=gzgetDWORD(file); m[std::string(f.path)]=f; } + return true; } bool smDtpFileR::openDtpFromMemory(const char* ptr,DWORD size) { @@ -50,11 +53,12 @@ bool smDtpFileR::openDtpFromMemory(const char* ptr,DWORD size) f.path=new char[pl+1];f.data=NULL; for(int j=0;j