[quake3-commits] r2100 - in trunk/code: game ui

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Jul 26 20:02:45 EDT 2011


Author: thilo
Date: 2011-07-26 20:02:45 -0400 (Tue, 26 Jul 2011)
New Revision: 2100

Modified:
   trunk/code/game/g_local.h
   trunk/code/game/g_syscalls.c
   trunk/code/ui/ui_local.h
   trunk/code/ui/ui_syscalls.c
Log:
Fix last "noreturn" warnings


Modified: trunk/code/game/g_local.h
===================================================================
--- trunk/code/game/g_local.h	2011-07-26 23:56:21 UTC (rev 2099)
+++ trunk/code/game/g_local.h	2011-07-27 00:02:45 UTC (rev 2100)
@@ -627,7 +627,7 @@
 void QDECL G_LogPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
 void SendScoreboardMessageToAllClients( void );
 void QDECL G_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
-void QDECL G_Error( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
+void QDECL G_Error( const char *fmt, ... ) __attribute__ ((noreturn, format (printf, 1, 2)));
 
 //
 // g_client.c
@@ -767,7 +767,7 @@
 extern	vmCvar_t	g_proxMineTimeout;
 
 void	trap_Printf( const char *fmt );
-void	trap_Error( const char *fmt );
+void trap_Error(const char *fmt) __attribute__((noreturn));
 int		trap_Milliseconds( void );
 int	trap_RealTime( qtime_t *qtime );
 int		trap_Argc( void );

Modified: trunk/code/game/g_syscalls.c
===================================================================
--- trunk/code/game/g_syscalls.c	2011-07-26 23:56:21 UTC (rev 2099)
+++ trunk/code/game/g_syscalls.c	2011-07-27 00:02:45 UTC (rev 2100)
@@ -45,8 +45,10 @@
 	syscall( G_PRINT, fmt );
 }
 
-void	trap_Error( const char *fmt ) {
-	syscall( G_ERROR, fmt );
+void trap_Error(const char *fmt)
+{
+	syscall(G_ERROR, fmt);
+	exit(1);
 }
 
 int		trap_Milliseconds( void ) {

Modified: trunk/code/ui/ui_local.h
===================================================================
--- trunk/code/ui/ui_local.h	2011-07-26 23:56:21 UTC (rev 2099)
+++ trunk/code/ui/ui_local.h	2011-07-27 00:02:45 UTC (rev 2100)
@@ -915,7 +915,7 @@
 // ui_syscalls.c
 //
 void			trap_Print( const char *string );
-void			trap_Error( const char *string );
+void			trap_Error(const char *string) __attribute__((noreturn));
 int				trap_Milliseconds( void );
 void			trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
 void			trap_Cvar_Update( vmCvar_t *vmCvar );

Modified: trunk/code/ui/ui_syscalls.c
===================================================================
--- trunk/code/ui/ui_syscalls.c	2011-07-26 23:56:21 UTC (rev 2099)
+++ trunk/code/ui/ui_syscalls.c	2011-07-27 00:02:45 UTC (rev 2100)
@@ -44,8 +44,10 @@
 	syscall( UI_PRINT, string );
 }
 
-void trap_Error( const char *string ) {
-	syscall( UI_ERROR, string );
+void trap_Error(const char *string)
+{
+	syscall(UI_ERROR, string);
+	exit(1);
 }
 
 int trap_Milliseconds( void ) {



More information about the quake3-commits mailing list