Eliminate more cases of duplication of compat.h's functionality.

git-svn-id: https://svn.eduke32.com/eduke32@6075 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-02-25 08:15:45 +00:00
parent aa04307ad1
commit 77875948ba
9 changed files with 20 additions and 69 deletions

View file

@ -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) for (size_t t = 0; t < loopStartTagCount && vc_loopstart == NULL; ++t)
{ {
char const * const tag = loopStartTags[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); vc_loopstart = strdup(value);
} }
for (size_t t = 0; t < loopEndTagCount && vc_loopend == NULL; ++t) for (size_t t = 0; t < loopEndTagCount && vc_loopend == NULL; ++t)
{ {
char const * const tag = loopEndTags[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); vc_loopend = strdup(value);
} }
for (size_t t = 0; t < loopLengthTagCount && vc_looplength == NULL; ++t) for (size_t t = 0; t < loopLengthTagCount && vc_looplength == NULL; ++t)
{ {
char const * const tag = loopLengthTags[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); vc_looplength = strdup(value);
} }
} }

View file

@ -81,21 +81,21 @@ static void MV_GetVorbisCommentLoops(VoiceNode *voice, vorbis_comment *vc)
for (size_t t = 0; t < loopStartTagCount && vc_loopstart == NULL; ++t) for (size_t t = 0; t < loopStartTagCount && vc_loopstart == NULL; ++t)
{ {
char const * const tag = loopStartTags[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; vc_loopstart = value;
} }
for (size_t t = 0; t < loopEndTagCount && vc_loopend == NULL; ++t) for (size_t t = 0; t < loopEndTagCount && vc_loopend == NULL; ++t)
{ {
char const * const tag = loopEndTags[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; vc_loopend = value;
} }
for (size_t t = 0; t < loopLengthTagCount && vc_looplength == NULL; ++t) for (size_t t = 0; t < loopLengthTagCount && vc_looplength == NULL; ++t)
{ {
char const * const tag = loopLengthTags[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; vc_looplength = value;
} }
} }

View file

@ -2,14 +2,6 @@
#ifdef USE_LIBVPX #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"
#include "compat.h" #include "compat.h"

View file

@ -36,11 +36,8 @@ credits.
#if !defined(_WIN32) #if !defined(_WIN32)
#include <dirent.h> #include <dirent.h>
# if !defined __INTEL_COMPILER static inline int32_t _lrotl(int32_t i, int sh) { return (i >> (-sh)) | (i << sh); }
typedef long long __int64; /*inline*/ int32_t filelength(int h)
# endif
static __inline int32_t _lrotl(int32_t i, int sh) { return (i >> (-sh)) | (i << sh); }
/*__inline*/ int32_t filelength(int h)
{ {
struct stat st; struct stat st;
if (fstat(h,&st) < 0) return -1; 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
#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. //use GCC-specific extension to force symbol name to be something in particular to override underscoring.
#if defined(__GNUC__) && defined(__i386__) && !defined(NOASM) #if defined(__GNUC__) && defined(__i386__) && !defined(NOASM)
#define ASMNAME(x) asm(x) #define ASMNAME(x) asm(x)
@ -160,7 +148,7 @@ static uint8_t qhufbit0[1<<LOGQHUFSIZ0], qhufbit1[1<<LOGQHUFSIZ1];
#if defined(_MSC_VER) && !defined(NOASM) #if defined(_MSC_VER) && !defined(NOASM)
static _inline int32_t bitrev(int32_t b, int32_t c) static inline int32_t bitrev(int32_t b, int32_t c)
{ {
_asm _asm
{ {
@ -233,9 +221,9 @@ static void suckbitsnextblock()
filptr = &fakebuf[4]; bitpos -= 32; filptr = &fakebuf[4]; bitpos -= 32;
} }
static _inline int32_t peekbits(int32_t n) { return (B_LITTLE32(B_UNBUF32(&filptr[bitpos>>3]))>>(bitpos&7))&pow2mask[n]; } 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 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 getbits(int32_t n) { int32_t i = peekbits(n); suckbits(n); return i; }
static int32_t hufgetsym(int32_t *hitab, int32_t *hbmax) 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) #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 _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 _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 _asm
{ {
@ -1001,7 +989,7 @@ static int32_t colclip[1024], colclipup8[1024], colclipup16[1024];
#if defined(_MSC_VER) && !defined(NOASM) #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 _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 _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) 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) 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 #endif

View file

@ -4,10 +4,6 @@
// //
// Use SDL 1.2 or 2.0 from http://www.libsdl.org // 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 "compat.h"
#include <signal.h> #include <signal.h>
#include "sdl_inc.h" #include "sdl_inc.h"

View file

@ -21,11 +21,6 @@
#include "dxdidf.h" // comment this out if c_dfDI* is being reported as multiply defined #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 <signal.h> #include <signal.h>
// undefine to restrict windowed resolutions to conventional sizes // undefine to restrict windowed resolutions to conventional sizes

View file

@ -25,11 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "midi.h" #include "midi.h"
#include "mpu401.h" #include "mpu401.h"
#ifndef TRUE
#define TRUE (1 == 1)
#define FALSE (!TRUE)
#endif
int32_t MUSIC_SoundDevice = -1; int32_t MUSIC_SoundDevice = -1;
int32_t MUSIC_ErrorCode = MUSIC_Ok; int32_t MUSIC_ErrorCode = MUSIC_Ok;

View file

@ -20,12 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#ifndef __STDC_FORMAT_MACROS #include "compat.h"
#define __STDC_FORMAT_MACROS
#endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include "duke3d.h" #include "duke3d.h"
#include "renderlayer.h" // for win_gethwnd() #include "renderlayer.h" // for win_gethwnd()

View file

@ -37,16 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "cache1d.h" #include "cache1d.h"
#include "baselayer.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 #define MaxFiles 20
static char *FileNames[MaxFiles]; static char *FileNames[MaxFiles];