diff --git a/source/audiolib/src/flac.cpp b/source/audiolib/src/flac.cpp index 0521485f1..1fe1fdd6f 100644 --- a/source/audiolib/src/flac.cpp +++ b/source/audiolib/src/flac.cpp @@ -560,21 +560,21 @@ int32_t MV_PlayFLAC(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t lo for (size_t t = 0; t < loopStartTagCount && vc_loopstart == NULL; ++t) { char const * const tag = loopStartTags[t]; - if (field == strlen(tag) && strncasecmp(entry, tag, field) == 0) + if (field == strlen(tag) && Bstrncasecmp(entry, tag, field) == 0) vc_loopstart = strdup(value); } for (size_t t = 0; t < loopEndTagCount && vc_loopend == NULL; ++t) { char const * const tag = loopEndTags[t]; - if (field == strlen(tag) && strncasecmp(entry, tag, field) == 0) + if (field == strlen(tag) && Bstrncasecmp(entry, tag, field) == 0) vc_loopend = strdup(value); } for (size_t t = 0; t < loopLengthTagCount && vc_looplength == NULL; ++t) { char const * const tag = loopLengthTags[t]; - if (field == strlen(tag) && strncasecmp(entry, tag, field) == 0) + if (field == strlen(tag) && Bstrncasecmp(entry, tag, field) == 0) vc_looplength = strdup(value); } } diff --git a/source/audiolib/src/vorbis.cpp b/source/audiolib/src/vorbis.cpp index 28bc0bb4b..19f31a0ea 100644 --- a/source/audiolib/src/vorbis.cpp +++ b/source/audiolib/src/vorbis.cpp @@ -81,21 +81,21 @@ static void MV_GetVorbisCommentLoops(VoiceNode *voice, vorbis_comment *vc) for (size_t t = 0; t < loopStartTagCount && vc_loopstart == NULL; ++t) { char const * const tag = loopStartTags[t]; - if (field == strlen(tag) && strncasecmp(entry, tag, field) == 0) + if (field == strlen(tag) && Bstrncasecmp(entry, tag, field) == 0) vc_loopstart = value; } for (size_t t = 0; t < loopEndTagCount && vc_loopend == NULL; ++t) { char const * const tag = loopEndTags[t]; - if (field == strlen(tag) && strncasecmp(entry, tag, field) == 0) + if (field == strlen(tag) && Bstrncasecmp(entry, tag, field) == 0) vc_loopend = value; } for (size_t t = 0; t < loopLengthTagCount && vc_looplength == NULL; ++t) { char const * const tag = loopLengthTags[t]; - if (field == strlen(tag) && strncasecmp(entry, tag, field) == 0) + if (field == strlen(tag) && Bstrncasecmp(entry, tag, field) == 0) vc_looplength = value; } } diff --git a/source/build/src/animvpx.cpp b/source/build/src/animvpx.cpp index a48ca4019..339631cde 100644 --- a/source/build/src/animvpx.cpp +++ b/source/build/src/animvpx.cpp @@ -2,14 +2,6 @@ #ifdef USE_LIBVPX -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif - - #include "compat.h" #include "compat.h" diff --git a/source/build/src/kplib.cpp b/source/build/src/kplib.cpp index 5294540a5..601892d96 100644 --- a/source/build/src/kplib.cpp +++ b/source/build/src/kplib.cpp @@ -36,11 +36,8 @@ credits. #if !defined(_WIN32) #include -# if !defined __INTEL_COMPILER -typedef long long __int64; -# endif -static __inline int32_t _lrotl(int32_t i, int sh) { return (i >> (-sh)) | (i << sh); } -/*__inline*/ int32_t filelength(int h) +static inline int32_t _lrotl(int32_t i, int sh) { return (i >> (-sh)) | (i << sh); } +/*inline*/ int32_t filelength(int h) { struct stat st; if (fstat(h,&st) < 0) return -1; @@ -56,15 +53,6 @@ static __inline int32_t _lrotl(int32_t i, int sh) { return (i >> (-sh)) | (i << #endif #endif -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#if defined(__GNUC__) -#undef _inline -#define _inline inline -#endif - //use GCC-specific extension to force symbol name to be something in particular to override underscoring. #if defined(__GNUC__) && defined(__i386__) && !defined(NOASM) #define ASMNAME(x) asm(x) @@ -160,7 +148,7 @@ static uint8_t qhufbit0[1<>3]))>>(bitpos&7))&pow2mask[n]; } -static _inline void suckbits(int32_t n) { bitpos += n; if (bitpos < 0) return; suckbitsnextblock(); } -static _inline int32_t getbits(int32_t n) { int32_t i = peekbits(n); suckbits(n); return i; } +static inline int32_t peekbits(int32_t n) { return (B_LITTLE32(B_UNBUF32(&filptr[bitpos>>3]))>>(bitpos&7))&pow2mask[n]; } +static inline void suckbits(int32_t n) { bitpos += n; if (bitpos < 0) return; suckbitsnextblock(); } +static inline int32_t getbits(int32_t n) { int32_t i = peekbits(n); suckbits(n); return i; } static int32_t hufgetsym(int32_t *hitab, int32_t *hbmax) { @@ -402,7 +390,7 @@ static int32_t initpass() //Interlaced images have 7 "passes", non-interlaced h #if defined(_MSC_VER) && !defined(NOASM) -static _inline int32_t Paeth686(int32_t a, int32_t b, int32_t c) +static inline int32_t Paeth686(int32_t a, int32_t b, int32_t c) { _asm { @@ -429,7 +417,7 @@ static _inline int32_t Paeth686(int32_t a, int32_t b, int32_t c) } } -static _inline void rgbhlineasm(int32_t c, int32_t d, int32_t t, int32_t b) +static inline void rgbhlineasm(int32_t c, int32_t d, int32_t t, int32_t b) { _asm { @@ -470,7 +458,7 @@ static _inline void rgbhlineasm(int32_t c, int32_t d, int32_t t, int32_t b) } } -static _inline void pal8hlineasm(int32_t c, int32_t d, int32_t t, int32_t b) +static inline void pal8hlineasm(int32_t c, int32_t d, int32_t t, int32_t b) { _asm { @@ -1001,7 +989,7 @@ static int32_t colclip[1024], colclipup8[1024], colclipup16[1024]; #if defined(_MSC_VER) && !defined(NOASM) -static _inline int32_t mulshr24(int32_t a, int32_t d) +static inline int32_t mulshr24(int32_t a, int32_t d) { _asm { @@ -1011,7 +999,7 @@ static _inline int32_t mulshr24(int32_t a, int32_t d) } } -static _inline int32_t mulshr32(int32_t a, int32_t d) +static inline int32_t mulshr32(int32_t a, int32_t d) { _asm { @@ -1039,12 +1027,12 @@ static _inline int32_t mulshr32(int32_t a, int32_t d) static inline int32_t mulshr24(int32_t a, int32_t b) { - return (int32_t)((((__int64)a)*((__int64)b))>>24); + return (int32_t)((((int64_t)a)*((int64_t)b))>>24); } static inline int32_t mulshr32(int32_t a, int32_t b) { - return (int32_t)((((__int64)a)*((__int64)b))>>32); + return (int32_t)((((int64_t)a)*((int64_t)b))>>32); } #endif diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index c4e5033ae..398b5e921 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -4,10 +4,6 @@ // // Use SDL 1.2 or 2.0 from http://www.libsdl.org -#define __STDC_FORMAT_MACROS -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif #include "compat.h" #include #include "sdl_inc.h" diff --git a/source/build/src/winlayer.cpp b/source/build/src/winlayer.cpp index 1e89ccc3b..cb897b0a6 100644 --- a/source/build/src/winlayer.cpp +++ b/source/build/src/winlayer.cpp @@ -21,11 +21,6 @@ #include "dxdidf.h" // comment this out if c_dfDI* is being reported as multiply defined -#define __STDC_FORMAT_MACROS -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif - #include // undefine to restrict windowed resolutions to conventional sizes diff --git a/source/duke3d/src/music.cpp b/source/duke3d/src/music.cpp index 5b879fcbe..2692560e9 100644 --- a/source/duke3d/src/music.cpp +++ b/source/duke3d/src/music.cpp @@ -25,11 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "midi.h" #include "mpu401.h" -#ifndef TRUE -#define TRUE (1 == 1) -#define FALSE (!TRUE) -#endif - int32_t MUSIC_SoundDevice = -1; int32_t MUSIC_ErrorCode = MUSIC_Ok; diff --git a/source/duke3d/src/sounds.cpp b/source/duke3d/src/sounds.cpp index 925f02153..d533a7c98 100644 --- a/source/duke3d/src/sounds.cpp +++ b/source/duke3d/src/sounds.cpp @@ -20,12 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif +#include "compat.h" #include "duke3d.h" #include "renderlayer.h" // for win_gethwnd() diff --git a/source/mact/src/file_lib.cpp b/source/mact/src/file_lib.cpp index 7c389fc04..134a688ab 100644 --- a/source/mact/src/file_lib.cpp +++ b/source/mact/src/file_lib.cpp @@ -37,16 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "cache1d.h" #include "baselayer.h" -#ifndef O_BINARY -#define O_BINARY 0 -#endif -#ifndef O_TEXT -#define O_TEXT 0 -#endif -#ifndef F_OK -#define F_OK 0 -#endif - #define MaxFiles 20 static char *FileNames[MaxFiles];