This is an automated email from the git hooks/post-receive script. smcv pushed a commit to branch master in repository openjk.
commit 816add8d232554d01599bf14a4e08b2171e278b9 Author: Simon McVittie <[email protected]> Date: Sun Feb 8 21:49:34 2015 +0000 Refresh patches, squash some compiler warnings --- ...renderer-and-clients-to-a-bunch-of-unnece.patch | 56 ++- ...d-QINLINE-to-inline-on-Linux-and-kFreeBSD.patch | 40 +++ ...ompiler-warnings-about-NORETURN-functions.patch | 71 ++++ ...p-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch} | 380 ++++++++++----------- debian/patches/series | 4 +- 5 files changed, 322 insertions(+), 229 deletions(-) diff --git a/debian/patches/Don-t-link-renderer-and-clients-to-a-bunch-of-unnece.patch b/debian/patches/Don-t-link-renderer-and-clients-to-a-bunch-of-unnece.patch index e52b4f5..4ee8075 100644 --- a/debian/patches/Don-t-link-renderer-and-clients-to-a-bunch-of-unnece.patch +++ b/debian/patches/Don-t-link-renderer-and-clients-to-a-bunch-of-unnece.patch @@ -5,43 +5,29 @@ Subject: Don't link renderer and clients to a bunch of unnecessary X11 They only directly use libGL. --- - code/CMakeLists.txt | 2 +- code/rd-vanilla/CMakeLists.txt | 2 +- codemp/CMakeLists.txt | 2 +- codemp/rd-vanilla/CMakeLists.txt | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) + 3 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt -index 567c366..b9d0377 100644 ---- a/code/CMakeLists.txt -+++ b/code/CMakeLists.txt -@@ -30,7 +30,7 @@ if(BuildSPEngine OR BuildJK2SPEngine) - # OpenGL - find_package(OpenGL REQUIRED) - set(SPEngineIncludeDirectories ${SPEngineIncludeDirectories} ${OPENGL_INCLUDE_DIR}) -- set(SPEngineLibraries ${SPEngineLibraries} ${OPENGL_LIBRARIES}) -+ set(SPEngineLibraries ${SPEngineLibraries} ${OPENGL_gl_LIBRARY}) - endif() - - # OpenAL (is optionally included for Windows) diff --git a/code/rd-vanilla/CMakeLists.txt b/code/rd-vanilla/CMakeLists.txt -index 4e00534..9c84912 100644 +index 0c4ed8f..81bc1de 100644 --- a/code/rd-vanilla/CMakeLists.txt +++ b/code/rd-vanilla/CMakeLists.txt -@@ -193,7 +193,7 @@ if(BuildSPRdVanilla OR BuildJK2SPRdVanilla) - if(NOT WIN32) - find_package(OpenGL REQUIRED) - set(SPRDVanillaRendererIncludeDirectories ${SPRDVanillaRendererIncludeDirectories} ${OPENGL_INCLUDE_DIR}) -- set(SPRDVanillaRendererLibraries ${SPRDVanillaRendererLibraries} ${OPENGL_LIBRARIES}) -+ set(SPRDVanillaRendererLibraries ${SPRDVanillaRendererLibraries} ${OPENGL_gl_LIBRARY}) +@@ -177,7 +177,7 @@ if(BuildSPRdVanilla OR BuildJK2SPRdVanilla) + + find_package(OpenGL REQUIRED) + set(SPRDVanillaRendererIncludeDirectories ${SPRDVanillaRendererIncludeDirectories} ${OPENGL_INCLUDE_DIR}) +- set(SPRDVanillaRendererLibraries ${SPRDVanillaRendererLibraries} ${OPENGL_LIBRARIES}) ++ set(SPRDVanillaRendererLibraries ${SPRDVanillaRendererLibraries} ${OPENGL_gl_LIBRARY}) - set(SDL2_BUILDING_LIBRARY ON) # don't want main() in Renderer - find_package(SDL2 REQUIRED) + set(SPRDVanillaRendererIncludeDirectories ${SPRDVanillaRendererIncludeDirectories} ${OpenJKLibDir}) + diff --git a/codemp/CMakeLists.txt b/codemp/CMakeLists.txt -index d6175e0..e5b7064 100644 +index cd09c1c..98620cb 100644 --- a/codemp/CMakeLists.txt +++ b/codemp/CMakeLists.txt -@@ -360,7 +360,7 @@ if(BuildMPEngine) +@@ -349,7 +349,7 @@ if(BuildMPEngine) # OpenGL find_package(OpenGL REQUIRED) set(MPEngineIncludeDirectories ${MPEngineIncludeDirectories} ${OPENGL_INCLUDE_DIR}) @@ -51,15 +37,15 @@ index d6175e0..e5b7064 100644 # OpenAL (is optionally included for Windows) diff --git a/codemp/rd-vanilla/CMakeLists.txt b/codemp/rd-vanilla/CMakeLists.txt -index 1b05ba0..a16d18d 100644 +index bcfe4c9..ba3327c 100644 --- a/codemp/rd-vanilla/CMakeLists.txt +++ b/codemp/rd-vanilla/CMakeLists.txt -@@ -160,7 +160,7 @@ endif() - if(NOT WIN32) - find_package(OpenGL REQUIRED) - set(MPVanillaRendererIncludeDirectories ${MPVanillaRendererIncludeDirectories} ${OPENGL_INCLUDE_DIR}) -- set(MPVanillaRendererLibraries ${MPVanillaRendererLibraries} ${OPENGL_LIBRARIES}) -+ set(MPVanillaRendererLibraries ${MPVanillaRendererLibraries} ${OPENGL_gl_LIBRARY}) +@@ -162,7 +162,7 @@ endif() + + find_package(OpenGL REQUIRED) + set(MPVanillaRendererIncludeDirectories ${MPVanillaRendererIncludeDirectories} ${OPENGL_INCLUDE_DIR}) +-set(MPVanillaRendererLibraries ${MPVanillaRendererLibraries} ${OPENGL_LIBRARIES}) ++set(MPVanillaRendererLibraries ${MPVanillaRendererLibraries} ${OPENGL_gl_LIBRARY}) - set(SDL2_BUILDING_LIBRARY ON) # don't want main() in Renderer - find_package(SDL2 REQUIRED) + set(MPVanillaRendererIncludeDirectories ${MPVanillaRendererIncludeDirectories} ${OpenJKLibDir}) + add_library(${MPVanillaRenderer} SHARED ${MPVanillaRendererFiles}) diff --git a/debian/patches/Expand-QINLINE-to-inline-on-Linux-and-kFreeBSD.patch b/debian/patches/Expand-QINLINE-to-inline-on-Linux-and-kFreeBSD.patch new file mode 100644 index 0000000..0e33a1c --- /dev/null +++ b/debian/patches/Expand-QINLINE-to-inline-on-Linux-and-kFreeBSD.patch @@ -0,0 +1,40 @@ +From: Simon McVittie <[email protected]> +Date: Sun, 8 Feb 2015 16:26:17 +0000 +Subject: Expand QINLINE to inline on Linux (and kFreeBSD) + +This suppresses a lot of compiler warnings about GLimp_LogComment +being unused: gcc warns if a static function is unused, but does not +warn about static inline functions. + +Applied-upstream: 2015-02-08, commit:a175acc +--- + code/qcommon/q_platform.h | 2 +- + codemp/qcommon/q_platform.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/code/qcommon/q_platform.h b/code/qcommon/q_platform.h +index 6578739..daf818d 100644 +--- a/code/qcommon/q_platform.h ++++ b/code/qcommon/q_platform.h +@@ -100,7 +100,7 @@ + #ifdef __clang__ + #define QINLINE static inline + #else +- #define QINLINE /*inline*/ ++ #define QINLINE inline + #endif + + #define PATH_SEP '/' +diff --git a/codemp/qcommon/q_platform.h b/codemp/qcommon/q_platform.h +index 1b3221b..14c9eba 100644 +--- a/codemp/qcommon/q_platform.h ++++ b/codemp/qcommon/q_platform.h +@@ -100,7 +100,7 @@ + #ifdef __clang__ + #define QINLINE static inline + #else +- #define QINLINE /*inline*/ ++ #define QINLINE inline + #endif + + #define PATH_SEP '/' diff --git a/debian/patches/Fix-some-compiler-warnings-about-NORETURN-functions.patch b/debian/patches/Fix-some-compiler-warnings-about-NORETURN-functions.patch new file mode 100644 index 0000000..62913cf --- /dev/null +++ b/debian/patches/Fix-some-compiler-warnings-about-NORETURN-functions.patch @@ -0,0 +1,71 @@ +From: Simon McVittie <[email protected]> +Date: Sun, 8 Feb 2015 16:11:50 +0000 +Subject: Fix some compiler warnings about NORETURN functions + +gcc warns that Com_Crash_f returns (even though in practice it does not), +because a NULL dereference is undefined behaviour. However, abort() +is a standard (ISO C) way to crash the program. + +Similarly, gcc warns that G_Error returns (even though it doesn't +really), because it doesn't know that gi.Error is in fact also NORETURN. + +Applied-upstream: 2015-02-08, commit:a175acc +--- + code/game/g_local.h | 2 +- + code/game/g_public.h | 2 +- + code/qcommon/common.cpp | 2 ++ + codemp/qcommon/common.cpp | 2 ++ + 4 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/code/game/g_local.h b/code/game/g_local.h +index dd50908..b78c0aa 100644 +--- a/code/game/g_local.h ++++ b/code/game/g_local.h +@@ -452,7 +452,7 @@ void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, const char + // g_main.c + // + void G_RunThink (gentity_t *ent); +-void QDECL G_Error( const char *fmt, ... ); ++void QDECL NORETURN G_Error( const char *fmt, ... ); + void SetInUse(gentity_t *ent); + void ClearInUse(gentity_t *ent); + qboolean PInUse(unsigned int entNum); +diff --git a/code/game/g_public.h b/code/game/g_public.h +index 451e965..7c687c8 100644 +--- a/code/game/g_public.h ++++ b/code/game/g_public.h +@@ -146,7 +146,7 @@ typedef struct { + void (*FlushCamFile)(); + + // abort the game +- void (*Error)( int, const char *fmt, ... ); ++ NORETURN void (*Error)( int, const char *fmt, ... ); + + // get current time for profiling reasons + // this should NOT be used for any game related tasks, +diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp +index 26dc848..e110696 100644 +--- a/code/qcommon/common.cpp ++++ b/code/qcommon/common.cpp +@@ -960,6 +960,8 @@ A way to force a bus error for development reasons + */ + static void NORETURN Com_Crash_f( void ) { + * ( volatile int * ) 0 = 0x12345678; ++ /* that should crash already, but to reassure the compiler: */ ++ abort(); + } + + /* +diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp +index c6f763b..7350689 100644 +--- a/codemp/qcommon/common.cpp ++++ b/codemp/qcommon/common.cpp +@@ -979,6 +979,8 @@ A way to force a bus error for development reasons + */ + static void NORETURN Com_Crash_f( void ) { + * ( volatile int * ) 0 = 0x12345678; ++ /* that should crash already, but to reassure the compiler: */ ++ abort(); + } + + /* diff --git a/debian/patches/Use-NET_Sleep-or-Sys_Sleep-for-SP-to-avoid-busy-wait.patch b/debian/patches/Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch similarity index 73% rename from debian/patches/Use-NET_Sleep-or-Sys_Sleep-for-SP-to-avoid-busy-wait.patch rename to debian/patches/Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch index aa0fb1b..97aef4e 100644 --- a/debian/patches/Use-NET_Sleep-or-Sys_Sleep-for-SP-to-avoid-busy-wait.patch +++ b/debian/patches/Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch @@ -1,6 +1,6 @@ From: Simon McVittie <[email protected]> -Date: Wed, 31 Dec 2014 01:00:21 +0000 -Subject: Use NET_Sleep() (or Sys_Sleep() for SP) to avoid busy-waiting +Date: Sun, 8 Feb 2015 16:11:29 +0000 +Subject: Use NET_Sleep() (or Sys_Sleep in SP) to avoid busy-waiting MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit @@ -8,33 +8,43 @@ Content-Transfer-Encoding: 8bit Backported and simplified from an assortment of ioquake3 commits, mostly by Thilo Schulz, with contributions from Zack Middleton and Özkan Sezer. + +Bug: https://github.com/JACoders/OpenJK/issues/507 --- - code/qcommon/common.cpp | 91 +++++++++++++++++++++------------ - code/qcommon/qcommon.h | 6 +-- - code/win32/win_main.cpp | 8 +++ - codemp/null/null_net.c | 11 ---- - codemp/qcommon/common.cpp | 116 +++++++++++++++++++++++++----------------- - codemp/qcommon/net_ip.cpp | 92 ++++++++++++++++++++++++++++----- - codemp/qcommon/qcommon.h | 6 +-- - codemp/server/sv_main.cpp | 32 +++++++++--- - codemp/sys/sys_unix.cpp | 17 ------- - codemp/win32/win_main.cpp | 18 ------- - codemp/win32/win_main_ded.cpp | 16 ------ - 11 files changed, 243 insertions(+), 170 deletions(-) + code/qcommon/common.cpp | 90 +++++++++++++++++++++--------------- + code/qcommon/qcommon.h | 2 +- + code/win32/win_main.cpp | 5 -- + codemp/null/null_net.c | 11 ----- + codemp/qcommon/common.cpp | 115 ++++++++++++++++++++++++++-------------------- + codemp/qcommon/net_ip.cpp | 92 +++++++++++++++++++++++++++++++------ + codemp/qcommon/qcommon.h | 3 +- + codemp/server/sv_main.cpp | 32 +++++++++---- + shared/sys/sys_event.cpp | 23 ---------- + shared/sys/sys_main.cpp | 11 +++-- + shared/sys/sys_public.h | 8 ++-- + 11 files changed, 235 insertions(+), 157 deletions(-) diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp -index a7defc4..927b69e 100644 +index 1f950c0..26dc848 100644 --- a/code/qcommon/common.cpp +++ b/code/qcommon/common.cpp -@@ -52,6 +52,7 @@ cvar_t *sv_paused; - cvar_t *com_skippingcin; - cvar_t *com_speedslog; // 1 = buffer log, 2 = flush after each print - cvar_t *com_homepath; +@@ -41,7 +41,6 @@ cvar_t *com_speeds; + cvar_t *com_developer; + cvar_t *com_timescale; + cvar_t *com_fixedtime; +-cvar_t *com_maxfps; + cvar_t *com_sv_running; + cvar_t *com_cl_running; + cvar_t *com_logfile; // 1 = buffer log, 2 = flush after each print +@@ -57,6 +56,7 @@ cvar_t *com_homepath; + #ifndef _WIN32 + cvar_t *com_ansiColor = NULL; + #endif +cvar_t *com_busyWait; #ifdef G2_PERFORMANCE_ANALYSIS cvar_t *com_G2Report; -@@ -69,7 +70,6 @@ int timeInPVSCheck; +@@ -74,7 +74,6 @@ int timeInPVSCheck; int numTraces; int com_frameTime; @@ -42,7 +52,7 @@ index a7defc4..927b69e 100644 int com_frameNumber = 0; qboolean com_errorEntered = qfalse; -@@ -872,25 +872,6 @@ int Com_EventLoop( void ) { +@@ -874,25 +873,6 @@ int Com_EventLoop( void ) { Cbuf_AddText( (char *)ev.evPtr ); Cbuf_AddText( "\n" ); break; @@ -68,7 +78,16 @@ index a7defc4..927b69e 100644 } // free any block data -@@ -1159,6 +1140,7 @@ void Com_Init( char *commandLine ) { +@@ -1106,8 +1086,6 @@ void Com_Init( char *commandLine ) { + Cmd_AddCommand ("quit", Com_Quit_f); + Cmd_AddCommand ("writeconfig", Com_WriteConfig_f ); + +- com_maxfps = Cvar_Get ("com_maxfps", "125", CVAR_ARCHIVE); +- + com_developer = Cvar_Get ("developer", "0", CVAR_TEMP ); + com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP ); + com_speedslog = Cvar_Get ("speedslog", "0", CVAR_TEMP ); +@@ -1129,6 +1107,7 @@ void Com_Init( char *commandLine ) { com_buildScript = Cvar_Get( "com_buildScript", "0", 0 ); com_affinity = Cvar_Get( "com_affinity", "1", CVAR_ARCHIVE ); @@ -76,7 +95,7 @@ index a7defc4..927b69e 100644 com_bootlogo = Cvar_Get( "com_bootlogo", "1", CVAR_ARCHIVE ); -@@ -1349,6 +1331,26 @@ int Com_ModifyMsec( int msec, float &fraction ) +@@ -1317,6 +1296,26 @@ int Com_ModifyMsec( int msec, float &fraction ) /* ================= @@ -103,32 +122,28 @@ index a7defc4..927b69e 100644 Com_Frame ================= */ -@@ -1374,7 +1376,8 @@ void Com_Frame( void ) { +@@ -1342,7 +1341,8 @@ void Com_Frame( void ) { { int timeBeforeFirstEvents = 0, timeBeforeServer = 0, timeBeforeEvents = 0, timeBeforeClient = 0, timeAfter = 0; int msec, minMsec; - static int lastTime = 0; -+ int timeVal; ++ int timeVal; + static int lastTime = 0, bias = 0; // write config file if anything changed Com_WriteConfiguration(); -@@ -1392,25 +1395,47 @@ void Com_Frame( void ) { +@@ -1354,25 +1354,43 @@ void Com_Frame( void ) { timeBeforeFirstEvents = Sys_Milliseconds (); } - // we may want to spin here if things are going too fast - if ( com_maxfps->integer > 0 ) { -+// Figure out how much time we have -+#if 0 -+ // FIXME: enable this ioquake3 feature one day ++ // Figure out how much time we have + if(com_minimized->integer && com_maxfpsMinimized->integer > 0) + minMsec = 1000 / com_maxfpsMinimized->integer; + else if(com_unfocused->integer && com_maxfpsUnfocused->integer > 0) + minMsec = 1000 / com_maxfpsUnfocused->integer; -+ else -+#endif -+ if(com_maxfps->integer > 0) ++ else if(com_maxfps->integer > 0) minMsec = 1000 / com_maxfps->integer; - } else { + else @@ -174,10 +189,10 @@ index a7defc4..927b69e 100644 msec = Com_ModifyMsec( msec, fractionMsec); diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h -index 03b2c5e..5415d5d 100644 +index 366e236..b8be98a 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h -@@ -594,6 +594,7 @@ unsigned Com_BlockChecksum( const void *buffer, int length ); +@@ -598,6 +598,7 @@ unsigned Com_BlockChecksum( const void *buffer, int length ); int Com_Filter(const char *filter, const char *name, int casesensitive); int Com_FilterPath(const char *filter, const char *name, int casesensitive); qboolean Com_SafeMode( void ); @@ -185,7 +200,7 @@ index 03b2c5e..5415d5d 100644 void Com_StartupVariable( const char *match ); // checks for and removes command line "+set var arg" constructs -@@ -624,7 +625,6 @@ extern int timeInPVSCheck; +@@ -632,7 +633,6 @@ extern int timeInPVSCheck; extern int numTraces; extern int com_frameTime; @@ -193,43 +208,36 @@ index 03b2c5e..5415d5d 100644 extern qboolean com_errorEntered; -@@ -800,8 +800,7 @@ typedef enum { - SE_CHAR, // evValue is an ascii char - SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves - SE_JOYSTICK_AXIS, // evValue is an axis number and evValue2 is the current state (-127 to 127) -- SE_CONSOLE, // evPtr is a char* -- SE_PACKET // evPtr is a netadr_t followed by data bytes to evPtrLength -+ SE_CONSOLE // evPtr is a char* - } sysEventType_t; - - typedef struct { -@@ -865,6 +864,7 @@ const char *Sys_Basename( char *path ); - - char **Sys_ListFiles( const char *directory, const char *extension, char *filter, int *numfiles, qboolean wantsubs ); - void Sys_FreeFileList( char **filelist ); -+void Sys_Sleep(int msec); - - qboolean Sys_LowPhysicalMemory(); - diff --git a/code/win32/win_main.cpp b/code/win32/win_main.cpp -index 30c7f1d..439ee64 100644 +index 30c7f1d..9968597 100644 --- a/code/win32/win_main.cpp +++ b/code/win32/win_main.cpp -@@ -963,6 +963,14 @@ static int ParseCommandLine(char *cmdline, char **argv) - //======================================================================= - //int totalMsec, countMsec; +@@ -685,7 +685,6 @@ EVENT LOOP -+void Sys_Sleep( int msec ) -+{ -+ if( msec <= 0 ) -+ return; -+ -+ Sleep( msec ); -+} -+ - #ifndef DEFAULT_BASEDIR - # define DEFAULT_BASEDIR Sys_BinaryPath() - #endif + sysEvent_t eventQue[MAX_QUED_EVENTS]; + int eventHead, eventTail; +-byte sys_packetReceived[MAX_MSGLEN]; + + /* + ================ +@@ -733,7 +732,6 @@ sysEvent_t Sys_GetEvent( void ) { + MSG msg; + sysEvent_t ev; + char *s; +- msg_t netmsg; + + // return if we have data + if ( eventHead > eventTail ) { +@@ -766,9 +764,6 @@ sysEvent_t Sys_GetEvent( void ) { + Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b ); + } + +- // check for network packets +- MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); +- + // return if we have data + if ( eventHead > eventTail ) { + eventTail++; diff --git a/codemp/null/null_net.c b/codemp/null/null_net.c index c8abf18..37a012a 100644 --- a/codemp/null/null_net.c @@ -250,26 +258,28 @@ index c8abf18..37a012a 100644 - return false; -} diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp -index 55e15f9..f972d6b 100644 +index 7995c5e..c6f763b 100644 --- a/codemp/qcommon/common.cpp +++ b/codemp/qcommon/common.cpp -@@ -18,7 +18,6 @@ cvar_t *com_developer; +@@ -19,9 +19,7 @@ cvar_t *com_developer; cvar_t *com_dedicated; cvar_t *com_timescale; cvar_t *com_fixedtime; -cvar_t *com_dropsim; // 0.0 to 1.0, simulated packet drops cvar_t *com_journal; - cvar_t *com_maxfps; +-cvar_t *com_maxfps; cvar_t *com_timedemo; -@@ -44,6 +43,7 @@ cvar_t *com_minimized; - cvar_t *com_homepath; + cvar_t *com_sv_running; + cvar_t *com_cl_running; +@@ -44,6 +42,7 @@ cvar_t *com_homepath; + #ifndef _WIN32 + cvar_t *com_ansiColor = NULL; + #endif ++cvar_t *com_busyWait; cvar_t *com_affinity; -+cvar_t *com_busyWait; - // com_speeds times - int time_game; -@@ -51,7 +51,6 @@ int time_frontend; // renderer frontend time +@@ -53,7 +52,6 @@ int time_frontend; // renderer frontend time int time_backend; // renderer backend time int com_frameTime; @@ -277,7 +287,7 @@ index 55e15f9..f972d6b 100644 int com_frameNumber; qboolean com_errorEntered = qfalse; -@@ -897,36 +896,6 @@ int Com_EventLoop( void ) { +@@ -892,36 +890,6 @@ int Com_EventLoop( void ) { } Cbuf_AddText( "\n" ); break; @@ -314,15 +324,23 @@ index 55e15f9..f972d6b 100644 } // free any block data -@@ -1222,7 +1191,6 @@ void Com_Init( char *commandLine ) { +@@ -1209,15 +1177,12 @@ void Com_Init( char *commandLine ) { + // + // init commands and vars + // +- com_maxfps = Cvar_Get ("com_maxfps", "125", CVAR_ARCHIVE); +- + com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP ); + + com_timescale = Cvar_Get ("timescale", "1", CVAR_CHEAT | CVAR_SYSTEMINFO ); com_fixedtime = Cvar_Get ("fixedtime", "0", CVAR_CHEAT); com_showtrace = Cvar_Get ("com_showtrace", "0", CVAR_CHEAT); - com_dropsim = Cvar_Get ("com_dropsim", "0", CVAR_CHEAT); - com_viewlog = Cvar_Get( "viewlog", "0", 0 ); com_speeds = Cvar_Get ("com_speeds", "0", 0); com_timedemo = Cvar_Get ("timedemo", "0", 0); -@@ -1244,6 +1212,7 @@ void Com_Init( char *commandLine ) { + com_cameraMode = Cvar_Get ("com_cameraMode", "0", CVAR_CHEAT); +@@ -1238,6 +1203,7 @@ void Com_Init( char *commandLine ) { #endif com_affinity = Cvar_Get( "com_affinity", "1", CVAR_ARCHIVE ); @@ -330,7 +348,7 @@ index 55e15f9..f972d6b 100644 com_bootlogo = Cvar_Get( "com_bootlogo", "1", CVAR_ARCHIVE); -@@ -1442,6 +1411,26 @@ extern int G2Time_PreciseFrame; +@@ -1429,6 +1395,26 @@ extern int G2Time_PreciseFrame; /* ================= @@ -357,17 +375,17 @@ index 55e15f9..f972d6b 100644 Com_Frame ================= */ -@@ -1453,7 +1442,8 @@ void Com_Frame( void ) { +@@ -1440,7 +1426,8 @@ void Com_Frame( void ) { G2PerformanceTimer_PreciseFrame.Start(); #endif int msec, minMsec; - static int lastTime = 0; -+ int timeVal; ++ int timeVal; + static int lastTime = 0, bias = 0; - int timeBeforeFirstEvents; - int timeBeforeServer; -@@ -1488,25 +1478,57 @@ void Com_Frame( void ) { + int timeBeforeFirstEvents = 0; + int timeBeforeServer = 0; +@@ -1458,25 +1445,53 @@ void Com_Frame( void ) { timeBeforeFirstEvents = Sys_Milliseconds (); } @@ -383,15 +401,11 @@ index 55e15f9..f972d6b 100644 + minMsec = SV_FrameMsec(); + else + { -+#if 0 -+ // FIXME: enable this ioquake3 feature one day + if(com_minimized->integer && com_maxfpsMinimized->integer > 0) + minMsec = 1000 / com_maxfpsMinimized->integer; + else if(com_unfocused->integer && com_maxfpsUnfocused->integer > 0) + minMsec = 1000 / com_maxfpsUnfocused->integer; -+ else -+#endif -+ if(com_maxfps->integer > 0) ++ else if(com_maxfps->integer > 0) + minMsec = 1000 / com_maxfps->integer; + else + minMsec = 1; @@ -439,7 +453,7 @@ index 55e15f9..f972d6b 100644 // diff --git a/codemp/qcommon/net_ip.cpp b/codemp/qcommon/net_ip.cpp -index 77b68a5..d405cda 100644 +index 06550cf..498b8ed 100644 --- a/codemp/qcommon/net_ip.cpp +++ b/codemp/qcommon/net_ip.cpp @@ -71,6 +71,8 @@ static cvar_t *net_socksPassword; @@ -477,7 +491,7 @@ index 77b68a5..d405cda 100644 return qfalse; } -@@ -878,6 +880,8 @@ static qboolean NET_GetCvars( void ) { +@@ -865,6 +867,8 @@ static qboolean NET_GetCvars( void ) { modified += net_socksPassword->modified; net_socksPassword->modified = qfalse; @@ -486,7 +500,7 @@ index 77b68a5..d405cda 100644 return modified ? qtrue : qfalse; } -@@ -982,31 +986,91 @@ void NET_Shutdown( void ) { +@@ -969,31 +973,91 @@ void NET_Shutdown( void ) { /* ==================== @@ -589,10 +603,10 @@ index 77b68a5..d405cda 100644 /* diff --git a/codemp/qcommon/qcommon.h b/codemp/qcommon/qcommon.h -index 70522de..6cf7fcf 100644 +index 7907097..685264e 100644 --- a/codemp/qcommon/qcommon.h +++ b/codemp/qcommon/qcommon.h -@@ -733,6 +733,7 @@ int Com_Filter(char *filter, char *name, int casesensitive); +@@ -734,6 +734,7 @@ int Com_Filter(char *filter, char *name, int casesensitive); int Com_FilterPath(char *filter, char *name, int casesensitive); int Com_RealTime(qtime_t *qtime); qboolean Com_SafeMode( void ); @@ -600,7 +614,7 @@ index 70522de..6cf7fcf 100644 void Com_StartupVariable( const char *match ); // checks for and removes command line "+set var arg" constructs -@@ -773,7 +774,6 @@ extern int time_frontend; +@@ -774,7 +775,6 @@ extern int time_frontend; extern int time_backend; // renderer backend time extern int com_frameTime; @@ -608,7 +622,7 @@ index 70522de..6cf7fcf 100644 extern qboolean com_errorEntered; -@@ -953,6 +953,7 @@ void SV_Init( void ); +@@ -954,6 +954,7 @@ void SV_Init( void ); void SV_Shutdown( char *finalmsg ); void SV_Frame( int msec ); void SV_PacketEvent( netadr_t from, msg_t *msg ); @@ -616,18 +630,8 @@ index 70522de..6cf7fcf 100644 qboolean SV_GameCommand( void ); -@@ -986,8 +987,7 @@ typedef enum { - SE_CHAR, // evValue is an ascii char - SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves - SE_JOYSTICK_AXIS, // evValue is an axis number and evValue2 is the current state (-127 to 127) -- SE_CONSOLE, // evPtr is a char* -- SE_PACKET // evPtr is a netadr_t followed by data bytes to evPtrLength -+ SE_CONSOLE // evPtr is a char* - } sysEventType_t; - - typedef struct sysEvent_s { diff --git a/codemp/server/sv_main.cpp b/codemp/server/sv_main.cpp -index 1a9a798..9e9ced9 100644 +index 2f7352f..f2d7d57 100644 --- a/codemp/server/sv_main.cpp +++ b/codemp/server/sv_main.cpp @@ -8,7 +8,7 @@ server_t sv; // local server @@ -635,7 +639,7 @@ index 1a9a798..9e9ced9 100644 cvar_t *sv_snapsMin; // minimum snapshots/sec a client can request, also limited by sv_snapsMax cvar_t *sv_snapsMax; // maximum snapshots/sec a client can request, also limited by sv_fps -cvar_t *sv_fps; // time rate for running non-clients -+cvar_t *sv_fps = NULL; // time rate for running non-clients ++cvar_t *sv_fps = NULL; // time rate for running non-clients cvar_t *sv_timeout; // seconds without any message cvar_t *sv_zombietime; // seconds to sink messages after disconnect cvar_t *sv_rconPassword; // password for remote server commands @@ -683,28 +687,33 @@ index 1a9a798..9e9ced9 100644 // if time is about to hit the 32nd bit, kick all clients // and clear sv.time, rather // than checking for negative time wraparound everywhere. -diff --git a/codemp/sys/sys_unix.cpp b/codemp/sys/sys_unix.cpp -index b20f2eb..df278c3 100644 ---- a/codemp/sys/sys_unix.cpp -+++ b/codemp/sys/sys_unix.cpp -@@ -187,13 +187,10 @@ EVENT LOOP - - sysEvent_t eventQue[MAX_QUED_EVENTS]; - int eventHead, eventTail; --byte sys_packetReceived[MAX_MSGLEN]; +diff --git a/shared/sys/sys_event.cpp b/shared/sys/sys_event.cpp +index 33ff7ca..6756c37 100644 +--- a/shared/sys/sys_event.cpp ++++ b/shared/sys/sys_event.cpp +@@ -15,17 +15,10 @@ EVENT LOOP + + static sysEvent_t eventQue[MAX_QUED_EVENTS] = {}; + static int eventHead = 0, eventTail = 0; +-#if !defined(_JK2EXE) +-static byte sys_packetReceived[MAX_MSGLEN] = {}; +-#endif sysEvent_t Sys_GetEvent( void ) { sysEvent_t ev; char *s; -- msg_t netmsg; +-#if !defined(_JK2EXE) - netadr_t adr; +- msg_t netmsg; +-#endif // return if we have data if ( eventHead > eventTail ) { -@@ -213,20 +210,6 @@ sysEvent_t Sys_GetEvent( void ) { +@@ -45,22 +38,6 @@ sysEvent_t Sys_GetEvent( void ) { Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b ); } +-#if !defined(_JK2EXE) - // check for network packets - MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); - if ( Sys_GetPacket ( &adr, &netmsg ) ) { @@ -718,84 +727,69 @@ index b20f2eb..df278c3 100644 - memcpy( buf+1, netmsg.data, netmsg.cursize ); - Sys_QueEvent( 0, SE_PACKET, 0, 0, len, buf ); - } +-#endif - // return if we have data if ( eventHead > eventTail ) { eventTail++; -diff --git a/codemp/win32/win_main.cpp b/codemp/win32/win_main.cpp -index caef083..7c64108 100644 ---- a/codemp/win32/win_main.cpp -+++ b/codemp/win32/win_main.cpp -@@ -641,7 +641,6 @@ EVENT LOOP - - sysEvent_t eventQue[MAX_QUED_EVENTS]; - int eventHead, eventTail; --byte sys_packetReceived[MAX_MSGLEN]; +diff --git a/shared/sys/sys_main.cpp b/shared/sys/sys_main.cpp +index 3525f8c..25c7f08 100644 +--- a/shared/sys/sys_main.cpp ++++ b/shared/sys/sys_main.cpp +@@ -14,10 +14,11 @@ + static char binaryPath[ MAX_OSPATH ] = { 0 }; + static char installPath[ MAX_OSPATH ] = { 0 }; + +-#ifndef DEDICATED + cvar_t *com_minimized; + cvar_t *com_unfocused; +-#endif ++cvar_t *com_maxfps; ++cvar_t *com_maxfpsMinimized; ++cvar_t *com_maxfpsUnfocused; /* - ================ -@@ -689,8 +688,6 @@ sysEvent_t Sys_GetEvent( void ) { - MSG msg; - sysEvent_t ev; - char *s; -- msg_t netmsg; -- netadr_t adr; + ================= +@@ -132,10 +133,12 @@ void Sys_Init( void ) { + Cmd_AddCommand ("in_restart", IN_Restart); + Cvar_Get( "arch", OS_STRING " " ARCH_STRING, CVAR_ROM ); + Cvar_Get( "username", Sys_GetCurrentUser(), CVAR_ROM ); +-#ifndef DEDICATED ++ + com_unfocused = Cvar_Get( "com_unfocused", "0", CVAR_ROM ); + com_minimized = Cvar_Get( "com_minimized", "0", CVAR_ROM ); +-#endif ++ com_maxfps = Cvar_Get ("com_maxfps", "125", CVAR_ARCHIVE); ++ com_maxfpsUnfocused = Cvar_Get( "com_maxfpsUnfocused", "0", CVAR_ARCHIVE ); ++ com_maxfpsMinimized = Cvar_Get( "com_maxfpsMinimized", "0", CVAR_ARCHIVE ); + } - // return if we have data - if ( eventHead > eventTail ) { -@@ -723,21 +720,6 @@ sysEvent_t Sys_GetEvent( void ) { - Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b ); - } + static void NORETURN Sys_Exit( int ex ) { +diff --git a/shared/sys/sys_public.h b/shared/sys/sys_public.h +index c3b7d5d..623f373 100644 +--- a/shared/sys/sys_public.h ++++ b/shared/sys/sys_public.h +@@ -46,8 +46,7 @@ typedef enum { + SE_CHAR, // evValue is an ascii char + SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves + SE_JOYSTICK_AXIS, // evValue is an axis number and evValue2 is the current state (-127 to 127) +- SE_CONSOLE, // evPtr is a char* +- SE_PACKET // evPtr is a netadr_t followed by data bytes to evPtrLength ++ SE_CONSOLE // evPtr is a char* + } sysEventType_t; -- // check for network packets -- MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); -- if ( Sys_GetPacket ( &adr, &netmsg ) ) { -- netadr_t *buf; -- int len; -- -- // copy out to a seperate buffer for qeueing -- // the readcount stepahead is for SOCKS support -- len = sizeof( netadr_t ) + netmsg.cursize - netmsg.readcount; -- buf = (netadr_t *)Z_Malloc( len, TAG_EVENT, qtrue ); -- *buf = adr; -- memcpy( buf+1, &netmsg.data[netmsg.readcount], netmsg.cursize - netmsg.readcount ); -- Sys_QueEvent( 0, SE_PACKET, 0, 0, len, buf ); -- } -- - // return if we have data - if ( eventHead > eventTail ) { - eventTail++; -diff --git a/codemp/win32/win_main_ded.cpp b/codemp/win32/win_main_ded.cpp -index 6304446..bc88d2d 100644 ---- a/codemp/win32/win_main_ded.cpp -+++ b/codemp/win32/win_main_ded.cpp -@@ -782,7 +782,6 @@ EVENT LOOP - sysEvent_t eventQue[MAX_QUED_EVENTS]; - static int eventHead=0; - static int eventTail=0; --byte sys_packetReceived[MAX_MSGLEN]; + typedef struct sysEvent_s { +@@ -58,10 +57,11 @@ typedef struct sysEvent_s { + void *evPtr; // this must be manually freed if not NULL + } sysEvent_t; - /* - ================ -@@ -864,21 +863,6 @@ sysEvent_t Sys_GetEvent( void ) { - Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b ); - } +-#ifndef DEDICATED + extern cvar_t *com_minimized; + extern cvar_t *com_unfocused; +-#endif ++extern cvar_t *com_maxfps; ++extern cvar_t *com_maxfpsMinimized; ++extern cvar_t *com_maxfpsUnfocused; + + sysEvent_t Sys_GetEvent( void ); -- // check for network packets -- MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); -- if ( Sys_GetPacket ( &adr, &netmsg ) ) { -- netadr_t *buf; -- int len; -- -- // copy out to a seperate buffer for qeueing -- // the readcount stepahead is for SOCKS support -- len = sizeof( netadr_t ) + netmsg.cursize - netmsg.readcount; -- buf = (netadr_t *)Z_Malloc( len, TAG_EVENT, qtrue ); -- *buf = adr; -- memcpy( buf+1, &netmsg.data[netmsg.readcount], netmsg.cursize - netmsg.readcount ); -- Sys_QueEvent( 0, SE_PACKET, 0, 0, len, buf ); -- } -- - // return if we have data - if ( eventHead > eventTail ) { - eventTail++; diff --git a/debian/patches/series b/debian/patches/series index a233f30..4539e44 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,6 @@ g_utils-stub-out-debug-code-to-write-to-a-misc-Windo.patch Don-t-link-renderer-and-clients-to-a-bunch-of-unnece.patch -Use-NET_Sleep-or-Sys_Sleep-for-SP-to-avoid-busy-wait.patch +Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch +Fix-some-compiler-warnings-about-NORETURN-functions.patch +Expand-QINLINE-to-inline-on-Linux-and-kFreeBSD.patch Fix-use-of-uninitialized-variable.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

