From af28013f39960547695df60f477418c280895016 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 10 Jul 2014 09:01:48 +0000 Subject: [PATCH] Lunatic fixes: 1 compiler error. 2 compiler warnings. 1 runtime warning. Note that at this time, CPLUSPLUS=1 LUNATIC=1 fails to build due to C++ function mangling, and Win64 Lunatic crashes. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4540 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/compat.h | 2 ++ polymer/eduke32/build/src/lunatic.c | 8 ++++---- polymer/eduke32/build/src/sdlayer.c | 2 ++ polymer/eduke32/build/src/winlayer.c | 2 ++ polymer/eduke32/source/animvpx.c | 2 ++ polymer/eduke32/source/lunatic/lunacon.lua | 2 +- polymer/eduke32/source/sounds.c | 2 ++ 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index 011539d71..7cfdb8cbd 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -40,7 +40,9 @@ #undef __USE_MINGW_ANSI_STDIO // Workaround for MinGW-w64. #define __STDC_FORMAT_MACROS +#ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS +#endif #ifdef HAVE_INTTYPES # include # include diff --git a/polymer/eduke32/build/src/lunatic.c b/polymer/eduke32/build/src/lunatic.c index 8ca3763c4..3e09101d1 100644 --- a/polymer/eduke32/build/src/lunatic.c +++ b/polymer/eduke32/build/src/lunatic.c @@ -142,7 +142,7 @@ static void L_OnOutOfMem(void) extern void uninitengine(void); OSD_Printf("Out of memory in Lunatic.\n"); uninitengine(); - Bexit(127); + exit(127); } void (*L_ErrorFunc)(const char *) = NULL; @@ -175,11 +175,11 @@ int L_HandleError(lua_State *L, int errcode, void (*ErrorPrintFunc)(const char * } /* unreachable */ -#ifdef NDEBUG - return 0; -#else +#ifndef NDEBUG Bassert(0); #endif + + return 0; } static void L_ErrorPrint(const char *errmsg) diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 5567156d0..9e809faa5 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -5,7 +5,9 @@ // 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 #include // pow #include diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 90e0a4e30..4e9d15e3f 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -51,7 +51,9 @@ #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 #include #include diff --git a/polymer/eduke32/source/animvpx.c b/polymer/eduke32/source/animvpx.c index 03cca37d1..bc6458e24 100644 --- a/polymer/eduke32/source/animvpx.c +++ b/polymer/eduke32/source/animvpx.c @@ -3,7 +3,9 @@ #ifdef USE_LIBVPX #define __STDC_FORMAT_MACROS +#ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS +#endif #include diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index 9d85438c4..f72352e15 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -444,7 +444,7 @@ local function new_initial_gvartab() } -- Reserved bits - gamevar.LOGO_FLAGS.rbits = bit.bnot(65535) + gamevar.LOGO_FLAGS.rbits = bit.bnot(2097151) for w=0,C.MAX_WEAPONS-1 do for i=1,#wmembers do diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index acafb913b..549fd2c51 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -21,7 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #define __STDC_FORMAT_MACROS +#ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS +#endif #include #include