From bff0847761e51dc43cc5cce4859c644851a63a14 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Apr 2022 20:04:06 +0900 Subject: [PATCH] [cvar] Clean up most misinterpreted cvar types The misinterpretations were due to either the cvar not being accessed directly by the engine, but via only the callback, or the cvars were accesssed only by progs (in which case, they should be float). The remainder are a potential enum (hud gravity) and a "too hard basket" (rcon password: need to figure out how I want to handle secret strings). --- libs/audio/cd_linux.c | 2 +- libs/audio/renderer/midi.c | 4 +-- libs/audio/renderer/snd_dma.c | 8 +++--- libs/console/console.c | 2 +- libs/console/server.c | 2 +- libs/gamecode/pr_debug.c | 2 +- libs/video/targets/context_win.c | 32 ++++++++++----------- libs/video/targets/in_x11.c | 4 +-- libs/video/targets/joy_win.c | 42 ++++++++++++++-------------- nq/include/game.h | 1 - nq/include/server.h | 1 - nq/source/cl_main.c | 8 +++--- nq/source/game.c | 6 ++-- nq/source/host.c | 16 +++++------ nq/source/sv_progs.c | 48 ++++++++++++++++---------------- qw/include/game.h | 1 - qw/include/server.h | 2 -- qw/include/sv_demo.h | 1 - qw/source/cl_main.c | 12 ++++---- qw/source/cl_skin.c | 8 +++--- qw/source/game.c | 4 +-- qw/source/sv_demo.c | 18 ++++++------ qw/source/sv_main.c | 20 ++++++------- qw/source/sv_progs.c | 4 +-- 24 files changed, 121 insertions(+), 127 deletions(-) diff --git a/libs/audio/cd_linux.c b/libs/audio/cd_linux.c index 15452ce8c..add4910be 100644 --- a/libs/audio/cd_linux.c +++ b/libs/audio/cd_linux.c @@ -84,7 +84,7 @@ static cvar_t mus_cddevice_cvar = { "device to use for CD music", .default_value = "/dev/cdrom", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &mus_cddevice }, + .value = { .type = 0, .value = &mus_cddevice }, }; static float bgmvolume; static cvar_t bgmvolume_cvar = { diff --git a/libs/audio/renderer/midi.c b/libs/audio/renderer/midi.c index f0dc91b58..3172c8ea2 100644 --- a/libs/audio/renderer/midi.c +++ b/libs/audio/renderer/midi.c @@ -57,14 +57,14 @@ typedef struct { static int midi_intiialized = 0; -static char *wildmidi_volume; +static float wildmidi_volume; static cvar_t wildmidi_volume_cvar = { .name = "wildmidi_volume", .description = "Set the Master Volume", .default_value = "100", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &wildmidi_volume }, + .value = { .type = &cexpr_float, .value = &wildmidi_volume }, }; static char *wildmidi_config; static cvar_t wildmidi_config_cvar = { diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index c8ab69577..0ec153d03 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -69,14 +69,14 @@ static cvar_t snd_volume_cvar = { .flags = CVAR_ARCHIVE, .value = { .type = &cexpr_float, .value = &snd_volume }, }; -static char *nosound; +static int nosound; static cvar_t nosound_cvar = { .name = "nosound", .description = "Set to turn sound off", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &nosound }, + .value = { .type = &cexpr_int, .value = &nosound }, }; static float snd_mixahead; static cvar_t snd_mixahead_cvar = { @@ -97,14 +97,14 @@ static cvar_t snd_noextraupdate_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_int, .value = &snd_noextraupdate }, }; -static char *snd_show; +static int snd_show; static cvar_t snd_show_cvar = { .name = "snd_show", .description = "Toggles display of sounds currently being played", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &snd_show }, + .value = { .type = &cexpr_int, .value = &snd_show }, }; static general_data_t plugin_info_general_data; diff --git a/libs/console/console.c b/libs/console/console.c index 36f137423..7b5dcfeca 100644 --- a/libs/console/console.c +++ b/libs/console/console.c @@ -63,7 +63,7 @@ static cvar_t con_interpreter_cvar = { "Interpreter for the interactive console", .default_value = "id", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &con_interpreter }, + .value = { .type = 0, .value = &con_interpreter }, }; static sys_printf_t saved_sys_printf; diff --git a/libs/console/server.c b/libs/console/server.c index 3b10f64e6..bf2fb09e0 100644 --- a/libs/console/server.c +++ b/libs/console/server.c @@ -90,7 +90,7 @@ static cvar_t sv_logfile_cvar = { "\"filename:gzflags\"", .default_value = "none", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &sv_logfile }, + .value = { .type = 0, .value = &sv_logfile }, }; static exprenum_t sv_conmode_enum; static exprtype_t sv_conmode_type = { diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 101bb92dc..d27255e11 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -133,7 +133,7 @@ static cvar_t pr_source_path_cvar = { "where to look (within gamedir) for source files", .default_value = ".", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &pr_source_path }, + .value = { .type = 0, .value = &pr_source_path }, }; static char *source_path_string; static char **source_paths; diff --git a/libs/video/targets/context_win.c b/libs/video/targets/context_win.c index 0d3d8e973..ce9eb87b5 100644 --- a/libs/video/targets/context_win.c +++ b/libs/video/targets/context_win.c @@ -78,14 +78,14 @@ static cvar_t vid_mode_cvar = { }; // Note that 0 is MODE_WINDOWED -static char *_vid_default_mode; +int _vid_default_mode; static cvar_t _vid_default_mode_cvar = { .name = "_vid_default_mode", .description = "", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &_vid_default_mode }, + .value = { .type = &cexpr_int, .value = &_vid_default_mode }, }; // Note that 3 is MODE_FULLSCREEN_DEFAULT @@ -98,59 +98,59 @@ static cvar_t _vid_default_mode_win_cvar = { .flags = CVAR_ARCHIVE, .value = { .type = &cexpr_int, .value = &_vid_default_mode_win }, }; -static char *vid_wait; +int vid_wait; static cvar_t vid_wait_cvar = { .name = "vid_wait", .description = "", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &vid_wait }, + .value = { .type = &cexpr_int, .value = &vid_wait }, }; -static char *vid_nopageflip; +int vid_nopageflip; static cvar_t vid_nopageflip_cvar = { .name = "vid_nopageflip", .description = "", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &vid_nopageflip }, + .value = { .type = &cexpr_int, .value = &vid_nopageflip }, }; -static char *_vid_wait_override; +int _vid_wait_override; static cvar_t _vid_wait_override_cvar = { .name = "_vid_wait_override", .description = "", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &_vid_wait_override }, + .value = { .type = &cexpr_int, .value = &_vid_wait_override }, }; -static char *vid_config_x; +int vid_config_x; static cvar_t vid_config_x_cvar = { .name = "vid_config_x", .description = "", .default_value = "800", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &vid_config_x }, + .value = { .type = &cexpr_int, .value = &vid_config_x }, }; -static char *vid_config_y; +int vid_config_y; static cvar_t vid_config_y_cvar = { .name = "vid_config_y", .description = "", .default_value = "600", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &vid_config_y }, + .value = { .type = &cexpr_int, .value = &vid_config_y }, }; -static char *vid_stretch_by_2; +int vid_stretch_by_2; static cvar_t vid_stretch_by_2_cvar = { .name = "vid_stretch_by_2", .description = "", .default_value = "1", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &vid_stretch_by_2 }, + .value = { .type = &cexpr_int, .value = &vid_stretch_by_2 }, }; static int _windowed_mouse; static cvar_t _windowed_mouse_cvar = { @@ -179,14 +179,14 @@ static cvar_t vid_windowed_mode_cvar = { .flags = CVAR_ARCHIVE, .value = { .type = &cexpr_int, .value = &vid_windowed_mode }, }; -static char *block_switch; +int block_switch; static cvar_t block_switch_cvar = { .name = "block_switch", .description = "", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &block_switch }, + .value = { .type = &cexpr_int, .value = &block_switch }, }; static int vid_window_x; static cvar_t vid_window_x_cvar = { diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index f7552c424..80e435188 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -151,14 +151,14 @@ static cvar_t in_snd_block_cvar = { .flags = CVAR_ARCHIVE, .value = { .type = &cexpr_int, .value = &in_snd_block }, }; -char *in_dga; +int in_dga; static cvar_t in_dga_cvar = { .name = "in_dga", .description = "DGA Input support", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &in_dga }, + .value = { .type = &cexpr_int, .value = &in_dga }, }; int in_mouse_accel; static cvar_t in_mouse_accel_cvar = { diff --git a/libs/video/targets/joy_win.c b/libs/video/targets/joy_win.c index 65c4d600c..56e8f49ce 100644 --- a/libs/video/targets/joy_win.c +++ b/libs/video/targets/joy_win.c @@ -46,14 +46,14 @@ #include "compat.h" // Joystick variables and structures -char *joy_sensitivity; +float joy_sensitivity; static cvar_t joy_sensitivity_cvar = { .name = "joy_sensitivity", .description = "Joystick sensitivity", .default_value = "1", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &joy_sensitivity }, + .value = { .type = &cexpr_float, .value = &joy_sensitivity }, }; // joystick defines and variables @@ -97,7 +97,7 @@ static cvar_t in_joystick_cvar = { "FIXME: No Description", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &in_joystick }, + .value = { .type = 0, .value = &in_joystick }, }; char *joy_name; static cvar_t joy_name_cvar = { @@ -171,77 +171,77 @@ static cvar_t joy_advaxisv_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_int, .value = &joy_advaxisv }, }; -char *joy_forwardthreshold; +float joy_forwardthreshold; static cvar_t joy_forwardthreshold_cvar = { .name = "joyforwardthreshold", .description = "FIXME: No Description", .default_value = "0.15", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_forwardthreshold }, + .value = { .type = &cexpr_float, .value = &joy_forwardthreshold }, }; -char *joy_sidethreshold; +float joy_sidethreshold; static cvar_t joy_sidethreshold_cvar = { .name = "joysidethreshold", .description = "FIXME: No Description", .default_value = "0.15", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_sidethreshold }, + .value = { .type = &cexpr_float, .value = &joy_sidethreshold }, }; -char *joy_pitchthreshold; +float joy_pitchthreshold; static cvar_t joy_pitchthreshold_cvar = { .name = "joypitchthreshold", .description = "FIXME: No Description", .default_value = "0.15", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_pitchthreshold }, + .value = { .type = &cexpr_float, .value = &joy_pitchthreshold }, }; -char *joy_yawthreshold; +float joy_yawthreshold; static cvar_t joy_yawthreshold_cvar = { .name = "joyyawthreshold", .description = "FIXME: No Description", .default_value = "0.15", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_yawthreshold }, + .value = { .type = &cexpr_float, .value = &joy_yawthreshold }, }; -char *joy_forwardsensitivity; +float joy_forwardsensitivity; static cvar_t joy_forwardsensitivity_cvar = { .name = "joyforwardsensitivity", .description = "FIXME: No Description", .default_value = "-1.0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_forwardsensitivity }, + .value = { .type = &cexpr_float, .value = &joy_forwardsensitivity }, }; -char *joy_sidesensitivity; +float joy_sidesensitivity; static cvar_t joy_sidesensitivity_cvar = { .name = "joysidesensitivity", .description = "FIXME: No Description", .default_value = "-1.0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_sidesensitivity }, + .value = { .type = &cexpr_float, .value = &joy_sidesensitivity }, }; -char *joy_pitchsensitivity; +float joy_pitchsensitivity; static cvar_t joy_pitchsensitivity_cvar = { .name = "joypitchsensitivity", .description = "FIXME: No Description", .default_value = "1.0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_pitchsensitivity }, + .value = { .type = &cexpr_float, .value = &joy_pitchsensitivity }, }; -char *joy_yawsensitivity; +float joy_yawsensitivity; static cvar_t joy_yawsensitivity_cvar = { .name = "joyyawsensitivity", .description = "FIXME: No Description", .default_value = "-1.0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_yawsensitivity }, + .value = { .type = &cexpr_float, .value = &joy_yawsensitivity }, }; int joy_wwhack1; static cvar_t joy_wwhack1_cvar = { @@ -252,14 +252,14 @@ static cvar_t joy_wwhack1_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_int, .value = &joy_wwhack1 }, }; -char *joy_wwhack2; +float joy_wwhack2; static cvar_t joy_wwhack2_cvar = { .name = "joywwhack2", .description = "FIXME: No Description", .default_value = "0.0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &joy_wwhack2 }, + .value = { .type = &cexpr_float, .value = &joy_wwhack2 }, }; int joy_debug; diff --git a/nq/include/game.h b/nq/include/game.h index 485c82426..55c53428f 100644 --- a/nq/include/game.h +++ b/nq/include/game.h @@ -156,7 +156,6 @@ extern int current_skill; // skill level for currently loaded level (in case extern qboolean isDedicated; extern qboolean standard_quake; -extern char *registered; struct memhunk_s; void Game_Init (struct memhunk_s *hunk); diff --git a/nq/include/server.h b/nq/include/server.h index 3518f3257..411768be5 100644 --- a/nq/include/server.h +++ b/nq/include/server.h @@ -206,7 +206,6 @@ extern int teamplay; extern int skill; extern int deathmatch; extern int coop; -extern char *fraglimit; extern int timelimit; extern float sv_rollangle; diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 25163ade7..06ebcb1e1 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -137,23 +137,23 @@ static cvar_t hud_time_cvar = { .value = { .type = &cexpr_int, .value = &hud_time }, }; -static char *r_ambient; +static int r_ambient; static cvar_t r_ambient_cvar = { .name = "r_ambient", .description = "Determines the ambient lighting for a level", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &r_ambient }, + .value = { .type = &cexpr_int, .value = &r_ambient }, }; -static char *r_drawflat; +static int r_drawflat; static cvar_t r_drawflat_cvar = { .name = "r_drawflat", .description = "Toggles the drawing of textures", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &r_drawflat }, + .value = { .type = &cexpr_int, .value = &r_drawflat }, }; int fps_count; diff --git a/nq/source/game.c b/nq/source/game.c index bbac0de20..249c679dc 100644 --- a/nq/source/game.c +++ b/nq/source/game.c @@ -40,14 +40,14 @@ qboolean standard_quake = false; -char *registered; +float registered; static cvar_t registered_cvar = { .name = "registered", .description = "Is the game the registered version. 1 yes 0 no", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = ®istered }, + .value = { .type = &cexpr_float, .value = ®istered }, }; char *cmdline; static cvar_t cmdline_cvar = { @@ -56,7 +56,7 @@ static cvar_t cmdline_cvar = { "None", .default_value = "0", .flags = CVAR_SERVERINFO, - .value = { .type = 0/* not used */, .value = &cmdline }, + .value = { .type = 0, .value = &cmdline }, }; int static_registered = 1; diff --git a/nq/source/host.c b/nq/source/host.c index dc45ef372..c309861fb 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -174,14 +174,14 @@ static cvar_t cl_quakerc_cvar = { .value = { .type = &cexpr_int, .value = &cl_quakerc }, }; -char *fraglimit; +float fraglimit; static cvar_t fraglimit_cvar = { .name = "fraglimit", .description = "None", .default_value = "0", .flags = CVAR_SERVERINFO, - .value = { .type = 0/* not used */, .value = &fraglimit }, + .value = { .type = &cexpr_float, .value = &fraglimit }, }; int timelimit; static cvar_t timelimit_cvar = { @@ -201,23 +201,23 @@ static cvar_t teamplay_cvar = { .flags = CVAR_SERVERINFO, .value = { .type = &cexpr_int, .value = &teamplay }, }; -char *noexit; +float noexit; static cvar_t noexit_cvar = { .name = "noexit", .description = "None", .default_value = "0", .flags = CVAR_SERVERINFO, - .value = { .type = 0/* not used */, .value = &noexit }, + .value = { .type = &cexpr_float, .value = &noexit }, }; -char *samelevel; +float samelevel; static cvar_t samelevel_cvar = { .name = "samelevel", .description = "None", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &samelevel }, + .value = { .type = &cexpr_float, .value = &samelevel }, }; int skill; @@ -258,14 +258,14 @@ static cvar_t pausable_cvar = { .value = { .type = &cexpr_int, .value = &pausable }, }; -char *temp1; +float temp1; static cvar_t temp1_cvar = { .name = "temp1", .description = "None", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &temp1 }, + .value = { .type = &cexpr_float, .value = &temp1 }, }; int cl_usleep; static cvar_t cl_usleep_cvar = { diff --git a/nq/source/sv_progs.c b/nq/source/sv_progs.c index e9e318a28..2637c4992 100644 --- a/nq/source/sv_progs.c +++ b/nq/source/sv_progs.c @@ -91,114 +91,114 @@ static cvar_t sv_progs_ext_cvar = { .flags = CVAR_NONE, .value = { .type = 0, .value = &sv_progs_ext }, }; -char *pr_checkextensions; +float pr_checkextensions; static cvar_t pr_checkextensions_cvar = { .name = "pr_checkextensions", .description = "indicate the presence of the checkextentions qc function", .default_value = "1", .flags = CVAR_ROM, - .value = { .type = 0/* not used */, .value = &pr_checkextensions }, + .value = { .type = &cexpr_float, .value = &pr_checkextensions }, }; -char *nomonsters; +float nomonsters; static cvar_t nomonsters_cvar = { .name = "nomonsters", .description = "No Description", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &nomonsters }, + .value = { .type = &cexpr_float, .value = &nomonsters }, }; -char *gamecfg; +float gamecfg; static cvar_t gamecfg_cvar = { .name = "gamecfg", .description = "No Description", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &gamecfg }, + .value = { .type = &cexpr_float, .value = &gamecfg }, }; -char *scratch1; +float scratch1; static cvar_t scratch1_cvar = { .name = "scratch1", .description = "No Description", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &scratch1 }, + .value = { .type = &cexpr_float, .value = &scratch1 }, }; -char *scratch2; +float scratch2; static cvar_t scratch2_cvar = { .name = "scratch2", .description = "No Description", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &scratch2 }, + .value = { .type = &cexpr_float, .value = &scratch2 }, }; -char *scratch3; +float scratch3; static cvar_t scratch3_cvar = { .name = "scratch3", .description = "No Description", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &scratch3 }, + .value = { .type = &cexpr_float, .value = &scratch3 }, }; -char *scratch4; +float scratch4; static cvar_t scratch4_cvar = { .name = "scratch4", .description = "No Description", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &scratch4 }, + .value = { .type = &cexpr_float, .value = &scratch4 }, }; -char *savedgamecfg; +float savedgamecfg; static cvar_t savedgamecfg_cvar = { .name = "savedgamecfg", .description = "No Description", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &savedgamecfg }, + .value = { .type = &cexpr_float, .value = &savedgamecfg }, }; -char *saved1; +float saved1; static cvar_t saved1_cvar = { .name = "saved1", .description = "No Description", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &saved1 }, + .value = { .type = &cexpr_float, .value = &saved1 }, }; -char *saved2; +float saved2; static cvar_t saved2_cvar = { .name = "saved2", .description = "No Description", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &saved2 }, + .value = { .type = &cexpr_float, .value = &saved2 }, }; -char *saved3; +float saved3; static cvar_t saved3_cvar = { .name = "saved3", .description = "No Description", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &saved3 }, + .value = { .type = &cexpr_float, .value = &saved3 }, }; -char *saved4; +float saved4; static cvar_t saved4_cvar = { .name = "saved4", .description = "No Description", .default_value = "0", .flags = CVAR_ARCHIVE, - .value = { .type = 0/* not used */, .value = &saved4 }, + .value = { .type = &cexpr_float, .value = &saved4 }, }; static int sv_range; diff --git a/qw/include/game.h b/qw/include/game.h index 474b11c02..95b1bed1b 100644 --- a/qw/include/game.h +++ b/qw/include/game.h @@ -33,7 +33,6 @@ #include "QF/qtypes.h" #include "QF/qdefs.h" -extern char *registered; void Game_Init (void); void Game_Init_Cvars (void); diff --git a/qw/include/server.h b/qw/include/server.h index 9d00ee13e..44f57e10d 100644 --- a/qw/include/server.h +++ b/qw/include/server.h @@ -437,10 +437,8 @@ extern float sv_timeout; extern netadr_t master_adr[MAX_MASTERS]; // address of the master server -extern char *spawn; extern int teamplay; extern int deathmatch; -extern char *fraglimit; extern int timelimit; extern server_static_t svs; // persistant server info diff --git a/qw/include/sv_demo.h b/qw/include/sv_demo.h index 900362915..c1e608909 100644 --- a/qw/include/sv_demo.h +++ b/qw/include/sv_demo.h @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern struct recorder_s demo; extern float sv_demofps; extern float sv_demoPings; -extern char *sv_demoMaxSize; void SV_Stop (int reason); void Demo_Init (void); diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 73bf69394..bdb2ac24a 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -355,14 +355,14 @@ static cvar_t password_cvar = { .flags = CVAR_NONE, .value = { .type = 0, .value = &password }, }; -char *spectator; +int spectator; static cvar_t spectator_cvar = { .name = "spectator", .description = "Set to 1 before connecting to become a spectator", .default_value = "", .flags = CVAR_USERINFO, - .value = { .type = 0/* not used */, .value = &spectator }, + .value = { .type = &cexpr_int, .value = &spectator }, }; char *cl_name; static cvar_t cl_name_cvar = { @@ -391,23 +391,23 @@ static cvar_t rate_cvar = { .flags = CVAR_ARCHIVE | CVAR_USERINFO, .value = { .type = &cexpr_float, .value = &rate }, }; -char *noaim; +int noaim; static cvar_t noaim_cvar = { .name = "noaim", .description = "Auto aim off switch. Set to 1 to turn off.", .default_value = "0", .flags = CVAR_ARCHIVE | CVAR_USERINFO, - .value = { .type = 0/* not used */, .value = &noaim }, + .value = { .type = &cexpr_int, .value = &noaim }, }; -char *msg; +int msg; static cvar_t msg_cvar = { .name = "msg", .description = "Determines the type of messages reported 0 is maximum, 4 is none", .default_value = "1", .flags = CVAR_ARCHIVE | CVAR_USERINFO, - .value = { .type = 0/* not used */, .value = &msg }, + .value = { .type = &cexpr_int, .value = &msg }, }; /* GIB events */ diff --git a/qw/source/cl_skin.c b/qw/source/cl_skin.c index e509764cc..cbf02c133 100644 --- a/qw/source/cl_skin.c +++ b/qw/source/cl_skin.c @@ -68,23 +68,23 @@ static cvar_t skin_cvar = { .flags = CVAR_ARCHIVE | CVAR_USERINFO, .value = { .type = 0, .value = &skin }, }; -char *topcolor; +int topcolor; static cvar_t topcolor_cvar = { .name = "topcolor", .description = "Players color on top", .default_value = "0", .flags = CVAR_ARCHIVE | CVAR_USERINFO, - .value = { .type = 0/* not used */, .value = &topcolor }, + .value = { .type = &cexpr_int, .value = &topcolor }, }; -char *bottomcolor; +int bottomcolor; static cvar_t bottomcolor_cvar = { .name = "bottomcolor", .description = "Players color on bottom", .default_value = "0", .flags = CVAR_ARCHIVE | CVAR_USERINFO, - .value = { .type = 0/* not used */, .value = &bottomcolor }, + .value = { .type = &cexpr_int, .value = &bottomcolor }, }; diff --git a/qw/source/game.c b/qw/source/game.c index dba073f3e..fdd9842a2 100644 --- a/qw/source/game.c +++ b/qw/source/game.c @@ -46,14 +46,14 @@ #include "qw/include/game.h" #include "qw/include/server.h" -char *registered; +float registered; static cvar_t registered_cvar = { .name = "registered", .description = "Is the game the registered version. 1 yes 0 no", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = ®istered }, + .value = { .type = &cexpr_float, .value = ®istered }, }; int static_registered = 1; // only for startup check, then set diff --git a/qw/source/sv_demo.c b/qw/source/sv_demo.c index b0b8fb30c..c8e01f86f 100644 --- a/qw/source/sv_demo.c +++ b/qw/source/sv_demo.c @@ -90,14 +90,14 @@ static cvar_t sv_demoPings_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_float, .value = &sv_demoPings }, }; -char *sv_demoMaxSize; +int sv_demoMaxSize; static cvar_t sv_demoMaxSize_cvar = { .name = "sv_demoMaxSize", .description = "FIXME", .default_value = "20480", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &sv_demoMaxSize }, + .value = { .type = &cexpr_int, .value = &sv_demoMaxSize }, }; static int sv_demoUseCache; static cvar_t sv_demoUseCache_cvar = { @@ -108,23 +108,23 @@ static cvar_t sv_demoUseCache_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_int, .value = &sv_demoUseCache }, }; -static char *sv_demoCacheSize; +int sv_demoCacheSize; static cvar_t sv_demoCacheSize_cvar = { .name = "sv_demoCacheSize", .description = "FIXME", .default_value = 0, .flags = CVAR_ROM, - .value = { .type = 0/* not used */, .value = &sv_demoCacheSize }, + .value = { .type = &cexpr_int, .value = &sv_demoCacheSize }, }; -static char *sv_demoMaxDirSize; +int sv_demoMaxDirSize; static cvar_t sv_demoMaxDirSize_cvar = { .name = "sv_demoMaxDirSize", .description = "FIXME", .default_value = "102400", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &sv_demoMaxDirSize }, + .value = { .type = &cexpr_int, .value = &sv_demoMaxDirSize }, }; static char *sv_demoDir; static cvar_t sv_demoDir_cvar = { @@ -135,14 +135,14 @@ static cvar_t sv_demoDir_cvar = { .flags = CVAR_NONE, .value = { .type = 0, .value = &sv_demoDir }, }; -static char *sv_demoNoVis; +int sv_demoNoVis; static cvar_t sv_demoNoVis_cvar = { .name = "sv_demoNoVis", .description = "FIXME", .default_value = "1", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &sv_demoNoVis }, + .value = { .type = &cexpr_int, .value = &sv_demoNoVis }, }; static char *sv_demoPrefix; static cvar_t sv_demoPrefix_cvar = { @@ -178,7 +178,7 @@ static cvar_t sv_ondemoremove_cvar = { "FIXME", .default_value = "", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &sv_ondemoremove }, + .value = { .type = 0, .value = &sv_ondemoremove }, }; static int sv_demotxt; static cvar_t sv_demotxt_cvar = { diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 651bb8ccf..d5b504ba5 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -319,14 +319,14 @@ static cvar_t allow_download_maps_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_int, .value = &allow_download_maps }, }; -char *allow_download_demos; +int allow_download_demos; static cvar_t allow_download_demos_cvar = { .name = "allow_download_demos", .description = "Toggle if clients can download maps from the server", .default_value = "1", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &allow_download_demos }, + .value = { .type = &cexpr_int, .value = &allow_download_demos }, }; int sv_highchars; @@ -391,14 +391,14 @@ static cvar_t sv_timefmt_cvar = { }; // game rules mirrored in svs.info -char *fraglimit; +float fraglimit; static cvar_t fraglimit_cvar = { .name = "fraglimit", .description = "None", .default_value = "0", .flags = CVAR_SERVERINFO, - .value = { .type = 0/* not used */, .value = &fraglimit }, + .value = { .type = &cexpr_float, .value = &fraglimit }, }; int timelimit; static cvar_t timelimit_cvar = { @@ -418,14 +418,14 @@ static cvar_t teamplay_cvar = { .flags = CVAR_SERVERINFO, .value = { .type = &cexpr_int, .value = &teamplay }, }; -char *samelevel; +float samelevel; static cvar_t samelevel_cvar = { .name = "samelevel", .description = "None", .default_value = "0", .flags = CVAR_NONE, - .value = { .type = 0/* not used */, .value = &samelevel }, + .value = { .type = &cexpr_float, .value = &samelevel }, }; int maxclients; static cvar_t maxclients_cvar = { @@ -475,23 +475,23 @@ static cvar_t skill_cvar = { .flags = CVAR_NONE, .value = { .type = &cexpr_int, .value = &skill }, }; -char *spawn; +float spawn; static cvar_t spawn_cvar = { .name = "spawn", .description = "Spawn the player entity", .default_value = "0", .flags = CVAR_SERVERINFO, - .value = { .type = 0/* not used */, .value = &spawn }, + .value = { .type = &cexpr_float, .value = &spawn }, }; -char *watervis; +int watervis; static cvar_t watervis_cvar = { .name = "watervis", .description = "Set nonzero to enable r_wateralpha on clients", .default_value = "0", .flags = CVAR_SERVERINFO, - .value = { .type = 0/* not used */, .value = &watervis }, + .value = { .type = &cexpr_int, .value = &watervis }, }; char *hostname; diff --git a/qw/source/sv_progs.c b/qw/source/sv_progs.c index fe95916b2..345efc945 100644 --- a/qw/source/sv_progs.c +++ b/qw/source/sv_progs.c @@ -102,14 +102,14 @@ static cvar_t sv_progs_ext_cvar = { .flags = CVAR_NONE, .value = { .type = 0, .value = &sv_progs_ext }, }; -char *pr_checkextensions; +float pr_checkextensions; static cvar_t pr_checkextensions_cvar = { .name = "pr_checkextensions", .description = "indicate the presence of the checkextentions qc function", .default_value = "1", .flags = CVAR_ROM, - .value = { .type = 0/* not used */, .value = &pr_checkextensions }, + .value = { .type = &cexpr_float, .value = &pr_checkextensions }, }; int sv_old_entity_free; static cvar_t sv_old_entity_free_cvar = {