aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
Diffstat (limited to 'code')
-rw-r--r--code/botlib/be_interface.c2
-rw-r--r--code/botlib/l_precomp.c4
-rw-r--r--code/game/g_client.c6
-rw-r--r--code/q3_ui/ui_connect.c2
-rw-r--r--code/renderer/qgl.h6
-rw-r--r--code/sdl/sdl_gamma.c7
-rw-r--r--code/sdl/sdl_glimp.c12
-rw-r--r--code/sdl/sdl_input.c6
-rw-r--r--code/sdl/sdl_snd.c6
-rw-r--r--code/sys/sys_main.c20
-rw-r--r--code/sys/win_resource.rc5
-rw-r--r--code/tools/asm/q3asm.c11
-rw-r--r--code/ui/ui_main.c3
13 files changed, 61 insertions, 29 deletions
diff --git a/code/botlib/be_interface.c b/code/botlib/be_interface.c
index 9ef6756..5418635 100644
--- a/code/botlib/be_interface.c
+++ b/code/botlib/be_interface.c
@@ -136,7 +136,7 @@ qboolean BotLibSetup(char *str)
int Export_BotLibSetup(void)
{
int errnum;
- char logfilename[MAX_QPATH];
+ char logfilename[MAX_OSPATH];
char *homedir, *gamedir;
bot_developer = LibVarGetValue("bot_developer");
diff --git a/code/botlib/l_precomp.c b/code/botlib/l_precomp.c
index 91b9a7b..8b5e4d3 100644
--- a/code/botlib/l_precomp.c
+++ b/code/botlib/l_precomp.c
@@ -705,11 +705,7 @@ int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define
token_t **firsttoken, token_t **lasttoken)
{
token_t *token;
-#ifdef _WIN32
- unsigned long t; // time_t t; //to prevent LCC warning
-#else
time_t t;
-#endif
char *curtime;
diff --git a/code/game/g_client.c b/code/game/g_client.c
index 5414240..575d2e0 100644
--- a/code/game/g_client.c
+++ b/code/game/g_client.c
@@ -629,7 +629,7 @@ static void ClientCleanName( const char *in, char *out, int outSize ) {
}
// don't allow leading spaces
- if( !*p && ch == ' ' ) {
+ if( colorlessLen == 0 && ch == ' ' ) {
continue;
}
@@ -658,11 +658,15 @@ static void ClientCleanName( const char *in, char *out, int outSize ) {
}
// don't allow too many consecutive spaces
+ // don't count spaces in colorlessLen
if( ch == ' ' ) {
spaces++;
if( spaces > 3 ) {
continue;
}
+ *out++ = ch;
+ len++;
+ continue;
}
else {
spaces = 0;
diff --git a/code/q3_ui/ui_connect.c b/code/q3_ui/ui_connect.c
index 0db89a2..27db956 100644
--- a/code/q3_ui/ui_connect.c
+++ b/code/q3_ui/ui_connect.c
@@ -94,7 +94,7 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
UI_DrawProportionalString( 8, 224, xferText, style, color_white );
if (downloadSize > 0) {
- s = va( "%s (%d%%)", downloadName, downloadCount * 100 / downloadSize );
+ s = va( "%s (%d%%)", downloadName, (int)( (float)downloadCount * 100.0f / downloadSize ) );
} else {
s = downloadName;
}
diff --git a/code/renderer/qgl.h b/code/renderer/qgl.h
index dcbc04d..5296193 100644
--- a/code/renderer/qgl.h
+++ b/code/renderer/qgl.h
@@ -26,7 +26,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef __QGL_H__
#define __QGL_H__
-#include "SDL_opengl.h"
+#ifdef USE_LOCAL_HEADERS
+# include "SDL_opengl.h"
+#else
+# include <SDL_opengl.h>
+#endif
extern void (APIENTRYP qglActiveTextureARB) (GLenum texture);
extern void (APIENTRYP qglClientActiveTextureARB) (GLenum texture);
diff --git a/code/sdl/sdl_gamma.c b/code/sdl/sdl_gamma.c
index 2673700..71a42c8 100644
--- a/code/sdl/sdl_gamma.c
+++ b/code/sdl/sdl_gamma.c
@@ -20,7 +20,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#include "SDL.h"
+#ifdef USE_LOCAL_HEADERS
+# include "SDL.h"
+#else
+# include <SDL.h>
+#endif
+
#include "../renderer/tr_local.h"
#include "../qcommon/qcommon.h"
diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c
index 5befe19..c5954ac 100644
--- a/code/sdl/sdl_glimp.c
+++ b/code/sdl/sdl_glimp.c
@@ -20,7 +20,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#include "SDL.h"
+#ifdef USE_LOCAL_HEADERS
+# include "SDL.h"
+#else
+# include <SDL.h>
+#endif
#if !SDL_VERSION_ATLEAST(1, 2, 10)
#define SDL_GL_ACCELERATED_VISUAL 15
@@ -30,7 +34,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#ifdef SMP
-#include "SDL_thread.h"
+# ifdef USE_LOCAL_HEADERS
+# include "SDL_thread.h"
+# else
+# include <SDL_thread.h>
+# endif
#endif
#include <stdarg.h>
diff --git a/code/sdl/sdl_input.c b/code/sdl/sdl_input.c
index 2e610a8..0663c7f 100644
--- a/code/sdl/sdl_input.c
+++ b/code/sdl/sdl_input.c
@@ -20,7 +20,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#include "SDL.h"
+#ifdef USE_LOCAL_HEADERS
+# include "SDL.h"
+#else
+# include <SDL.h>
+#endif
#include <stdarg.h>
#include <stdio.h>
diff --git a/code/sdl/sdl_snd.c b/code/sdl/sdl_snd.c
index dfc2316..a131db7 100644
--- a/code/sdl/sdl_snd.c
+++ b/code/sdl/sdl_snd.c
@@ -23,7 +23,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <stdlib.h>
#include <stdio.h>
-#include "SDL.h"
+#ifdef USE_LOCAL_HEADERS
+# include "SDL.h"
+#else
+# include <SDL.h>
+#endif
#include "../qcommon/q_shared.h"
#include "../client/snd_local.h"
diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c
index dcefa78..453b082 100644
--- a/code/sys/sys_main.c
+++ b/code/sys/sys_main.c
@@ -19,13 +19,11 @@ along with Quake III Arena source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#include <unistd.h>
+
#include <signal.h>
#include <stdlib.h>
#include <limits.h>
-#include <sys/time.h>
#include <sys/types.h>
-#include <unistd.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -34,8 +32,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <errno.h>
#ifndef DEDICATED
-#include "SDL.h"
-#include "SDL_cpuinfo.h"
+#ifdef USE_LOCAL_HEADERS
+# include "SDL.h"
+# include "SDL_cpuinfo.h"
+#else
+# include <SDL.h>
+# include <SDL_cpuinfo.h>
+#endif
#endif
#include "sys_local.h"
@@ -163,10 +166,7 @@ void Sys_Exit( int ex )
#endif
#ifdef NDEBUG
- // _exit is called instead of exit since there are rumours of
- // GL libraries installing atexit calls that we don't want to call
- // FIXME: get some testing done with plain exit
- _exit(ex);
+ exit(ex);
#else
// Cause a backtrace on error exits
assert( ex == 0 );
@@ -436,7 +436,6 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
{
void *libHandle;
void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) );
- char curpath[MAX_OSPATH];
char fname[MAX_OSPATH];
char *basepath;
char *homepath;
@@ -445,7 +444,6 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
assert( name );
- getcwd(curpath, sizeof(curpath));
Q_snprintf (fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name);
// TODO: use fs_searchpaths from files.c
diff --git a/code/sys/win_resource.rc b/code/sys/win_resource.rc
index 2654835..cbc9ce5 100644
--- a/code/sys/win_resource.rc
+++ b/code/sys/win_resource.rc
@@ -57,7 +57,12 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
+#ifndef __MINGW32__
+IDI_ICON1 ICON DISCARDABLE "../quake3.ico"
+#else
IDI_ICON1 ICON DISCARDABLE "misc/quake3.ico"
+#endif
+
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/code/tools/asm/q3asm.c b/code/tools/asm/q3asm.c
index 8926699..769b46d 100644
--- a/code/tools/asm/q3asm.c
+++ b/code/tools/asm/q3asm.c
@@ -1357,7 +1357,6 @@ void WriteVmFile( void ) {
vmHeader_t header;
FILE *f;
int headerSize;
- int i;
report( "%i total errors\n", errorCount );
@@ -1403,9 +1402,13 @@ void WriteVmFile( void ) {
report( "Writing to %s\n", imageName );
#ifdef Q3_BIG_ENDIAN
- // byte swap the header
- for ( i = 0 ; i < sizeof( vmHeader_t ) / 4 ; i++ ) {
- ((int *)&header)[i] = LittleLong( ((int *)&header)[i] );
+ {
+ int i;
+
+ // byte swap the header
+ for ( i = 0 ; i < sizeof( vmHeader_t ) / 4 ; i++ ) {
+ ((int *)&header)[i] = LittleLong( ((int *)&header)[i] );
+ }
}
#endif
diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c
index dc09385..b6d98aa 100644
--- a/code/ui/ui_main.c
+++ b/code/ui/ui_main.c
@@ -5424,7 +5424,8 @@ static void UI_DisplayDownloadInfo( const char *downloadName, float centerPoint,
Text_PaintCenter(centerPoint, yStart + 248, scale, colorWhite, xferText, 0);
if (downloadSize > 0) {
- s = va( "%s (%d%%)", downloadName, downloadCount * 100 / downloadSize );
+ s = va( "%s (%d%%)", downloadName,
+ (int)( (float)downloadCount * 100.0f / downloadSize ) );
} else {
s = downloadName;
}