From e63e9a9b02c291336d0e61e79e582e27e74b8fad Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 12 Nov 2016 12:04:17 +0200 Subject: [PATCH] - fix most of warnings with non-MSVC toolchains --- fileformat.cpp | 6 +++--- main.cpp | 4 ++-- resourcefile.h | 2 +- wadext.cpp | 16 +++++++--------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/fileformat.cpp b/fileformat.cpp index fe480a5..1f4c17f 100644 --- a/fileformat.cpp +++ b/fileformat.cpp @@ -312,9 +312,9 @@ bool isHmp(const uint8_t *pbuffer, int len) bool isXmi(const uint8_t *pbuffer, int len) { return len >= 12 && - (IsMagic(pbuffer, "FORM") && IsMagic(pbuffer + 8, "XDIR") || - IsMagic(pbuffer, "FORM") && IsMagic(pbuffer + 8, "XMID") || - IsMagic(pbuffer, "CAT ") && IsMagic(pbuffer + 8, "XMID")); + ((IsMagic(pbuffer, "FORM") && IsMagic(pbuffer + 8, "XDIR")) || + (IsMagic(pbuffer, "FORM") && IsMagic(pbuffer + 8, "XMID")) || + (IsMagic(pbuffer, "CAT ") && IsMagic(pbuffer + 8, "XMID"))); } //============================================================================ diff --git a/main.cpp b/main.cpp index e86bb72..5284e1c 100644 --- a/main.cpp +++ b/main.cpp @@ -33,7 +33,7 @@ int ParseOptions(int argc,char ** argv,int & index) { struct parseinf { - char * opt; + const char * opt; int flag; int argc; } pi[]={ @@ -92,4 +92,4 @@ int main(int argc, char ** argv) printf(" -tx: Converts a set of TEXTURE1/TEXTURE2/PNAMES in the current directory to a textures.txt file.\n"); } return 0; -} \ No newline at end of file +} diff --git a/resourcefile.h b/resourcefile.h index 2e47dab..d94c401 100644 --- a/resourcefile.h +++ b/resourcefile.h @@ -85,4 +85,4 @@ struct WadItemList void OpenMainWad(char * filename); -#endif \ No newline at end of file +#endif diff --git a/wadext.cpp b/wadext.cpp index 305029c..1c9520d 100644 --- a/wadext.cpp +++ b/wadext.cpp @@ -117,10 +117,10 @@ const char * MakeFileName(const char * base, const char * ext) { // replace special path characters in the lump name if (basebuffer[i] == '\\') basebuffer[i] = '^'; - if (basebuffer[i] == '/') basebuffer[i] = '§'; - if (basebuffer[i] == ':') basebuffer[i] = '¡'; - if (basebuffer[i] == '*') basebuffer[i] = '²'; - if (basebuffer[i] == '?') basebuffer[i] = '¿'; + if (basebuffer[i] == '/') basebuffer[i] = '\xA7'; + if (basebuffer[i] == ':') basebuffer[i] = '\xA1'; + if (basebuffer[i] == '*') basebuffer[i] = '\xB2'; + if (basebuffer[i] == '?') basebuffer[i] = '\xBF'; } for(int i=0;;i++) @@ -134,7 +134,7 @@ const char * MakeFileName(const char * base, const char * ext) } } -void Extract(WadItemList *w,char * dir,const char * ext, int options, bool isflat) //It is completely impossible to detect flats, so we have to flag it when extracting the F_ namespace +void Extract(WadItemList *w,const char * dir,const char * ext, int options, bool isflat) //It is completely impossible to detect flats, so we have to flag it when extracting the F_ namespace { FileType ft = IdentifyFileType(w->Name(), (uint8_t*)w->Address(), w->Length()); const char *filename; @@ -208,9 +208,8 @@ void Extract(WadItemList *w,char * dir,const char * ext, int options, bool isfla chdir(maindir); } -int ListExtract(int startmarker,char * dir,char * endm,char * endm2,bool isflat,int options,int pack=0) +int ListExtract(int startmarker,const char * dir,const char * endm,const char * endm2,bool isflat,int options,int pack=0) { - int ev=0; char dirbuf[200]; mkdir(dir); @@ -234,11 +233,10 @@ bool isLevel(int lump) return false; } -int MapExtract(int startmarker,char *dir,int options) +int MapExtract(int startmarker,const char *dir,int options) { int i; char buffer[40]; - int packlength[13]={0}; TArray directory; mkdir(dir);