2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-03 18:45:46 +03:00

Merge pull request #353 from In-line/UseFuncWheneverPossible

Use __func__ whenever possible.
This commit is contained in:
Lev 2017-02-14 21:06:44 +05:00 committed by GitHub
commit 28d4b4e559
3 changed files with 13 additions and 13 deletions

View File

@ -228,22 +228,22 @@ void HPAK_AddLump(qboolean bUseQueue, char *pakname, struct resource_s *pResourc
if (pakname == NULL) if (pakname == NULL)
{ {
Con_Printf("HPAK_AddLump called with invalid arguments: no .pak filename\n"); Con_Printf("%s called with invalid arguments: no .pak filename\n", __func__);
return; return;
} }
if (!pResource) if (!pResource)
{ {
Con_Printf("HPAK_AddLump called with invalid arguments: no lump to add\n"); Con_Printf("%s called with invalid arguments: no lump to add\n", __func__);
return; return;
} }
if (!pData && !fpSource) if (!pData && !fpSource)
{ {
Con_Printf("HPAK_AddLump called with invalid arguments: no file handle\n"); Con_Printf("%s called with invalid arguments: no file handle\n", __func__);
return; return;
} }
if (pResource->nDownloadSize < 1024 || (unsigned int)pResource->nDownloadSize > MAX_FILE_SIZE) if (pResource->nDownloadSize < 1024 || (unsigned int)pResource->nDownloadSize > MAX_FILE_SIZE)
{ {
Con_Printf("HPAK_AddLump called with bogus lump, size: %i\n", pResource->nDownloadSize); Con_Printf("%s called with bogus lump, size: %i\n", __func__, pResource->nDownloadSize);
return; return;
} }
Q_memset(&ctx, 0, sizeof(MD5Context_t)); Q_memset(&ctx, 0, sizeof(MD5Context_t));
@ -264,7 +264,7 @@ void HPAK_AddLump(qboolean bUseQueue, char *pakname, struct resource_s *pResourc
MD5Final(md5, &ctx); MD5Final(md5, &ctx);
if (Q_memcmp(pResource->rgucMD5_hash, md5, sizeof(md5)) != 0) if (Q_memcmp(pResource->rgucMD5_hash, md5, sizeof(md5)) != 0)
{ {
Con_Printf("HPAK_AddLump called with bogus lump, md5 mismatch\n"); Con_Printf("%s called with bogus lump, md5 mismatch\n", __func__);
Con_Printf("Purported: %s\n", MD5_Print(pResource->rgucMD5_hash)); Con_Printf("Purported: %s\n", MD5_Print(pResource->rgucMD5_hash));
Con_Printf("Actual : %s\n", MD5_Print(md5)); Con_Printf("Actual : %s\n", MD5_Print(md5));
Con_Printf("Ignoring lump addition\n"); Con_Printf("Ignoring lump addition\n");
@ -312,7 +312,7 @@ void HPAK_AddLump(qboolean bUseQueue, char *pakname, struct resource_s *pResourc
FS_Close(iRead); FS_Close(iRead);
FS_Close(iWrite); FS_Close(iWrite);
FS_Unlink(szTempName); FS_Unlink(szTempName);
Con_Printf("Invalid .hpk version in HPAK_AddLump\n"); Con_Printf("Invalid .hpk version in %s\n", __func__);
return; return;
} }

View File

@ -631,7 +631,7 @@ void Netchan_CheckForCompletion(netchan_t *chan, int stream, int intotalbuffers)
Cbuf_AddText(szCommand); Cbuf_AddText(szCommand);
return; return;
} }
Con_Printf("Netchan_CheckForCompletion: Lost/dropped fragment would cause stall, retrying connection\n"); Con_Printf("%s: Lost/dropped fragment would cause stall, retrying connection\n", __func__);
Cbuf_AddText("retry\n"); Cbuf_AddText("retry\n");
} }
@ -1430,7 +1430,7 @@ qboolean Netchan_CopyNormalFragments(netchan_t *chan)
if (!chan->incomingbufs[FRAG_NORMAL_STREAM]) if (!chan->incomingbufs[FRAG_NORMAL_STREAM])
{ {
Con_Printf("Netchan_CopyNormalFragments: Called with no fragments readied\n"); Con_Printf("%s: Called with no fragments readied\n", __func__);
chan->incomingready[FRAG_NORMAL_STREAM] = FALSE; chan->incomingready[FRAG_NORMAL_STREAM] = FALSE;
return FALSE; return FALSE;
} }
@ -1466,11 +1466,11 @@ qboolean Netchan_CopyNormalFragments(netchan_t *chan)
{ {
if (chan->player_slot == 0) if (chan->player_slot == 0)
{ {
Con_Printf("Netchan_CopyNormalFragments: Incoming overflowed\n"); Con_Printf("%s: Incoming overflowed\n", __func__);
} }
else else
{ {
Con_Printf("Netchan_CopyNormalFragments: Incoming overflowed from %s\n", g_psvs.clients[chan->player_slot - 1].name); Con_Printf("%s: Incoming overflowed from %s\n", __func__, g_psvs.clients[chan->player_slot - 1].name);
} }
SZ_Clear(&net_message); SZ_Clear(&net_message);
@ -1517,7 +1517,7 @@ qboolean Netchan_CopyFileFragments(netchan_t *chan)
p = chan->incomingbufs[FRAG_FILE_STREAM]; p = chan->incomingbufs[FRAG_FILE_STREAM];
if (!p) if (!p)
{ {
Con_Printf("Netchan_CopyFileFragments: Called with no fragments readied\n"); Con_Printf("%s: Called with no fragments readied\n", __func__);
chan->incomingready[FRAG_FILE_STREAM] = FALSE; chan->incomingready[FRAG_FILE_STREAM] = FALSE;
return FALSE; return FALSE;
} }

View File

@ -3576,13 +3576,13 @@ void SV_ProcessFile(client_t *cl, char *filename)
if (!bFound) if (!bFound)
{ {
Con_Printf("SV_ProcessFile: Unrequested decal\n"); Con_Printf("%s: Unrequested decal\n", __func__);
return; return;
} }
if (resource->nDownloadSize != cl->netchan.tempbuffersize) if (resource->nDownloadSize != cl->netchan.tempbuffersize)
{ {
Con_Printf("SV_ProcessFile: Downloaded %i bytes for purported %i byte file\n", cl->netchan.tempbuffersize, resource->nDownloadSize); Con_Printf("%s: Downloaded %i bytes for purported %i byte file\n", __func__, cl->netchan.tempbuffersize, resource->nDownloadSize);
return; return;
} }