add const to print and error functions

This commit is contained in:
Daniel Wolf 2021-03-09 19:22:23 -05:00
parent 2734d6fdea
commit 7ad73da647
Signed by: nephatrine
GPG Key ID: F402AF4822FB01F5
13 changed files with 29 additions and 27 deletions

View File

@ -150,7 +150,7 @@ game_export_t *GetGameAPI (game_import_t *import)
#ifndef GAME_HARD_LINKED
// this is only here so the functions in q_shared.c and q_shwin.c can link
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char text[1024];
@ -162,7 +162,7 @@ void Sys_Error (char *error, ...)
gi.error (ERR_FATAL, "%s", text);
}
void Com_Printf (char *msg, ...)
void Com_Printf (const char *msg, ...)
{
va_list argptr;
char text[1024];

View File

@ -290,8 +290,8 @@ void Sys_FindClose (void);
// this is only here so the functions in q_shared.c and q_shwin.c can link
void Sys_Error (char *error, ...);
void Com_Printf (char *msg, ...);
void Sys_Error (const char *error, ...);
void Com_Printf (const char *msg, ...);
/*

View File

@ -150,7 +150,7 @@ game_export_t *GetGameAPI (game_import_t *import)
#ifndef GAME_HARD_LINKED
// this is only here so the functions in q_shared.c and q_shwin.c can link
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char text[1024];
@ -162,7 +162,7 @@ void Sys_Error (char *error, ...)
gi.error (ERR_FATAL, "%s", text);
}
void Com_Printf (char *msg, ...)
void Com_Printf (const char *msg, ...)
{
va_list argptr;
char text[1024];

View File

@ -290,8 +290,8 @@ void Sys_FindClose (void);
// this is only here so the functions in q_shared.c and q_shwin.c can link
void Sys_Error (char *error, ...);
void Com_Printf (char *msg, ...);
void Sys_Error (const char *error, ...);
void Com_Printf (const char *msg, ...);
/*

View File

@ -62,7 +62,7 @@ void Sys_ConsoleOutput (char *string)
fputs(string, stdout);
}
void Sys_Printf (char *fmt, ...)
void Sys_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];
@ -102,7 +102,7 @@ void Sys_Init(void)
#endif
}
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char string[1024];

View File

@ -62,7 +62,7 @@ void Sys_ConsoleOutput (char *string)
fputs(string, stdout);
}
void Sys_Printf (char *fmt, ...)
void Sys_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];
@ -102,7 +102,7 @@ void Sys_Init(void)
#endif
}
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char string[1024];

View File

@ -31,7 +31,7 @@ void Sys_mkdir (char *path)
{
}
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;

View File

@ -105,7 +105,7 @@ Both client and server can use this, and it will output
to the apropriate place.
=============
*/
void Com_Printf (char *fmt, ...)
void Com_Printf (const char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
@ -160,7 +160,7 @@ Com_DPrintf
A Com_Printf that only shows up if the "developer" cvar is set
================
*/
void Com_DPrintf (char *fmt, ...)
void Com_DPrintf (const char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
@ -186,7 +186,7 @@ Both client and server can use this, and it will
do the apropriate things.
=============
*/
void Com_Error (int code, char *fmt, ...)
void Com_Error (int code, const char *fmt, ...)
{
va_list argptr;
static char msg[MAXPRINTMSG];

View File

@ -696,6 +696,8 @@ FILESYSTEM
*/
void FS_InitFilesystem (void);
void FS_ShutdownFilesystem (void);
void FS_SetGamedir (char *dir);
char *FS_Gamedir (void);
char *FS_NextPath (char *prevpath);
@ -739,9 +741,9 @@ MISC
void Com_BeginRedirect (int target, char *buffer, int buffersize, void (*flush));
void Com_EndRedirect (void);
void Com_Printf (char *fmt, ...);
void Com_DPrintf (char *fmt, ...);
void Com_Error (int code, char *fmt, ...);
void Com_Printf (const char *fmt, ...);
void Com_DPrintf (const char *fmt, ...);
void Com_Error (int code, const char *fmt, ...);
void Com_Quit (void);
int Com_ServerState (void); // this should have just been a cvar...
@ -801,7 +803,7 @@ void *Sys_GetGameAPI (void *parms);
char *Sys_ConsoleInput (void);
void Sys_ConsoleOutput (char *string);
void Sys_SendKeyEvents (void);
void Sys_Error (char *error, ...);
void Sys_Error (const char *error, ...);
void Sys_Quit (void);
char *Sys_GetClipboardData( void );
void Sys_CopyProtect (void);

View File

@ -1725,7 +1725,7 @@ refexport_t GetRefAPI (refimport_t rimp )
#ifndef REF_HARD_LINKED
// this is only here so the functions in q_shared.c and q_shwin.c can link
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char text[1024];
@ -1737,7 +1737,7 @@ void Sys_Error (char *error, ...)
ri.Sys_Error (ERR_FATAL, "%s", text);
}
void Com_Printf (char *fmt, ...)
void Com_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];

View File

@ -1398,7 +1398,7 @@ refexport_t GetRefAPI (refimport_t rimp)
#ifndef REF_HARD_LINKED
// this is only here so the functions in q_shared.c and q_shwin.c can link
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char text[1024];
@ -1410,7 +1410,7 @@ void Sys_Error (char *error, ...)
ri.Sys_Error (ERR_FATAL, "%s", text);
}
void Com_Printf (char *fmt, ...)
void Com_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];

View File

@ -59,7 +59,7 @@ void Sys_ConsoleOutput (char *string)
fputs(string, stdout);
}
void Sys_Printf (char *fmt, ...)
void Sys_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];
@ -99,7 +99,7 @@ void Sys_Init(void)
#endif
}
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char string[1024];

View File

@ -64,7 +64,7 @@ SYSTEM IO
*/
void Sys_Error (char *error, ...)
void Sys_Error (const char *error, ...)
{
va_list argptr;
char text[1024];