From 44dcf7462747000a8622a790bd93905a3a28daaa Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 14 May 2002 06:12:29 +0000 Subject: [PATCH] strip the \n from all(?) of the Sys_Error calls (Sys_Error itself will be adding \n). --- libs/audio/renderer/snd_dma.c | 2 +- libs/audio/targets/snd_alsa_0_5.c | 4 +- libs/audio/targets/snd_sdl.c | 2 +- libs/gamecode/builtins/bi_cmd.c | 2 +- libs/models/alias/gl_model_alias.c | 2 +- libs/models/alias/model_alias.c | 4 +- libs/models/gl_model_fullbright.c | 2 +- libs/models/model.c | 2 +- libs/models/sprite/model_sprite.c | 2 +- libs/util/cmd.c | 12 ++-- libs/util/cvar.c | 2 +- libs/util/dstring.c | 6 +- libs/util/info.c | 6 +- libs/util/mathlib.c | 4 +- libs/util/msg.c | 2 +- libs/util/qfplist.c | 2 +- libs/util/quakefs.c | 2 +- libs/util/tga.c | 8 +-- libs/util/wad.c | 4 +- libs/util/zone.c | 20 +++--- libs/video/renderer/gl/gl_dyn_part.c | 2 +- libs/video/renderer/gl/gl_funcs.c | 6 +- libs/video/renderer/gl/gl_graph.c | 2 +- libs/video/renderer/gl/gl_screen.c | 2 +- libs/video/renderer/gl/gl_sky_clip.c | 2 +- libs/video/renderer/gl/gl_textures.c | 2 +- libs/video/renderer/gl/noisetextures.c | 4 +- libs/video/renderer/r_efrag.c | 2 +- libs/video/renderer/sw/d_surf.c | 4 +- libs/video/renderer/sw32/d_edge.c | 2 +- libs/video/renderer/sw32/d_fill.c | 2 +- libs/video/renderer/sw32/d_part.c | 2 +- libs/video/renderer/sw32/d_polyse.c | 2 +- libs/video/renderer/sw32/d_scan.c | 6 +- libs/video/renderer/sw32/d_sky.c | 2 +- libs/video/renderer/sw32/d_sprite.c | 2 +- libs/video/renderer/sw32/d_surf.c | 4 +- libs/video/renderer/sw32/d_zpoint.c | 2 +- libs/video/renderer/sw32/draw.c | 18 +++--- libs/video/renderer/sw32/screen.c | 4 +- libs/video/renderer/sw32/sw32_graph.c | 2 +- libs/video/renderer/sw32/sw32_ralias.c | 2 +- libs/video/renderer/sw32/sw32_rsky.c | 2 +- libs/video/renderer/sw32/sw32_rsurf.c | 2 +- libs/video/renderer/sw32/sw32_skin.c | 2 +- libs/video/targets/context_x11.c | 2 +- libs/video/targets/fbset.c | 2 +- libs/video/targets/fbset_modes_l.l | 88 +++++++++++++------------- libs/video/targets/in_win.c | 4 +- libs/video/targets/in_x11.c | 4 +- libs/video/targets/qfgl_ext.c | 4 +- libs/video/targets/vid.c | 12 ++-- libs/video/targets/vid_3dfxsvga.c | 2 +- libs/video/targets/vid_common_gl.c | 2 +- libs/video/targets/vid_common_sw.c | 6 +- libs/video/targets/vid_common_sw32.c | 8 +-- libs/video/targets/vid_ext.c | 2 +- libs/video/targets/vid_fbdev.c | 18 +++--- libs/video/targets/vid_glx.c | 3 +- libs/video/targets/vid_mgl.c | 4 +- libs/video/targets/vid_sdl.c | 2 +- libs/video/targets/vid_sdl32.c | 4 +- libs/video/targets/vid_sgl.c | 4 +- libs/video/targets/vid_svgalib.c | 8 +-- libs/video/targets/vid_wgl.c | 14 ++-- libs/video/targets/vid_x11.c | 20 +++--- nq/source/host.c | 16 ++--- nq/source/locs.c | 2 +- nq/source/net_bw.c | 8 +-- nq/source/net_dgrm.c | 12 ++-- nq/source/net_ipx.c | 6 +- nq/source/net_loop.c | 2 +- nq/source/net_main.c | 2 +- nq/source/net_mp.c | 6 +- nq/source/net_udp.c | 8 +-- nq/source/net_vcr.c | 2 +- nq/source/net_wins.c | 4 +- nq/source/net_wipx.c | 6 +- qw/source/cl_demo.c | 2 +- qw/source/cl_main.c | 4 +- qw/source/cl_slist.c | 8 +-- qw/source/locs.c | 2 +- qw/source/sv_ccmds.c | 2 +- qw/source/sv_main.c | 6 +- qw/source/sv_progs.c | 2 +- qw/source/sv_send.c | 2 +- tools/qfcc/source/cmdlib.c | 2 +- tools/qfcc/source/expr.c | 6 +- tools/qfcc/source/pr_def.c | 2 +- tools/qfcc/source/qc-lex.l | 4 +- tools/qfcc/source/qc-parse.y | 4 +- tools/qfcc/source/switch.c | 4 +- tools/qfcc/source/type.c | 2 +- tools/qfdefs/source/fix_globals.c | 2 +- tools/qwaq/main.c | 4 +- 95 files changed, 258 insertions(+), 259 deletions(-) diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index e48c0644b..c9b0d55cf 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -299,7 +299,7 @@ SND_FindName (const char *name) sfx_t *sfx; if (!name) - Sys_Error ("S_FindName: NULL\n"); + Sys_Error ("S_FindName: NULL"); if (strlen (name) >= MAX_QPATH) Sys_Error ("Sound name too long: %s", name); diff --git a/libs/audio/targets/snd_alsa_0_5.c b/libs/audio/targets/snd_alsa_0_5.c index 1e9afb17c..133a848b3 100644 --- a/libs/audio/targets/snd_alsa_0_5.c +++ b/libs/audio/targets/snd_alsa_0_5.c @@ -369,7 +369,7 @@ SNDDMA_Submit (void) case SND_PCM_STATUS_PREPARED: if ((rc = snd_pcm_channel_go (pcm_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - Sys_Error ("unable to start playback. %s\n", + Sys_Error ("unable to start playback. %s", snd_strerror (rc)); } break; @@ -378,7 +378,7 @@ SNDDMA_Submit (void) case SND_PCM_STATUS_UNDERRUN: if ((rc = snd_pcm_plugin_prepare (pcm_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - Sys_Error ("underrun: playback channel prepare error. %s\n", + Sys_Error ("underrun: playback channel prepare error. %s", snd_strerror (rc)); } break; diff --git a/libs/audio/targets/snd_sdl.c b/libs/audio/targets/snd_sdl.c index 9620e2c91..eec86ba11 100644 --- a/libs/audio/targets/snd_sdl.c +++ b/libs/audio/targets/snd_sdl.c @@ -174,7 +174,7 @@ SNDDMA_Init (void) shm->buffer = calloc(shm->samples * (shm->samplebits / 8), 1); if (!shm->buffer) { - Sys_Error ("Failed to allocate buffer for sound!\n"); + Sys_Error ("Failed to allocate buffer for sound!"); } snd_inited = 1; diff --git a/libs/gamecode/builtins/bi_cmd.c b/libs/gamecode/builtins/bi_cmd.c index bb58109cd..ce36640d0 100644 --- a/libs/gamecode/builtins/bi_cmd.c +++ b/libs/gamecode/builtins/bi_cmd.c @@ -81,7 +81,7 @@ bi_cmd_f (void *pr) bi_cmd_t *cmd = Hash_Find (bi_cmds, Cmd_Argv (0)); if (!cmd) - Sys_Error ("bi_cmd_f: unexpected call %s\n", Cmd_Argv (0)); + Sys_Error ("bi_cmd_f: unexpected call %s", Cmd_Argv (0)); PR_ExecuteProgram (cmd->pr, cmd->func); } diff --git a/libs/models/alias/gl_model_alias.c b/libs/models/alias/gl_model_alias.c index 631730735..2b3cac25d 100644 --- a/libs/models/alias/gl_model_alias.c +++ b/libs/models/alias/gl_model_alias.c @@ -157,7 +157,7 @@ Mod_LoadSkin (byte * skin, int skinsize, int snum, int gnum, qboolean group, // save 8 bit texels for the player model to remap if (strequal (loadmodel->name, "progs/player.mdl")) { if (skinsize > sizeof (player_8bit_texels)) - Sys_Error ("Player skin too large\n"); + Sys_Error ("Player skin too large"); memcpy (player_8bit_texels, pskin, skinsize); } diff --git a/libs/models/alias/model_alias.c b/libs/models/alias/model_alias.c index a52629627..8806ddc62 100644 --- a/libs/models/alias/model_alias.c +++ b/libs/models/alias/model_alias.c @@ -82,7 +82,7 @@ Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex) float *poutskinintervals; if (numskins < 1 || numskins > MAX_SKINS) - Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins); + Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d", numskins); skinsize = pheader->mdl.skinwidth * pheader->mdl.skinheight; pskindesc = Hunk_AllocName (numskins * sizeof (maliasskindesc_t), @@ -223,7 +223,7 @@ Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator) pmodel->numframes = LittleLong (pinmodel->numframes); numframes = pmodel->numframes; if (numframes < 1) - Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d\n", numframes); + Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d", numframes); pmodel->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO; mod->synctype = LittleLong (pinmodel->synctype); diff --git a/libs/models/gl_model_fullbright.c b/libs/models/gl_model_fullbright.c index 67ba85e79..1f61e9a33 100644 --- a/libs/models/gl_model_fullbright.c +++ b/libs/models/gl_model_fullbright.c @@ -73,7 +73,7 @@ Mod_Fullbright (byte * skin, int width, int height, char *name) // ptexels = Hunk_Alloc(s); ptexels = malloc (pixels); if (!ptexels) - Sys_Error ("Mod_Fullbright: Memory Allocation Failure\n"); + Sys_Error ("Mod_Fullbright: Memory Allocation Failure"); if (Mod_CalcFullbright (skin, ptexels, pixels)) { Sys_DPrintf ("FB Model ID: '%s'\n", name); texnum = GL_LoadTexture (name, width, height, ptexels, true, true, 1); diff --git a/libs/models/model.c b/libs/models/model.c index 9f2e45753..332c9b01d 100644 --- a/libs/models/model.c +++ b/libs/models/model.c @@ -242,7 +242,7 @@ void Mod_CallbackLoad (void *object, cache_allocator_t allocator) { if (((model_t *)object)->type != mod_alias) - Sys_Error ("Mod_CallbackLoad for non-alias model? FIXME!\n"); + Sys_Error ("Mod_CallbackLoad for non-alias model? FIXME!"); // FIXME: do we want crash set to true? Mod_RealLoadModel (object, true, allocator); } diff --git a/libs/models/sprite/model_sprite.c b/libs/models/sprite/model_sprite.c index 4e8f5fdd0..b3f322891 100644 --- a/libs/models/sprite/model_sprite.c +++ b/libs/models/sprite/model_sprite.c @@ -166,7 +166,7 @@ Mod_LoadSpriteModel (model_t *mod, void *buffer) // load the frames if (numframes < 1) - Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes); + Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d", numframes); mod->numframes = numframes; diff --git a/libs/util/cmd.c b/libs/util/cmd.c index 290785c13..d0d99c4d6 100644 --- a/libs/util/cmd.c +++ b/libs/util/cmd.c @@ -659,7 +659,7 @@ Cmd_StuffCmds_f (void) // pull out the commands build = malloc (s + 1); if (!build) - Sys_Error ("Cmd_StuffCmds_f: Memory Allocation Failure\n"); + Sys_Error ("Cmd_StuffCmds_f: Memory Allocation Failure"); build[0] = 0; for (i = 0; i < s - 1; i++) { @@ -1558,7 +1558,7 @@ Cmd_AddCommand (const char *cmd_name, xcommand_t function, cmd = calloc (1, sizeof (cmd_function_t)); if (!cmd) - Sys_Error ("Cmd_AddCommand: Memory Allocation Failure\n"); + Sys_Error ("Cmd_AddCommand: Memory Allocation Failure"); cmd->name = cmd_name; cmd->function = function; cmd->description = description; @@ -1700,7 +1700,7 @@ Cmd_CompleteBuildList (const char *partial) buf = malloc (sizeofbuf + sizeof (char *)); if (!buf) - Sys_Error ("Cmd_CompleteBuildList: Memory Allocation Failure\n"); + Sys_Error ("Cmd_CompleteBuildList: Memory Allocation Failure"); // Loop through the alias list and print all matches for (cmd = cmd_functions; cmd; cmd = cmd->next) if (!strncasecmp (partial, cmd->name, len)) @@ -1789,7 +1789,7 @@ Cmd_CompleteAliasBuildList (const char *partial) buf = malloc (sizeofbuf + sizeof (char *)); if (!buf) - Sys_Error ("Cmd_CompleteAliasBuildList: Memory Allocation Failure\n"); + Sys_Error ("Cmd_CompleteAliasBuildList: Memory Allocation Failure"); // Loop through the alias list and print all matches for (alias = cmd_alias; alias; alias = alias->next) if (!strncasecmp (partial, alias->name, len)) @@ -1928,7 +1928,7 @@ Cmd_Alias_f (void) alias = calloc (1, sizeof (cmdalias_t)); if (!alias) - Sys_Error ("Cmd_Alias_f: Memory Allocation Failure\n"); + Sys_Error ("Cmd_Alias_f: Memory Allocation Failure"); alias->name = strdup (s); Hash_Add (cmd_alias_hash, alias); for (a = &cmd_alias; *a; a = &(*a)->next) @@ -1940,7 +1940,7 @@ Cmd_Alias_f (void) // copy the rest of the command line cmd = malloc (strlen (Cmd_Args (1)) + 2); // can never be longer if (!cmd) - Sys_Error ("Cmd_Alias_f: Memory Allocation Failure\n"); + Sys_Error ("Cmd_Alias_f: Memory Allocation Failure"); cmd[0] = 0; // start out with a null string c = Cmd_Argc (); for (i = 2; i < c; i++) { diff --git a/libs/util/cvar.c b/libs/util/cvar.c index 06d6766a9..7d9042380 100644 --- a/libs/util/cvar.c +++ b/libs/util/cvar.c @@ -217,7 +217,7 @@ Cvar_CompleteBuildList (const char *partial) len = strlen(partial); buf = malloc(sizeofbuf + sizeof (char *)); if (!buf) - Sys_Error ("Cvar_CompleteBuildList: Memory Allocation Failure\n"); + Sys_Error ("Cvar_CompleteBuildList: Memory Allocation Failure"); // Loop through the alias list and print all matches for (cvar = cvar_vars; cvar; cvar = cvar->next) if (!strncasecmp(partial, cvar->name, len)) diff --git a/libs/util/dstring.c b/libs/util/dstring.c index ee0262574..d758c9e5f 100644 --- a/libs/util/dstring.c +++ b/libs/util/dstring.c @@ -43,7 +43,7 @@ dstring_new (void) new = calloc (1, sizeof (dstring_t)); if (!new) - Sys_Error ("dstring_new: Failed to allocate memory.\n"); + Sys_Error ("dstring_new: Failed to allocate memory."); return new; } @@ -61,7 +61,7 @@ dstring_adjust (dstring_t *dstr) if (dstr->size > dstr->truesize) { dstr->str = realloc (dstr->str, dstr->size); if (!dstr->str) - Sys_Error ("dstring_adjust: Failed to reallocate memory.\n"); + Sys_Error ("dstring_adjust: Failed to reallocate memory."); dstr->truesize = dstr->size; } } @@ -130,7 +130,7 @@ dstring_newstr (void) new = calloc (1, sizeof (dstring_t)); if (!new) - Sys_Error ("dstring_newstr: Failed to allocate memory.\n"); + Sys_Error ("dstring_newstr: Failed to allocate memory."); new->size = 1; dstring_adjust (new); new->str[0] = 0; diff --git a/libs/util/info.c b/libs/util/info.c index 5d3faff2f..7ce36e99d 100644 --- a/libs/util/info.c +++ b/libs/util/info.c @@ -132,14 +132,14 @@ Info_SetValueForStarKey (info_t *info, const char *key, const char *value, int f free ((char*)k->value); } else { if (!(k = malloc (sizeof (info_key_t)))) - Sys_Error ("Info_SetValueForStarKey: out of memory\n"); + Sys_Error ("Info_SetValueForStarKey: out of memory"); if (!(k->key = strdup (key))) - Sys_Error ("Info_SetValueForStarKey: out of memory\n"); + Sys_Error ("Info_SetValueForStarKey: out of memory"); info->cursize += strlen (key) + 1; Hash_Add (info->tab, k); } if (!(str = strdup (value))) - Sys_Error ("Info_SetValueForStarKey: out of memory\n"); + Sys_Error ("Info_SetValueForStarKey: out of memory"); if (flags & 1) { byte *s, *d; for (d = s = str; *s; s++) diff --git a/libs/util/mathlib.c b/libs/util/mathlib.c index 91bc91d80..b8f645094 100644 --- a/libs/util/mathlib.c +++ b/libs/util/mathlib.c @@ -518,10 +518,10 @@ FloorDivMod (double numer, double denom, int *quotient, int *rem) #ifndef PARANOID if (denom <= 0.0) - Sys_Error ("FloorDivMod: bad denominator %f\n", denom); + Sys_Error ("FloorDivMod: bad denominator %f", denom); // if ((floor(numer) != numer) || (floor(denom) != denom)) -// Sys_Error ("FloorDivMod: non-integer numer or denom %f %f\n", +// Sys_Error ("FloorDivMod: non-integer numer or denom %f %f", // numer, denom); #endif diff --git a/libs/util/msg.c b/libs/util/msg.c index 9ccaee4c7..0443f571b 100644 --- a/libs/util/msg.c +++ b/libs/util/msg.c @@ -283,7 +283,7 @@ MSG_ReadString (msg_t *msg) msg->badread_string_size = len + 1; } if (!msg->badread_string) - Sys_Error ("MSG_ReadString: out of memory\n"); + Sys_Error ("MSG_ReadString: out of memory"); strncpy (msg->badread_string, string, len); msg->badread_string[len] = 0; return msg->badread_string; diff --git a/libs/util/qfplist.c b/libs/util/qfplist.c index bceb9cebe..0a422e29f 100644 --- a/libs/util/qfplist.c +++ b/libs/util/qfplist.c @@ -488,7 +488,7 @@ PL_GetPropertyList (const char *string) return newpl; } else { if (pl && pl->error && pl->error[0]) - Sys_Error ("%d,%d: %s\n", pl->line, pl->pos, pl->error); + Sys_Error ("%d,%d: %s", pl->line, pl->pos, pl->error); free (pl); return NULL; } diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index 8b196020d..915c5ac9b 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -727,7 +727,7 @@ COM_LoadGameDirectory (const char *dir) pakfiles[count] = malloc (FNAME_SIZE); if (!pakfiles[count]) - Sys_Error ("COM_LoadGameDirectory: MemoryAllocationFailure\n"); + Sys_Error ("COM_LoadGameDirectory: MemoryAllocationFailure"); snprintf (pakfiles[count], FNAME_SIZE - 1, "%s/%s", dir, dirent->d_name); pakfiles[count][FNAME_SIZE - 1] = '\0'; diff --git a/libs/util/tga.c b/libs/util/tga.c index 5a0f7ca2d..d771d9150 100644 --- a/libs/util/tga.c +++ b/libs/util/tga.c @@ -135,12 +135,12 @@ LoadTGA (VFile *fin) targa->height = LittleShort (targa->height); if (targa->image_type != 2 && targa->image_type != 10) - Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n"); + Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported"); if (targa->colormap_type != 0 || (targa->pixel_size != 32 && targa->pixel_size != 24)) Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported " - "(no colormaps)\n"); + "(no colormaps)"); columns = targa->width; rows = targa->height; @@ -150,14 +150,14 @@ LoadTGA (VFile *fin) case 24: tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 3])); if (!tex) - Sys_Error ("LoadTGA: Memory Allocation Failure\n"); + Sys_Error ("LoadTGA: Memory Allocation Failure"); tex->format = tex_rgb; break; default: case 32: tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4])); if (!tex) - Sys_Error ("LoadTGA: Memory Allocation Failure\n"); + Sys_Error ("LoadTGA: Memory Allocation Failure"); tex->format = tex_rgba; break; } diff --git a/libs/util/wad.c b/libs/util/wad.c index ec970a371..e04fb450d 100644 --- a/libs/util/wad.c +++ b/libs/util/wad.c @@ -98,7 +98,7 @@ W_LoadWadFile (const char *filename) fs_basegame->string); Sys_Printf (" fs_sharepath is %s\n", fs_sharepath->string); Sys_Printf (" fs_userpath is %s\n\n", fs_userpath->string); - Sys_Error ("W_LoadWadFile: unable to load %s\n\n", filename); + Sys_Error ("W_LoadWadFile: unable to load %s", filename); } header = (wadinfo_t *) wad_base; @@ -107,7 +107,7 @@ W_LoadWadFile (const char *filename) || header->identification[1] != 'A' || header->identification[2] != 'D' || header->identification[3] != '2') - Sys_Error ("Wad file %s doesn't have WAD2 id\n", filename); + Sys_Error ("Wad file %s doesn't have WAD2 id", filename); wad_numlumps = LittleLong (header->numlumps); infotableofs = LittleLong (header->infotableofs); diff --git a/libs/util/zone.c b/libs/util/zone.c index 4d420df26..9a8e28ae4 100644 --- a/libs/util/zone.c +++ b/libs/util/zone.c @@ -853,7 +853,7 @@ Cache_RealFree (cache_user_t *c) #ifdef MMAPPED_CACHE if (munmap (cs, cs->size)) - Sys_Error ("Cache_Free: munmap failed!\n"); + Sys_Error ("Cache_Free: munmap failed!"); #endif } @@ -968,7 +968,7 @@ Cache_Add (cache_user_t *c, void *object, cache_loader_t loader) CACHE_WRITE_LOCK; if (c->data || c->object || c->loader) - Sys_Error ("Cache_Add: cache item already exists!\n"); + Sys_Error ("Cache_Add: cache item already exists!"); c->object = object; c->loader = loader; @@ -984,7 +984,7 @@ Cache_Remove (cache_user_t *c) CACHE_WRITE_LOCK; if (!c->object || !c->loader) - Sys_Error ("Cache_Remove: already removed!\n"); + Sys_Error ("Cache_Remove: already removed!"); if (Cache_RealCheck (c)) Cache_RealFree (c); @@ -1018,7 +1018,7 @@ Cache_Get (cache_user_t *c) { void *mem = Cache_TryGet (c); if (!mem) - Sys_Error ("Cache_Get: couldn't get cache!\n"); + Sys_Error ("Cache_Get: couldn't get cache!"); return mem; } @@ -1030,7 +1030,7 @@ Cache_Release (cache_user_t *c) readlock = &(((cache_system_t *)c->data) - 1)->readlock; if (!*readlock) - Sys_Error ("Cache_Release: already released!\n"); + Sys_Error ("Cache_Release: already released!"); (*readlock)--; @@ -1057,7 +1057,7 @@ QA_alloc (unsigned flags, ...) va_list ap; if (flags & ~(QA_FAILURE | QA_PREVIOUS | QA_SIZE | QA_ZEROED)) - Sys_Error ("QA_alloc: bad flags: %u\n", flags); + Sys_Error ("QA_alloc: bad flags: %u", flags); va_start (ap, flags); if (flags & QA_PREVIOUS) @@ -1071,13 +1071,13 @@ QA_alloc (unsigned flags, ...) va_end (ap); if (failure != QA_NOFAIL && failure != QA_LATEFAIL && failure != QA_EARLYFAIL) - Sys_Error ("QA_alloc: invalid failure type: %u\n", failure); + Sys_Error ("QA_alloc: invalid failure type: %u", failure); if (size) { do { if (ptr) { if (zeroed) - Sys_Error ("QA_alloc: Zeroing reallocated memory not yet supported\n"); + Sys_Error ("QA_alloc: Zeroing reallocated memory not yet supported"); else mem = realloc (ptr, size); } else { @@ -1090,12 +1090,12 @@ QA_alloc (unsigned flags, ...) && QA_alloc_callback && QA_alloc_callback (size)); if (!mem && failure == QA_NOFAIL) - Sys_Error ("QA_alloc: could not allocate %d bytes!\n", (int)size); + Sys_Error ("QA_alloc: could not allocate %d bytes!", (int)size); return mem; } else { if (!ptr) - Sys_Error ("QA_alloc: can't free a NULL pointers!\n"); + Sys_Error ("QA_alloc: can't free a NULL pointers!"); free (ptr); return 0; } diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index 7fb8ecf1b..74d89d6a1 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -78,7 +78,7 @@ particle_new (ptype_t type, int texnum, const vec3_t org, float scale, /* if (numparticles >= r_maxparticles) { - Sys_Error ("FAILED PARTICLE ALLOC!\n"); + Sys_Error ("FAILED PARTICLE ALLOC!"); return NULL; } */ diff --git a/libs/video/renderer/gl/gl_funcs.c b/libs/video/renderer/gl/gl_funcs.c index c1123392e..ed8ffe226 100644 --- a/libs/video/renderer/gl/gl_funcs.c +++ b/libs/video/renderer/gl/gl_funcs.c @@ -73,7 +73,7 @@ QFGL_LoadLibrary (void) void *handle; if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) { - Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_driver->string, + Sys_Error ("Couldn't load OpenGL library %s: %s", gl_driver->string, dlerror ()); } getProcAddress = dlsym; @@ -92,7 +92,7 @@ QFGL_LoadLibrary (void) void *handle; if (!(handle = LoadLibrary (gl_driver->string))) { - Sys_Error ("Couldn't load OpenGL library %s!\n", gl_driver->string); + Sys_Error ("Couldn't load OpenGL library %s!", gl_driver->string); } getProcAddress = GetProcAddress; (FARPROC)glGetProcAddress = GetProcAddress (handle, "wglGetProcAddress"); @@ -148,7 +148,7 @@ QFGL_ProcAddress (void *handle, const char *name, qboolean crit) Con_DPrintf ("not found\n"); if (crit) - Sys_Error ("Couldn't load critical OpenGL function %s, exiting...\n", + Sys_Error ("Couldn't load critical OpenGL function %s, exiting...", name); return NULL; diff --git a/libs/video/renderer/gl/gl_graph.c b/libs/video/renderer/gl/gl_graph.c index 0b80822f2..80bada753 100644 --- a/libs/video/renderer/gl/gl_graph.c +++ b/libs/video/renderer/gl/gl_graph.c @@ -88,7 +88,7 @@ R_LineGraph (int x, int y, int *h_vals, int count) graph_width[graph_index] = count; if (!graph_texels[graph_index]) - Sys_Error ("R_LineGraph: failed to allocate texture buffer\n"); + Sys_Error ("R_LineGraph: failed to allocate texture buffer"); i = 0; while (count--) { diff --git a/libs/video/renderer/gl/gl_screen.c b/libs/video/renderer/gl/gl_screen.c index 2f0eb6111..537cb1e01 100644 --- a/libs/video/renderer/gl/gl_screen.c +++ b/libs/video/renderer/gl/gl_screen.c @@ -604,7 +604,7 @@ SCR_ScreenShot_f (void) } buffer = malloc (glwidth * glheight * 3); if (!buffer) - Sys_Error ("SCR_ScreenShot_f: Memory Allocation Failure\n"); + Sys_Error ("SCR_ScreenShot_f: Memory Allocation Failure"); qfglReadPixels (glx, gly, glwidth, glheight, GL_BGR_EXT, GL_UNSIGNED_BYTE, buffer); WriteTGAfile (pcxname, buffer, glwidth, glheight); diff --git a/libs/video/renderer/gl/gl_sky_clip.c b/libs/video/renderer/gl/gl_sky_clip.c index 126ce0cab..0d2582a2f 100644 --- a/libs/video/renderer/gl/gl_sky_clip.c +++ b/libs/video/renderer/gl/gl_sky_clip.c @@ -144,7 +144,7 @@ determine_face (vec3_t v) i = 2; } if (!m) { - Sys_Error ("You are speared by a sky poly edge\n"); + Sys_Error ("You are speared by a sky poly edge"); } if (v[i] < 0) i += 3; diff --git a/libs/video/renderer/gl/gl_textures.c b/libs/video/renderer/gl/gl_textures.c index c18a28a61..f0ccf7e70 100644 --- a/libs/video/renderer/gl/gl_textures.c +++ b/libs/video/renderer/gl/gl_textures.c @@ -509,7 +509,7 @@ GL_Upload8 (byte * data, int width, int height, qboolean mipmap, qboolean alpha) s = width * height; trans = malloc (s * sizeof (unsigned int)); if (!trans) - Sys_Error ("GL_Upload8: Memory Allocation Failure\n"); + Sys_Error ("GL_Upload8: Memory Allocation Failure"); // if there are no transparent pixels, make it a 3 component // texture even if it was specified as otherwise diff --git a/libs/video/renderer/gl/noisetextures.c b/libs/video/renderer/gl/noisetextures.c index e09086152..e3c3f2ea4 100644 --- a/libs/video/renderer/gl/noisetextures.c +++ b/libs/video/renderer/gl/noisetextures.c @@ -62,11 +62,11 @@ noise_diamondsquare (unsigned char *noise, unsigned int size, for (sizepower = 0; (1 << sizepower) < size; sizepower++); if (size != (1 << sizepower)) - Sys_Error("fractalnoise: size must be power of 2\n"); + Sys_Error("fractalnoise: size must be power of 2"); for (gridpower = 0; (1 << gridpower) < startgrid; gridpower++); if (startgrid != (1 << gridpower)) - Sys_Error("fractalnoise: grid must be power of 2\n"); + Sys_Error("fractalnoise: grid must be power of 2"); startgrid = bound(0, startgrid, size); amplitude = 0xFFFF; // this gets halved before use diff --git a/libs/video/renderer/r_efrag.c b/libs/video/renderer/r_efrag.c index 813f397ad..c9ee339ed 100644 --- a/libs/video/renderer/r_efrag.c +++ b/libs/video/renderer/r_efrag.c @@ -254,7 +254,7 @@ R_StoreEfrags (efrag_t **ppefrag) break; default: - Sys_Error ("R_StoreEfrags: Bad entity type %d\n", + Sys_Error ("R_StoreEfrags: Bad entity type %d", model->type); } } diff --git a/libs/video/renderer/sw/d_surf.c b/libs/video/renderer/sw/d_surf.c index b72dbbfde..6d1d83a3d 100644 --- a/libs/video/renderer/sw/d_surf.c +++ b/libs/video/renderer/sw/d_surf.c @@ -149,10 +149,10 @@ D_SCAlloc (int width, int size) qboolean wrapped_this_time; if ((width < 0) || (width > 256)) - Sys_Error ("D_SCAlloc: bad cache width %d\n", width); + Sys_Error ("D_SCAlloc: bad cache width %d", width); if ((size <= 0) || (size > 0x10000)) - Sys_Error ("D_SCAlloc: bad cache size %d\n", size); + Sys_Error ("D_SCAlloc: bad cache size %d", size); /* This adds the offset of data[0] in the surfcache_t struct. */ size += field_offset (surfcache_t, data); diff --git a/libs/video/renderer/sw32/d_edge.c b/libs/video/renderer/sw32/d_edge.c index c91d32146..905998ff4 100644 --- a/libs/video/renderer/sw32/d_edge.c +++ b/libs/video/renderer/sw32/d_edge.c @@ -130,7 +130,7 @@ D_DrawSolidSurface (surf_t *surf, int color) } break; default: - Sys_Error("D_DrawSolidSurface: unsupported r_pixbytes %i\n", + Sys_Error("D_DrawSolidSurface: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_fill.c b/libs/video/renderer/sw32/d_fill.c index d844fca3d..f13365997 100644 --- a/libs/video/renderer/sw32/d_fill.c +++ b/libs/video/renderer/sw32/d_fill.c @@ -157,6 +157,6 @@ D_FillRect (vrect_t *rect, int color) } break; default: - Sys_Error("D_FillRect: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("D_FillRect: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_part.c b/libs/video/renderer/sw32/d_part.c index 32cee0cbf..e92ce42c0 100644 --- a/libs/video/renderer/sw32/d_part.c +++ b/libs/video/renderer/sw32/d_part.c @@ -379,6 +379,6 @@ D_DrawParticle (particle_t *pparticle) } break; default: - Sys_Error("D_DrawParticles: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("D_DrawParticles: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_polyse.c b/libs/video/renderer/sw32/d_polyse.c index e073c8023..e28414682 100644 --- a/libs/video/renderer/sw32/d_polyse.c +++ b/libs/video/renderer/sw32/d_polyse.c @@ -583,7 +583,7 @@ done32: ; break; default: - Sys_Error("D_PolysetDrawSpans: unsupported r_pixbytes %i\n", + Sys_Error("D_PolysetDrawSpans: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_scan.c b/libs/video/renderer/sw32/d_scan.c index d3b372d1c..04aa25f20 100644 --- a/libs/video/renderer/sw32/d_scan.c +++ b/libs/video/renderer/sw32/d_scan.c @@ -198,7 +198,7 @@ D_WarpScreen (void) } break; default: - Sys_Error("D_WarpScreen: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("D_WarpScreen: unsupported r_pixbytes %i", r_pixbytes); } } @@ -254,7 +254,7 @@ D_DrawTurbulentSpan (void) } break; default: - Sys_Error("D_DrawTurbulentSpan: unsupported r_pixbytes %i\n", + Sys_Error("D_DrawTurbulentSpan: unsupported r_pixbytes %i", r_pixbytes); } } @@ -817,7 +817,7 @@ D_DrawSpans (espan_t *pspan) } break; default: - Sys_Error("D_DrawSpans: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("D_DrawSpans: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_sky.c b/libs/video/renderer/sw32/d_sky.c index 3a08175f7..0675dead3 100644 --- a/libs/video/renderer/sw32/d_sky.c +++ b/libs/video/renderer/sw32/d_sky.c @@ -272,6 +272,6 @@ D_DrawSkyScans (espan_t *pspan) break; default: - Sys_Error("D_DrawSkyScans: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("D_DrawSkyScans: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_sprite.c b/libs/video/renderer/sw32/d_sprite.c index d4d473d22..8f15097c7 100644 --- a/libs/video/renderer/sw32/d_sprite.c +++ b/libs/video/renderer/sw32/d_sprite.c @@ -501,7 +501,7 @@ NextSpan4: break; default: - Sys_Error("D_SpriteDrawSpans: unsupported r_pixbytes %i\n", + Sys_Error("D_SpriteDrawSpans: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/d_surf.c b/libs/video/renderer/sw32/d_surf.c index 9a4ef39f5..0deab6fb5 100644 --- a/libs/video/renderer/sw32/d_surf.c +++ b/libs/video/renderer/sw32/d_surf.c @@ -150,10 +150,10 @@ D_SCAlloc (int width, int size) qboolean wrapped_this_time; if ((width < 0) || (width > 256)) - Sys_Error ("D_SCAlloc: bad cache width %d\n", width); + Sys_Error ("D_SCAlloc: bad cache width %d", width); if ((size <= 0) || (size > (0x10000 * r_pixbytes))) - Sys_Error ("D_SCAlloc: bad cache size %d\n", size); + Sys_Error ("D_SCAlloc: bad cache size %d", size); /* This adds the offset of data[0] in the surfcache_t struct. */ size += field_offset (surfcache_t, data); diff --git a/libs/video/renderer/sw32/d_zpoint.c b/libs/video/renderer/sw32/d_zpoint.c index 3af4a9fe1..ad63f4f4a 100644 --- a/libs/video/renderer/sw32/d_zpoint.c +++ b/libs/video/renderer/sw32/d_zpoint.c @@ -64,7 +64,7 @@ D_DrawZPoint (void) d_8to24table[r_zpointdesc.color]; break; default: - Sys_Error("D_DrawZPoint: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("D_DrawZPoint: unsupported r_pixbytes %i", r_pixbytes); } } } diff --git a/libs/video/renderer/sw32/draw.c b/libs/video/renderer/sw32/draw.c index ca833c89a..25613f8ba 100644 --- a/libs/video/renderer/sw32/draw.c +++ b/libs/video/renderer/sw32/draw.c @@ -311,7 +311,7 @@ Draw_Character (int x, int y, unsigned int num) } break; default: - Sys_Error("Draw_Character: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("Draw_Character: unsupported r_pixbytes %i", r_pixbytes); } } @@ -361,7 +361,7 @@ Draw_Pixel (int x, int y, byte color) d_8to24table[color]; break; default: - Sys_Error("Draw_Pixel: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("Draw_Pixel: unsupported r_pixbytes %i", r_pixbytes); } } @@ -477,7 +477,7 @@ Draw_Pic (int x, int y, qpic_t *pic) } break; default: - Sys_Error("Draw_Pic: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("Draw_Pic: unsupported r_pixbytes %i", r_pixbytes); } } @@ -529,7 +529,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, } break; default: - Sys_Error("Draw_SubPic: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("Draw_SubPic: unsupported r_pixbytes %i", r_pixbytes); } } @@ -618,7 +618,7 @@ Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation) } break; default: - Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i\n", + Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i", r_pixbytes); } } @@ -705,7 +705,7 @@ Draw_ConsoleBackground (int lines) break; default: - Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i\n", + Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i", r_pixbytes); } @@ -990,7 +990,7 @@ R_DrawRect (vrect_t *prect, int rowbytes, byte * psrc, int transparent) } break; default: - Sys_Error("R_DrawRect: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("R_DrawRect: unsupported r_pixbytes %i", r_pixbytes); } } @@ -1103,7 +1103,7 @@ Draw_Fill (int x, int y, int w, int h, int c) } break; default: - Sys_Error("Draw_Fill: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("Draw_Fill: unsupported r_pixbytes %i", r_pixbytes); } } @@ -1154,7 +1154,7 @@ Draw_FadeScreen (void) } break; default: - Sys_Error("Draw_FadeScreen: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("Draw_FadeScreen: unsupported r_pixbytes %i", r_pixbytes); } VID_UnlockBuffer (); diff --git a/libs/video/renderer/sw32/screen.c b/libs/video/renderer/sw32/screen.c index c74191fea..d7628c12e 100644 --- a/libs/video/renderer/sw32/screen.c +++ b/libs/video/renderer/sw32/screen.c @@ -434,7 +434,7 @@ SCR_ApplyBlend (void) // Used to be V_UpdatePalette } break; default: - Sys_Error("V_UpdatePalette: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("V_UpdatePalette: unsupported r_pixbytes %i", r_pixbytes); } } @@ -677,7 +677,7 @@ SCR_ScreenShot_f (void) Con_Printf("SCR_ScreenShot_f: FIXME - add 32bit support\n"); break; default: - Sys_Error("SCR_ScreenShot_f: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("SCR_ScreenShot_f: unsupported r_pixbytes %i", r_pixbytes); } // for adapters that can't stay mapped in for linear writes all the time diff --git a/libs/video/renderer/sw32/sw32_graph.c b/libs/video/renderer/sw32/sw32_graph.c index ea4a000aa..e9a1d27cf 100644 --- a/libs/video/renderer/sw32/sw32_graph.c +++ b/libs/video/renderer/sw32/sw32_graph.c @@ -94,7 +94,7 @@ R_LineGraph (int x, int y, int *h_vals, int count) } break; default: - Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n", + Sys_Error("R_LineGraph: unsupported r_pixbytes %i", r_pixbytes); } } diff --git a/libs/video/renderer/sw32/sw32_ralias.c b/libs/video/renderer/sw32/sw32_ralias.c index 8b41da9ea..0b2b38246 100644 --- a/libs/video/renderer/sw32/sw32_ralias.c +++ b/libs/video/renderer/sw32/sw32_ralias.c @@ -727,7 +727,7 @@ R_AliasDrawModel (alight_t *plighting) else if (r_pixbytes == 4) acolormap = vid.colormap32; else - Sys_Error("R_AliasDrawmodel: unsupported r_pixbytes %i\n", + Sys_Error("R_AliasDrawmodel: unsupported r_pixbytes %i", r_pixbytes); } diff --git a/libs/video/renderer/sw32/sw32_rsky.c b/libs/video/renderer/sw32/sw32_rsky.c index bf79d6750..43eca4b1e 100644 --- a/libs/video/renderer/sw32/sw32_rsky.c +++ b/libs/video/renderer/sw32/sw32_rsky.c @@ -187,7 +187,7 @@ R_MakeSky (void) } break; default: - Sys_Error("R_MakeSky: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("R_MakeSky: unsupported r_pixbytes %i", r_pixbytes); } r_skymade = 1; } diff --git a/libs/video/renderer/sw32/sw32_rsurf.c b/libs/video/renderer/sw32/sw32_rsurf.c index df2bd1aa1..3b4299b4a 100644 --- a/libs/video/renderer/sw32/sw32_rsurf.c +++ b/libs/video/renderer/sw32/sw32_rsurf.c @@ -304,7 +304,7 @@ R_DrawSurface (void) pblockdrawer = surfmiptable32[r_drawsurf.surfmip]; break; default: - Sys_Error("R_DrawSurface: unsupported r_pixbytes %i\n", r_pixbytes); + Sys_Error("R_DrawSurface: unsupported r_pixbytes %i", r_pixbytes); pblockdrawer = NULL; } diff --git a/libs/video/renderer/sw32/sw32_skin.c b/libs/video/renderer/sw32/sw32_skin.c index 987ac3dc4..5d25bd1dc 100644 --- a/libs/video/renderer/sw32/sw32_skin.c +++ b/libs/video/renderer/sw32/sw32_skin.c @@ -145,7 +145,7 @@ Skin_Set_Translate (int top, int bottom, void *_dest) } break; default: - Sys_Error("Skin_Set_Translate: unsupported r_pixbytes %i\n", + Sys_Error("Skin_Set_Translate: unsupported r_pixbytes %i", r_pixbytes); } /* diff --git a/libs/video/targets/context_x11.c b/libs/video/targets/context_x11.c index 675db5481..22e2dfd90 100644 --- a/libs/video/targets/context_x11.c +++ b/libs/video/targets/context_x11.c @@ -243,7 +243,7 @@ X11_OpenDisplay (void) if (!x_disp) { x_disp = XOpenDisplay (NULL); if (!x_disp) { - Sys_Error ("X11_OpenDisplay: Could not open display [%s]\n", + Sys_Error ("X11_OpenDisplay: Could not open display [%s]", XDisplayName (NULL)); } diff --git a/libs/video/targets/fbset.c b/libs/video/targets/fbset.c index c0f8e826d..d835cc649 100644 --- a/libs/video/targets/fbset.c +++ b/libs/video/targets/fbset.c @@ -408,7 +408,7 @@ AddVideoMode (const struct VideoMode *vmode) vmode->name); vmode2 = malloc(sizeof(struct VideoMode)); if (!vmode2) - Sys_Error ("AddVideoMode: Memory Allocation Failure\n"); + Sys_Error ("AddVideoMode: Memory Allocation Failure"); *vmode2 = *vmode; if (!FillScanRates(vmode2)) Die("%s:%d: Bad video mode `%s'\n", Opt_modedb, line, vmode2->name); diff --git a/libs/video/targets/fbset_modes_l.l b/libs/video/targets/fbset_modes_l.l index 5bb8a9122..20d750b96 100644 --- a/libs/video/targets/fbset_modes_l.l +++ b/libs/video/targets/fbset_modes_l.l @@ -26,33 +26,33 @@ #define YY_NO_UNPUT struct keyword { - const char *name; - int token; - int value; + const char *name; + int token; + int value; }; static struct keyword keywords[] = { - { "mode", MODE, 0 }, - { "geometry", GEOMETRY, 0 }, - { "timings", TIMINGS, 0 }, - { "hsync", HSYNC, 0 }, - { "vsync", VSYNC, 0 }, - { "csync", CSYNC, 0 }, - { "gsync", GSYNC, 0 }, - { "extsync", EXTSYNC, 0 }, - { "bcast", BCAST, 0 }, - { "laced", LACED, 0 }, - { "double", DOUBLE, 0 }, - { "rgba", RGBA, 0 }, - { "nonstd", NONSTD, 0 }, - { "accel", ACCEL, 0 }, - { "grayscale", GRAYSCALE, 0 }, - { "endmode", ENDMODE, 0 }, - { "low", POLARITY, LOW }, - { "high", POLARITY, HIGH }, - { "false", BOOLEAN, FALSE }, - { "true", BOOLEAN, TRUE }, - { "", -1, 0 } + { "mode", MODE, 0 }, + { "geometry", GEOMETRY, 0 }, + { "timings", TIMINGS, 0 }, + { "hsync", HSYNC, 0 }, + { "vsync", VSYNC, 0 }, + { "csync", CSYNC, 0 }, + { "gsync", GSYNC, 0 }, + { "extsync", EXTSYNC, 0 }, + { "bcast", BCAST, 0 }, + { "laced", LACED, 0 }, + { "double", DOUBLE, 0 }, + { "rgba", RGBA, 0 }, + { "nonstd", NONSTD, 0 }, + { "accel", ACCEL, 0 }, + { "grayscale", GRAYSCALE, 0 }, + { "endmode", ENDMODE, 0 }, + { "low", POLARITY, LOW }, + { "high", POLARITY, HIGH }, + { "false", BOOLEAN, FALSE }, + { "true", BOOLEAN, TRUE }, + { "", -1, 0 } }; int line = 1; @@ -60,40 +60,40 @@ int line = 1; void yyerror(const char *s) { - Die("%s:%d: %s\n", Opt_modedb, line, s); + Die("%s:%d: %s", Opt_modedb, line, s); } int yywrap(void) { - return 1; + return 1; } static int FindToken(const char *s) { - int i; + int i; - for (i = 0; keywords[i].token > 0; i++) + for (i = 0; keywords[i].token > 0; i++) if (!strcasecmp(s, keywords[i].name)) { yylval.int_val = keywords[i].value; - return keywords[i].token; + return keywords[i].token; } - Die("%s:%d: Unknown keyword `%s'\n", Opt_modedb, line, s); + Die("%s:%d: Unknown keyword `%s'", Opt_modedb, line, s); } static const char *CopyString(const char *s) { - int len; - char *s2; + int len; + char *s2; - len = strlen(s)-2; - if (!(s2 = malloc(len+1))) - Die("No memory\n"); - strncpy(s2, s+1, len); - s2[len] = '\0'; - return s2; + len = strlen(s)-2; + if (!(s2 = malloc(len+1))) + Die("No memory"); + strncpy(s2, s+1, len); + s2[len] = '\0'; + return s2; } @@ -110,17 +110,17 @@ junk . {keyword} { return FindToken(yytext); - } + } {number} { yylval.int_val = strtoul(yytext, NULL, 0); return NUMBER; - } + } {string} { yylval.string = CopyString(yytext); return STRING; - } + } {comment}$ break; @@ -129,10 +129,10 @@ junk . \n { line++; break; - } + } {junk} { - Die("%s:%d: Invalid token `%s'\n", Opt_modedb, line, yytext); - } + Die("%s:%d: Invalid token `%s'", Opt_modedb, line, yytext); + } %% diff --git a/libs/video/targets/in_win.c b/libs/video/targets/in_win.c index 686445bdd..032225af4 100644 --- a/libs/video/targets/in_win.c +++ b/libs/video/targets/in_win.c @@ -757,8 +757,8 @@ AppActivate (BOOL fActive, BOOL minimize) if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { IN_ShowMouse (); - Sys_Error ("Couldn't set fullscreen DIB mode\n(try " - "upgrading your video drivers)\r\n (%lx)", + Sys_Error ("Couldn't set fullscreen DIB mode\n" + "(try upgrading your video drivers)\n (%lx)", GetLastError()); } ShowWindow (mainwindow, SW_SHOWNORMAL); diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index ce7867b30..85cb01f3b 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -584,9 +584,9 @@ IN_LL_Init (void) { // open the display if (!x_disp) - Sys_Error ("IN: No display!!\n"); + Sys_Error ("IN: No display!!"); if (!x_win) - Sys_Error ("IN: No window!!\n"); + Sys_Error ("IN: No window!!"); X11_OpenDisplay (); // call to increment the reference counter diff --git a/libs/video/targets/qfgl_ext.c b/libs/video/targets/qfgl_ext.c index 0e01586a1..bc6b2dd59 100644 --- a/libs/video/targets/qfgl_ext.c +++ b/libs/video/targets/qfgl_ext.c @@ -116,13 +116,13 @@ QFGL_ExtensionAddress (const char *name) if (!handle) { #if defined(HAVE_DLOPEN) if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) { - Sys_Error ("Couldn't load OpenGL library %s: %s\n", + Sys_Error ("Couldn't load OpenGL library %s: %s", gl_driver->string, dlerror ()); return 0; } #elif defined(_WIN32) if (!(handle = LoadLibrary (gl_driver->string))) { - Sys_Error ("Couldn't load OpenGL library %s!\n", + Sys_Error ("Couldn't load OpenGL library %s!", gl_driver->string); return 0; } diff --git a/libs/video/targets/vid.c b/libs/video/targets/vid.c index 0559a6836..bab88139a 100644 --- a/libs/video/targets/vid.c +++ b/libs/video/targets/vid.c @@ -69,33 +69,33 @@ VID_GetWindowSize (int def_w, int def_h) if ((pnum = COM_CheckParm ("-width"))) { if (pnum >= com_argc - 1) - Sys_Error ("VID: -width \n"); + Sys_Error ("VID: -width "); Cvar_Set (vid_width, com_argv[pnum + 1]); if (!vid_width->int_val) - Sys_Error ("VID: Bad window width\n"); + Sys_Error ("VID: Bad window width"); } if ((pnum = COM_CheckParm ("-height"))) { if (pnum >= com_argc - 1) - Sys_Error ("VID: -height \n"); + Sys_Error ("VID: -height "); Cvar_Set (vid_height, com_argv[pnum + 1]); if (!vid_height->int_val) - Sys_Error ("VID: Bad window height\n"); + Sys_Error ("VID: Bad window height"); } if ((pnum = COM_CheckParm ("-winsize"))) { if (pnum >= com_argc - 2) - Sys_Error ("VID: -winsize \n"); + Sys_Error ("VID: -winsize "); Cvar_Set (vid_width, com_argv[pnum + 1]); Cvar_Set (vid_height, com_argv[pnum + 2]); if (!vid_width->int_val || !vid_height->int_val) - Sys_Error ("VID: Bad window width/height\n"); + Sys_Error ("VID: Bad window width/height"); } Cvar_SetFlags (vid_width, vid_width->flags | CVAR_ROM); diff --git a/libs/video/targets/vid_3dfxsvga.c b/libs/video/targets/vid_3dfxsvga.c index c47ff9195..c221be12b 100644 --- a/libs/video/targets/vid_3dfxsvga.c +++ b/libs/video/targets/vid_3dfxsvga.c @@ -320,7 +320,7 @@ VID_Init (unsigned char *palette) fc = qf_fxMesaCreateContext (0, findres (&scr_width, &scr_height), GR_REFRESH_75Hz, attribs); if (!fc) - Sys_Error ("Unable to create 3DFX context.\n"); + Sys_Error ("Unable to create 3DFX context."); qf_fxMesaMakeCurrent (fc); diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index 1476084a3..d21021c9e 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -244,7 +244,7 @@ void GL_Pre_Init (void) { if (!GLF_Init()) { - Sys_Error("Can't init video.\n"); + Sys_Error("Can't init video."); return; } } diff --git a/libs/video/targets/vid_common_sw.c b/libs/video/targets/vid_common_sw.c index 81903201a..779e32613 100644 --- a/libs/video/targets/vid_common_sw.c +++ b/libs/video/targets/vid_common_sw.c @@ -73,7 +73,7 @@ VID_InitBuffers (void) // Allocate the new screen buffer vid.conbuffer = vid.buffer = calloc (buffersize, 1); if (!vid.conbuffer) { - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); } } // Allocate the new z-buffer @@ -81,7 +81,7 @@ VID_InitBuffers (void) if (!vid.zbuffer) { free (vid.buffer); vid.conbuffer = vid.buffer = NULL; - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); } // Allocate the new surface cache; free the z-buffer if we fail vid.surfcache = calloc (cachesize, 1); @@ -90,7 +90,7 @@ VID_InitBuffers (void) free (vid.zbuffer); vid.conbuffer = vid.buffer = NULL; vid.zbuffer = NULL; - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); } if (vid.init_caches) diff --git a/libs/video/targets/vid_common_sw32.c b/libs/video/targets/vid_common_sw32.c index d6f5cf9a5..7e3becf4e 100644 --- a/libs/video/targets/vid_common_sw32.c +++ b/libs/video/targets/vid_common_sw32.c @@ -198,7 +198,7 @@ VID_MakeColormaps (int fullbrights, byte *pal) vid.colormap16 = malloc (256*VID_GRADES * sizeof (short)); vid.colormap32 = malloc (256*VID_GRADES * sizeof (int)); if (!vid.colormap8 || !vid.colormap16 || !vid.colormap32) - Sys_Error ("VID_MakeColormaps: Memory Allocation Failure\n"); + Sys_Error ("VID_MakeColormaps: Memory Allocation Failure"); VID_MakeColormap8(vid.colormap8, pal); VID_MakeColormap16(vid.colormap16, pal); VID_MakeColormap32(vid.colormap32, pal); @@ -238,7 +238,7 @@ VID_InitBuffers (void) // Allocate the new screen buffer vid.conbuffer = vid.buffer = calloc (buffersize, 1); if (!vid.conbuffer) { - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); } } // Allocate the new z-buffer @@ -246,7 +246,7 @@ VID_InitBuffers (void) if (!vid.zbuffer) { free (vid.buffer); vid.conbuffer = vid.buffer = NULL; - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); } // Allocate the new surface cache; free the z-buffer if we fail vid.surfcache = calloc (cachesize, 1); @@ -254,7 +254,7 @@ VID_InitBuffers (void) free (vid.buffer); free (vid.zbuffer); vid.zbuffer = NULL; - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); } if (vid.init_caches) diff --git a/libs/video/targets/vid_ext.c b/libs/video/targets/vid_ext.c index 715f9bbd5..5ec2d1d89 100644 --- a/libs/video/targets/vid_ext.c +++ b/libs/video/targets/vid_ext.c @@ -228,7 +228,7 @@ VID_SetVESAPalette (viddef_t *lvid, vmode_t * pcurrentmode, unsigned char *pal) dos_int86 (0x10); if (regs.x.ax != 0x4f) - Sys_Error ("Unable to load VESA palette\n"); + Sys_Error ("Unable to load VESA palette"); } diff --git a/libs/video/targets/vid_fbdev.c b/libs/video/targets/vid_fbdev.c index 05894d6c0..fc5ac9f11 100644 --- a/libs/video/targets/vid_fbdev.c +++ b/libs/video/targets/vid_fbdev.c @@ -306,7 +306,7 @@ loadpalette (unsigned short *red, unsigned short *green, unsigned short *blue) cmap.transp = NULL; cmap.start = 0; if (-1 == ioctl(fb_fd, FBIOPUTCMAP, (void *)&cmap)) - Sys_Error("ioctl FBIOPUTCMAP %s\n", strerror(errno)); + Sys_Error("ioctl FBIOPUTCMAP %s", strerror(errno)); } void @@ -377,21 +377,21 @@ VID_SetMode (const char *name, unsigned char *palette) ConvertFromVideoMode(¤t_mode, &var); err = ioctl(fb_fd, FBIOPUT_VSCREENINFO, &var); if (err) - Sys_Error ("Video mode failed: %s\n", name); + Sys_Error ("Video mode failed: %s", name); ConvertToVideoMode(&var, ¤t_mode); current_mode.name = current_name; VID_SetPalette (palette); err = ioctl(fb_fd, FBIOGET_FSCREENINFO, &fix); if (err) - Sys_Error ("Video mode failed: %s\n", name); + Sys_Error ("Video mode failed: %s", name); smem_start = (unsigned long)fix.smem_start & PAGE_MASK; smem_offset = (unsigned long)fix.smem_start & ~PAGE_MASK; fb_map_length = (smem_offset+fix.smem_len+~PAGE_MASK) & PAGE_MASK; fb_map_addr = (char *)mmap(0, fb_map_length, PROT_WRITE, MAP_SHARED, fb_fd, 0); if (!fb_map_addr) - Sys_Error ("This mode isn't hapnin'\n"); + Sys_Error ("This mode isn't hapnin'"); vid.direct = framebuffer_ptr = fb_map_addr; // alloc screen buffer, z-buffer, and surface cache @@ -442,14 +442,14 @@ fb_switch_init (void) sigaction(SIGUSR2, &act, 0); if (ioctl(tty_fd, VT_GETMODE, &vtmode)) { - Sys_Error("ioctl VT_GETMODE: %s\n", strerror(errno)); + Sys_Error("ioctl VT_GETMODE: %s", strerror(errno)); } vtmode.mode = VT_PROCESS; vtmode.waitv = 0; vtmode.relsig = SIGUSR1; vtmode.acqsig = SIGUSR2; if (ioctl(tty_fd, VT_SETMODE, &vtmode)) { - Sys_Error("ioctl VT_SETMODE: %s\n", strerror(errno)); + Sys_Error("ioctl VT_SETMODE: %s", strerror(errno)); } } @@ -473,10 +473,10 @@ VID_Init (unsigned char *palette) fb_fd = open(fbname, O_RDWR); if (fb_fd < 0) - Sys_Error ("failed to open fb device\n"); + Sys_Error ("failed to open fb device"); if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &orig_var)) - Sys_Error ("failed to get var screen info\n"); + Sys_Error ("failed to get var screen info"); fb_switch_init(); @@ -516,7 +516,7 @@ VID_Init (unsigned char *palette) /* Set vid parameters */ vmode = FindVideoMode(modestr); if (!vmode) - Sys_Error("no video mode %s\n", modestr); + Sys_Error("no video mode %s", modestr); current_mode = *vmode; ioctl(tty_fd, KDSETMODE, KD_GRAPHICS); VID_SetMode (current_mode.name, palette); diff --git a/libs/video/targets/vid_glx.c b/libs/video/targets/vid_glx.c index 47083a3b3..570181a52 100644 --- a/libs/video/targets/vid_glx.c +++ b/libs/video/targets/vid_glx.c @@ -180,8 +180,7 @@ VID_Init (unsigned char *palette) x_visinfo = qfglXChooseVisual (x_disp, x_screen, attrib); if (!x_visinfo) { - Sys_Error ("Error couldn't get an RGB, Double-buffered, Depth " - "visual\n"); + Sys_Error ("Error couldn't get an RGB, Double-buffered, Depth visual"); } x_vis = x_visinfo->visual; diff --git a/libs/video/targets/vid_mgl.c b/libs/video/targets/vid_mgl.c index 267aa2be5..7fa4bd871 100644 --- a/libs/video/targets/vid_mgl.c +++ b/libs/video/targets/vid_mgl.c @@ -250,7 +250,7 @@ VID_AllocBuffers (int width, int height) // Allocate the new z-buffer d_pzbuffer = calloc (zbuffersize, 1); if (!d_pzbuffer) { - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); return false; } // Allocate the new surface cache; free the z-buffer if we fail @@ -258,7 +258,7 @@ VID_AllocBuffers (int width, int height) if (!vid_surfcache) { free (d_pzbuffer); d_pzbuffer = NULL; - Sys_Error ("Not enough memory for video mode\n"); + Sys_Error ("Not enough memory for video mode"); return false; } vid_surfcachesize = cachesize; diff --git a/libs/video/targets/vid_sdl.c b/libs/video/targets/vid_sdl.c index 8cb386150..a3d9de543 100644 --- a/libs/video/targets/vid_sdl.c +++ b/libs/video/targets/vid_sdl.c @@ -109,7 +109,7 @@ VID_Init (unsigned char *palette) // Initialize display if (!(screen = SDL_SetVideoMode (vid.width, vid.height, 8, flags))) - Sys_Error ("VID: Couldn't set video mode: %s\n", SDL_GetError ()); + Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ()); VID_InitGamma (palette); VID_SetPalette (palette); diff --git a/libs/video/targets/vid_sdl32.c b/libs/video/targets/vid_sdl32.c index 75c879311..f3a7a6c79 100644 --- a/libs/video/targets/vid_sdl32.c +++ b/libs/video/targets/vid_sdl32.c @@ -122,7 +122,7 @@ VID_Init (unsigned char *palette) // Initialize display if (!(screen = SDL_SetVideoMode (vid.width, vid.height, vid_bitdepth->int_val, flags))) - Sys_Error ("VID: Couldn't set video mode: %s\n", SDL_GetError ()); + Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ()); VID_InitGamma (palette); VID_SetPalette (palette); @@ -149,7 +149,7 @@ VID_Init (unsigned char *palette) 0x0000FF00, 0x00FF0000, 0x00000000); break; default: - Sys_Error ("VID_Init: unsupported bit depth\n"); + Sys_Error ("VID_Init: unsupported bit depth"); } // now we know everything we need to know about the buffer diff --git a/libs/video/targets/vid_sgl.c b/libs/video/targets/vid_sgl.c index 069983787..d610aebec 100644 --- a/libs/video/targets/vid_sgl.c +++ b/libs/video/targets/vid_sgl.c @@ -165,7 +165,7 @@ VID_Init (unsigned char *palette) // Initialize the SDL library if (SDL_Init (SDL_INIT_VIDEO) < 0) - Sys_Error ("Couldn't initialize SDL: %s\n", SDL_GetError ()); + Sys_Error ("Couldn't initialize SDL: %s", SDL_GetError ()); // Check if we want fullscreen if (vid_fullscreen->value) { @@ -190,7 +190,7 @@ VID_Init (unsigned char *palette) SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 1); if (!(screen = SDL_SetVideoMode (scr_width, scr_height, 8, flags))) { - Sys_Error ("Couldn't set video mode: %s\n", SDL_GetError ()); + Sys_Error ("Couldn't set video mode: %s", SDL_GetError ()); SDL_Quit (); } diff --git a/libs/video/targets/vid_svgalib.c b/libs/video/targets/vid_svgalib.c index 9a88ff629..fcf0c2527 100644 --- a/libs/video/targets/vid_svgalib.c +++ b/libs/video/targets/vid_svgalib.c @@ -267,7 +267,7 @@ VID_InitModes (void) num_modes = vga_lastmodenumber () + 1; modes = malloc (num_modes * sizeof (vga_modeinfo)); if (!modes) - Sys_Error ("VID_InitModes: Memory Allocation Failure\n"); + Sys_Error ("VID_InitModes: Memory Allocation Failure"); for (i = 0; i < num_modes; i++) { if (vga_hasmode (i)) { memcpy (&modes[i], vga_getmodeinfo (i), sizeof (vga_modeinfo)); @@ -399,7 +399,7 @@ VID_SetMode (int modenum, unsigned char *palette) /* get goin' */ err = vga_setmode (current_mode); if (err) { - Sys_Error ("Video mode failed: %d\n", modenum); + Sys_Error ("Video mode failed: %d", modenum); } VID_SetPalette (palette); @@ -410,7 +410,7 @@ VID_SetMode (int modenum, unsigned char *palette) } #endif if (!framebuffer_ptr) { - Sys_Error ("This mode isn't hapnin'\n"); + Sys_Error ("This mode isn't hapnin'"); } vga_setpage (0); @@ -449,7 +449,7 @@ VID_Init (unsigned char *palette) if (UseDisplay) { err = vga_init (); if (err) - Sys_Error ("SVGALib failed to allocate a new VC\n"); + Sys_Error ("SVGALib failed to allocate a new VC"); if (vga_runinbackground_version () == 1) { Con_Printf ("SVGALIB background support detected\n"); diff --git a/libs/video/targets/vid_wgl.c b/libs/video/targets/vid_wgl.c index 9ade862a8..6a0cc01d0 100644 --- a/libs/video/targets/vid_wgl.c +++ b/libs/video/targets/vid_wgl.c @@ -210,7 +210,7 @@ VID_SetWindowedMode (int modenum) NULL, NULL, global_hInstance, NULL); if (!mainwindow) - Sys_Error ("Couldn't create DIB window (%lx)\r\n",GetLastError()); + Sys_Error ("Couldn't create DIB window (%lx)",GetLastError()); // Center and show the window CenterWindow (mainwindow, WindowRect.right - WindowRect.left, @@ -265,7 +265,7 @@ VID_SetFullDIBMode (int modenum) if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) - Sys_Error ("Couldn't set fullscreen DIB mode (%lx)\r\n", + Sys_Error ("Couldn't set fullscreen DIB mode (%lx)", GetLastError()); } @@ -300,7 +300,7 @@ VID_SetFullDIBMode (int modenum) global_hInstance, NULL); if (!mainwindow) - Sys_Error ("Couldn't create DIB window (%lx)\r\n",GetLastError()); + Sys_Error ("Couldn't create DIB window (%lx)",GetLastError()); ShowWindow (mainwindow, SW_SHOWDEFAULT); UpdateWindow (mainwindow); @@ -343,7 +343,7 @@ VID_SetMode (int modenum, unsigned char *palette) if ((windowed && (modenum != 0)) || (!windowed && (modenum < 1)) || (!windowed && (modenum >= nummodes))) { - Sys_Error ("Bad video mode\n"); + Sys_Error ("Bad video mode"); } // so Con_Printfs don't mess us up by forcing vid and snd updates @@ -690,7 +690,7 @@ VID_InitDIB (HINSTANCE hInstance) wc.lpszClassName = "QuakeForge"; if (!RegisterClass (&wc)) - Sys_Error ("Couldn't register window class (%lx)\r\n", GetLastError()); + Sys_Error ("Couldn't register window class (%lx)", GetLastError()); modelist[0].type = MS_WINDOWED; @@ -1069,7 +1069,7 @@ VID_Init (unsigned char *palette) ReleaseDC (mainwindow, maindc); Sys_Error("Could not initialize GL (wglCreateContext failed).\n\nMake " "sure you in are 65535 color mode, and try running -window. " - "\nError code: (%lx)\r\n", lasterror); + "\nError code: (%lx)", lasterror); } if (!qf_wglMakeCurrent (maindc, baseRC)) { @@ -1078,7 +1078,7 @@ VID_Init (unsigned char *palette) qf_wglDeleteContext (baseRC); if (maindc && mainwindow) ReleaseDC (mainwindow, maindc); - Sys_Error ("wglMakeCurrent failed (%lx)\r\n", lasterror); + Sys_Error ("wglMakeCurrent failed (%lx)", lasterror); } GL_Init (); diff --git a/libs/video/targets/vid_x11.c b/libs/video/targets/vid_x11.c index 7c3226499..c19c09286 100644 --- a/libs/video/targets/vid_x11.c +++ b/libs/video/targets/vid_x11.c @@ -302,7 +302,7 @@ ResetFrameBuffer (void) mem = ((vid.width * pwidth + 7) & ~7) * vid.height; buf = malloc (mem); if (!buf) - Sys_Error ("ResetFrameBuffer: Memory Allocation Failure\n"); + Sys_Error ("ResetFrameBuffer: Memory Allocation Failure"); // allocate new screen buffer x_framebuffer[0] = XCreateImage (x_disp, x_vis, x_visinfo->depth, @@ -310,7 +310,7 @@ ResetFrameBuffer (void) vid.height, 32, 0); if (!x_framebuffer[0]) { - Sys_Error ("VID: XCreateImage failed\n"); + Sys_Error ("VID: XCreateImage failed"); } } @@ -339,12 +339,12 @@ ResetSharedFrameBuffers (void) size = x_framebuffer[frm]->bytes_per_line * x_framebuffer[frm]->height; if (size < minsize) - Sys_Error ("VID: Window must use at least %d bytes\n", minsize); + Sys_Error ("VID: Window must use at least %d bytes", minsize); key = random (); x_shminfo[frm].shmid = shmget ((key_t) key, size, IPC_CREAT | 0777); if (x_shminfo[frm].shmid == -1) - Sys_Error ("VID: Could not get any shared memory (%s)\n", + Sys_Error ("VID: Could not get any shared memory (%s)", strerror (errno)); // attach to the shared memory segment @@ -357,7 +357,7 @@ ResetSharedFrameBuffers (void) // get the X server to attach to it if (!XShmAttach (x_disp, &x_shminfo[frm])) - Sys_Error ("VID: XShmAttach() failed\n"); + Sys_Error ("VID: XShmAttach() failed"); XSync (x_disp, 0); shmctl (x_shminfo[frm].shmid, IPC_RMID, 0); @@ -435,7 +435,7 @@ VID_Init (unsigned char *palette) // specify a visual id if ((pnum = COM_CheckParm ("-visualid"))) { if (pnum >= com_argc - 1) - Sys_Error ("VID: -visualid \n"); + Sys_Error ("VID: -visualid "); template.visualid = atoi (com_argv[pnum + 1]); template_mask = VisualIDMask; } else { // If not specified, use default @@ -458,9 +458,9 @@ VID_Init (unsigned char *palette) } else { if (num_visuals == 0) { if (template_mask == VisualIDMask) { - Sys_Error ("VID: Bad visual ID %ld\n", template.visualid); + Sys_Error ("VID: Bad visual ID %ld", template.visualid); } else { - Sys_Error ("VID: No visuals at depth %d\n", template.depth); + Sys_Error ("VID: No visuals at depth %d", template.depth); } } } @@ -639,7 +639,7 @@ VID_Update (vrect_t *rects) x_framebuffer[current_framebuffer], rects->x, rects->y, rects->x, rects->y, rects->width, rects->height, True)) { - Sys_Error ("VID_Update: XShmPutImage failed\n"); + Sys_Error ("VID_Update: XShmPutImage failed"); } oktodraw = false; while (!oktodraw) @@ -653,7 +653,7 @@ VID_Update (vrect_t *rects) if (XPutImage (x_disp, x_win, x_gc, x_framebuffer[0], rects->x, rects->y, rects->x, rects->y, rects->width, rects->height)) { - Sys_Error ("VID_Update: XPutImage failed\n"); + Sys_Error ("VID_Update: XPutImage failed"); } rects = rects->pnext; } diff --git a/nq/source/host.c b/nq/source/host.c index 2fb97244e..f70e91546 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -139,7 +139,7 @@ Host_EndGame (const char *message, ...) Host_ShutdownServer (false); if (cls.state == ca_dedicated) - Sys_Error ("Host_EndGame: %s\n", string); // dedicated servers exit + Sys_Error ("Host_EndGame: %s", string); // dedicated servers exit if (cls.demonum != -1) CL_NextDemo (); @@ -175,7 +175,7 @@ Host_Error (const char *error, ...) Host_ShutdownServer (false); if (cls.state == ca_dedicated) - Sys_Error ("Host_Error: %s\n", string); // dedicated servers exit + Sys_Error ("Host_Error: %s", string); // dedicated servers exit Con_Printf ("Host_Error: %s\n", string); @@ -730,21 +730,21 @@ Host_InitVCR (quakeparms_t *parms) if (COM_CheckParm ("-playback")) { if (com_argc != 2) - Sys_Error ("No other parameters allowed with -playback\n"); + Sys_Error ("No other parameters allowed with -playback"); vcrFile = Qopen ("quake.vcr", "rbz"); if (!vcrFile) - Sys_Error ("playback file not found\n"); + Sys_Error ("playback file not found"); Qread (vcrFile, &i, sizeof (int)); if (i != VCR_SIGNATURE) - Sys_Error ("Invalid signature in vcr file\n"); + Sys_Error ("Invalid signature in vcr file"); Qread (vcrFile, &com_argc, sizeof (int)); com_argv = malloc (com_argc * sizeof (char *)); if (!com_argv) - Sys_Error ("Host_InitVCR: Memory Allocation Failure\n"); + Sys_Error ("Host_InitVCR: Memory Allocation Failure"); com_argv[0] = parms->argv[0]; for (i = 0; i < com_argc; i++) { @@ -752,7 +752,7 @@ Host_InitVCR (quakeparms_t *parms) p = malloc (len); if (!p) - Sys_Error ("Host_InitVCR: Memory Allocation Failure\n"); + Sys_Error ("Host_InitVCR: Memory Allocation Failure"); Qread (vcrFile, p, len); com_argv[i + 1] = p; } @@ -841,7 +841,7 @@ CL_Init_Memory (void) mem_base = malloc (mem_size); if (!mem_base) - Sys_Error ("Can't allocate %d\n", mem_size); + Sys_Error ("Can't allocate %d", mem_size); Sys_PageIn (mem_base, mem_size); Memory_Init (mem_base, mem_size); diff --git a/nq/source/locs.c b/nq/source/locs.c index 87f593921..30fa50f17 100644 --- a/nq/source/locs.c +++ b/nq/source/locs.c @@ -98,7 +98,7 @@ locs_add (const vec3_t location, const char *name) locations[num] = malloc (sizeof (location_t)); if (!locations[num]) - Sys_Error ("locs_add: Memory Allocation Failure\n"); + Sys_Error ("locs_add: Memory Allocation Failure"); locations[num]->loc[0] = location[0]; locations[num]->loc[1] = location[1]; diff --git a/nq/source/net_bw.c b/nq/source/net_bw.c index a2eed5e94..c135dbc8f 100644 --- a/nq/source/net_bw.c +++ b/nq/source/net_bw.c @@ -347,7 +347,7 @@ BW_Init (void) lowmem_buffer = dos_getmemory (LOWMEM_SIZE); if (!lowmem_buffer) - Sys_Error ("not enough low memory\n"); + Sys_Error ("not enough low memory"); lowmem_bufoff = ptr2real (lowmem_buffer) & 0xf; lowmem_bufseg = ptr2real (lowmem_buffer) >> 4; @@ -397,7 +397,7 @@ BW_Listen (qboolean state) if (net_acceptsocket != -1) return; if ((net_acceptsocket = BW_OpenSocket (net_hostport)) == -1) - Sys_Error ("BW_Listen: Unable to open accept socket\n"); + Sys_Error ("BW_Listen: Unable to open accept socket"); return; } // disable listening @@ -583,7 +583,7 @@ BW_Broadcast (int s, byte * msg, int len) writeInfo->remotePort = net_hostport; writeInfo->dataLen = len; if (len > NET_DATAGRAMSIZE) - Sys_Error ("BW UDP write packet too large: %u\n", len); + Sys_Error ("BW UDP write packet too large: %u", len); Q_memcpy (writeInfo->data, msg, len); writeInfo->data[len] = 0; regs.h.ah = 0x40; @@ -619,7 +619,7 @@ BW_Write (int s, byte * msg, int len, struct qsockaddr *to) writeInfo->remotePort = ntohs (((struct sockaddr_in *) to)->sin_port); writeInfo->dataLen = len; if (len > NET_DATAGRAMSIZE) - Sys_Error ("BW UDP write packet too large: %u\n", len); + Sys_Error ("BW UDP write packet too large: %u", len); Q_memcpy (writeInfo->data, msg, len); writeInfo->data[len] = 0; regs.h.ah = 0x40; diff --git a/nq/source/net_dgrm.c b/nq/source/net_dgrm.c index c597c4523..4ed9f7127 100644 --- a/nq/source/net_dgrm.c +++ b/nq/source/net_dgrm.c @@ -198,13 +198,13 @@ Datagram_SendMessage (qsocket_t * sock, sizebuf_t *data) #ifdef DEBUG if (data->cursize == 0) - Sys_Error ("Datagram_SendMessage: zero length message\n"); + Sys_Error ("Datagram_SendMessage: zero length message"); if (data->cursize > NET_MAXMESSAGE) - Sys_Error ("Datagram_SendMessage: message too big %u\n", data->cursize); + Sys_Error ("Datagram_SendMessage: message too big %u", data->cursize); if (sock->canSend == false) - Sys_Error ("SendMessage: called with canSend == false\n"); + Sys_Error ("SendMessage: called with canSend == false"); #endif memcpy (sock->sendMessage, data->data, data->cursize); @@ -323,10 +323,10 @@ Datagram_SendUnreliableMessage (qsocket_t * sock, sizebuf_t *data) #ifdef DEBUG if (data->cursize == 0) - Sys_Error ("Datagram_SendUnreliableMessage: zero length message\n"); + Sys_Error ("Datagram_SendUnreliableMessage: zero length message"); if (data->cursize > MAX_DATAGRAM) - Sys_Error ("Datagram_SendUnreliableMessage: message too big %u\n", + Sys_Error ("Datagram_SendUnreliableMessage: message too big %u", data->cursize); #endif @@ -576,7 +576,7 @@ Test_Poll (void) break; if (MSG_ReadByte (net_message) != CCREP_PLAYER_INFO) - Sys_Error ("Unexpected repsonse to Player Info request\n"); + Sys_Error ("Unexpected repsonse to Player Info request"); playerNumber = MSG_ReadByte (net_message); strcpy (name, MSG_ReadString (net_message)); diff --git a/nq/source/net_ipx.c b/nq/source/net_ipx.c index 45a2f5be1..3221234e5 100644 --- a/nq/source/net_ipx.c +++ b/nq/source/net_ipx.c @@ -330,7 +330,7 @@ IPX_Listen (qboolean state) if (net_acceptsocket != -1) return; if ((net_acceptsocket = IPX_OpenSocket (net_hostport)) == -1) - Sys_Error ("IPX_Listen: Unable to open accept socket\n"); + Sys_Error ("IPX_Listen: Unable to open accept socket"); return; } // disable listening @@ -391,7 +391,7 @@ IPX_OpenSocket (int port) } // "this will NEVER happen" - Sys_Error ("IPX_OpenSocket: handle allocation failed\n"); + Sys_Error ("IPX_OpenSocket: handle allocation failed"); return -1; } @@ -482,7 +482,7 @@ IPX_Read (int handle, byte * buf, int len, struct qsockaddr *addr) ntohs (rcvbuf->header.length) - (sizeof (int) + sizeof (IPXheader)); if (len < copylen) - Sys_Error ("IPX_Read: buffer too small (%d vs %d)\n", len, copylen); + Sys_Error ("IPX_Read: buffer too small (%d vs %d)", len, copylen); Q_memcpy (buf, rcvbuf->data, copylen); // fill in the addr if they want it diff --git a/nq/source/net_loop.c b/nq/source/net_loop.c index 03433bf84..0816402ce 100644 --- a/nq/source/net_loop.c +++ b/nq/source/net_loop.c @@ -187,7 +187,7 @@ Loop_SendMessage (qsocket_t * sock, sizebuf_t *data) bufferLength = &((qsocket_t *) sock->driverdata)->receiveMessageLength; if ((*bufferLength + data->cursize + 4) > NET_MAXMESSAGE) - Sys_Error ("Loop_SendMessage: overflow\n"); + Sys_Error ("Loop_SendMessage: overflow"); buffer = ((qsocket_t *) sock->driverdata)->receiveMessage + *bufferLength; diff --git a/nq/source/net_main.c b/nq/source/net_main.c index c7b38dbc0..ff7d8f533 100644 --- a/nq/source/net_main.c +++ b/nq/source/net_main.c @@ -192,7 +192,7 @@ NET_FreeQSocket (qsocket_t * sock) break; } if (!s) - Sys_Error ("NET_FreeQSocket: not active\n"); + Sys_Error ("NET_FreeQSocket: not active"); } // add it to free list diff --git a/nq/source/net_mp.c b/nq/source/net_mp.c index 45773e3ce..75f8c8fa7 100644 --- a/nq/source/net_mp.c +++ b/nq/source/net_mp.c @@ -108,7 +108,7 @@ MPATH_Init (void) } if ((net_controlsocket = MPATH_OpenSocket (0)) == -1) - Sys_Error ("MPATH_Init: Unable to open control socket\n"); + Sys_Error ("MPATH_Init: Unable to open control socket"); ((struct sockaddr_in *) &broadcastaddr)->sin_family = AF_INET; ((struct sockaddr_in *) &broadcastaddr)->sin_addr.s_addr = INADDR_BROADCAST; @@ -145,7 +145,7 @@ MPATH_Listen (qboolean state) if (net_acceptsocket != -1) return; if ((net_acceptsocket = MPATH_OpenSocket (net_hostport)) == -1) - Sys_Error ("MPATH_Listen: Unable to open accept socket\n"); + Sys_Error ("MPATH_Listen: Unable to open accept socket"); return; } // disable listening @@ -318,7 +318,7 @@ MPATH_Broadcast (int socket, byte * buf, int len) if (socket != net_broadcastsocket) { if (net_broadcastsocket != 0) - Sys_Error ("Attempted to use multiple broadcasts sockets\n"); + Sys_Error ("Attempted to use multiple broadcasts sockets"); ret = MPATH_MakeSocketBroadcastCapable (socket); if (ret == -1) { Con_Printf ("Unable to make socket broadcast capable\n"); diff --git a/nq/source/net_udp.c b/nq/source/net_udp.c index e3dd9532a..7061fa0f7 100644 --- a/nq/source/net_udp.c +++ b/nq/source/net_udp.c @@ -146,7 +146,7 @@ UDP_Init (void) } if ((net_controlsocket = UDP_OpenSocket (0)) == -1) - Sys_Error ("UDP_Init: Unable to open control socket\n"); + Sys_Error ("UDP_Init: Unable to open control socket"); ((struct sockaddr_in *) &broadcastaddr)->sin_family = AF_INET; ((struct sockaddr_in *) &broadcastaddr)->sin_addr.s_addr = @@ -181,7 +181,7 @@ UDP_Listen (qboolean state) if (net_acceptsocket != -1) return; if ((net_acceptsocket = UDP_OpenSocket (net_hostport)) == -1) - Sys_Error ("UDP_Listen: Unable to open accept socket\n"); + Sys_Error ("UDP_Listen: Unable to open accept socket"); return; } // disable listening @@ -306,7 +306,7 @@ UDP_CheckNewConnections (void) return -1; if (ioctl (net_acceptsocket, FIONREAD, &available) == -1) - Sys_Error ("UDP: ioctlsocket (FIONREAD) failed\n"); + Sys_Error ("UDP: ioctlsocket (FIONREAD) failed"); if (available) return net_acceptsocket; recvfrom (net_acceptsocket, buff, 0, 0, (struct sockaddr *) &from, @@ -347,7 +347,7 @@ UDP_Broadcast (int socket, byte * buf, int len) if (socket != net_broadcastsocket) { if (net_broadcastsocket != 0) - Sys_Error ("Attempted to use multiple broadcasts sockets\n"); + Sys_Error ("Attempted to use multiple broadcasts sockets"); ret = UDP_MakeSocketBroadcastCapable (socket); if (ret == -1) { Con_Printf ("Unable to make socket broadcast capable\n"); diff --git a/nq/source/net_vcr.c b/nq/source/net_vcr.c index 5bb8eae02..1acb8d242 100644 --- a/nq/source/net_vcr.c +++ b/nq/source/net_vcr.c @@ -73,7 +73,7 @@ VCR_ReadNext (void) { if (Qread (vcrFile, &next, sizeof (next)) == 0) { next.op = 255; - Sys_Error ("=== END OF PLAYBACK===\n"); + Sys_Error ("=== END OF PLAYBACK==="); } if (next.op < 1 || next.op > VCR_MAX_MESSAGE) Sys_Error ("VCR_ReadNext: bad op"); diff --git a/nq/source/net_wins.c b/nq/source/net_wins.c index 4a469ca8f..683afa144 100644 --- a/nq/source/net_wins.c +++ b/nq/source/net_wins.c @@ -279,7 +279,7 @@ WINS_Listen (qboolean state) return; WINS_GetLocalAddress (); if ((net_acceptsocket = WINS_OpenSocket (net_hostport)) == -1) - Sys_Error ("WINS_Listen: Unable to open accept socket\n"); + Sys_Error ("WINS_Listen: Unable to open accept socket"); return; } // disable listening @@ -455,7 +455,7 @@ WINS_Broadcast (int socket, byte * buf, int len) if (socket != net_broadcastsocket) { if (net_broadcastsocket != 0) - Sys_Error ("Attempted to use multiple broadcasts sockets\n"); + Sys_Error ("Attempted to use multiple broadcasts sockets"); WINS_GetLocalAddress (); ret = WINS_MakeSocketBroadcastCapable (socket); if (ret == -1) { diff --git a/nq/source/net_wipx.c b/nq/source/net_wipx.c index 4ab47a67c..3c1cfdb01 100644 --- a/nq/source/net_wipx.c +++ b/nq/source/net_wipx.c @@ -156,7 +156,7 @@ WIPX_Listen (qboolean state) if (net_acceptsocket != -1) return; if ((net_acceptsocket = WIPX_OpenSocket (net_hostport)) == -1) - Sys_Error ("WIPX_Listen: Unable to open accept socket\n"); + Sys_Error ("WIPX_Listen: Unable to open accept socket"); return; } // disable listening @@ -202,7 +202,7 @@ WIPX_OpenSocket (int port) return handle; } - Sys_Error ("Winsock IPX bind failed\n"); + Sys_Error ("Winsock IPX bind failed"); ErrorReturn: pclosesocket (newsocket); return -1; @@ -241,7 +241,7 @@ WIPX_CheckNewConnections (void) return -1; if (pioctlsocket (ipxsocket[net_acceptsocket], FIONREAD, &available) == -1) - Sys_Error ("WIPX: ioctlsocket (FIONREAD) failed\n"); + Sys_Error ("WIPX: ioctlsocket (FIONREAD) failed"); if (available) return net_acceptsocket; return -1; diff --git a/qw/source/cl_demo.c b/qw/source/cl_demo.c index ea9083c75..6b7cb2962 100644 --- a/qw/source/cl_demo.c +++ b/qw/source/cl_demo.c @@ -947,7 +947,7 @@ CL_TimeFrames_AddTimestamp (void) ((cl_timeframes_index / CL_TIMEFRAMES_ARRAYBLOCK) + 1) * CL_TIMEFRAMES_ARRAYBLOCK); if (cl_timeframes_array == NULL) - Sys_Error ("Unable to allocate timeframes buffer\n"); + Sys_Error ("Unable to allocate timeframes buffer"); cl_timeframes_array[cl_timeframes_index] = Sys_DoubleTime (); cl_timeframes_index++; } diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 605b069fa..ebd73de8c 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1412,7 +1412,7 @@ Host_Error (const char *error, ...) if (host_initialized) { longjmp (host_abort, 1); } else { - Sys_Error ("Host_Error: %s\n", string); + Sys_Error ("Host_Error: %s", string); } } @@ -1638,7 +1638,7 @@ CL_Init_Memory (void) mem_base = malloc (mem_size); if (!mem_base) - Sys_Error ("Can't allocate %d\n", mem_size); + Sys_Error ("Can't allocate %d", mem_size); Sys_PageIn (mem_base, mem_size); Memory_Init (mem_base, mem_size); diff --git a/qw/source/cl_slist.c b/qw/source/cl_slist.c index 3333e54e3..a7fa7bf64 100644 --- a/qw/source/cl_slist.c +++ b/qw/source/cl_slist.c @@ -129,7 +129,7 @@ SL_Add (server_entry_t *start, char *ip, char *desc) start->server = malloc (strlen (ip) + 1); start->desc = malloc (strlen (desc ? desc : ip) + 1); if (!start->server || !start->desc) - Sys_Error ("SL_Add: Memory Allocation Failure\n"); + Sys_Error ("SL_Add: Memory Allocation Failure"); strcpy (start->server, ip); strcpy (start->desc, desc ? desc : ip); start->status = NULL; @@ -146,7 +146,7 @@ SL_Add (server_entry_t *start, char *ip, char *desc) p->next->server = malloc (strlen (ip) + 1); p->next->desc = malloc (strlen (desc ? desc : ip) + 1); if (!p->next->server || !p->next->desc) - Sys_Error ("SL_Add: Memory Allocation Failure\n"); + Sys_Error ("SL_Add: Memory Allocation Failure"); strcpy (p->next->server, ip); strcpy (p->next->desc, desc ? desc : ip); @@ -191,7 +191,7 @@ SL_InsB (server_entry_t *start, server_entry_t *place, char *ip, char *desc) new->server = malloc (strlen (ip) + 1); new->desc = malloc (strlen (desc) + 1); if (!new->server || !new->desc) - Sys_Error ("SL_InsB: Memory Allocation Failure\n"); + Sys_Error ("SL_InsB: Memory Allocation Failure"); strcpy (new->server, ip); strcpy (new->desc, desc); other = place->prev; @@ -637,7 +637,7 @@ SL_LoadF (VFile *f, server_entry_t *start) len = gettoklen (line, 1, ' '); addr = malloc (len + 1); if (!addr) - Sys_Error ("SL_LoadF: Memory Allocation Failure\n"); + Sys_Error ("SL_LoadF: Memory Allocation Failure"); strncpy (addr, &line[0], len); addr[len] = '\0'; if ((st = gettokstart (line, 2, ' '))) { diff --git a/qw/source/locs.c b/qw/source/locs.c index 5825afa34..9364da4b3 100644 --- a/qw/source/locs.c +++ b/qw/source/locs.c @@ -99,7 +99,7 @@ locs_add (const vec3_t location, const char *name) locations[num] = malloc (sizeof (location_t)); if (!locations[num]) - Sys_Error ("locs_add: Memory Allocation Failure\n"); + Sys_Error ("locs_add: Memory Allocation Failure"); locations[num]->loc[0] = location[0]; locations[num]->loc[1] = location[1]; diff --git a/qw/source/sv_ccmds.c b/qw/source/sv_ccmds.c index fc7f54668..33ea2d276 100644 --- a/qw/source/sv_ccmds.c +++ b/qw/source/sv_ccmds.c @@ -394,7 +394,7 @@ SV_Map_f (void) SV_Printf ("Can't find %s\n", expanded); // If curlevel == level, something is SCREWED! --KB if (strcaseequal (level, curlevel)) - Sys_Error ("map: cannot restart level\n"); + Sys_Error ("map: cannot restart level"); else Cbuf_AddText (va ("map %s", curlevel)); return; diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index fa15aab1d..cfb465a86 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -1155,7 +1155,7 @@ SV_PrintIP (byte *ip) if (!inet_ntop (AF_INET, ip, buf, INET_ADDRSTRLEN)) # endif #endif - Sys_Error ("SV_CleanIPList: inet_ntop_failed. wtf?\n"); + Sys_Error ("SV_CleanIPList: inet_ntop_failed. wtf?"); return buf; } @@ -1244,7 +1244,7 @@ SV_StringToFilter (const char *address, ipfilter_t *f) s = strdup (address); if (!s) - Sys_Error ("SV_StringToFilter: memory allocation failure\n"); + Sys_Error ("SV_StringToFilter: memory allocation failure"); // Parse out the mask (the /8 part) if ((slash = strchr (s, '/'))) { @@ -2384,7 +2384,7 @@ SV_Init_Memory (void) mem_base = malloc (mem_size); if (!mem_base) - Sys_Error ("Can't allocate %d\n", mem_size); + Sys_Error ("Can't allocate %d", mem_size); Memory_Init (mem_base, mem_size); } diff --git a/qw/source/sv_progs.c b/qw/source/sv_progs.c index 134aa5f6c..f1e320eff 100644 --- a/qw/source/sv_progs.c +++ b/qw/source/sv_progs.c @@ -179,7 +179,7 @@ SV_LoadProgs (void) PR_LoadProgs (&sv_pr_state, sv_progs->string, MAX_EDICTS, 0); if (!sv_pr_state.progs) - Sys_Error ("SV_LoadProgs: couldn't load %s\n", sv_progs->string); + Sys_Error ("SV_LoadProgs: couldn't load %s", sv_progs->string); // progs engine needs these globals anyway sv_globals.self = sv_pr_state.globals.self; sv_globals.time = sv_pr_state.globals.time; diff --git a/qw/source/sv_send.c b/qw/source/sv_send.c index 44672b55a..6ceab4f8b 100644 --- a/qw/source/sv_send.c +++ b/qw/source/sv_send.c @@ -228,7 +228,7 @@ SV_PrintToClient (client_t *cl, int level, const char *string) free (buffer); buffer = malloc (buffer_size); if (!buffer) - Sys_Error ("SV_PrintToClient: could not allocate %d bytes\n", + Sys_Error ("SV_PrintToClient: could not allocate %d bytes", buffer_size); } diff --git a/tools/qfcc/source/cmdlib.c b/tools/qfcc/source/cmdlib.c index 395841912..6c9925b21 100644 --- a/tools/qfcc/source/cmdlib.c +++ b/tools/qfcc/source/cmdlib.c @@ -225,7 +225,7 @@ LoadFile (char *filename, void **bufferptr) length = FileLength (f); buffer = malloc (length + 1); if (!buffer) - Sys_Error ("LoadFile: Memory Allocation Failure\n"); + Sys_Error ("LoadFile: Memory Allocation Failure"); ((char *) buffer)[length] = 0; SafeRead (f, buffer, length); fclose (f); diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 231b88683..61e96e9cd 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -349,7 +349,7 @@ new_label_name (void) char *lname = malloc (len); if (!lname) - Sys_Error ("new_label_expr: Memory Allocation Failure\n"); + Sys_Error ("new_label_expr: Memory Allocation Failure"); snprintf (lname, len, "$%s_%d", fname, lnum); return lname; } @@ -602,7 +602,7 @@ do_op_string (int op, expr_t *e1, expr_t *e2) len = strlen (s1) + strlen (s2) + 1; buf = malloc (len); if (!buf) - Sys_Error ("do_op_string: Memory Allocation Failure\n"); + Sys_Error ("do_op_string: Memory Allocation Failure"); strcpy (buf, s1); strcat (buf, s2); e1->e.string_val = buf; @@ -1571,7 +1571,7 @@ function_expr (expr_t *e1, expr_t *e2) ret->e.def = memcpy (malloc (sizeof (def_t)), &def_ret, sizeof (def_t)); if (!ret->e.def) - Sys_Error ("function_expr: Memory Allocation Failure\n"); + Sys_Error ("function_expr: Memory Allocation Failure"); ret->e.def->type = ftype->aux_type; call->e.block.result = ret; } diff --git a/tools/qfcc/source/pr_def.c b/tools/qfcc/source/pr_def.c index f72d504ee..33ba59206 100644 --- a/tools/qfcc/source/pr_def.c +++ b/tools/qfcc/source/pr_def.c @@ -269,7 +269,7 @@ PR_FreeLocation (def_t *def) free_free_locs = malloc (256 * sizeof (locref_t)); if (!free_free_locs) - Sys_Error ("PR_FreeLocation: Memory Allocation Failure\n"); + Sys_Error ("PR_FreeLocation: Memory Allocation Failure"); for (loc = free_free_locs; loc - free_free_locs < 255; loc++) loc->next = loc + 1; loc->next = 0; diff --git a/tools/qfcc/source/qc-lex.l b/tools/qfcc/source/qc-lex.l index 568407257..d9994d321 100644 --- a/tools/qfcc/source/qc-lex.l +++ b/tools/qfcc/source/qc-lex.l @@ -377,7 +377,7 @@ add_frame_macro (char *token) { frame_t *frame = malloc (sizeof (frame_t)); if (!frame) - Sys_Error ("add_frame_macro: Memory Allocation Failure\n"); + Sys_Error ("add_frame_macro: Memory Allocation Failure"); frame->name = strdup (token); frame->num = frame_number++; @@ -404,7 +404,7 @@ make_string (char *token) s = str = malloc (strlen (token) + 1); if (!str) - Sys_Error ("make_string: Memory Allocation Failure\n"); + Sys_Error ("make_string: Memory Allocation Failure"); mask = 0x00; boldnext = 0; diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index aa3fede62..a556bc1c9 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -1275,7 +1275,7 @@ scan_scope (hashtab_t *tab, def_t *scope) if (def->name && !def->removed) { def_state_t *ds = malloc (sizeof (def_state_t)); if (!ds) - Sys_Error ("scan_scope: Memory Allocation Failure\n"); + Sys_Error ("scan_scope: Memory Allocation Failure"); ds->def = def; ds->state = def->initialized; Hash_Add (tab, ds); @@ -1306,7 +1306,7 @@ merge_local_inits (hashtab_t *dl_1, hashtab_t *dl_2) nds = malloc (sizeof (def_state_t)); if (!nds) - Sys_Error ("merge_local_inits: Memory Allocation Failure\n"); + Sys_Error ("merge_local_inits: Memory Allocation Failure"); nds->def = (*ds)->def; nds->state = (*ds)->state && d->state; Hash_Add (tab, nds); diff --git a/tools/qfcc/source/switch.c b/tools/qfcc/source/switch.c index 4fae3efba..881c6f9d7 100644 --- a/tools/qfcc/source/switch.c +++ b/tools/qfcc/source/switch.c @@ -75,7 +75,7 @@ case_label_expr (switch_block_t *switch_block, expr_t *value) case_label_t *cl = malloc (sizeof (case_label_t)); if (!cl) - Sys_Error ("case_label_expr: Memory Allocation Failure\n"); + Sys_Error ("case_label_expr: Memory Allocation Failure"); if (value) convert_name (value); @@ -106,7 +106,7 @@ new_switch_block (void) switch_block_t *switch_block = malloc (sizeof (switch_block_t)); if (!switch_block) - Sys_Error ("new_switch_block: Memory Allocation Failure\n"); + Sys_Error ("new_switch_block: Memory Allocation Failure"); switch_block->labels = Hash_NewTable (127, 0, 0, 0); Hash_SetHashCompare (switch_block->labels, get_hash, compare); switch_block->test = 0; diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 0c5db1352..a9e2cbd16 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -122,7 +122,7 @@ find_type (type_t *type) // allocate a new one check = malloc (sizeof (*check)); if (!check) - Sys_Error ("find_type: Memory Allocation Failure\n"); + Sys_Error ("find_type: Memory Allocation Failure"); *check = *type; chain_type (check); diff --git a/tools/qfdefs/source/fix_globals.c b/tools/qfdefs/source/fix_globals.c index 32b7be407..0869901a5 100644 --- a/tools/qfdefs/source/fix_globals.c +++ b/tools/qfdefs/source/fix_globals.c @@ -106,7 +106,7 @@ fix_missing_globals (progs_t *pr, def_t *globals) progs = malloc (pr->progs_size + strings_size); if (!progs) - Sys_Error ("fix_missing_globals: Memory Allocation Failure\n"); + Sys_Error ("fix_missing_globals: Memory Allocation Failure"); memcpy (progs, pr->progs, pr->progs_size); offs = progs->ofs_strings + progs->numstrings; diff --git a/tools/qwaq/main.c b/tools/qwaq/main.c index 9a897ac55..b70cf1347 100644 --- a/tools/qwaq/main.c +++ b/tools/qwaq/main.c @@ -65,7 +65,7 @@ main () Cmd_Init_Hash (); membase = malloc (memsize); if (!membase) - Sys_Error ("Memory Allocation Failure\n"); + Sys_Error ("Memory Allocation Failure"); Memory_Init (membase, memsize); Cvar_Init (); Cbuf_Init (); @@ -100,7 +100,7 @@ main () Qclose (f); } if (!progs.progs) - Sys_Error ("couldn't load %s\n", "qwaq.dat"); + Sys_Error ("couldn't load %s", "qwaq.dat"); if (!PR_ResolveGlobals (&progs)) PR_Error (&progs, "unable to load %s", progs.progs_name);