From b1585b303920b46582752c67c3ef9c2d6b4ed04b Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 29 Aug 2010 12:55:41 +0000 Subject: [PATCH] more fixes for deprecated conversion from string constant to char*: handle the -safe command line switch using a new global safemode, check for safemode in the related driver init functions and remove the safeargvs & co from common.c and COM_InitArgv(). git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@307 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/cd_sdl.c | 2 +- Quake/common.c | 25 ++++--------------------- Quake/common.h | 7 +++++++ Quake/in_sdl.c | 2 +- Quake/net_dgrm.c | 2 +- Quake/snd_dma.c | 2 +- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/Quake/cd_sdl.c b/Quake/cd_sdl.c index 195a7cd7..67635908 100644 --- a/Quake/cd_sdl.c +++ b/Quake/cd_sdl.c @@ -512,7 +512,7 @@ int CDAudio_Init(void) { int i, sdl_num_drives; - if (COM_CheckParm("-nocdaudio")) + if (safemode || COM_CheckParm("-nocdaudio")) return -1; export_cddev_arg(); diff --git a/Quake/common.c b/Quake/common.c index 7652d2bb..c4f25516 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -22,13 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" -#define NUM_SAFE_ARGVS 7 +static char *largv[MAX_NUM_ARGVS + 1]; +static char argvdummy[] = " "; -static char *largv[MAX_NUM_ARGVS + NUM_SAFE_ARGVS + 1]; -static char *argvdummy = " "; - -static char *safeargvs[NUM_SAFE_ARGVS] = - {"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"}; +int safemode; cvar_t registered = {"registered","0"}; cvar_t cmdline = {"cmdline","", false, true}; @@ -1126,7 +1123,6 @@ COM_InitArgv */ void COM_InitArgv (int argc, char **argv) { - qboolean safe; int i, j, n; // reconstitute the command line for the cmdline externally visible cvar @@ -1152,24 +1148,11 @@ void COM_InitArgv (int argc, char **argv) Con_Printf("Command line: %s\n", com_cmdline); - safe = false; - for (com_argc=0 ; (com_argc