summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-08-15 15:25:21 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-08-15 15:25:21 +0000
commitd876b69b388528fd3236f2f05caac22345a798f4 (patch)
tree114f57a7ffc7a3e3a0a75fd93f4bb33680ed33d4
parentf294db4ccf45f6274e65260dd6f9a2c5faa94313 (diff)
Fixed UI_ModeChanged not being called for hard linked UI.
Added QDECL specifier for some interface functions. Changed default values for com_date_format and com_time_format. On Windows, set up empty CRT invalid parameter handler so e.g. invalid modificators passed to strftime do not raise an exception.
-rw-r--r--source/cl_main.c2
-rw-r--r--source/cl_ui.c1
-rw-r--r--source/cl_view.c4
-rw-r--r--source/common.c4
-rw-r--r--source/files.c2
-rw-r--r--source/gl_draw.c2
-rw-r--r--source/in_dx.c3
-rw-r--r--source/q_shared.c2
-rw-r--r--source/q_shared.h4
-rw-r--r--source/r_images.c6
-rw-r--r--source/snd_dx.c4
-rw-r--r--source/sys_win.c13
-rw-r--r--source/ui_playermodels.c2
13 files changed, 27 insertions, 22 deletions
diff --git a/source/cl_main.c b/source/cl_main.c
index 13b47f2..eb085bb 100644
--- a/source/cl_main.c
+++ b/source/cl_main.c
@@ -764,7 +764,7 @@ static void CL_ServerStatus_f( void ) {
SortPlayers
====================
*/
-static int SortPlayers( const void *v1, const void *v2 ) {
+static int QDECL SortPlayers( const void *v1, const void *v2 ) {
const playerStatus_t *p1 = ( const playerStatus_t * )v1;
const playerStatus_t *p2 = ( const playerStatus_t * )v2;
diff --git a/source/cl_ui.c b/source/cl_ui.c
index 93829f3..f5ba46d 100644
--- a/source/cl_ui.c
+++ b/source/cl_ui.c
@@ -49,6 +49,7 @@ CL_InitUI
*/
void CL_InitUI( void ) {
if( UI_Init() ) {
+ UI_ModeChanged();
cls.ui_initialized = qtrue;
}
}
diff --git a/source/cl_view.c b/source/cl_view.c
index a9f1dd4..b523f23 100644
--- a/source/cl_view.c
+++ b/source/cl_view.c
@@ -382,7 +382,7 @@ void V_Gun_Model_f (void)
//============================================================================
-static int entitycmpfnc( const entity_t *a, const entity_t *b )
+static int QDECL entitycmpfnc( const entity_t *a, const entity_t *b )
{
/*
** all other models are sorted by model then skin
@@ -494,7 +494,7 @@ void V_RenderView( void ) {
cl.refdef.rdflags = cl.frame.ps.rdflags;
// sort entities for better cache locality
- qsort( cl.refdef.entities, cl.refdef.num_entities, sizeof( cl.refdef.entities[0] ), (int (*)(const void *, const void *))entitycmpfnc );
+ qsort( cl.refdef.entities, cl.refdef.num_entities, sizeof( cl.refdef.entities[0] ), (int (QDECL *)(const void *, const void *))entitycmpfnc );
}
ref.RenderFrame (&cl.refdef);
diff --git a/source/common.c b/source/common.c
index 6ee5ab0..fd1718e 100644
--- a/source/common.c
+++ b/source/common.c
@@ -1400,8 +1400,8 @@ void Qcommon_Init( char *commandLine ) {
cl_paused = Cvar_Get( "cl_paused", "0", CVAR_ROM );
com_timedemo = Cvar_Get( "timedemo", "0", CVAR_CHEAT );
com_sleep = Cvar_Get( "com_sleep", "1", 0 );
- com_date_format = Cvar_Get( "com_date_format", "%F", 0 );
- com_time_format = Cvar_Get( "com_time_format", "%T", 0 );
+ com_date_format = Cvar_Get( "com_date_format", "%Y-%m-%d", 0 );
+ com_time_format = Cvar_Get( "com_time_format", "%H:%M:%S", 0 );
com_debug_break = Cvar_Get( "com_debug_break", "0", 0 );
Cvar_Get( "version", version, CVAR_SERVERINFO|CVAR_ROM );
diff --git a/source/files.c b/source/files.c
index e33bc9e..1f1adea 100644
--- a/source/files.c
+++ b/source/files.c
@@ -1530,7 +1530,7 @@ fail:
}
#endif
-static int pakcmp( const void *p1, const void *p2 ) {
+static int QDECL pakcmp( const void *p1, const void *p2 ) {
const char *s1 = *( const char ** )p1;
const char *s2 = *( const char ** )p2;
diff --git a/source/gl_draw.c b/source/gl_draw.c
index fd75910..51f6b9c 100644
--- a/source/gl_draw.c
+++ b/source/gl_draw.c
@@ -371,7 +371,7 @@ void Draw_FPS( int x, int y ) {
#define FPS_APERTURE 9
-int SortCmp( const void *v1, const void *v2 ) {
+int QDECL SortCmp( const void *v1, const void *v2 ) {
int i1 = *( int * )v1;
int i2 = *( int * )v2;
diff --git a/source/in_dx.c b/source/in_dx.c
index 839925a..684853a 100644
--- a/source/in_dx.c
+++ b/source/in_dx.c
@@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// win_dinput.c - DirectInput 7 mouse driver
//
-#if USE_DINPUT
-
#include "win_local.h"
#define DIRECTINPUT_VERSION 0x0700
@@ -328,4 +326,3 @@ void DI_FillAPI( inputAPI_t *api ) {
api->ClearStates = DI_ClearMouseStates;
}
-#endif // USE_DINPUT
diff --git a/source/q_shared.c b/source/q_shared.c
index 764769a..4a144e1 100644
--- a/source/q_shared.c
+++ b/source/q_shared.c
@@ -908,7 +908,7 @@ uint32 COM_ParseHex( const char *string ) {
SortStrcmp
=================
*/
-int SortStrcmp( const void *p1, const void *p2 ) {
+int QDECL SortStrcmp( const void *p1, const void *p2 ) {
const char *s1 = *(const char **)p1;
const char *s2 = *(const char **)p2;
diff --git a/source/q_shared.h b/source/q_shared.h
index c4357c9..5e022db 100644
--- a/source/q_shared.h
+++ b/source/q_shared.h
@@ -437,7 +437,7 @@ int Q_strncasecmp( const char *s1, const char *s2, int n );
#define Q_stricmp Q_strcasecmp
#define Q_stricmpn Q_strncasecmp
-int SortStrcmp( const void *p1, const void *p2 );
+int QDECL SortStrcmp( const void *p1, const void *p2 );
char *COM_SkipPath( const char *pathname );
void COM_StripExtension( const char *in, char *out, int outSize );
@@ -454,7 +454,7 @@ char *COM_Parse( const char **data_p );
int COM_Compress( char *data );
int Com_WildCmp( const char *filter, const char *string, qboolean ignoreCase );
-int SortStrcmp( const void *p1, const void *p2 );
+int QDECL SortStrcmp( const void *p1, const void *p2 );
uint32 Com_HashString( const char *string, int hashSize );
uint32 Com_HashPath( const char *string, int hashSize );
diff --git a/source/r_images.c b/source/r_images.c
index 0218d25..f15e5dc 100644
--- a/source/r_images.c
+++ b/source/r_images.c
@@ -912,7 +912,7 @@ struct pngReadStruct {
byte *maxp;
};
-static void png_vfs_read_fn( png_structp png_ptr, png_bytep buf, png_size_t size ) {
+static void QDECL png_vfs_read_fn( png_structp png_ptr, png_bytep buf, png_size_t size ) {
struct pngReadStruct *r = png_get_io_ptr( png_ptr );
if( r->data + size > r->maxp ) {
@@ -922,14 +922,14 @@ static void png_vfs_read_fn( png_structp png_ptr, png_bytep buf, png_size_t size
r->data += size;
}
-static void png_console_error_fn( png_structp png_ptr, png_const_charp error_msg ) {
+static void QDECL png_console_error_fn( png_structp png_ptr, png_const_charp error_msg ) {
char *f = png_get_error_ptr( png_ptr );
Com_EPrintf( "LoadPNG: %s: %s\n", f, error_msg );
longjmp( png_jmpbuf( png_ptr ), -1 );
}
-static void png_console_warning_fn( png_structp png_ptr, png_const_charp warning_msg ) {
+static void QDECL png_console_warning_fn( png_structp png_ptr, png_const_charp warning_msg ) {
char *f = png_get_error_ptr( png_ptr );
Com_WPrintf( "LoadPNG: %s: %s\n", f, warning_msg );
diff --git a/source/snd_dx.c b/source/snd_dx.c
index 7fdbbbf..660543c 100644
--- a/source/snd_dx.c
+++ b/source/snd_dx.c
@@ -18,8 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#if USE_DSOUND
-
#include "win_local.h"
#include <mmsystem.h>
#include <dsound.h>
@@ -425,5 +423,3 @@ void DS_FillAPI( snddmaAPI_t *api ) {
api->Submit = DS_Submit;
api->Activate = DS_Activate;
}
-
-#endif // USE_DSOUND \ No newline at end of file
diff --git a/source/sys_win.c b/source/sys_win.c
index 892519f..a34cd36 100644
--- a/source/sys_win.c
+++ b/source/sys_win.c
@@ -1500,6 +1500,11 @@ EXCEPTION_DISPOSITION _ExceptionHandler(
#endif /* USE_DBGHELP */
+#if ( _MSC_VER >= 1400 )
+static void msvcrt_sucks( const wchar_t *expr, const wchar_t *func, const wchar_t *file, unsigned int line, uintptr_t unused ) {
+}
+#endif
+
/*
==================
WinMain
@@ -1543,6 +1548,12 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
#endif
#endif /* USE_DBGHELP */
+#if ( _MSC_VER >= 1400 )
+ // no, please, don't let strftime kill the whole fucking
+ // process just because it does not conform to C99 :((
+ _set_invalid_parameter_handler( msvcrt_sucks );
+#endif
+
Qcommon_Init( lpCmdLine );
/* main program loop */
@@ -1607,7 +1618,7 @@ main
==================
*/
-int main( int argc, char **argv ) {
+int QDECL main( int argc, char **argv ) {
int i;
for( i = 1; i < argc; i++ ) {
diff --git a/source/ui_playermodels.c b/source/ui_playermodels.c
index c16efad..d7d0f78 100644
--- a/source/ui_playermodels.c
+++ b/source/ui_playermodels.c
@@ -57,7 +57,7 @@ static qboolean IconOfSkinExists( char *skin, char **pcxfiles, int npcxfiles ) {
return qfalse;
}
-static int pmicmpfnc( const void *_a, const void *_b ) {
+static int QDECL pmicmpfnc( const void *_a, const void *_b ) {
const playerModelInfo_t *a = (const playerModelInfo_t *)_a;
const playerModelInfo_t *b = (const playerModelInfo_t *)_b;