sound: use current func name in Com_Error

This commit is contained in:
Denis Pauk 2021-01-27 22:36:54 +02:00
parent f73bcf5fbd
commit 6f045f71af
2 changed files with 10 additions and 8 deletions

View file

@ -308,17 +308,18 @@ S_FindName(char *name, qboolean create)
if (!name) if (!name)
{ {
Com_Error(ERR_FATAL, "S_FindName: NULL\n"); Com_Error(ERR_FATAL, "%s: NULL\n", __func__);
} }
if (!name[0]) if (!name[0])
{ {
Com_Error(ERR_FATAL, "S_FindName: empty name\n"); Com_Error(ERR_FATAL, "%s: empty name\n", __func__);
} }
if (strlen(name) >= MAX_QPATH) if (strlen(name) >= MAX_QPATH)
{ {
Com_Error(ERR_FATAL, "Sound name too long: %s", name); Com_Error(ERR_FATAL, "%s :Sound name too long: %s",
__func__, name);
} }
/* see if already loaded */ /* see if already loaded */
@ -348,7 +349,7 @@ S_FindName(char *name, qboolean create)
{ {
if (num_sfx == MAX_SFX) if (num_sfx == MAX_SFX)
{ {
Com_Error(ERR_FATAL, "S_FindName: out of sfx_t"); Com_Error(ERR_FATAL, "%s: out of sfx_t", __func__);
} }
num_sfx++; num_sfx++;
@ -390,7 +391,7 @@ S_AliasName(char *aliasname, char *truename)
{ {
if (num_sfx == MAX_SFX) if (num_sfx == MAX_SFX)
{ {
Com_Error(ERR_FATAL, "S_FindName: out of sfx_t"); Com_Error(ERR_FATAL, "%s: out of sfx_t", __func__);
} }
num_sfx++; num_sfx++;
@ -572,7 +573,7 @@ S_PickChannel(int entnum, int entchannel)
if (entchannel < 0) if (entchannel < 0)
{ {
Com_Error(ERR_DROP, "S_PickChannel: entchannel<0"); Com_Error(ERR_DROP, "%s: entchannel<0", __func__);
} }
/* Check for replacement sound, or find the best one to replace */ /* Check for replacement sound, or find the best one to replace */
@ -920,7 +921,7 @@ S_StartLocalSound(char *sound)
if (!sfx) if (!sfx)
{ {
Com_Printf("S_StartLocalSound: can't cache %s\n", sound); Com_Printf("%s: can't cache %s\n", __func__, sound);
return; return;
} }

View file

@ -195,7 +195,8 @@ GetWavinfo(char *name, byte *wav, int wavlength)
{ {
if (samples < info.samples) if (samples < info.samples)
{ {
Com_Error(ERR_DROP, "Sound %s has a bad loop length", name); Com_Error(ERR_DROP, "%s: Sound %s has a bad loop length",
__func__, name);
} }
} }
else else