[openjk] 02/05: Imported Upstream version 0~20150524+dfsg1

Simon McVittie smcv at debian.org
Sat Jun 6 18:41:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository openjk.

commit 3684ee354b9ae4d37d0bec38cafeab618fb9e344
Author: Simon McVittie <smcv at debian.org>
Date:   Sat Jun 6 18:37:47 2015 +0100

    Imported Upstream version 0~20150524+dfsg1
---
 CMakeLists.txt                | 54 +++++++++++++++++++++++++++----------------
 code/CMakeLists.txt           |  4 ++--
 code/client/cl_keys.cpp       |  4 ++--
 code/game/NPC_stats.cpp       |  4 ++--
 code/game/g_savegame.cpp      |  2 +-
 code/mp3code/l3.h             | 32 +++----------------------
 code/qcommon/common.cpp       | 10 ++++----
 code/qcommon/cvar.cpp         | 18 +++++++--------
 code/qcommon/stv_version.h    |  6 ++---
 codeJK2/cgame/cg_weapons.cpp  |  4 ++--
 codeJK2/game/g_savegame.cpp   |  2 +-
 codeJK2/icarus/blockstream.h  |  1 +
 codeJK2/icarus/tokenizer.h    |  1 +
 codemp/CMakeLists.txt         |  4 ++--
 codemp/client/cl_cgameapi.cpp |  2 +-
 codemp/client/cl_keys.cpp     |  4 ++--
 codemp/client/cl_uiapi.cpp    |  2 +-
 codemp/game/NPC_spawn.c       |  6 ++---
 codemp/game/g_client.c        |  4 ++--
 codemp/game/w_force.c         |  2 +-
 codemp/mp3code/l3.h           | 32 +++----------------------
 codemp/qcommon/common.cpp     | 10 ++++----
 codemp/qcommon/cvar.cpp       | 18 +++++++--------
 codemp/qcommon/game_version.h |  8 +++----
 codemp/qcommon/vm.cpp         |  4 ++--
 codemp/server/sv_ccmds.cpp    |  8 +++----
 codemp/server/sv_gameapi.cpp  |  2 +-
 27 files changed, 106 insertions(+), 142 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0bd140b..e98b415 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,26 +76,38 @@ endif()
 # Custom CMake Modules needed
 list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/CMakeModules")
 
-# Arch Suffix
-if (CMAKE_SIZEOF_VOID_P MATCHES "8")
-	set(ARCH_BITS 64)
-	if(WIN32)
+# ${Architecture} must match ARCH_STRING in q_platform.h,
+# and is used in DLL names (jagamex86.dll, jagamex86.dylib, jagamei386.so).
+if(WIN32)
+	set(X86 ON)
+	if(CMAKE_SIZEOF_VOID_P MATCHES "8")
 		set(Architecture "x86_64")
 		set(WIN64 TRUE)
 	else()
-		set(Architecture "x86_64")
-	endif()
-else()
-	set(ARCH_BITS 32)
-	if(WIN32)
 		set(Architecture "x86")
 		set(WIN64 FALSE)
-	elseif(APPLE)
-		set(Architecture "x86")
-	elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+	endif()
+else()
+	set(X86 OFF)
+	if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
 		set(Architecture "arm")
+	elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+		set(X86 ON)
+		if(APPLE)
+			set(Architecture "x86")
+		else()
+			# e.g. Linux
+			set(Architecture "i386")
+		endif()
+	elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^x86.64$")
+		set(X86 ON)
+		set(Architecture "x86_64")
+	elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc")
+		set(Architecture "ppc")
+	elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc64")
+		set(Architecture "ppc64")
 	else()
-		set(Architecture "i386")
+		set(Architecture "${CMAKE_SYSTEM_PROCESSOR}")
 	endif()
 endif()
 
@@ -168,7 +180,7 @@ else()
 	set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb")
 	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
 
-	if (NOT Architecture STREQUAL "arm")
+	if (X86)
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
 	endif()
@@ -180,9 +192,12 @@ else()
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-comment")
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
-		if (Architecture STREQUAL "arm")
-			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
-		else()
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
+		if (X86)
+			# "x86 vm will crash without -mstackrealign since MMX
+			# instructions will be used no matter what and they
+			# corrupt the frame pointer in VM calls"
+			# -ioquake3 Makefile
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstackrealign")
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse")
 		endif()
@@ -199,9 +214,8 @@ else()
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-comment")
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
-		if (Architecture STREQUAL "arm")
-			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
-		else()
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
+		if (X86)
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstackrealign")
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse")
 		endif()
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 394c1c5..2cbaead 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -72,7 +72,7 @@ if(BuildSPEngine OR BuildJK2SPEngine)
 	endif()
 
 	if(UseInternalSDL2)
-		if(ARCH_BITS EQUAL 32)
+		if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 			set(SPEngineLibraries
 				${SPEngineLibraries}
 				${OpenJKLibDir}/SDL2/lib/x86/SDL2.lib
@@ -404,7 +404,7 @@ if(BuildSPEngine OR BuildJK2SPEngine)
 		if(WIN32)
 			add_executable(${ProjectName} WIN32 ${SPEngineFiles})
 			if(UseInternalSDL2)
-				if(ARCH_BITS EQUAL 32)
+				if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 					set(SPEngineExtraInstallFiles
 						${OpenJKLibDir}/SDL2/bin/x86/SDL2.dll
 						)
diff --git a/code/client/cl_keys.cpp b/code/client/cl_keys.cpp
index c694bd0..3e57df4 100644
--- a/code/client/cl_keys.cpp
+++ b/code/client/cl_keys.cpp
@@ -1026,7 +1026,7 @@ void Key_Bind_f( void ) {
 
 	if ( c == 2 ) {
 		if ( kg.keys[b].binding && kg.keys[b].binding[0] )
-			Com_Printf( S_COLOR_GREY"Bind "S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n", Key_KeynumToString( b ), kg.keys[b].binding );
+			Com_Printf( S_COLOR_GREY "Bind " S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n", Key_KeynumToString( b ), kg.keys[b].binding );
 		else
 			Com_Printf( "\"%s\" is not bound\n", Key_KeynumToString( b ) );
 		return;
@@ -1066,7 +1066,7 @@ Key_Bindlist_f
 void Key_Bindlist_f( void ) {
 	for ( size_t i=0; i<MAX_KEYS; i++ ) {
 		if ( kg.keys[i].binding && kg.keys[i].binding[0] )
-			Com_Printf( S_COLOR_GREY"Key "S_COLOR_WHITE"%s (%s) = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n", Key_KeynumToAscii( i ), Key_KeynumToString( i ), kg.keys[i].binding );
+			Com_Printf( S_COLOR_GREY "Key " S_COLOR_WHITE "%s (%s) = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n", Key_KeynumToAscii( i ), Key_KeynumToString( i ), kg.keys[i].binding );
 	}
 }
 
diff --git a/code/game/NPC_stats.cpp b/code/game/NPC_stats.cpp
index 94f0467..19611d8 100644
--- a/code/game/NPC_stats.cpp
+++ b/code/game/NPC_stats.cpp
@@ -40,7 +40,7 @@ extern vec3_t playerMins;
 extern vec3_t playerMaxs;
 extern stringID_table_t WPTable[];
 
-#define		MAX_MODELS_PER_LEVEL	40
+#define		MAX_MODELS_PER_LEVEL	60
 
 hstring		modelsAlreadyDone[MAX_MODELS_PER_LEVEL];
 
@@ -214,7 +214,7 @@ qboolean G_ParseLiteral( const char **data, const char *string )
 //
 // NPC parameters file : ext_data/NPCs/*.npc*
 //
-#define MAX_NPC_DATA_SIZE 0x40000
+#define MAX_NPC_DATA_SIZE 0x80000
 char	NPCParms[MAX_NPC_DATA_SIZE];
 
 /*
diff --git a/code/game/g_savegame.cpp b/code/game/g_savegame.cpp
index db3ddf6..9a0e603 100644
--- a/code/game/g_savegame.cpp
+++ b/code/game/g_savegame.cpp
@@ -499,7 +499,7 @@ static void EnumerateField(const save_field_t *pField, const byte *pbBase)
 	}
 }
 
-static void EnumerateFields(const save_field_t *pFields, const byte *pbData, unsigned int ulChid, int iLen)
+static void EnumerateFields(const save_field_t *pFields, const byte *pbData, unsigned int ulChid, size_t iLen)
 {
 	strList = new std::list<sstring_t>;
 
diff --git a/code/mp3code/l3.h b/code/mp3code/l3.h
index eb558ab..992f216 100644
--- a/code/mp3code/l3.h
+++ b/code/mp3code/l3.h
@@ -37,41 +37,15 @@ ____________________________________________________________________________*/
 
 #include "config.h"
 
+#include "qcommon/q_platform.h"
+
 #define GLOBAL_GAIN_SCALE (4*15)
 /* #define GLOBAL_GAIN_SCALE 0 */
 
-#ifdef _WIN32
-#if (defined _M_IX86 || defined __i386__)
-#define LITTLE_ENDIAN 1
-#endif
-
-#if (defined _M_X64 || defined _WIN64 || defined __WIN64__ || defined __x86_64__)
-#define LITTLE_ENDIAN 1
-#endif
-
-#ifdef _M_ALPHA
-#define LITTLE_ENDIAN 1
-#endif
-
-#ifdef sparc
-#define LITTLE_ENDIAN 0
-#endif
-
-#if defined(__POWERPC__)
-#define LITTLE_ENDIAN 0
-#elif defined(__INTEL__)
-#define LITTLE_ENDIAN 1
-#endif
-#endif
-
-#ifndef LITTLE_ENDIAN
-#error Layer III LITTLE_ENDIAN must be defined 0 or 1
-#endif
-
 /*-----------------------------------------------------------*/
 /*---- huffman lookup tables ---*/
 /* endian dependent !!! */
-#if LITTLE_ENDIAN
+#ifdef Q3_LITTLE_ENDIAN
 typedef union
 {
    int ptr;
diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp
index 6819199..e35e37a 100644
--- a/code/qcommon/common.cpp
+++ b/code/qcommon/common.cpp
@@ -1636,7 +1636,7 @@ PrintMatches
 */
 static void PrintMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_GREY"Cmd  "S_COLOR_WHITE"%s\n", s );
+		Com_Printf( S_COLOR_GREY "Cmd  " S_COLOR_WHITE "%s\n", s );
 	}
 }
 
@@ -1650,7 +1650,7 @@ PrintArgMatches
 // This is here for if ever commands with other argument completion
 static void PrintArgMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_WHITE"  %s\n", s );
+		Com_Printf( S_COLOR_WHITE "  %s\n", s );
 	}
 }
 #endif
@@ -1663,7 +1663,7 @@ PrintKeyMatches
 */
 static void PrintKeyMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_GREY"Key  "S_COLOR_WHITE"%s\n", s );
+		Com_Printf( S_COLOR_GREY "Key  " S_COLOR_WHITE "%s\n", s );
 	}
 }
 
@@ -1675,7 +1675,7 @@ PrintFileMatches
 */
 static void PrintFileMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_GREY"File "S_COLOR_WHITE"%s\n", s );
+		Com_Printf( S_COLOR_GREY "File " S_COLOR_WHITE "%s\n", s );
 	}
 }
 
@@ -1690,7 +1690,7 @@ static void PrintCvarMatches( const char *s ) {
 
 	if ( !Q_stricmpn( s, shortestMatch, (int)strlen( shortestMatch ) ) ) {
 		Com_TruncateLongString( value, Cvar_VariableString( s ) );
-		Com_Printf( S_COLOR_GREY"Cvar "S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n", s, value );
+		Com_Printf( S_COLOR_GREY "Cvar " S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n", s, value );
 	}
 }
 
diff --git a/code/qcommon/cvar.cpp b/code/qcommon/cvar.cpp
index e4e71a9..db52984 100644
--- a/code/qcommon/cvar.cpp
+++ b/code/qcommon/cvar.cpp
@@ -489,19 +489,19 @@ Prints the value, default, and latched string of the given variable
 ============
 */
 void Cvar_Print( cvar_t *v ) {
-	Com_Printf( S_COLOR_GREY"Cvar "S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, v->name, v->string );
+	Com_Printf( S_COLOR_GREY "Cvar " S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, v->name, v->string );
 
 	if ( !(v->flags & CVAR_ROM) ) {
 		if ( !Q_stricmp( v->string, v->resetString ) )
-			Com_Printf( ", "S_COLOR_WHITE"the default" );
+			Com_Printf( ", " S_COLOR_WHITE "the default" );
 		else
-			Com_Printf( ", "S_COLOR_WHITE"default = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, v->resetString );
+			Com_Printf( ", " S_COLOR_WHITE "default = " S_COLOR_GREY"\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, v->resetString );
 	}
 
 	Com_Printf( "\n" );
 
 	if ( v->latchedString )
-		Com_Printf( "     latched = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\"\n", v->latchedString );
+		Com_Printf( "     latched = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"\n", v->latchedString );
 }
 
 /*
@@ -969,9 +969,9 @@ void Cvar_List_f( void ) {
 		if (var->flags & CVAR_CHEAT)		Com_Printf( "C" );	else Com_Printf( " " );
 		if (var->flags & CVAR_USER_CREATED)	Com_Printf( "?" );	else Com_Printf( " " );
 
-		Com_Printf( S_COLOR_WHITE" %s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, var->name, var->string );
+		Com_Printf( S_COLOR_WHITE " %s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, var->name, var->string );
 		if ( var->latchedString )
-			Com_Printf( ", latched = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, var->latchedString );
+			Com_Printf( ", latched = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, var->latchedString );
 		Com_Printf( "\n" );
 	}
 
@@ -1008,9 +1008,9 @@ void Cvar_ListModified_f( void ) {
 	{
 		char *value = (*itr)->latchedString ? (*itr)->latchedString : (*itr)->string;
 
-		Com_Printf( S_COLOR_GREY"Cvar "
-			S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE", "
-			S_COLOR_WHITE"default = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n",
+		Com_Printf( S_COLOR_GREY "Cvar "
+			S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE ", "
+			S_COLOR_WHITE "default = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n",
 			(*itr)->name, value, (*itr)->resetString );
 	}
 }
diff --git a/code/qcommon/stv_version.h b/code/qcommon/stv_version.h
index a4a2a03..be9f98c 100644
--- a/code/qcommon/stv_version.h
+++ b/code/qcommon/stv_version.h
@@ -24,11 +24,11 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "../win32/AutoVersion.h"
 
 #ifdef _DEBUG
-	#define	Q3_VERSION		"(debug)OpenJK: v"VERSION_STRING_DOTTED
+	#define	Q3_VERSION		"(debug)OpenJK: v" VERSION_STRING_DOTTED
 #elif defined FINAL_BUILD
-	#define	Q3_VERSION		"OpenJK: v"VERSION_STRING_DOTTED
+	#define	Q3_VERSION		"OpenJK: v" VERSION_STRING_DOTTED
 #else
-	#define	Q3_VERSION		"(internal)OpenJK: v"VERSION_STRING_DOTTED
+	#define	Q3_VERSION		"(internal)OpenJK: v" VERSION_STRING_DOTTED
 #endif
 // end
 
diff --git a/codeJK2/cgame/cg_weapons.cpp b/codeJK2/cgame/cg_weapons.cpp
index d8f5e42..a03fe02 100644
--- a/codeJK2/cgame/cg_weapons.cpp
+++ b/codeJK2/cgame/cg_weapons.cpp
@@ -215,11 +215,11 @@ void CG_RegisterWeapon( int weaponNum ) {
 	// give ourselves the functions if we can
 	if (weaponData[weaponNum].func)
 	{
-		weaponInfo->missileTrailFunc = (void (__cdecl *)(struct centity_s *,const struct weaponInfo_s *))weaponData[weaponNum].func;
+		weaponInfo->missileTrailFunc = (void (QDECL *)(struct centity_s *,const struct weaponInfo_s *))weaponData[weaponNum].func;
 	}
 	if (weaponData[weaponNum].altfunc)
 	{
-		weaponInfo->alt_missileTrailFunc = (void (__cdecl *)(struct centity_s *,const struct weaponInfo_s *))weaponData[weaponNum].altfunc;
+		weaponInfo->alt_missileTrailFunc = (void (QDECL *)(struct centity_s *,const struct weaponInfo_s *))weaponData[weaponNum].altfunc;
 	}
 
 	switch ( weaponNum )	//extra client only stuff
diff --git a/codeJK2/game/g_savegame.cpp b/codeJK2/game/g_savegame.cpp
index 43013ec..22030ea 100644
--- a/codeJK2/game/g_savegame.cpp
+++ b/codeJK2/game/g_savegame.cpp
@@ -441,7 +441,7 @@ void EnumerateField(const field_t *pField, byte *pbBase)
 	}
 }
 
-static void EnumerateFields(const field_t *pFields, byte *pbData, unsigned int ulChid, int iLen)
+static void EnumerateFields(const field_t *pFields, byte *pbData, unsigned int ulChid, size_t iLen)
 {
 	strList = new list<sstring_t>;
 
diff --git a/codeJK2/icarus/blockstream.h b/codeJK2/icarus/blockstream.h
index 18afb11..2cc3797 100644
--- a/codeJK2/icarus/blockstream.h
+++ b/codeJK2/icarus/blockstream.h
@@ -32,6 +32,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #ifdef _MSC_VER
 	#pragma warning (push, 3)	//go back down to 3 for the stl include
diff --git a/codeJK2/icarus/tokenizer.h b/codeJK2/icarus/tokenizer.h
index aecb6ef..2556e08 100644
--- a/codeJK2/icarus/tokenizer.h
+++ b/codeJK2/icarus/tokenizer.h
@@ -26,6 +26,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #define __TOKENIZER_H
 
 #include <string>
+#include <string.h>
 #include <vector>
 #include <map>
 
diff --git a/codemp/CMakeLists.txt b/codemp/CMakeLists.txt
index 31a80d5..b031541 100644
--- a/codemp/CMakeLists.txt
+++ b/codemp/CMakeLists.txt
@@ -388,7 +388,7 @@ if(BuildMPEngine)
 	endif()
 
 	if(UseInternalSDL2)
-		if(ARCH_BITS EQUAL 32)
+		if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 			set(MPEngineLibraries
 				${MPEngineLibraries}
 				${OpenJKLibDir}/SDL2/lib/x86/SDL2.lib
@@ -569,7 +569,7 @@ if(BuildMPEngine)
 	if(WIN32)
 		add_executable(${MPEngine} WIN32 ${MPEngineFiles})
 		if(UseInternalSDL2)
-			if(ARCH_BITS EQUAL 32)
+			if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 				set(MPEngineExtraInstallFiles
 					${OpenJKLibDir}/SDL2/bin/x86/SDL2.dll
 					)
diff --git a/codemp/client/cl_cgameapi.cpp b/codemp/client/cl_cgameapi.cpp
index d3df9bf..4d90f44 100644
--- a/codemp/client/cl_cgameapi.cpp
+++ b/codemp/client/cl_cgameapi.cpp
@@ -1647,7 +1647,7 @@ void CL_BindCGame( void ) {
 	static cgameImport_t cgi;
 	cgameExport_t		*ret;
 	GetCGameAPI_t		GetCGameAPI;
-	char				dllName[MAX_OSPATH] = "cgame"ARCH_STRING DLL_EXT;
+	char				dllName[MAX_OSPATH] = "cgame" ARCH_STRING DLL_EXT;
 
 	memset( &cgi, 0, sizeof( cgi ) );
 
diff --git a/codemp/client/cl_keys.cpp b/codemp/client/cl_keys.cpp
index 4e24942..93fb8df 100644
--- a/codemp/client/cl_keys.cpp
+++ b/codemp/client/cl_keys.cpp
@@ -1085,7 +1085,7 @@ void Key_Bind_f( void ) {
 
 	if ( c == 2 ) {
 		if ( kg.keys[b].binding && kg.keys[b].binding[0] )
-			Com_Printf( S_COLOR_GREY"Bind "S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n", Key_KeynumToString( b ), kg.keys[b].binding );
+			Com_Printf( S_COLOR_GREY "Bind " S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n", Key_KeynumToString( b ), kg.keys[b].binding );
 		else
 			Com_Printf( "\"%s\" is not bound\n", Key_KeynumToString( b ) );
 		return;
@@ -1125,7 +1125,7 @@ Key_Bindlist_f
 void Key_Bindlist_f( void ) {
 	for ( size_t i=0; i<MAX_KEYS; i++ ) {
 		if ( kg.keys[i].binding && kg.keys[i].binding[0] )
-			Com_Printf( S_COLOR_GREY"Key "S_COLOR_WHITE"%s (%s) = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n", Key_KeynumToAscii( i ), Key_KeynumToString( i ), kg.keys[i].binding );
+			Com_Printf( S_COLOR_GREY "Key " S_COLOR_WHITE "%s (%s) = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n", Key_KeynumToAscii( i ), Key_KeynumToString( i ), kg.keys[i].binding );
 	}
 }
 
diff --git a/codemp/client/cl_uiapi.cpp b/codemp/client/cl_uiapi.cpp
index 1de9a59..8921aa6 100644
--- a/codemp/client/cl_uiapi.cpp
+++ b/codemp/client/cl_uiapi.cpp
@@ -1044,7 +1044,7 @@ void CL_BindUI( void ) {
 	static uiImport_t uii;
 	uiExport_t		*ret;
 	GetUIAPI_t		GetUIAPI;
-	char			dllName[MAX_OSPATH] = "ui"ARCH_STRING DLL_EXT;
+	char			dllName[MAX_OSPATH] = "ui" ARCH_STRING DLL_EXT;
 
 	memset( &uii, 0, sizeof( uii ) );
 
diff --git a/codemp/game/NPC_spawn.c b/codemp/game/NPC_spawn.c
index 4c17a4e..883550d 100644
--- a/codemp/game/NPC_spawn.c
+++ b/codemp/game/NPC_spawn.c
@@ -1419,7 +1419,7 @@ gentity_t *NPC_Spawn_Do( gentity_t *ent )
 
 	if ( newent == NULL )
 	{
-		Com_Printf ( S_COLOR_RED"ERROR: NPC G_Spawn failed\n" );
+		Com_Printf ( S_COLOR_RED "ERROR: NPC G_Spawn failed\n" );
 		return NULL;
 	}
 
@@ -1428,7 +1428,7 @@ gentity_t *NPC_Spawn_Do( gentity_t *ent )
 	newent->NPC = New_NPC_t(newent->s.number);
 	if ( newent->NPC == NULL )
 	{
-		Com_Printf ( S_COLOR_RED"ERROR: NPC G_Alloc NPC failed\n" );
+		Com_Printf ( S_COLOR_RED "ERROR: NPC G_Alloc NPC failed\n" );
 		goto finish;
 	//	return NULL;
 	}
@@ -1451,7 +1451,7 @@ gentity_t *NPC_Spawn_Do( gentity_t *ent )
 
 	if ( newent->client == NULL )
 	{
-		Com_Printf ( S_COLOR_RED"ERROR: NPC BG_Alloc client failed\n" );
+		Com_Printf ( S_COLOR_RED "ERROR: NPC BG_Alloc client failed\n" );
 		goto finish;
 	//	return NULL;
 	}
diff --git a/codemp/game/g_client.c b/codemp/game/g_client.c
index d2a2c57..80cc113 100644
--- a/codemp/game/g_client.c
+++ b/codemp/game/g_client.c
@@ -2160,7 +2160,7 @@ qboolean ClientUserinfoChanged( int clientNum ) {
 			Q_StripColor( client->pers.netname_nocolor );
 		}
 		else {
-			trap->SendServerCommand( -1, va( "print \"%s"S_COLOR_WHITE" %s %s\n\"", oldname, G_GetStringEdString( "MP_SVGAME", "PLRENAME" ), client->pers.netname ) );
+			trap->SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " %s %s\n\"", oldname, G_GetStringEdString( "MP_SVGAME", "PLRENAME" ), client->pers.netname ) );
 			G_LogPrintf( "ClientRename: %i [%s] (%s) \"%s^7\" -> \"%s^7\"\n", clientNum, ent->client->sess.IP, ent->client->pers.guid, oldname, ent->client->pers.netname );
 			client->pers.netnameTime = level.time + 5000;
 		}
@@ -2316,7 +2316,7 @@ qboolean ClientUserinfoChanged( int clientNum ) {
 
 	s = Info_ValueForKey( userinfo, "snaps" );
 	if ( atoi( s ) < sv_fps.integer )
-		trap->SendServerCommand( clientNum, va( "print \""S_COLOR_YELLOW"Recommend setting /snaps %d or higher to match this server's sv_fps\n\"", sv_fps.integer ) );
+		trap->SendServerCommand( clientNum, va( "print \"" S_COLOR_YELLOW "Recommend setting /snaps %d or higher to match this server's sv_fps\n\"", sv_fps.integer ) );
 
 	// send over a subset of the userinfo keys so other clients can
 	// print scoreboards, display models, and play custom sounds
diff --git a/codemp/game/w_force.c b/codemp/game/w_force.c
index e2b1ca4..64e4f87 100644
--- a/codemp/game/w_force.c
+++ b/codemp/game/w_force.c
@@ -228,7 +228,7 @@ void WP_InitForcePowers( gentity_t *ent ) {
 
 	if ( strlen( forcePowers ) != DEFAULT_FORCEPOWERS_LEN ) {
 		Q_strncpyz( forcePowers, DEFAULT_FORCEPOWERS, sizeof( forcePowers ) );
-		trap->SendServerCommand( ent-g_entities, "print \""S_COLOR_RED"Invalid forcepowers string, setting default\n\"" );
+		trap->SendServerCommand( ent-g_entities, "print \"" S_COLOR_RED "Invalid forcepowers string, setting default\n\"" );
 	}
 
 	//if it's a bot just copy the info directly from its personality
diff --git a/codemp/mp3code/l3.h b/codemp/mp3code/l3.h
index 0f650a7..f1f1e1d 100644
--- a/codemp/mp3code/l3.h
+++ b/codemp/mp3code/l3.h
@@ -37,41 +37,15 @@ ____________________________________________________________________________*/
 
 #include "config.h"
 
+#include "qcommon/q_platform.h"
+
 #define GLOBAL_GAIN_SCALE (4*15)
 /* #define GLOBAL_GAIN_SCALE 0 */
 
-#ifdef _WIN32
-#if (defined _M_IX86 || defined __i386__)
-#define LITTLE_ENDIAN 1
-#endif
-
-#if (defined _M_X64 || defined _WIN64 || defined __WIN64__ || defined __x86_64__)
-#define LITTLE_ENDIAN 1
-#endif
-
-#ifdef _M_ALPHA
-#define LITTLE_ENDIAN 1
-#endif
-
-#ifdef sparc
-#define LITTLE_ENDIAN 0
-#endif
-
-#if defined(__POWERPC__)
-#define LITTLE_ENDIAN 0
-#elif defined(__INTEL__)
-#define LITTLE_ENDIAN 1
-#endif
-#endif
-
-#ifndef LITTLE_ENDIAN
-#error Layer III LITTLE_ENDIAN must be defined 0 or 1
-#endif
-
 /*-----------------------------------------------------------*/
 /*---- huffman lookup tables ---*/
 /* endian dependent !!! */
-#if LITTLE_ENDIAN
+#ifdef Q3_LITTLE_ENDIAN
 typedef union
 {
    int ptr;
diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp
index 742ad17..b1d83af 100644
--- a/codemp/qcommon/common.cpp
+++ b/codemp/qcommon/common.cpp
@@ -1722,7 +1722,7 @@ PrintMatches
 */
 static void PrintMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_GREY"Cmd  "S_COLOR_WHITE"%s\n", s );
+		Com_Printf( S_COLOR_GREY "Cmd  " S_COLOR_WHITE "%s\n", s );
 	}
 }
 
@@ -1736,7 +1736,7 @@ PrintArgMatches
 // This is here for if ever commands with other argument completion
 static void PrintArgMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_WHITE"  %s\n", s );
+		Com_Printf( S_COLOR_WHITE "  %s\n", s );
 	}
 }
 #endif
@@ -1750,7 +1750,7 @@ PrintKeyMatches
 */
 static void PrintKeyMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_GREY"Key  "S_COLOR_WHITE"%s\n", s );
+		Com_Printf( S_COLOR_GREY "Key  " S_COLOR_WHITE "%s\n", s );
 	}
 }
 #endif
@@ -1763,7 +1763,7 @@ PrintFileMatches
 */
 static void PrintFileMatches( const char *s ) {
 	if ( !Q_stricmpn( s, shortestMatch, strlen( shortestMatch ) ) ) {
-		Com_Printf( S_COLOR_GREY"File "S_COLOR_WHITE"%s\n", s );
+		Com_Printf( S_COLOR_GREY "File " S_COLOR_WHITE "%s\n", s );
 	}
 }
 
@@ -1778,7 +1778,7 @@ static void PrintCvarMatches( const char *s ) {
 
 	if ( !Q_stricmpn( s, shortestMatch, (int)strlen( shortestMatch ) ) ) {
 		Com_TruncateLongString( value, Cvar_VariableString( s ) );
-		Com_Printf( S_COLOR_GREY"Cvar "S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n", s, value );
+		Com_Printf( S_COLOR_GREY "Cvar " S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n", s, value );
 	}
 }
 
diff --git a/codemp/qcommon/cvar.cpp b/codemp/qcommon/cvar.cpp
index b6f9691..1a648db 100644
--- a/codemp/qcommon/cvar.cpp
+++ b/codemp/qcommon/cvar.cpp
@@ -485,19 +485,19 @@ Prints the value, default, and latched string of the given variable
 ============
 */
 void Cvar_Print( cvar_t *v ) {
-	Com_Printf( S_COLOR_GREY"Cvar "S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, v->name, v->string );
+	Com_Printf( S_COLOR_GREY "Cvar " S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, v->name, v->string );
 
 	if ( !(v->flags & CVAR_ROM) ) {
 		if ( !Q_stricmp( v->string, v->resetString ) )
-			Com_Printf( ", "S_COLOR_WHITE"the default" );
+			Com_Printf( ", " S_COLOR_WHITE "the default" );
 		else
-			Com_Printf( ", "S_COLOR_WHITE"default = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, v->resetString );
+			Com_Printf( ", " S_COLOR_WHITE "default = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, v->resetString );
 	}
 
 	Com_Printf( "\n" );
 
 	if ( v->latchedString )
-		Com_Printf( "     latched = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\"\n", v->latchedString );
+		Com_Printf( "     latched = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"\n", v->latchedString );
 }
 
 /*
@@ -1088,9 +1088,9 @@ void Cvar_List_f( void ) {
 		if (var->flags & CVAR_CHEAT)		Com_Printf( "C" );	else Com_Printf( " " );
 		if (var->flags & CVAR_USER_CREATED)	Com_Printf( "?" );	else Com_Printf( " " );
 
-		Com_Printf( S_COLOR_WHITE" %s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, var->name, var->string );
+		Com_Printf( S_COLOR_WHITE " %s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, var->name, var->string );
 		if ( var->latchedString )
-			Com_Printf( ", latched = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE, var->latchedString );
+			Com_Printf( ", latched = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE, var->latchedString );
 		Com_Printf( "\n" );
 	}
 
@@ -1127,9 +1127,9 @@ void Cvar_ListModified_f( void ) {
 	{
 		char *value = (*itr)->latchedString ? (*itr)->latchedString : (*itr)->string;
 
-		Com_Printf( S_COLOR_GREY"Cvar "
-			S_COLOR_WHITE"%s = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE", "
-			S_COLOR_WHITE"default = "S_COLOR_GREY"\""S_COLOR_WHITE"%s"S_COLOR_GREY"\""S_COLOR_WHITE"\n",
+		Com_Printf( S_COLOR_GREY "Cvar "
+			S_COLOR_WHITE "%s = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE ", "
+			S_COLOR_WHITE "default = " S_COLOR_GREY "\"" S_COLOR_WHITE "%s" S_COLOR_GREY "\"" S_COLOR_WHITE "\n",
 			(*itr)->name, value, (*itr)->resetString );
 	}
 }
diff --git a/codemp/qcommon/game_version.h b/codemp/qcommon/game_version.h
index 032554d..a0988af 100644
--- a/codemp/qcommon/game_version.h
+++ b/codemp/qcommon/game_version.h
@@ -33,9 +33,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #define VERSION_STRING_DOTTED STR(VERSION_MAJOR_RELEASE) "." STR(VERSION_MINOR_RELEASE) "." STR(VERSION_EXTERNAL_BUILD) "." STR(VERSION_INTERNAL_BUILD) // "a.b.c.d"
 
 #if defined(_DEBUG)
-	#define	JK_VERSION		"(debug)OpenJK-MP: v"VERSION_STRING_DOTTED
-	#define JK_VERSION_OLD	"(debug)JAmp: v"VERSION_STRING_DOTTED
+	#define	JK_VERSION		"(debug)OpenJK-MP: v" VERSION_STRING_DOTTED
+	#define JK_VERSION_OLD	"(debug)JAmp: v" VERSION_STRING_DOTTED
 #else
-	#define	JK_VERSION		"OpenJK-MP: v"VERSION_STRING_DOTTED
-	#define JK_VERSION_OLD	"JAmp: v"VERSION_STRING_DOTTED
+	#define	JK_VERSION		"OpenJK-MP: v" VERSION_STRING_DOTTED
+	#define JK_VERSION_OLD	"JAmp: v" VERSION_STRING_DOTTED
 #endif
diff --git a/codemp/qcommon/vm.cpp b/codemp/qcommon/vm.cpp
index 4352b85..c1f810d 100644
--- a/codemp/qcommon/vm.cpp
+++ b/codemp/qcommon/vm.cpp
@@ -137,7 +137,7 @@ vm_t *VM_CreateLegacy( vmSlots_t vmSlot, intptr_t( *systemCalls )(intptr_t *) )
 	FS_FindPureDLL( vm->name );
 	vm->dllHandle = Sys_LoadLegacyGameDll( vm->name, &vm->legacy.main, VM_DllSyscall );
 
-	Com_Printf( "VM_CreateLegacy: %s"ARCH_STRING DLL_EXT, vm->name );
+	Com_Printf( "VM_CreateLegacy: %s" ARCH_STRING DLL_EXT, vm->name );
 	if ( vm->dllHandle ) {
 		if ( com_developer->integer )
 			Com_Printf( " succeeded [0x%" PRIxPTR "]\n", (uintptr_t)vm->dllHandle );
@@ -176,7 +176,7 @@ vm_t *VM_Create( vmSlots_t vmSlot ) {
 	FS_FindPureDLL( vm->name );
 	vm->dllHandle = Sys_LoadGameDll( vm->name, &vm->GetModuleAPI );
 
-	Com_Printf( "VM_Create: %s"ARCH_STRING DLL_EXT, vm->name );
+	Com_Printf( "VM_Create: %s" ARCH_STRING DLL_EXT, vm->name );
 	if ( vm->dllHandle ) {
 		if ( com_developer->integer )
 			Com_Printf( " succeeded [0x%" PRIxPTR "+0x%" PRIxPTR "]\n", vm->dllHandle, (intptr_t)vm->GetModuleAPI - (intptr_t)vm->dllHandle );
diff --git a/codemp/server/sv_ccmds.cpp b/codemp/server/sv_ccmds.cpp
index 0a98759..bf6b501 100644
--- a/codemp/server/sv_ccmds.cpp
+++ b/codemp/server/sv_ccmds.cpp
@@ -1249,8 +1249,8 @@ static void SV_ConSay_f(void) {
 
 	Cmd_ArgsBuffer( text, sizeof(text) );
 
-	Com_Printf ("broadcast: chat \""SVSAY_PREFIX"%s\\n\"\n", SV_ExpandNewlines((char *)text) );
-	SV_SendServerCommand(NULL, "chat \""SVSAY_PREFIX"%s\"\n", text);
+	Com_Printf ("broadcast: chat \"" SVSAY_PREFIX "%s\\n\"\n", SV_ExpandNewlines((char *)text) );
+	SV_SendServerCommand(NULL, "chat \"" SVSAY_PREFIX "%s\"\n", text);
 }
 
 #define SVTELL_PREFIX "\x19[Server^7\x19]\x19: "
@@ -1287,8 +1287,8 @@ static void SV_ConTell_f(void) {
 
 	Cmd_ArgsFromBuffer( 2, text, sizeof(text) );
 
-	Com_Printf ("tell: svtell to %s"S_COLOR_WHITE": %s\n", cl->name, SV_ExpandNewlines((char *)text) );
-	SV_SendServerCommand(cl, "chat \""SVTELL_PREFIX S_COLOR_MAGENTA"%s"S_COLOR_WHITE"\"\n", text);
+	Com_Printf ("tell: svtell to %s" S_COLOR_WHITE ": %s\n", cl->name, SV_ExpandNewlines((char *)text) );
+	SV_SendServerCommand(cl, "chat \"" SVTELL_PREFIX S_COLOR_MAGENTA "%s" S_COLOR_WHITE "\"\n", text);
 }
 
 const char *forceToggleNamePrints[NUM_FORCE_POWERS] = {
diff --git a/codemp/server/sv_gameapi.cpp b/codemp/server/sv_gameapi.cpp
index fbc6679..60190f5 100644
--- a/codemp/server/sv_gameapi.cpp
+++ b/codemp/server/sv_gameapi.cpp
@@ -2882,7 +2882,7 @@ void SV_BindGame( void ) {
 	static gameImport_t gi;
 	gameExport_t		*ret;
 	GetGameAPI_t		GetGameAPI;
-	char				dllName[MAX_OSPATH] = "jampgame"ARCH_STRING DLL_EXT;
+	char				dllName[MAX_OSPATH] = "jampgame" ARCH_STRING DLL_EXT;
 
 	memset( &gi, 0, sizeof( gi ) );
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list