minor error messages / whitespace tidy-up & small stuff.

This commit is contained in:
Ozkan Sezer 2022-04-22 17:50:02 +03:00
parent ddd1caebf5
commit f86f1595f3
21 changed files with 98 additions and 108 deletions

View file

@ -164,7 +164,7 @@ void CL_EstablishConnection (const char *host)
cls.netcon = NET_Connect (host);
if (!cls.netcon)
Host_Error ("CL_Connect: connect failed\n");
Host_Error ("CL_Connect: connect failed");
Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host);
cls.demonum = -1; // not in the demo loop now

View file

@ -808,7 +808,6 @@ void Cmd_ExecuteString (const char *text, cmd_source_t src)
// check cvars
if (!Cvar_Command ())
Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0));
}
@ -857,7 +856,7 @@ int Cmd_CheckParm (const char *parm)
int i;
if (!parm)
Sys_Error ("Cmd_CheckParm: NULL");
Sys_Error ("Cmd_CheckParm: null input\n");
for (i = 1; i < Cmd_Argc (); i++)
if ( !q_strcasecmp (parm, Cmd_Argv (i)) )

View file

@ -969,7 +969,7 @@ void *SZ_GetSpace (sizebuf_t *buf, int length)
Sys_Error ("SZ_GetSpace: %i is > full buffer size", length);
buf->overflowed = true;
Con_Printf ("SZ_GetSpace: overflow");
Con_Printf ("SZ_GetSpace: overflow\n");
SZ_Clear (buf);
}

View file

@ -1538,7 +1538,7 @@ void Mod_ProcessLeafs_S (dsleaf_t *in, int filelen)
//johnfitz
if (count > 32767)
Host_Error ("Mod_LoadLeafs: %i leafs exceeds limit of 32767.\n", count);
Host_Error ("Mod_LoadLeafs: %i leafs exceeds limit of 32767.", count);
//johnfitz
loadmodel->leafs = out;
@ -2385,7 +2385,6 @@ void *Mod_LoadAliasGroup (void * pin, maliasframedesc_t *frame)
frame->bboxmax.v[i] = pingroup->bboxmax.v[i];
}
pin_intervals = (daliasinterval_t *)(pingroup + 1);
frame->interval = LittleFloat (pin_intervals->interval);
@ -2503,7 +2502,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
skin = (byte *)(pskintype + 1);
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);
size = pheader->skinwidth * pheader->skinheight;
@ -2777,7 +2776,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->numframes = LittleLong (pinmodel->numframes);
numframes = pheader->numframes;
if (numframes < 1)
Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d\n", numframes);
Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d", numframes);
pheader->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
mod->synctype = (synctype_t) LittleLong (pinmodel->synctype);
@ -2790,7 +2789,6 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->eyeposition[i] = LittleFloat (pinmodel->eyeposition[i]);
}
//
// load the skins
//
@ -3017,7 +3015,7 @@ void Mod_LoadSpriteModel (qmodel_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;

View file

@ -213,10 +213,10 @@ byte *Image_LoadTGA (FILE *fin, int *width, int *height)
targa_header.attributes = fgetc(fin);
if (targa_header.image_type!=2 && targa_header.image_type!=10)
Sys_Error ("Image_LoadTGA: %s is not a type 2 or type 10 targa\n", loadfilename);
Sys_Error ("Image_LoadTGA: %s is not a type 2 or type 10 targa", loadfilename);
if (targa_header.colormap_type !=0 || (targa_header.pixel_size!=32 && targa_header.pixel_size!=24))
Sys_Error ("Image_LoadTGA: %s is not a 24bit or 32bit targa\n", loadfilename);
Sys_Error ("Image_LoadTGA: %s is not a 24bit or 32bit targa", loadfilename);
columns = targa_header.width;
rows = targa_header.height;

View file

@ -137,13 +137,13 @@ int 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
Q_memcpy(sock->sendMessage, data->data, data->cursize);
@ -263,10 +263,10 @@ int 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", data->cursize);
Sys_Error("Datagram_SendUnreliableMessage: message too big: %u", data->cursize);
#endif
packetLen = NET_HEADERSIZE + data->cursize;
@ -604,6 +604,7 @@ static void Test_f (void)
break;
}
}
if (n < hostCacheCount)
goto JustDoIt;
}
@ -1049,9 +1050,8 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
// allocate a QSocket
sock = NET_NewQSocket ();
if (sock == NULL)
if (sock == NULL) // no room; try to let him know
{
// no room; try to let him know
SZ_Clear(&net_message);
// save space for the header, filled in later
MSG_WriteLong(&net_message, 0);

View file

@ -53,7 +53,7 @@ sys_socket_t UDP_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{
err = SOCKETERRNO;
Con_SafePrintf("UDP_Init: gethostname failed (%s)\n",
Con_SafePrintf("UDP_Init: WARNING: gethostname failed (%s)\n",
socketerror(err));
}
else
@ -72,7 +72,7 @@ sys_socket_t UDP_Init (void)
#endif
if (!(local = gethostbyname(buff)))
{
Con_SafePrintf("UDP_Init: gethostbyname failed (%s)\n",
Con_SafePrintf("UDP_Init: WARNING: gethostbyname failed (%s)\n",
hstrerror(h_errno));
}
else if (local->h_addrtype != AF_INET)

View file

@ -83,7 +83,7 @@ static void WINS_GetLocalAddress (void)
if (gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR)
{
err = SOCKETERRNO;
Con_SafePrintf("WINS_GetLocalAddress: gethostname failed (%s)\n",
Con_SafePrintf("WINS_GetLocalAddress: WARNING: gethostname failed (%s)\n",
socketerror(err));
return;
}
@ -136,7 +136,7 @@ sys_socket_t WINS_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{
err = SOCKETERRNO;
Con_SafePrintf("WINS_Init: gethostname failed (%s)\n",
Con_SafePrintf("WINS_Init: WARNING: gethostname failed (%s)\n",
socketerror(err));
}
else

View file

@ -75,7 +75,7 @@ sys_socket_t WIPX_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{
err = SOCKETERRNO;
Con_SafePrintf("WIPX_Init: gethostname failed (%s)\n",
Con_SafePrintf("WIPX_Init: WARNING: gethostname failed (%s)\n",
socketerror(err));
}
else

View file

@ -91,7 +91,8 @@ static char *PF_VarString (int first)
{
if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime)
{
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n", (int) s, (int)(sizeof(out) - 1));
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n",
(int) s, (int)(sizeof(out) - 1));
dev_overflows.varstring = realtime;
}
}
@ -1689,7 +1690,7 @@ static void PF_changelevel (void)
/*
==============
for 2021 re-release:
2021 re-release
==============
*/
static void PF_finalefinished (void)

View file

@ -293,7 +293,7 @@ static int PR_EnterFunction (dfunction_t *f)
// save off any locals that the new function steps on
c = f->locals;
if (localstack_used + c > LOCALSTACK_SIZE)
PR_RunError("PR_ExecuteProgram: locals stack overflow\n");
PR_RunError("PR_ExecuteProgram: locals stack overflow");
for (i = 0; i < c ; i++)
localstack[localstack_used + i] = ((int *)pr_globals)[f->parm_start + i];

View file

@ -87,8 +87,6 @@ void R_DrawSpriteModel (entity_t *e)
float *s_up, *s_right;
float angle, sr, cr;
//TODO: frustum cull it?
frame = R_GetSpriteFrame (e);
psprite = (msprite_t *) currententity->model->cache.data;

View file

@ -146,10 +146,8 @@ void S_Startup (void)
}
else
{
Con_Printf("Audio: %d bit, %s, %d Hz\n",
shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono",
shm->speed);
Con_Printf("Audio: %d bit, %s, %d Hz\n", shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", shm->speed);
}
}
@ -275,13 +273,13 @@ static sfx_t *S_FindName (const char *name)
if (!name)
Sys_Error ("S_FindName: NULL");
if (Q_strlen(name) >= MAX_QPATH)
if (strlen(name) >= MAX_QPATH)
Sys_Error ("Sound name too long: %s", name);
// see if already loaded
for (i = 0; i < num_sfx; i++)
{
if (!Q_strcmp(known_sfx[i].name, name))
if (!strcmp(known_sfx[i].name, name))
{
return &known_sfx[i];
}
@ -977,7 +975,7 @@ static void S_Play (void)
while (i < Cmd_Argc())
{
q_strlcpy(name, Cmd_Argv(i), sizeof(name));
if (!Q_strrchr(Cmd_Argv(i), '.'))
if (!strrchr(Cmd_Argv(i), '.'))
{
q_strlcat(name, ".wav", sizeof(name));
}
@ -999,12 +997,12 @@ static void S_PlayVol (void)
while (i < Cmd_Argc())
{
q_strlcpy(name, Cmd_Argv(i), sizeof(name));
if (!Q_strrchr(Cmd_Argv(i), '.'))
if (!strrchr(Cmd_Argv(i), '.'))
{
q_strlcat(name, ".wav", sizeof(name));
}
sfx = S_PrecacheSound(name);
vol = Q_atof(Cmd_Argv(i + 1));
vol = atof(Cmd_Argv(i + 1));
S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0);
i += 2;
}

View file

@ -229,14 +229,12 @@ void SV_StartSound (edict_t *entity, int channel, const char *sample, int volume
{
if (sv.protocol == PROTOCOL_NETQUAKE)
return; //don't send any info protocol can't support
else
field_mask |= SND_LARGEENTITY;
}
if (sound_num >= 256 || channel >= 8)
{
if (sv.protocol == PROTOCOL_NETQUAKE)
return; //don't send any info protocol can't support
else
field_mask |= SND_LARGESOUND;
}
//johnfitz

View file

@ -270,12 +270,10 @@ SV_FixCheckBottom
void SV_FixCheckBottom (edict_t *ent)
{
// Con_Printf ("SV_FixCheckBottom\n");
ent->v.flags = (int)ent->v.flags | FL_PARTIALGROUND;
}
/*
================
SV_NewChaseDir

View file

@ -181,11 +181,11 @@ static void Z_CheckHeap (void)
if (block->next == &mainzone->blocklist)
break; // all blocks have been hit
if ( (byte *)block + block->size != (byte *)block->next)
Sys_Error ("Z_CheckHeap: block size does not touch the next block\n");
Sys_Error ("Z_CheckHeap: block size does not touch the next block");
if ( block->next->prev != block)
Sys_Error ("Z_CheckHeap: next block doesn't have proper back link\n");
Sys_Error ("Z_CheckHeap: next block doesn't have proper back link");
if (!block->tag && !block->next->tag)
Sys_Error ("Z_CheckHeap: two consecutive free blocks\n");
Sys_Error ("Z_CheckHeap: two consecutive free blocks");
}
}