Fix a couple of clang warnings. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4697 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2014-10-29 17:05:15 +00:00
parent eed56532a8
commit 384aec522a
8 changed files with 30 additions and 20 deletions

View file

@ -89,8 +89,8 @@ extern char inputdevices;
#define NUMKEYS 256
#define KEYSTATUSSIZ 256
#define KEYFIFOSIZ 64
extern char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
extern char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
extern char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyasciififo[KEYFIFOSIZ];
extern uint8_t keyasciififoplc, keyasciififoend, keyfifoplc, keyfifoend;
extern char scantoasc[128], remap[KEYSTATUSSIZ], key_names[NUMKEYS][24];
extern int32_t remapinit;

View file

@ -44,10 +44,12 @@
# define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x) x=x
#ifdef UNREFERENCED_PARAMETER
#undef UNREFERENCED_PARAMETER
#endif
#define UNREFERENCED_PARAMETER(x) x = x
#if defined __GNUC__ || defined __clang__
# define ATTRIBUTE(attrlist) __attribute__(attrlist)
#else
@ -582,7 +584,15 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
# define Bcalloc calloc
# define Brealloc realloc
# define Bfree free
#ifdef __cplusplus
# define Bstrdup _strdup
# define Bchdir _chdir
# define Bgetcwd _getcwd
#else
# define Bstrdup strdup
# define Bchdir chdir
# define Bgetcwd getcwd
#endif
# define Bmemalign memalign
# define Bopen open
# define Bclose close
@ -680,7 +690,6 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
# define Bvsnprintf vsnprintf
# endif
# define Bvfprintf vfprintf
# define Bgetcwd getcwd
# define Bgetenv getenv
# define Btime() time(NULL)
# define Butime utime

View file

@ -10,8 +10,8 @@
// input
char inputdevices=0;
char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyasciififo[KEYFIFOSIZ];
uint8_t keyfifoplc, keyfifoend, keyasciififoplc, keyasciififoend;
char remap[KEYSTATUSSIZ];
int32_t remapinit=0;
char key_names[NUMKEYS][24];

View file

@ -10695,7 +10695,7 @@ void test_map(int32_t mode)
if ((program_origcwd[0] == '\0') || !getcwd(current_cwd, BMAX_PATH))
current_cwd[0] = '\0';
else // Before we check if file exists, for the case there's no absolute path.
chdir(program_origcwd);
Bchdir(program_origcwd);
fp = fopen(game_executable, "rb"); // File exists?
if (fp != NULL)
@ -10719,7 +10719,7 @@ void test_map(int32_t mode)
}
if (current_cwd[0] != '\0') // Temporarily changing back,
chdir(current_cwd); // after checking if file exists.
Bchdir(current_cwd); // after checking if file exists.
if (testplay_addparam)
slen = Bstrlen(testplay_addparam);
@ -10765,10 +10765,10 @@ void test_map(int32_t mode)
#else
if (current_cwd[0] != '\0')
{
chdir(program_origcwd);
Bchdir(program_origcwd);
if (system(fullparam))
message("Error launching the game!");
chdir(current_cwd);
Bchdir(current_cwd);
}
else system(fullparam);
#endif

View file

@ -97,7 +97,7 @@ void *Bmalloc(bsize_t size)
void Bfree(void *ptr)
{
free(ptr);
Bfree(ptr);
}
int32_t Bopen(const char *pathname, int32_t flags, uint32_t mode)

View file

@ -157,11 +157,12 @@
/**************************************
Memory routines
**************************************/
#include "compat.h"
#include <stdlib.h> /* malloc, calloc, free */
#define ALLOCATOR(n,s) calloc(n,s)
#define FREEMEM free
#define ALLOCATOR(n,s) Xcalloc(n,s)
#define FREEMEM Bfree
#include <string.h> /* memset, memcpy */
#define MEM_INIT memset
#define MEM_INIT Bmemset
/**************************************

View file

@ -352,7 +352,7 @@ void G_ExtInit(void)
else asperr = -1;
}
if (asperr == 0)
chdir(cwd);
Bchdir(cwd);
Bfree(homedir);
}
}

View file

@ -11021,15 +11021,15 @@ static void G_Startup(void)
if (g_modDir[0] != '/' && (cwd = getcwd(NULL, 0)))
{
chdir(g_modDir);
Bchdir(g_modDir);
if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
{
chdir(cwd);
Bchdir(cwd);
if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
G_GameExit("Failed loading art.");
}
chdir(cwd);
free(cwd);
Bchdir(cwd);
Bfree(cwd);
}
else if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
G_GameExit("Failed loading art.");