diff --git a/rehlds/engine/cmd.cpp b/rehlds/engine/cmd.cpp index ff846bf..38eaa08 100644 --- a/rehlds/engine/cmd.cpp +++ b/rehlds/engine/cmd.cpp @@ -63,7 +63,7 @@ void Cbuf_AddText(char *text) if (cmd_text.cursize + len >= cmd_text.maxsize) { - Con_Printf("%s: overflow\n", __FUNCTION__); + Con_Printf("%s: overflow\n", __func__); return; } @@ -81,7 +81,7 @@ void Cbuf_InsertText(char *text) if (cmd_text.cursize + addLen >= cmd_text.maxsize) { - Con_Printf("%s: overflow\n", __FUNCTION__); + Con_Printf("%s: overflow\n", __func__); return; } @@ -119,7 +119,7 @@ void Cbuf_InsertTextLines(char *text) if (cmd_text.cursize + addLen + 2 >= cmd_text.maxsize) { - Con_Printf("%s: overflow\n", __FUNCTION__); + Con_Printf("%s: overflow\n", __func__); return; } @@ -721,20 +721,20 @@ void Cmd_AddCommand(const char *cmd_name, xcommand_t function) if (host_initialized) { - Sys_Error("%s: called after host_initialized", __FUNCTION__); + Sys_Error("%s: called after host_initialized", __func__); } // Check in variables list if (Cvar_FindVar(cmd_name) != NULL) { - Con_Printf("%s: \"%s\" already defined as a var\n", __FUNCTION__, cmd_name); + Con_Printf("%s: \"%s\" already defined as a var\n", __func__, cmd_name); return; } // Check if this command is already defined if (Cmd_Exists(cmd_name)) { - Con_Printf("%s: \"%s\" already defined\n", __FUNCTION__, cmd_name); + Con_Printf("%s: \"%s\" already defined\n", __func__, cmd_name); return; } @@ -755,14 +755,14 @@ void Cmd_AddMallocCommand(const char *cmd_name, xcommand_t function, int flag) // Check in variables list if (Cvar_FindVar(cmd_name) != NULL) { - Con_Printf("%s: \"%s\" already defined as a var\n", __FUNCTION__, cmd_name); + Con_Printf("%s: \"%s\" already defined as a var\n", __func__, cmd_name); return; } // Check if this command is already defined if (Cmd_Exists(cmd_name)) { - Con_Printf("%s: \"%s\" already defined\n", __FUNCTION__, cmd_name); + Con_Printf("%s: \"%s\" already defined\n", __func__, cmd_name); return; } @@ -1010,7 +1010,7 @@ qboolean Cmd_ForwardToServerInternal(sizebuf_t *pBuf) char tempData[4096], buffername[64]; sizebuf_t tempBuf; - Q_sprintf(buffername, "%s::%s", __FUNCTION__, nameof_variable(tempBuf)); + Q_sprintf(buffername, "%s::%s", __func__, nameof_variable(tempBuf)); tempBuf.buffername = buffername; tempBuf.data = (byte *)tempData; @@ -1063,7 +1063,7 @@ NOXREF int Cmd_CheckParm(char *parm) if (!parm) { - Sys_Error("%s: NULL", __FUNCTION__); + Sys_Error("%s: NULL", __func__); } int c = Cmd_Argc(); diff --git a/rehlds/engine/cmodel.cpp b/rehlds/engine/cmodel.cpp index 2d225f6..513163c 100644 --- a/rehlds/engine/cmodel.cpp +++ b/rehlds/engine/cmodel.cpp @@ -54,7 +54,7 @@ unsigned char *Mod_DecompressVis(unsigned char *in, model_t *model) if (row < 0 || row > MODEL_MAX_PVS) { - Sys_Error("%s: oversized model->numleafs: %i", __FUNCTION__, model->numleafs); + Sys_Error("%s: oversized model->numleafs: %i", __func__, model->numleafs); } CM_DecompressPVS(in, decompressed, row); diff --git a/rehlds/engine/common.cpp b/rehlds/engine/common.cpp index eb4b99d..4b36514 100644 --- a/rehlds/engine/common.cpp +++ b/rehlds/engine/common.cpp @@ -651,7 +651,7 @@ void MSG_WriteBitAngle(float fAngle, int numbits) { if (numbits >= 32) { - Sys_Error("%s: Can't write bit angle with 32 bits precision\n", __FUNCTION__); + Sys_Error("%s: Can't write bit angle with 32 bits precision\n", __func__); } uint32 shift = (1 << numbits); @@ -759,7 +759,7 @@ uint32 MSG_ReadBits(int numbits) #ifdef REHLDS_FIXES if (numbits > 32) { - Sys_Error("%s: invalid numbits %d\n", __FUNCTION__, numbits); + Sys_Error("%s: invalid numbits %d\n", __func__, numbits); } #endif // REHLDS_FIXES @@ -1243,7 +1243,7 @@ void *EXT_FUNC SZ_GetSpace(sizebuf_t *buf, int length) if (length < 0) { - Sys_Error("%s: %i negative length on %s", __FUNCTION__, length, buffername); + Sys_Error("%s: %i negative length on %s", __func__, length, buffername); } if (buf->cursize + length > buf->maxsize) @@ -1253,32 +1253,32 @@ void *EXT_FUNC SZ_GetSpace(sizebuf_t *buf, int length) { if (!buf->maxsize) { - Sys_Error("%s: tried to write to an uninitialized sizebuf_t: %s", __FUNCTION__, buffername); + Sys_Error("%s: tried to write to an uninitialized sizebuf_t: %s", __func__, buffername); } else if (length > buf->maxsize) { - Sys_Error("%s: %i is > full buffer size on %s", __FUNCTION__, length, buffername); + Sys_Error("%s: %i is > full buffer size on %s", __func__, length, buffername); } else { - Sys_Error("%s: overflow without FSB_ALLOWOVERFLOW set on %s", __FUNCTION__, buffername); + Sys_Error("%s: overflow without FSB_ALLOWOVERFLOW set on %s", __func__, buffername); } } if (length > buf->maxsize) { - Con_DPrintf("%s: %i is > full buffer size on %s, ignoring", __FUNCTION__, length, buffername); + Con_DPrintf("%s: %i is > full buffer size on %s, ignoring", __func__, length, buffername); } #else // REHLDS_FIXES if (!(buf->flags & SIZEBUF_ALLOW_OVERFLOW)) { if (!buf->maxsize) { - Sys_Error("%s: Tried to write to an uninitialized sizebuf_t: %s", __FUNCTION__, buffername); + Sys_Error("%s: Tried to write to an uninitialized sizebuf_t: %s", __func__, buffername); } else { - Sys_Error("%s: overflow without FSB_ALLOWOVERFLOW set on %s", __FUNCTION__, buffername); + Sys_Error("%s: overflow without FSB_ALLOWOVERFLOW set on %s", __func__, buffername); } } @@ -1286,14 +1286,14 @@ void *EXT_FUNC SZ_GetSpace(sizebuf_t *buf, int length) { if (!(buf->flags & SIZEBUF_ALLOW_OVERFLOW)) { - Sys_Error("%s: %i is > full buffer size on %s", __FUNCTION__, length, buffername); + Sys_Error("%s: %i is > full buffer size on %s", __func__, length, buffername); } - Con_DPrintf("%s: %i is > full buffer size on %s, ignoring", __FUNCTION__, length, buffername); + Con_DPrintf("%s: %i is > full buffer size on %s, ignoring", __func__, length, buffername); } #endif // REHLDS_FIXES - Con_Printf("%s: overflow on %s\n", __FUNCTION__, buffername); + Con_Printf("%s: overflow on %s\n", __func__, buffername); SZ_Clear(buf); buf->flags |= SIZEBUF_OVERFLOWED; @@ -1874,13 +1874,13 @@ NOXREF void COM_WriteFile(char *filename, void *data, int len) if (fp) { - Sys_Printf("%s: %s\n", __FUNCTION__, path); + Sys_Printf("%s: %s\n", __func__, path); FS_Write(data, len, 1, fp); FS_Close(fp); } else { - Sys_Printf("%s: failed on %s\n", __FUNCTION__, path); + Sys_Printf("%s: failed on %s\n", __func__, path); } } @@ -2050,7 +2050,7 @@ unsigned char* EXT_FUNC COM_LoadFile(const char *path, int usehunk, int *pLength #ifdef REHLDS_FIXES FS_Close(hFile); #endif - Sys_Error("%s: bad usehunk", __FUNCTION__); + Sys_Error("%s: bad usehunk", __func__); } if (!buf) @@ -2058,7 +2058,7 @@ unsigned char* EXT_FUNC COM_LoadFile(const char *path, int usehunk, int *pLength #ifdef REHLDS_FIXES FS_Close(hFile); #endif - Sys_Error("%s: not enough space for %s", __FUNCTION__, path); + Sys_Error("%s: not enough space for %s", __func__, path); } FS_Read(buf, len, 1, hFile); @@ -2129,7 +2129,7 @@ NOXREF unsigned char *COM_LoadFileLimit(char *path, int pos, int cbmax, int *pcb #ifdef REHLDS_FIXES FS_Close(hFile); #endif - Sys_Error("%s: invalid seek position for %s", __FUNCTION__, path); + Sys_Error("%s: invalid seek position for %s", __func__, path); } FS_Seek(hFile, pos, FILESYSTEM_SEEK_HEAD); @@ -2152,7 +2152,7 @@ NOXREF unsigned char *COM_LoadFileLimit(char *path, int pos, int cbmax, int *pcb #ifdef REHLDS_FIXES FS_Close(hFile); #endif - Sys_Error("%s: not enough space for %s", __FUNCTION__, path); + Sys_Error("%s: not enough space for %s", __func__, path); } FS_Close(hFile); diff --git a/rehlds/engine/crc.cpp b/rehlds/engine/crc.cpp index a68b1f3..1c3b9ce 100644 --- a/rehlds/engine/crc.cpp +++ b/rehlds/engine/crc.cpp @@ -133,7 +133,7 @@ byte COM_BlockSequenceCRCByte(byte *base, int length, int sequence) CRC32_t crc; if (sequence < 0) - Sys_Error("%s: sequence < 0\n", __FUNCTION__); + Sys_Error("%s: sequence < 0\n", __func__); p = (byte *)pulCRCTable + sequence % 0x3FC; if (length > 60) length = 60; diff --git a/rehlds/engine/cvar.cpp b/rehlds/engine/cvar.cpp index e590395..d72ccc2 100644 --- a/rehlds/engine/cvar.cpp +++ b/rehlds/engine/cvar.cpp @@ -309,7 +309,7 @@ void Cvar_Set(const char *var_name, const char *value) if (!var) { - Con_DPrintf("%s: variable \"%s\" not found\n", __FUNCTION__, var_name); + Con_DPrintf("%s: variable \"%s\" not found\n", __func__, var_name); return; } @@ -351,7 +351,7 @@ void EXT_FUNC Cvar_RegisterVariable(cvar_t *variable) if (Cmd_Exists(variable->name)) { - Con_Printf("%s: \"%s\" is a command\n", __FUNCTION__, variable->name); + Con_Printf("%s: \"%s\" is a command\n", __func__, variable->name); return; } diff --git a/rehlds/engine/decals.cpp b/rehlds/engine/decals.cpp index ac50243..7210f50 100644 --- a/rehlds/engine/decals.cpp +++ b/rehlds/engine/decals.cpp @@ -78,7 +78,7 @@ void Draw_CacheWadInitFromFile(FileHandle_t hFile, int len, char *name, int cach #ifdef REHLDS_FIXES FS_Close(hFile); #endif - Sys_Error("%s: Wad file %s doesn't have WAD3 id\n", __FUNCTION__, name); + Sys_Error("%s: Wad file %s doesn't have WAD3 id\n", __func__, name); } wad->lumps = (lumpinfo_s *)Mem_Malloc(len - header.infotableofs); @@ -103,7 +103,7 @@ void Draw_CacheWadInit(char *name, int cacheMax, cachewad_t *wad) int len; FileHandle_t hFile = FS_Open(name, "rb"); if (!hFile) - Sys_Error("%s: Couldn't open %s\n", __FUNCTION__, name); + Sys_Error("%s: Couldn't open %s\n", __func__, name); len = FS_Size(hFile); Draw_CacheWadInitFromFile(hFile, len, name, cacheMax, wad); FS_Close(hFile); @@ -180,7 +180,7 @@ void Draw_MiptexTexture(cachewad_t *wad, unsigned char *data) byte *pal; if (wad->cacheExtra != DECAL_EXTRASIZE) - Sys_Error("%s: Bad cached wad %s\n", __FUNCTION__, wad->name); + Sys_Error("%s: Bad cached wad %s\n", __func__, wad->name); tex = (texture_t *)data; mip = (miptex_t *)(data + wad->cacheExtra); @@ -311,7 +311,7 @@ NOXREF int Draw_DecalIndex(int id) char tmp[32]; char *pName; if (!decal_names[id][0]) - Sys_Error("%s: Used decal #%d without a name\n", __FUNCTION__, id); + Sys_Error("%s: Used decal #%d without a name\n", __func__, id); pName = decal_names[id]; if (!Host_IsServerActive() && violence_hblood.value == 0.0f && !Q_strncmp(pName, "{blood", 6)) @@ -360,7 +360,7 @@ NOXREF texture_t *Draw_DecalTexture(int index) { pCust = g_pcl.players[~index].customdata.pNext; if (!pCust || !pCust->bInUse || !pCust->pInfo || !pCust->pBuffer) - Sys_Error("%s: Failed to load custom decal for player #%i:%s using default decal 0.\n", __FUNCTION__, ~index, g_pcl.players[~index].name); + Sys_Error("%s: Failed to load custom decal for player #%i:%s using default decal 0.\n", __func__, ~index, g_pcl.players[~index].name); retval = (texture_t *)Draw_CustomCacheGet((cachewad_t *)pCust->pInfo, pCust->pBuffer, pCust->resource.nDownloadSize, pCust->nUserData1); if (!retval) @@ -383,7 +383,7 @@ int Draw_CacheByIndex(cachewad_t *wad, int nIndex, int playernum) if (i == wad->cacheCount) { if (i == wad->cacheMax) - Sys_Error("%s: Cache wad (%s) out of %d entries", __FUNCTION__, wad->name, i); + Sys_Error("%s: Cache wad (%s) out of %d entries", __func__, wad->name, i); wad->cacheCount++; Q_snprintf(pic->name, sizeof(pic->name), "%s", szTestName); } @@ -460,7 +460,7 @@ void Decal_MergeInDecals(cachewad_t *pwad, const char *pathID) cachewad_t *final; if (!pwad) - Sys_Error("%s: called with NULL wad\n", __FUNCTION__); + Sys_Error("%s: called with NULL wad\n", __func__); lumplist = NULL; if (!decal_wad) @@ -546,7 +546,7 @@ void Decal_Init(void) #else if (i == 0 && !hfile) #endif - Sys_Error("%s: Couldn't find '%s' in \"%s\" search path\n", __FUNCTION__, "decals.wad", pszPathID[i]); + Sys_Error("%s: Couldn't find '%s' in \"%s\" search path\n", __func__, "decals.wad", pszPathID[i]); #ifdef REHLDS_FIXES found = true; @@ -564,7 +564,7 @@ void Decal_Init(void) sv_decalnamecount = Draw_DecalCount(); if (sv_decalnamecount > MAX_DECALS) - Sys_Error("%s: Too many decals: %d / %d\n", __FUNCTION__, sv_decalnamecount, MAX_DECALS); + Sys_Error("%s: Too many decals: %d / %d\n", __func__, sv_decalnamecount, MAX_DECALS); for (i = 0; i < sv_decalnamecount; i++) { @@ -615,7 +615,7 @@ NOXREF void *Draw_CacheGet(cachewad_t *wad, int index) lumpinfo_t *pLump; if (index >= wad->cacheCount) - Sys_Error("%s: Cache wad indexed before load %s: %d", __FUNCTION__, wad->name, index); + Sys_Error("%s: Cache wad indexed before load %s: %d", __func__, wad->name, index); pic = wad->cache; dat = Cache_Check(&pic[index].cache); @@ -640,7 +640,7 @@ NOXREF void *Draw_CacheGet(cachewad_t *wad, int index) if (Draw_CacheReload(wad, i, pLump, pic, clean, path)) { if (pic->cache.data == NULL) - Sys_Error("%s: failed to load %s", __FUNCTION__, path); + Sys_Error("%s: failed to load %s", __func__, path); dat = pic->cache.data; } } @@ -655,7 +655,7 @@ void *Draw_CustomCacheGet(cachewad_t *wad, void *raw, int rawsize, int index) char clean[16]; if (wad->cacheCount <= index) - Sys_Error("%s: Cache wad indexed before load %s: %d", __FUNCTION__, wad->name, index); + Sys_Error("%s: Cache wad indexed before load %s: %d", __func__, wad->name, index); pic = &wad->cache[index]; pdata = Cache_Check(&pic->cache); @@ -667,7 +667,7 @@ void *Draw_CustomCacheGet(cachewad_t *wad, void *raw, int rawsize, int index) if (Draw_CacheLoadFromCustom(clean, wad, raw, rawsize, pic)) { if (!pic->cache.data) - Sys_Error("%s: failed to load %s", __FUNCTION__, pic->name); + Sys_Error("%s: failed to load %s", __func__, pic->name); pdata = pic->cache.data; } } @@ -699,7 +699,7 @@ NOXREF qboolean Draw_CacheReload(cachewad_t *wad, int i, lumpinfo_t *pLump, cach #endif // SWDS buf = (byte *)Cache_Alloc(&pic->cache, wad->cacheExtra + pLump->size + 1, clean); if (!buf) - Sys_Error("%s: not enough space for %s in %s", __FUNCTION__, path, wad->name); + Sys_Error("%s: not enough space for %s in %s", __func__, path, wad->name); buf[pLump->size + wad->cacheExtra] = 0; FS_Seek(hFile, pLump->filepos, FILESYSTEM_SEEK_HEAD); @@ -726,7 +726,7 @@ qboolean Draw_ValidateCustomLogo(cachewad_t *wad, unsigned char *data, lumpinfo_ if (wad->cacheExtra != DECAL_EXTRASIZE) { - Con_Printf("%s: Bad cached wad %s\n", __FUNCTION__, wad->name); + Con_Printf("%s: Bad cached wad %s\n", __func__, wad->name); return FALSE; } @@ -755,20 +755,20 @@ qboolean Draw_ValidateCustomLogo(cachewad_t *wad, unsigned char *data, lumpinfo_ || (tmp.offsets[0] + pix != tmp.offsets[1]) || paloffset != tmp.offsets[2] || palettesize != tmp.offsets[3]) { - Con_Printf("%s: Bad cached wad %s\n", __FUNCTION__, wad->name); + Con_Printf("%s: Bad cached wad %s\n", __func__, wad->name); return FALSE; } if (nPalleteCount > 256) { - Con_Printf("%s: Bad cached wad palette size %i on %s\n", __FUNCTION__, nPalleteCount, wad->name); + Con_Printf("%s: Bad cached wad palette size %i on %s\n", __func__, nPalleteCount, wad->name); return FALSE; } nSize = pixoffset + LittleLong(tmp.offsets[0]) + 3 * nPalleteCount + 2; if (nSize > lump->disksize) { - Con_Printf("%s: Bad cached wad %s\n", __FUNCTION__, wad->name); + Con_Printf("%s: Bad cached wad %s\n", __func__, wad->name); return FALSE; } @@ -792,7 +792,7 @@ qboolean Draw_CacheLoadFromCustom(char *clean, cachewad_t *wad, void *raw, int r pLump = &wad->lumps[idx]; buf = (byte *)Cache_Alloc(&pic->cache, wad->cacheExtra + pLump->size + 1, clean); if (!buf) - Sys_Error("%s: not enough space for %s in %s", __FUNCTION__, clean, wad->name); + Sys_Error("%s: not enough space for %s in %s", __func__, clean, wad->name); buf[wad->cacheExtra + pLump->size] = 0; Q_memcpy((char *)buf + wad->cacheExtra, (char *)raw + pLump->filepos, pLump->size); @@ -825,7 +825,7 @@ NOXREF int Draw_CacheIndex(cachewad_t *wad, char *path) if (i == wad->cacheCount) { if (wad->cacheMax == wad->cacheCount) - Sys_Error("%s: Cache wad (%s) out of %d entries", __FUNCTION__); + Sys_Error("%s: Cache wad (%s) out of %d entries", __func__); wad->cacheCount++; Q_strncpy(wad->name, path, 63); diff --git a/rehlds/engine/delta.cpp b/rehlds/engine/delta.cpp index 7653af8..d6f029d 100644 --- a/rehlds/engine/delta.cpp +++ b/rehlds/engine/delta.cpp @@ -326,7 +326,7 @@ delta_description_t *DELTA_FindField(delta_t *pFields, const char *pszField) } } - Con_Printf("%s: Warning, couldn't find %s\n", __FUNCTION__, pszField); + Con_Printf("%s: Warning, couldn't find %s\n", __func__, pszField); return NULL; } @@ -343,7 +343,7 @@ int EXT_FUNC DELTA_FindFieldIndex(struct delta_s *pFields, const char *fieldname } } - Con_Printf("%s: Warning, couldn't find %s\n", __FUNCTION__, fieldname); + Con_Printf("%s: Warning, couldn't find %s\n", __func__, fieldname); return -1; } @@ -471,7 +471,7 @@ int DELTA_TestDelta(unsigned char *from, unsigned char *to, delta_t *pFields) } break; default: - Con_Printf("%s: Bad field type %i\n", __FUNCTION__, fieldType); + Con_Printf("%s: Bad field type %i\n", __func__, fieldType); break; } @@ -559,7 +559,7 @@ void DELTA_MarkSendFields(unsigned char *from, unsigned char *to, delta_t *pFiel pTest->flags |= FDT_MARK; break; default: - Con_Printf("%s: Bad field type %i\n", __FUNCTION__, fieldType); + Con_Printf("%s: Bad field type %i\n", __func__, fieldType); break; } } @@ -715,7 +715,7 @@ void DELTA_WriteMarkedFields(unsigned char *from, unsigned char *to, delta_t *pF MSG_WriteBitString((const char *)&to[pTest->fieldOffset]); break; default: - Con_Printf("%s: unknown send field type\n", __FUNCTION__); + Con_Printf("%s: unknown send field type\n", __func__); break; } } @@ -843,7 +843,7 @@ int DELTA_ParseDelta(unsigned char *from, unsigned char *to, delta_t *pFields) Q_strcpy((char *)&to[pTest->fieldOffset], (char *)&from[pTest->fieldOffset]); break; default: - Con_Printf("%s: unparseable field type %i\n", __FUNCTION__, fieldType); + Con_Printf("%s: unparseable field type %i\n", __func__, fieldType); } continue; } @@ -985,7 +985,7 @@ int DELTA_ParseDelta(unsigned char *from, unsigned char *to, delta_t *pFields) } while (c); break; default: - Con_Printf("%s: unparseable field type %i\n", __FUNCTION__, fieldType); + Con_Printf("%s: unparseable field type %i\n", __func__, fieldType); break; } } @@ -1085,7 +1085,7 @@ delta_t *DELTA_BuildFromLinks(delta_link_t **pplinks) #ifdef REHLDS_FIXES if (count > DELTA_MAX_FIELDS) - Sys_Error("%s: Too many fields in delta description %i (MAX %i)\n", __FUNCTION__, count, DELTA_MAX_FIELDS); + Sys_Error("%s: Too many fields in delta description %i (MAX %i)\n", __func__, count, DELTA_MAX_FIELDS); #endif pdesc = (delta_description_t *)Mem_ZeroMalloc(sizeof(delta_description_t) * count); @@ -1116,7 +1116,7 @@ int DELTA_FindOffset(int count, delta_definition_t *pdef, char *fieldname) } } - Sys_Error("%s: Couldn't find offset for %s!!!\n", __FUNCTION__, fieldname); + Sys_Error("%s: Couldn't find offset for %s!!!\n", __func__, fieldname); } qboolean DELTA_ParseType(delta_description_t *pdelta, char **pstream) @@ -1150,11 +1150,11 @@ qboolean DELTA_ParseType(delta_description_t *pdelta, char **pstream) else if (!Q_stricmp(com_token, "DT_STRING")) pdelta->fieldType |= DT_STRING; else - Sys_Error("%s: Unknown type or type flag %s\n", __FUNCTION__, com_token); + Sys_Error("%s: Unknown type or type flag %s\n", __func__, com_token); } // We are hit the end of the stream - Sys_Error("%s: Expecting fieldtype info\n", __FUNCTION__); // Was Con_Printf here + Sys_Error("%s: Expecting fieldtype info\n", __func__); // Was Con_Printf here return FALSE; } @@ -1167,7 +1167,7 @@ qboolean DELTA_ParseField(int count, delta_definition_t *pdefinition, delta_link { if (Q_stricmp(com_token, "DEFINE_DELTA_POST")) { - Sys_Error("%s: Expecting DEFINE_*, got %s\n", __FUNCTION__, com_token); + Sys_Error("%s: Expecting DEFINE_*, got %s\n", __func__, com_token); } readpost = 1; } @@ -1175,13 +1175,13 @@ qboolean DELTA_ParseField(int count, delta_definition_t *pdefinition, delta_link *pstream = COM_Parse(*pstream); if (Q_stricmp(com_token, "(")) { - Sys_Error("%s: Expecting (, got %s\n", __FUNCTION__, com_token); + Sys_Error("%s: Expecting (, got %s\n", __func__, com_token); } *pstream = COM_Parse(*pstream); if (com_token[0] == 0) { - Sys_Error("%s: Expecting fieldname\n", __FUNCTION__); + Sys_Error("%s: Expecting fieldname\n", __func__); } Q_strncpy(pField->delta->fieldName, com_token, 31); @@ -1215,7 +1215,7 @@ qboolean DELTA_ParseField(int count, delta_definition_t *pdefinition, delta_link *pstream = COM_Parse(*pstream); if (Q_stricmp(com_token, ")")) { - Sys_Error("%s: Expecting ), got %s\n", __FUNCTION__, com_token); // Was Con_Printf here + Sys_Error("%s: Expecting ), got %s\n", __func__, com_token); // Was Con_Printf here return FALSE; } @@ -1309,7 +1309,7 @@ void DELTA_SkipDescription(char **pstream) *pstream = COM_Parse(*pstream); if (com_token[0] == 0) { - Sys_Error("%s: Error during description skip", __FUNCTION__); + Sys_Error("%s: Error during description skip", __func__); } } while (Q_stricmp(com_token, "}")); } @@ -1363,13 +1363,13 @@ qboolean DELTA_ParseDescription(char *name, delta_t **ppdesc, char *pstream) if (!ppdesc) { - Sys_Error("%s: called with no delta_description_t\n", __FUNCTION__); + Sys_Error("%s: called with no delta_description_t\n", __func__); } *ppdesc = 0; if (!pstream) { - Sys_Error("%s: called with no data stream\n", __FUNCTION__); + Sys_Error("%s: called with no data stream\n", __func__); } while (true) @@ -1389,14 +1389,14 @@ qboolean DELTA_ParseDescription(char *name, delta_t **ppdesc, char *pstream) pdefinition = DELTA_FindDefinition(com_token, &count); if (!pdefinition) { - Sys_Error("%s: Unknown data type: %s\n", __FUNCTION__, com_token); + Sys_Error("%s: Unknown data type: %s\n", __func__, com_token); } // Parse source of conditional encoder pstream = COM_Parse(pstream); if (com_token[0] == 0) { - Sys_Error("%s: Unknown encoder : %s\nValid values:\nnone\ngamedll funcname\nclientdll funcname\n", __FUNCTION__, com_token); + Sys_Error("%s: Unknown encoder : %s\nValid values:\nnone\ngamedll funcname\nclientdll funcname\n", __func__, com_token); } if (Q_stricmp(com_token, "none")) { @@ -1407,7 +1407,7 @@ qboolean DELTA_ParseDescription(char *name, delta_t **ppdesc, char *pstream) pstream = COM_Parse(pstream); if (com_token[0] == 0) { - Sys_Error("%s: Expecting encoder\n", __FUNCTION__); + Sys_Error("%s: Expecting encoder\n", __func__); } Q_strncpy(encoder, com_token, sizeof(encoder)-1); @@ -1428,7 +1428,7 @@ qboolean DELTA_ParseDescription(char *name, delta_t **ppdesc, char *pstream) } if (Q_stricmp(com_token, "{")) { - Sys_Error("%s: Expecting {, got %s\n", __FUNCTION__, com_token); // Was Con_Printf here + Sys_Error("%s: Expecting {, got %s\n", __func__, com_token); // Was Con_Printf here return FALSE; } if (!DELTA_ParseOneField(&pstream, &links, count, pdefinition)) @@ -1459,7 +1459,7 @@ qboolean DELTA_Load(char *name, delta_t **ppdesc, char *pszFile) pbuf = (char *)COM_LoadFile(pszFile, 5, 0); if (!pbuf) { - Sys_Error("%s: Couldn't load file %s\n", __FUNCTION__, pszFile); + Sys_Error("%s: Couldn't load file %s\n", __func__, pszFile); } bret = DELTA_ParseDescription(name, ppdesc, pbuf); diff --git a/rehlds/engine/delta_jit.cpp b/rehlds/engine/delta_jit.cpp index bacc41b..658d790 100644 --- a/rehlds/engine/delta_jit.cpp +++ b/rehlds/engine/delta_jit.cpp @@ -30,7 +30,7 @@ unsigned int DELTAJIT_GetFieldSize(delta_description_t* desc) { return 0; default: - Sys_Error("%s: Unknown delta field type %d", __FUNCTION__, desc->fieldType); + Sys_Error("%s: Unknown delta field type %d", __func__, desc->fieldType); return 0; } } @@ -56,11 +56,11 @@ void DELTAJIT_CreateDescription(delta_t* delta, deltajitdata_t &jitdesc) { // sanity checks & pre-clean if (numMemBlocks > DELTAJIT_MAX_BLOCKS) { - Sys_Error("%s: numMemBlocks > DELTAJIT_MAX_BLOCKS (%d > %d)", __FUNCTION__, numMemBlocks, DELTAJIT_MAX_BLOCKS); + Sys_Error("%s: numMemBlocks > DELTAJIT_MAX_BLOCKS (%d > %d)", __func__, numMemBlocks, DELTAJIT_MAX_BLOCKS); } if (delta->fieldCount > DELTAJIT_MAX_FIELDS) { - Sys_Error("%s: fieldCount > DELTAJIT_MAX_FIELDS (%d > %d)", __FUNCTION__, delta->fieldCount, DELTAJIT_MAX_FIELDS); + Sys_Error("%s: fieldCount > DELTAJIT_MAX_FIELDS (%d > %d)", __func__, delta->fieldCount, DELTAJIT_MAX_FIELDS); } Q_memset(&jitdesc, 0, sizeof(jitdesc)); @@ -684,20 +684,20 @@ CDeltaJit* DELTAJit_LookupDeltaJit(const char* callsite, delta_t *pFields) { } NOINLINE int DELTAJit_Fields_Clear_Mark_Check(unsigned char *from, unsigned char *to, delta_t *pFields, void* pForceMarkMask) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); CDeltaClearMarkFieldsJIT &func = *deltaJit->cleanMarkCheckFunc; return func(from, to, deltaJit, pForceMarkMask); } NOINLINE int DELTAJit_TestDelta(unsigned char *from, unsigned char *to, delta_t *pFields) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); CDeltaTestDeltaJIT &func = *deltaJit->testDeltaFunc; return func(from, to, deltaJit); } void DELTAJit_SetSendFlagBits(delta_t *pFields, int *bits, int *bytecount) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); bits[0] = deltaJit->marked_fields_mask.u32[0]; bits[1] = deltaJit->marked_fields_mask.u32[1]; @@ -706,29 +706,29 @@ void DELTAJit_SetSendFlagBits(delta_t *pFields, int *bits, int *bytecount) { void DELTAJit_SetFieldByIndex(struct delta_s *pFields, int fieldNumber) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); deltaJit->marked_fields_mask.u32[fieldNumber >> 5] |= (1 << (fieldNumber & 31)); } void DELTAJit_UnsetFieldByIndex(struct delta_s *pFields, int fieldNumber) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); deltaJit->marked_fields_mask.u32[fieldNumber >> 5] &= ~(1 << (fieldNumber & 31)); } qboolean DELTAJit_IsFieldMarked(delta_t* pFields, int fieldNumber) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); return deltaJit->marked_fields_mask.u32[fieldNumber >> 5] & (1 << (fieldNumber & 31)); } uint64 DELTAJit_GetOriginalMask(delta_t* pFields) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); return deltaJit->originalMarkedFieldsMask.u64; } uint64 DELTAJit_GetMaskU64(delta_t* pFields) { - CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__FUNCTION__, pFields); + CDeltaJit* deltaJit = DELTAJit_LookupDeltaJit(__func__, pFields); return deltaJit->marked_fields_mask.u64; } diff --git a/rehlds/engine/ed_strpool.cpp b/rehlds/engine/ed_strpool.cpp index 6c5676b..8a2e76f 100644 --- a/rehlds/engine/ed_strpool.cpp +++ b/rehlds/engine/ed_strpool.cpp @@ -40,7 +40,7 @@ char* Ed_StrPool_Alloc(const char* origStr) { unsigned int len = Q_strlen(origStr) + 1; if (len >= ARRAYSIZE(str)) { - Sys_Error("%s: Too long string allocated: %s", __FUNCTION__, origStr); + Sys_Error("%s: Too long string allocated: %s", __func__, origStr); } Q_strcpy(str, origStr); diff --git a/rehlds/engine/hashpak.cpp b/rehlds/engine/hashpak.cpp index 85acc8e..c28e415 100644 --- a/rehlds/engine/hashpak.cpp +++ b/rehlds/engine/hashpak.cpp @@ -72,7 +72,7 @@ qboolean HPAK_GetDataPointer(char *pakname, struct resource_s *pResource, unsign { pbuf = (byte *)Mem_Malloc(p->datasize); if (!pbuf) - Sys_Error("%s: Error allocating %i bytes for hpak!", __FUNCTION__, p->datasize); + Sys_Error("%s: Error allocating %i bytes for hpak!", __func__, p->datasize); Q_memcpy((void *)pbuf, p->data, p->datasize); *pbuffer = pbuf; } @@ -173,7 +173,7 @@ void HPAK_AddToQueue(char *pakname, struct resource_s *pResource, void *pData, F { hash_pack_queue_t *n = (hash_pack_queue_t *)Mem_Malloc(sizeof(hash_pack_queue_t)); if (!n) - Sys_Error("%s: Unable to allocate %i bytes for hpak queue!", __FUNCTION__, sizeof(hash_pack_queue_t)); + Sys_Error("%s: Unable to allocate %i bytes for hpak queue!", __func__, sizeof(hash_pack_queue_t)); Q_memset(n, 0, sizeof(hash_pack_queue_t)); n->pakname = Mem_Strdup(pakname); @@ -181,7 +181,7 @@ void HPAK_AddToQueue(char *pakname, struct resource_s *pResource, void *pData, F n->datasize = pResource->nDownloadSize; n->data = Mem_Malloc(pResource->nDownloadSize); if (!n->data) - Sys_Error("%s: Unable to allocate %i bytes for hpak queue!", __FUNCTION__, n->datasize); + Sys_Error("%s: Unable to allocate %i bytes for hpak queue!", __func__, n->datasize); if (pData) { @@ -192,7 +192,7 @@ void HPAK_AddToQueue(char *pakname, struct resource_s *pResource, void *pData, F else { if (!fpSource) - Sys_Error("%s: Add to Queue called without data or file pointer!", __FUNCTION__); + Sys_Error("%s: Add to Queue called without data or file pointer!", __func__); FS_Read(n->data, n->datasize, 1, fpSource); n->next = gp_hpak_queue; gp_hpak_queue = n; @@ -422,7 +422,7 @@ void HPAK_RemoveLump(char *pakname, resource_t *pResource) if (pakname == NULL || *pakname == '\0' || pResource == NULL) { - Con_Printf("%s: Invalid arguments\n", __FUNCTION__); + Con_Printf("%s: Invalid arguments\n", __func__); return; } HPAK_FlushHostQueue(); diff --git a/rehlds/engine/host.cpp b/rehlds/engine/host.cpp index 497a448..a361ec8 100644 --- a/rehlds/engine/host.cpp +++ b/rehlds/engine/host.cpp @@ -105,7 +105,7 @@ NOXREF void Host_EndGame(const char *message, ...) Q_vsnprintf(string, sizeof(string), message, argptr); va_end(argptr); - Con_DPrintf("%s: %s\n", __FUNCTION__, string); + Con_DPrintf("%s: %s\n", __func__, string); oldn = g_pcls.demonum; @@ -116,7 +116,7 @@ NOXREF void Host_EndGame(const char *message, ...) if (!g_pcls.state) { - Sys_Error("%s: %s\n", __FUNCTION__, string); + Sys_Error("%s: %s\n", __func__, string); } if (oldn != -1) @@ -142,7 +142,7 @@ void NORETURN Host_Error(const char *error, ...) va_start(argptr, error); if (inerror) - Sys_Error("%s: recursively entered", __FUNCTION__); + Sys_Error("%s: recursively entered", __func__); inerror = TRUE; SCR_EndLoadingPlaque(); @@ -152,7 +152,7 @@ void NORETURN Host_Error(const char *error, ...) if (g_psv.active && developer.value != 0.0 ) CL_WriteMessageHistory(0, 0); - Con_Printf("%s: %s\n", __FUNCTION__, string); + Con_Printf("%s: %s\n", __func__, string); if (g_psv.active) Host_ShutdownServer(FALSE); @@ -163,7 +163,7 @@ void NORETURN Host_Error(const char *error, ...) inerror = FALSE; longjmp(host_abortserver, 1); } - Sys_Error("%s: %s\n", __FUNCTION__, string); + Sys_Error("%s: %s\n", __func__, string); } void Host_InitLocal(void) @@ -1161,11 +1161,11 @@ int Host_Init(quakeparms_t *parms) Q_memset(&g_module, 0, sizeof(g_module)); if (g_pcls.state != ca_dedicated) { - //Sys_Error("%s: Only dedicated server mode is supported", __FUNCTION__); + //Sys_Error("%s: Only dedicated server mode is supported", __func__); color24 *disk_basepal = (color24 *)COM_LoadHunkFile("gfx/palette.lmp"); if (!disk_basepal) - Sys_Error("%s: Couldn't load gfx/palette.lmp", __FUNCTION__); + Sys_Error("%s: Couldn't load gfx/palette.lmp", __func__); host_basepal = (unsigned short *)Hunk_AllocName(sizeof(PackedColorVec) * 256, "palette.lmp"); for (int i = 0; i < 256; i++) diff --git a/rehlds/engine/host_cmd.cpp b/rehlds/engine/host_cmd.cpp index 48b3b56..c79c33f 100644 --- a/rehlds/engine/host_cmd.cpp +++ b/rehlds/engine/host_cmd.cpp @@ -1715,7 +1715,7 @@ void EntityInit(edict_t *pEdict, int className) { ENTITYINIT pEntityInit; if (!className) - Sys_Error("%s: Bad class!!\n", __FUNCTION__); + Sys_Error("%s: Bad class!!\n", __func__); ReleaseEntityDLLFields(pEdict); InitEntityDLLFields(pEdict); @@ -1935,7 +1935,7 @@ int LoadGamestate(char *level, int createPlayers) else { if (!(pEntInfo->flags & FENTTABLE_PLAYER)) - Sys_Error("%s: ENTITY IS NOT A PLAYER: %d\n", __FUNCTION__, i); + Sys_Error("%s: ENTITY IS NOT A PLAYER: %d\n", __func__, i); pent = g_psvs.clients[pEntInfo->id - 1].edict; if (createPlayers && pent) @@ -2048,7 +2048,7 @@ int CreateEntityList(SAVERESTOREDATA *pSaveData, int levelMask) if (pent && !pent->free) { if (!(pEntInfo->flags & FENTTABLE_PLAYER)) - Sys_Error("%s: ENTITY IS NOT A PLAYER: %d\n", __FUNCTION__, i); + Sys_Error("%s: ENTITY IS NOT A PLAYER: %d\n", __func__, i); if (cl->active) EntityInit(pent, pEntInfo->classname); @@ -2339,7 +2339,7 @@ void Host_Changelevel2_f(void) FS_LogLevelLoadStarted(level); if (!SV_SpawnServer(FALSE, level, startspot)) - Sys_Error("%s: Couldn't load map %s\n", __FUNCTION__, level); + Sys_Error("%s: Couldn't load map %s\n", __func__, level); if (pSaveData) SaveExit(pSaveData); diff --git a/rehlds/engine/mathlib.cpp b/rehlds/engine/mathlib.cpp index 4a9759d..efbd2fb 100644 --- a/rehlds/engine/mathlib.cpp +++ b/rehlds/engine/mathlib.cpp @@ -116,7 +116,7 @@ float anglemod(float a) void BOPS_Error(void) { - Sys_Error("%s: Bad signbits", __FUNCTION__); + Sys_Error("%s: Bad signbits", __func__); } #ifdef REHLDS_OPT_PEDANTIC diff --git a/rehlds/engine/model.cpp b/rehlds/engine/model.cpp index 01f2f1f..a9c8f7d 100644 --- a/rehlds/engine/model.cpp +++ b/rehlds/engine/model.cpp @@ -68,14 +68,14 @@ void* EXT_FUNC Mod_Extradata(model_t *mod) if (mod->type == mod_brush) { - Sys_Error("%s: called with mod_brush!\n", __FUNCTION__); + Sys_Error("%s: called with mod_brush!\n", __func__); } Mod_LoadModel(mod, 1, 0); if (mod->cache.data == NULL) { - Sys_Error("%s: caching failed", __FUNCTION__); + Sys_Error("%s: caching failed", __func__); } return mod->cache.data; @@ -88,7 +88,7 @@ mleaf_t *Mod_PointInLeaf(vec_t *p, model_t *model) mplane_t *plane; if (!model || !model->nodes) - Sys_Error("%s: bad model", __FUNCTION__); + Sys_Error("%s: bad model", __func__); node = model->nodes; while (node->contents >= 0) @@ -140,7 +140,7 @@ model_t *Mod_FindName(qboolean trackCRC, const char *name) avail = NULL; if (!name[0]) - Sys_Error("%s: NULL name", __FUNCTION__); + Sys_Error("%s: NULL name", __func__); for (i = 0, mod = mod_known; i < mod_numknown; i++, mod++) { @@ -164,7 +164,7 @@ model_t *Mod_FindName(qboolean trackCRC, const char *name) else { if (!avail) - Sys_Error("%s: mod_numknown >= MAX_KNOWN_MODELS", __FUNCTION__); + Sys_Error("%s: mod_numknown >= MAX_KNOWN_MODELS", __func__); mod = avail; Mod_FillInCRCInfo(trackCRC, avail - mod_known); } @@ -286,7 +286,7 @@ model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean trackCRC) if (!buf) { if (crash) - Sys_Error("%s: %s not found", __FUNCTION__, mod->name); + Sys_Error("%s: %s not found", __func__, mod->name); return 0; } @@ -303,7 +303,7 @@ model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean trackCRC) { if (currentCRC != p->initialCRC) { - Sys_Error("%s: %s has been modified since starting the engine. Consider running system diagnostics to check for faulty hardware.\n", __FUNCTION__, mod->name); + Sys_Error("%s: %s has been modified since starting the engine. Consider running system diagnostics to check for faulty hardware.\n", __func__, mod->name); } } else @@ -495,7 +495,7 @@ void Mod_LoadTextures(lump_t *l) mt->width = LittleLong(mt->width); mt->height = LittleLong(mt->height); if (mt->width & 0xF || mt->height & 0xF) - Sys_Error("%s: Texture %s is not 16 aligned", __FUNCTION__, mt); + Sys_Error("%s: Texture %s is not 16 aligned", __func__, mt); pixels = 85 * mt->height * mt->width / 64; palette = *(uint16*)((char*)mt + sizeof(miptex_t) + pixels); @@ -559,7 +559,7 @@ void Mod_LoadTextures(lump_t *l) if (max < '0' || max > '9') { if (max < 'A' || max > 'J') - Sys_Error("%s: Bad animating texture %s", __FUNCTION__, tx); + Sys_Error("%s: Bad animating texture %s", __func__, tx); altmax = max - 'A'; max = 0; altanims[altmax] = tx; @@ -592,7 +592,7 @@ void Mod_LoadTextures(lump_t *l) if (num < '0' || num > '9') { if (num < 'A' || num > 'J') - Sys_Error("%s: Bad animating texture %s", __FUNCTION__, tx); + Sys_Error("%s: Bad animating texture %s", __func__, tx); num -= 'A'; altanims[num] = tx2; @@ -613,7 +613,7 @@ void Mod_LoadTextures(lump_t *l) { tx2 = anims[j]; if (!tx2) - Sys_Error("%s: Missing frame %i of %s", __FUNCTION__, j, tx); + Sys_Error("%s: Missing frame %i of %s", __func__, j, tx); tx2->anim_min = j; tx2->anim_total = max; tx2->anim_max = j + 1; @@ -626,7 +626,7 @@ void Mod_LoadTextures(lump_t *l) { tx2 = altanims[j]; if (!tx2) - Sys_Error("%s: Missing frame %i of %s", __FUNCTION__, j, tx); + Sys_Error("%s: Missing frame %i of %s", __func__, j, tx); tx2->anim_min = j; tx2->anim_total = altmax; @@ -706,7 +706,7 @@ void Mod_LoadVertexes(lump_t *l) in = (dvertex_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (mvertex_t*) Hunk_AllocName(count * sizeof(*out), loadname); @@ -729,7 +729,7 @@ void Mod_LoadSubmodels(lump_t *l) in = (dmodel_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (dmodel_t *)Hunk_AllocName(count*sizeof(*out), loadname); @@ -760,7 +760,7 @@ void Mod_LoadEdges(lump_t *l) in = (dedge_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (medge_t*) Hunk_AllocName((count + 1) * sizeof(*out), loadname); @@ -784,7 +784,7 @@ void Mod_LoadTexinfo(lump_t *l) in = (texinfo_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (mtexinfo_t*) Hunk_AllocName(count*sizeof(*out), loadname); @@ -829,7 +829,7 @@ void Mod_LoadTexinfo(lump_t *l) else { if (_miptex >= loadmodel->numtextures) - Sys_Error("%s: miptex >= loadmodel->numtextures", __FUNCTION__); + Sys_Error("%s: miptex >= loadmodel->numtextures", __func__); out->texture = loadmodel->textures[_miptex]; if (!out->texture) { @@ -882,7 +882,7 @@ void CalcSurfaceExtents(msurface_t *s) s->texturemins[i] = bmins[i] * 16; s->extents[i] = (bmaxs[i] - bmins[i]) * 16; if (!(tex->flags & TEX_SPECIAL) && s->extents[i] > 256) - Sys_Error("%s: Bad surface extents", __FUNCTION__); + Sys_Error("%s: Bad surface extents", __func__); } } @@ -895,7 +895,7 @@ void Mod_LoadFaces(lump_t *l) in = (dface_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (msurface_t *) Hunk_AllocName(count*sizeof(*out), loadname); @@ -985,7 +985,7 @@ void Mod_LoadNodes(lump_t *l) in = (dnode_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (mnode_t*) Hunk_AllocName(count*sizeof(*out), loadname); @@ -1027,7 +1027,7 @@ void Mod_LoadLeafs(lump_t *l) in = (dleaf_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (mleaf_t*) Hunk_AllocName(count*sizeof(*out), loadname); @@ -1039,7 +1039,7 @@ void Mod_LoadLeafs(lump_t *l) if (row < 0 || row > MODEL_MAX_PVS) { - Sys_Error("%s: oversized loadmodel->numleafs: %i", __FUNCTION__, loadmodel->numleafs); + Sys_Error("%s: oversized loadmodel->numleafs: %i", __func__, loadmodel->numleafs); } } #endif @@ -1078,7 +1078,7 @@ void Mod_LoadClipnodes(lump_t *l) in = (dclipnode_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (dclipnode_t*) Hunk_AllocName(count*sizeof(*out), loadname); @@ -1169,7 +1169,7 @@ void Mod_LoadMarksurfaces(lump_t *l) in = (short *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (msurface_t **) Hunk_AllocName(count * sizeof(*out), loadname); @@ -1180,7 +1180,7 @@ void Mod_LoadMarksurfaces(lump_t *l) { j = LittleShort(in[i]); if (j >= loadmodel->numsurfaces) - Sys_Error("%s: bad surface number", __FUNCTION__); + Sys_Error("%s: bad surface number", __func__); out[i] = loadmodel->surfaces + j; } } @@ -1192,7 +1192,7 @@ void Mod_LoadSurfedges(lump_t *l) in = (int *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (int*) Hunk_AllocName(count * sizeof(*out), loadname); @@ -1213,7 +1213,7 @@ void Mod_LoadPlanes(lump_t *l) in = (dplane_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) - Sys_Error("%s: funny lump size in %s", __FUNCTION__, loadmodel->name); + Sys_Error("%s: funny lump size in %s", __func__, loadmodel->name); count = l->filelen / sizeof(*in); out = (mplane_t*) Hunk_AllocName(count * 2 * sizeof(*out), loadname); @@ -1265,7 +1265,7 @@ void EXT_FUNC Mod_LoadBrushModel_internal(model_t *mod, void *buffer) i = LittleLong(header->version); if (i != Q1BSP_VERSION && i != HLBSP_VERSION) - Sys_Error("%s: %s has wrong version number (%i should be %i)", __FUNCTION__, mod, i, HLBSP_VERSION); + Sys_Error("%s: %s has wrong version number (%i should be %i)", __func__, mod, i, HLBSP_VERSION); // swap all the lumps mod_base = (byte *)header; @@ -1415,7 +1415,7 @@ void *Mod_LoadAliasGroup(void *pin, int *pframeindex, int numv, trivertx_t *pbbo *poutintervals = LittleFloat(pin_intervals->interval); if (*poutintervals <= 0.0f) - Sys_Error("%s: interval<=0", __FUNCTION__); + Sys_Error("%s: interval<=0", __func__); poutintervals++; pin_intervals++; @@ -1441,7 +1441,7 @@ void *Mod_LoadAliasSkin(void *pin, int *pskinindex, int skinsize, aliashdr_t *ph if (r_pixbytes == 1) Q_memcpy(pskin, pinskin, skinsize); else if (r_pixbytes != 2) - Sys_Error("%s: driver set invalid r_pixbytes: %d\n", __FUNCTION__, r_pixbytes); + Sys_Error("%s: driver set invalid r_pixbytes: %d\n", __func__, r_pixbytes); return (void *)&pinskin[skinsize]; } @@ -1471,7 +1471,7 @@ void *Mod_LoadAliasSkinGroup(void *pin, int *pskinindex, int skinsize, aliashdr_ *poutskinintervals = LittleFloat(pinskinintervals->interval); if (*poutskinintervals <= 0.0f) - Sys_Error("%s: interval<=0", __FUNCTION__); + Sys_Error("%s: interval<=0", __func__); poutskinintervals++; pinskinintervals++; @@ -1512,7 +1512,7 @@ void Mod_LoadAliasModel(model_t *mod, void *buffer) version = LittleLong(pinmodel->version); if (version != ALIAS_MODEL_VERSION) - Sys_Error("%s: %s has wrong version number (%i should be %i)", __FUNCTION__, mod->name, version, ALIAS_MODEL_VERSION); + Sys_Error("%s: %s has wrong version number (%i should be %i)", __func__, mod->name, version, ALIAS_MODEL_VERSION); // allocate space for a working header, plus all the data except the frames, // skin and group info @@ -1532,20 +1532,20 @@ void Mod_LoadAliasModel(model_t *mod, void *buffer) pmodel->skinheight = LittleLong(pinmodel->skinheight); if (pmodel->skinheight > MAX_LBM_HEIGHT) - Sys_Error("%s: model %s has a skin taller than %d", __FUNCTION__, mod->name, MAX_LBM_HEIGHT); + Sys_Error("%s: model %s has a skin taller than %d", __func__, mod->name, MAX_LBM_HEIGHT); pmodel->numverts = LittleLong(pinmodel->numverts); if (pmodel->numverts <= 0) - Sys_Error("%s: model %s has no vertices", __FUNCTION__, mod->name); + Sys_Error("%s: model %s has no vertices", __func__, mod->name); if (pmodel->numverts > MAX_ALIAS_MODEL_VERTS) - Sys_Error("%s: model %s has too many vertices", __FUNCTION__, mod->name); + Sys_Error("%s: model %s has too many vertices", __func__, mod->name); pmodel->numtris = LittleLong(pinmodel->numtris); if (pmodel->numtris <= 0) - Sys_Error("%s: model %s has no triangles", __FUNCTION__, mod->name); + Sys_Error("%s: model %s has no triangles", __func__, mod->name); pmodel->numframes = LittleLong(pinmodel->numframes); pmodel->size = LittleFloat(pinmodel->size) * 0.09090909090909091; @@ -1564,7 +1564,7 @@ void Mod_LoadAliasModel(model_t *mod, void *buffer) numframes = pmodel->numframes; if ((pmodel->skinwidth % 4) != 0) - Sys_Error("%s: skinwidth not multiple of 4", __FUNCTION__); + Sys_Error("%s: skinwidth not multiple of 4", __func__); pheader->model = (byte *)pmodel - (byte *)pheader; @@ -1572,7 +1572,7 @@ void Mod_LoadAliasModel(model_t *mod, void *buffer) skinsize = pmodel->skinwidth * pmodel->skinheight; if (numskins < 1) - Sys_Error("%s: Invalid # of skins: %d\n", __FUNCTION__, numskins); + Sys_Error("%s: Invalid # of skins: %d\n", __func__, numskins); pskintype = (daliasskintype_t *)(pinmodel + 1); pskindesc = (maliasskindesc_t *)Hunk_AllocName(sizeof(maliasskindesc_t) * numskins, loadname); @@ -1619,7 +1619,7 @@ void Mod_LoadAliasModel(model_t *mod, void *buffer) // load the frames if (numframes < 1) - Sys_Error("%s: Invalid # of frames: %d\n", __FUNCTION__, numframes); + Sys_Error("%s: Invalid # of frames: %d\n", __func__, numframes); pframetype = (daliasframetype_t *)(pintriangles + pmodel->numtris); for (i = 0; i < numframes; i++) @@ -1713,7 +1713,7 @@ void *Mod_LoadSpriteFrame(void *pin, mspriteframe_t **ppframe) } else { - Sys_Error("%s: driver set invalid r_pixbytes: %d\n", __FUNCTION__, r_pixbytes); + Sys_Error("%s: driver set invalid r_pixbytes: %d\n", __func__, r_pixbytes); } return (void *)((byte *)pinframe + sizeof(dspriteframe_t) + size); @@ -1747,7 +1747,7 @@ void *Mod_LoadSpriteGroup(void *pin, mspriteframe_t **ppframe) { *poutintervals = LittleFloat(pin_intervals->interval); if (*poutintervals <= 0.0f) - Sys_Error("%s: interval<=0", __FUNCTION__); + Sys_Error("%s: interval<=0", __func__); poutintervals++; pin_intervals++; @@ -1777,7 +1777,7 @@ void Mod_LoadSpriteModel(model_t *mod, void *buffer) version = LittleLong(pin->version); if (version != SPRITE_VERSION) - Sys_Error("%s: %s has wrong version number (%i should be %i)", __FUNCTION__, mod->name, version, SPRITE_VERSION); + Sys_Error("%s: %s has wrong version number (%i should be %i)", __func__, mod->name, version, SPRITE_VERSION); numframes = LittleLong(pin->numframes); int palsize = *(uint16*)&pin[1]; @@ -1814,7 +1814,7 @@ void Mod_LoadSpriteModel(model_t *mod, void *buffer) // load the frames // if (numframes < 1) - Sys_Error("%s: Invalid # of frames: %d\n", __FUNCTION__, numframes); + Sys_Error("%s: Invalid # of frames: %d\n", __func__, numframes); mod->numframes = numframes; mod->flags = 0; @@ -1913,7 +1913,7 @@ model_t *Mod_Handle(int modelindex) { #ifdef REHLDS_FIXES if (modelindex < 0 || modelindex > MAX_MODELS - 1) { - Sys_Error("%s: bad modelindex #%i\n", __FUNCTION__, modelindex); + Sys_Error("%s: bad modelindex #%i\n", __func__, modelindex); } #endif diff --git a/rehlds/engine/net_chan.cpp b/rehlds/engine/net_chan.cpp index 1719804..0a1fb5a 100644 --- a/rehlds/engine/net_chan.cpp +++ b/rehlds/engine/net_chan.cpp @@ -62,7 +62,7 @@ void Netchan_UnlinkFragment(fragbuf_t *buf, fragbuf_t **list) if (list == nullptr) { - Con_Printf("%s: Asked to unlink fragment from empty list, ignored\n", __FUNCTION__); + Con_Printf("%s: Asked to unlink fragment from empty list, ignored\n", __func__); return; } @@ -85,7 +85,7 @@ void Netchan_UnlinkFragment(fragbuf_t *buf, fragbuf_t **list) search = search->next; } - Con_Printf("%s: Couldn't find fragment\n", __FUNCTION__); + Con_Printf("%s: Couldn't find fragment\n", __func__); } void Netchan_OutOfBand(netsrc_t sock, netadr_t adr, int length, byte *data) @@ -167,7 +167,7 @@ void Netchan_Clear(netchan_t *chan) if (chan->reliable_length) { - Con_DPrintf("%s: reliable length not 0, reliable_sequence: %d, incoming_reliable_acknowledged: %d\n", __FUNCTION__, chan->reliable_length, chan->incoming_reliable_acknowledged); + Con_DPrintf("%s: reliable length not 0, reliable_sequence: %d, incoming_reliable_acknowledged: %d\n", __func__, chan->reliable_length, chan->incoming_reliable_acknowledged); chan->reliable_sequence ^= 1; chan->reliable_length = 0; } @@ -1158,7 +1158,7 @@ void Netchan_CreateFileFragmentsFromBuffer(qboolean server, netchan_t *chan, con if (server) SV_DropClient(host_client, 0, "Malloc problem"); else - rehlds_syserror("%s:Reverse me: client-side code", __FUNCTION__); + rehlds_syserror("%s:Reverse me: client-side code", __func__); #ifdef REHLDS_FIXES if (bCompressed) { @@ -1358,7 +1358,7 @@ int Netchan_CreateFileFragments_(qboolean server, netchan_t *chan, const char *f } else { - rehlds_syserror("%s: Reverse clientside code", __FUNCTION__); + rehlds_syserror("%s: Reverse clientside code", __func__); return 0; } } diff --git a/rehlds/engine/net_ws.cpp b/rehlds/engine/net_ws.cpp index 357952d..6cdb305 100644 --- a/rehlds/engine/net_ws.cpp +++ b/rehlds/engine/net_ws.cpp @@ -589,7 +589,7 @@ void NET_TransferRawData(sizebuf_t *msg, unsigned char *pStart, int nSize) #ifdef REHLDS_CHECKS if (msg->maxsize < nSize) { - Sys_Error("%s: data size is bigger than sizebuf maxsize", __FUNCTION__); + Sys_Error("%s: data size is bigger than sizebuf maxsize", __func__); } #endif // REHLDS_CHECKS Q_memcpy(msg->data, pStart, nSize); @@ -638,7 +638,7 @@ void NET_SendLoopPacket(netsrc_t sock, int length, void *data, const netadr_t& t #ifdef REHLDS_CHECKS if (sizeof(loop->msgs[i].data) < length) { - Sys_Error("%s: data size is bigger than message storage size", __FUNCTION__); + Sys_Error("%s: data size is bigger than message storage size", __func__); } #endif // REHLDS_CHECKS @@ -1004,15 +1004,15 @@ qboolean NET_QueuePacket(netsrc_t sock) { if (err == WSAEMSGSIZE) { - Con_DPrintf("%s: Ignoring oversized network message\n", __FUNCTION__); + Con_DPrintf("%s: Ignoring oversized network message\n", __func__); } else { if (g_pcls.state != ca_dedicated) { - Sys_Error("%s: %s", __FUNCTION__, NET_ErrorString(err)); + Sys_Error("%s: %s", __func__, NET_ErrorString(err)); } - Con_Printf("%s: %s\n", __FUNCTION__, NET_ErrorString(err)); + Con_Printf("%s: %s\n", __func__, NET_ErrorString(err)); } } continue; @@ -1022,7 +1022,7 @@ qboolean NET_QueuePacket(netsrc_t sock) if (ret != MAX_UDP_PACKET) break; - Con_NetPrintf("%s: Oversize packet from %s\n", __FUNCTION__, NET_AdrToString(in_from)); + Con_NetPrintf("%s: Oversize packet from %s\n", __func__, NET_AdrToString(in_from)); } if (ret == -1 || ret == MAX_UDP_PACKET) { @@ -1169,7 +1169,7 @@ void NET_StartThread(void) if (!net_thread_initialized) { net_thread_initialized = TRUE; - Sys_Error("%s: -net_thread is not reversed yet", __FUNCTION__); + Sys_Error("%s: -net_thread is not reversed yet", __func__); #ifdef _WIN32 /* InitializeCriticalSection(&net_cs); @@ -1179,7 +1179,7 @@ void NET_StartThread(void) DeleteCriticalSection(&net_cs); net_thread_initialized = 0; use_thread = 0; - Sys_Error("%s: Couldn't initialize network thread, run without -net_thread\n", __FUNCTION__); + Sys_Error("%s: Couldn't initialize network thread, run without -net_thread\n", __func__); } */ #endif // _WIN32 @@ -1200,7 +1200,7 @@ void NET_StopThread(void) */ #endif // _WIN32 net_thread_initialized = FALSE; - Sys_Error("%s: -net_thread is not reversed yet", __FUNCTION__); + Sys_Error("%s: -net_thread is not reversed yet", __func__); } } } @@ -1467,7 +1467,7 @@ void NET_SendPacket(netsrc_t sock, int length, void *data, const netadr_t& to) #endif // _WIN32 else { - Sys_Error("%s: bad address type", __FUNCTION__); + Sys_Error("%s: bad address type", __func__); } NetadrToSockadr(&to, &addr); @@ -1495,17 +1495,17 @@ void NET_SendPacket(netsrc_t sock, int length, void *data, const netadr_t& to) // let dedicated servers continue after errors if (g_pcls.state == ca_dedicated) { - Con_Printf("%s: ERROR: %s\n", __FUNCTION__, NET_ErrorString(err)); + Con_Printf("%s: ERROR: %s\n", __func__, NET_ErrorString(err)); } else { if (err == WSAEADDRNOTAVAIL || err == WSAENOBUFS) { - Con_DPrintf("%s: Warning: %s : %s\n", __FUNCTION__, NET_ErrorString(err), NET_AdrToString(to)); + Con_DPrintf("%s: Warning: %s : %s\n", __func__, NET_ErrorString(err), NET_AdrToString(to)); } else { - Sys_Error("%s: ERROR: %s\n", __FUNCTION__, NET_ErrorString(err)); + Sys_Error("%s: ERROR: %s\n", __func__, NET_ErrorString(err)); } } } @@ -1668,7 +1668,7 @@ void NET_OpenIP(void) if (!ip_sockets[NS_SERVER] && dedicated) #endif { - Sys_Error("%s: Couldn't allocate dedicated server IP port %d.", __FUNCTION__, port); + Sys_Error("%s: Couldn't allocate dedicated server IP port %d.", __func__, port); } sv_port = port; } diff --git a/rehlds/engine/pmovetst.cpp b/rehlds/engine/pmovetst.cpp index 9b237ae..a862877 100644 --- a/rehlds/engine/pmovetst.cpp +++ b/rehlds/engine/pmovetst.cpp @@ -113,7 +113,7 @@ int EXT_FUNC PM_HullPointContents(hull_t *hull, int num, vec_t *p) while (num >= 0) { if (num < hull->firstclipnode || num > hull->lastclipnode) - Sys_Error("%s: bad node number", __FUNCTION__); + Sys_Error("%s: bad node number", __func__); node = &hull->clipnodes[num]; plane = &hull->planes[node->planenum]; diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index 6630620..ba88336 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -99,7 +99,7 @@ void EXT_FUNC SetMinMaxSize(edict_t *e, const float *min, const float *max, qboo for (int i = 0; i < 3; i++) { if (min[i] > max[i]) - Host_Error("%s: backwards mins/maxs", __FUNCTION__); + Host_Error("%s: backwards mins/maxs", __func__); } e->v.mins[0] = min[0]; @@ -161,7 +161,7 @@ void EXT_FUNC PF_setmodel_I(edict_t *e, const char *m) } } - Host_Error("%s: no precache: %s\n", __FUNCTION__, m); + Host_Error("%s: no precache: %s\n", __func__, m); } int EXT_FUNC PF_modelindex(const char *pstr) @@ -324,13 +324,13 @@ void EXT_FUNC PF_ambientsound_I(edict_t *entity, float *pos, const char *samp, f void EXT_FUNC PF_sound_I(edict_t *entity, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch) { if (volume < 0.0 || volume > 255.0) - Sys_Error("%s: volume = %i", __FUNCTION__, volume); + Sys_Error("%s: volume = %i", __func__, volume); if (attenuation < 0.0 || attenuation > 4.0) - Sys_Error("%s: attenuation = %f", __FUNCTION__, attenuation); + Sys_Error("%s: attenuation = %f", __func__, attenuation); if (channel < 0 || channel > 7) - Sys_Error("%s: channel = %i", __FUNCTION__, channel); + Sys_Error("%s: channel = %i", __func__, channel); if (pitch < 0 || pitch > 255) - Sys_Error("%s: pitch = %i", __FUNCTION__, pitch); + Sys_Error("%s: pitch = %i", __func__, pitch); SV_StartSound(0, entity, channel, sample, (int)(volume * 255), attenuation, fFlags, pitch); } @@ -390,7 +390,7 @@ void EXT_FUNC TraceHull(const float *v1, const float *v2, int fNoMonsters, int h void EXT_FUNC TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) { - Sys_Error("%s: TraceSphere not yet implemented!\n", __FUNCTION__); + Sys_Error("%s: TraceSphere not yet implemented!\n", __func__); } void EXT_FUNC TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) @@ -906,7 +906,7 @@ edict_t* EXT_FUNC CreateNamedEntity(int className) ENTITYINIT pEntityInit; if (!className) - Sys_Error("%s: Spawned a NULL entity!", __FUNCTION__); + Sys_Error("%s: Spawned a NULL entity!", __func__); pedict = ED_Alloc(); pedict->v.classname = className; @@ -1020,13 +1020,13 @@ int EXT_FUNC PF_precache_sound_I(const char *s) int i; if (!s) - Host_Error("%s: NULL pointer", __FUNCTION__); + Host_Error("%s: NULL pointer", __func__); if (PR_IsEmptyString(s)) - Host_Error("%s: Bad string '%s'", __FUNCTION__, s); + Host_Error("%s: Bad string '%s'", __func__, s); if (s[0] == '!') - Host_Error("%s: '%s' do not precache sentence names!", __FUNCTION__, s); + Host_Error("%s: '%s' do not precache sentence names!", __func__, s); if (g_psv.state == ss_loading) { @@ -1050,7 +1050,7 @@ int EXT_FUNC PF_precache_sound_I(const char *s) } Host_Error("%s: Sound '%s' failed to precache because the item count is over the %d limit.\n" - "Reduce the number of brush models and/or regular models in the map to correct this.", __FUNCTION__, + "Reduce the number of brush models and/or regular models in the map to correct this.", __func__, s, MAX_SOUNDS); } else @@ -1062,7 +1062,7 @@ int EXT_FUNC PF_precache_sound_I(const char *s) return i; } - Host_Error("%s: '%s' Precache can only be done in spawn functions", __FUNCTION__, s); + Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, s); } // unreach @@ -1072,10 +1072,10 @@ int EXT_FUNC PF_precache_sound_I(const char *s) unsigned short EXT_FUNC EV_Precache(int type, const char *psz) { if (!psz) - Host_Error("%s: NULL pointer", __FUNCTION__); + Host_Error("%s: NULL pointer", __func__); if (PR_IsEmptyString(psz)) - Host_Error("%s: Bad string '%s'", __FUNCTION__, psz); + Host_Error("%s: Bad string '%s'", __func__, psz); if (g_psv.state == ss_loading) { @@ -1085,7 +1085,7 @@ unsigned short EXT_FUNC EV_Precache(int type, const char *psz) if (!ev->filename) { if (type != 1) - Host_Error("%s: only file type 1 supported currently\n", __FUNCTION__); + Host_Error("%s: only file type 1 supported currently\n", __func__); char szpath[MAX_PATH]; Q_snprintf(szpath, sizeof(szpath), "%s", psz); @@ -1094,7 +1094,7 @@ unsigned short EXT_FUNC EV_Precache(int type, const char *psz) int scriptSize = 0; char* evScript = (char*) COM_LoadFile(szpath, 5, &scriptSize); if (!evScript) - Host_Error("%s: file %s missing from server\n", __FUNCTION__, psz); + Host_Error("%s: file %s missing from server\n", __func__, psz); #ifdef REHLDS_FIXES // Many modders don't know that the resource names passed to precache functions must be a static strings. // Also some metamod modules can be unloaded during the server running. @@ -1114,7 +1114,7 @@ unsigned short EXT_FUNC EV_Precache(int type, const char *psz) if (!Q_stricmp(ev->filename, psz)) return i; } - Host_Error("%s: '%s' overflow", __FUNCTION__, psz); + Host_Error("%s: '%s' overflow", __func__, psz); } else { @@ -1125,7 +1125,7 @@ unsigned short EXT_FUNC EV_Precache(int type, const char *psz) return i; } - Host_Error("%s: '%s' Precache can only be done in spawn functions", __FUNCTION__, psz); + Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, psz); } } @@ -1218,13 +1218,13 @@ void EXT_FUNC EV_Playback(int flags, const edict_t *pInvoker, unsigned short eve if (eventindex < 1u || eventindex >= MAX_EVENTS) { - Con_DPrintf("%s: index out of range %i\n", __FUNCTION__, eventindex); + Con_DPrintf("%s: index out of range %i\n", __func__, eventindex); return; } if (!g_psv.event_precache[eventindex].pszScript) { - Con_DPrintf("%s: no event for index %i\n", __FUNCTION__, eventindex); + Con_DPrintf("%s: no event for index %i\n", __func__, eventindex); return; } @@ -1355,7 +1355,7 @@ void EXT_FUNC EV_SV_Playback(int flags, int clientindex, unsigned short eventind return; if (clientindex < 0 || clientindex >= g_psvs.maxclients) - Host_Error("%s: Client index %i out of range\n", __FUNCTION__, clientindex); + Host_Error("%s: Client index %i out of range\n", __func__, clientindex); edict_t *pEdict = g_psvs.clients[clientindex].edict; EV_Playback(flags,pEdict, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2); @@ -1391,10 +1391,10 @@ int EXT_FUNC PF_precache_model_I(const char *s) { int iOptional = 0; if (!s) - Host_Error("%s: NULL pointer", __FUNCTION__); + Host_Error("%s: NULL pointer", __func__); if (PR_IsEmptyString(s)) - Host_Error("%s: Bad string '%s'", __FUNCTION__, s); + Host_Error("%s: Bad string '%s'", __func__, s); if (*s == '!') { @@ -1436,7 +1436,7 @@ int EXT_FUNC PF_precache_model_I(const char *s) #endif } Host_Error("%s: Model '%s' failed to precache because the item count is over the %d limit.\n" - "Reduce the number of brush models and/or regular models in the map to correct this.", __FUNCTION__, + "Reduce the number of brush models and/or regular models in the map to correct this.", __func__, s, MAX_MODELS); } else @@ -1452,7 +1452,7 @@ int EXT_FUNC PF_precache_model_I(const char *s) return i; #endif } - Host_Error("%s: '%s' Precache can only be done in spawn functions", __FUNCTION__, s); + Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, s); } } @@ -1460,12 +1460,12 @@ int EXT_FUNC PF_precache_model_I(const char *s) int EXT_FUNC PF_precache_generic_I(char *s) { if (!s) - Host_Error("%s: NULL pointer", __FUNCTION__); + Host_Error("%s: NULL pointer", __func__); if (PR_IsEmptyString(s)) { // TODO: Call to Con_Printf is replaced with Host_Error in 6153 - Host_Error("%s: Bad string '%s'", __FUNCTION__, s); + Host_Error("%s: Bad string '%s'", __func__, s); } char resName[MAX_QPATH]; @@ -1490,12 +1490,12 @@ int EXT_FUNC PF_precache_generic_I(char *s) } if (g_psv.state != ss_loading) - Host_Error("%s: '%s' Precache can only be done in spawn functions", __FUNCTION__, resName); + Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, resName); if (resCount >= ARRAYSIZE(g_rehlds_sv.precachedGenericResourceNames)) { Host_Error("%s: Generic item '%s' failed to precache because the item count is over the %d limit.\n" - "Reduce the number of brush models and/or regular models in the map to correct this.", __FUNCTION__, + "Reduce the number of brush models and/or regular models in the map to correct this.", __func__, resName, ARRAYSIZE(g_rehlds_sv.precachedGenericResourceNames)); } @@ -1507,12 +1507,12 @@ int EXT_FUNC PF_precache_generic_I(char *s) int EXT_FUNC PF_precache_generic_I(char *s) { if (!s) - Host_Error("%s: NULL pointer", __FUNCTION__); + Host_Error("%s: NULL pointer", __func__); if (PR_IsEmptyString(s)) { // TODO: Call to Con_Printf is replaced with Host_Error in 6153 - Host_Error("%s: Bad string '%s'", __FUNCTION__, s); + Host_Error("%s: Bad string '%s'", __func__, s); } if (g_psv.state == ss_loading) @@ -1529,7 +1529,7 @@ int EXT_FUNC PF_precache_generic_I(char *s) return i; } Host_Error("%s: Generic item '%s' failed to precache because the item count is over the %d limit.\n" - "Reduce the number of brush models and/or regular models in the map to correct this.", __FUNCTION__, + "Reduce the number of brush models and/or regular models in the map to correct this.", __func__, s, MAX_GENERIC); } else @@ -1539,7 +1539,7 @@ int EXT_FUNC PF_precache_generic_I(char *s) if (!Q_stricmp(g_psv.generic_precache[i], s)) return i; } - Host_Error("%s: '%s' Precache can only be done in spawn functions", __FUNCTION__, s); + Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, s); } } #endif // REHLDS_FIXES @@ -1614,7 +1614,7 @@ void EXT_FUNC PF_SetKeyValue_I(char *infobuffer, const char *key, const char *va { if (infobuffer != Info_Serverinfo()) { - Sys_Error("%s: Can't set client keys with SetKeyValue", __FUNCTION__); + Sys_Error("%s: Can't set client keys with SetKeyValue", __func__); } #ifdef REHLDS_FIXES Info_SetValueForKey(infobuffer, key, value, MAX_INFO_STRING); // Use correct length @@ -1906,7 +1906,7 @@ void EXT_FUNC PF_setview_I(const edict_t *clientent, const edict_t *viewent) { int clientnum = NUM_FOR_EDICT(clientent); if (clientnum < 1 || clientnum > g_psvs.maxclients) - Host_Error("%s: not a client", __FUNCTION__); + Host_Error("%s: not a client", __func__); client_t *client = &g_psvs.clients[clientnum - 1]; if (!client->fakeclient) @@ -2049,7 +2049,7 @@ sizebuf_t* EXT_FUNC WriteDest_Parm(int dest) entnum = NUM_FOR_EDICT(gMsgEntity); if (entnum <= 0 || entnum > g_psvs.maxclients) { - Host_Error("%s: not a client", __FUNCTION__); + Host_Error("%s: not a client", __func__); } if (dest == MSG_ONE) { @@ -2069,7 +2069,7 @@ sizebuf_t* EXT_FUNC WriteDest_Parm(int dest) case MSG_SPEC: return &g_psv.spectator; default: - Host_Error("%s: bad destination = %d", __FUNCTION__, dest); + Host_Error("%s: bad destination = %d", __func__, dest); } } @@ -2078,19 +2078,19 @@ void EXT_FUNC PF_MessageBegin_I(int msg_dest, int msg_type, const float *pOrigin if (msg_dest == MSG_ONE || msg_dest == MSG_ONE_UNRELIABLE) { if (!ed) - Sys_Error("%s: with no target entity\n", __FUNCTION__); + Sys_Error("%s: with no target entity\n", __func__); } else { if (ed) - Sys_Error("%s: Invalid message: Cannot use broadcast message with a target entity", __FUNCTION__); + Sys_Error("%s: Invalid message: Cannot use broadcast message with a target entity", __func__); } if (gMsgStarted) - Sys_Error("%s: New message started when msg '%d' has not been sent yet", __FUNCTION__, gMsgType); + Sys_Error("%s: New message started when msg '%d' has not been sent yet", __func__, gMsgType); if (msg_type == 0) - Sys_Error("%s: Tried to create a message with a bogus message type ( 0 )", __FUNCTION__); + Sys_Error("%s: Tried to create a message with a bogus message type ( 0 )", __func__); gMsgStarted = 1; gMsgType = msg_type; @@ -2117,14 +2117,14 @@ void EXT_FUNC PF_MessageEnd_I(void) { qboolean MsgIsVarLength = 0; if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); gMsgStarted = 0; if (gMsgEntity && (gMsgEntity->v.flags & FL_FAKECLIENT)) return; if (gMsgBuffer.flags & SIZEBUF_OVERFLOWED) - Sys_Error("%s: called, but message buffer from .dll had overflowed\n", __FUNCTION__); + Sys_Error("%s: called, but message buffer from .dll had overflowed\n", __func__); if (gMsgType > svc_startofusermessages) @@ -2142,7 +2142,7 @@ void EXT_FUNC PF_MessageEnd_I(void) if (!pUserMsg) { - Con_DPrintf("%s: Unknown User Msg %d\n", __FUNCTION__, gMsgType); + Con_DPrintf("%s: Unknown User Msg %d\n", __func__, gMsgType); return; } @@ -2152,12 +2152,12 @@ void EXT_FUNC PF_MessageEnd_I(void) // Limit packet sizes if (gMsgBuffer.cursize > MAX_USER_MSG_DATA) - Host_Error("%s: Refusing to send user message %s of %i bytes to client, user message size limit is %i bytes\n", __FUNCTION__, pUserMsg->szName, gMsgBuffer.cursize, MAX_USER_MSG_DATA); + Host_Error("%s: Refusing to send user message %s of %i bytes to client, user message size limit is %i bytes\n", __func__, pUserMsg->szName, gMsgBuffer.cursize, MAX_USER_MSG_DATA); } else { if (pUserMsg->iSize != gMsgBuffer.cursize) - Sys_Error("%s: User Msg '%s': %d bytes written, expected %d\n", __FUNCTION__, pUserMsg->szName, gMsgBuffer.cursize, pUserMsg->iSize); + Sys_Error("%s: User Msg '%s': %d bytes written, expected %d\n", __func__, pUserMsg->szName, gMsgBuffer.cursize, pUserMsg->iSize); } } #ifdef REHLDS_FIXES @@ -2172,7 +2172,7 @@ void EXT_FUNC PF_MessageEnd_I(void) { int entnum = NUM_FOR_EDICT((const edict_t *)gMsgEntity); if (entnum < 1 || entnum > g_psvs.maxclients) - Host_Error("%s: not a client", __FUNCTION__); + Host_Error("%s: not a client", __func__); client_t* client = &g_psvs.clients[entnum - 1]; if (client->fakeclient || !client->hasusrmsgs || (!client->active && !client->spawned)) @@ -2232,56 +2232,56 @@ void EXT_FUNC PF_MessageEnd_I(void) void EXT_FUNC PF_WriteByte_I(int iValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteByte(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteChar_I(int iValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteChar(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteShort_I(int iValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteShort(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteLong_I(int iValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteLong(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteAngle_I(float flValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteAngle(&gMsgBuffer, flValue); } void EXT_FUNC PF_WriteCoord_I(float flValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteShort(&gMsgBuffer, (int)(flValue * 8.0)); } void EXT_FUNC PF_WriteString_I(const char *sz) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteString(&gMsgBuffer, sz); } void EXT_FUNC PF_WriteEntity_I(int iValue) { if (!gMsgStarted) - Sys_Error("%s: called with no active message\n", __FUNCTION__); + Sys_Error("%s: called with no active message\n", __func__); MSG_WriteShort(&gMsgBuffer, iValue); } @@ -2331,7 +2331,7 @@ void EXT_FUNC PF_setspawnparms_I(edict_t *ent) { int i = NUM_FOR_EDICT(ent); if (i < 1 || i > g_psvs.maxclients) - Host_Error("%s: Entity is not a client", __FUNCTION__); + Host_Error("%s: Entity is not a client", __func__); } void EXT_FUNC PF_changelevel_I(const char *s1, const char *s2) @@ -2646,10 +2646,10 @@ void EXT_FUNC PF_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, cons int i; if (!filename) - Host_Error("%s: NULL pointer", __FUNCTION__); + Host_Error("%s: NULL pointer", __func__); if (PR_IsEmptyString(filename)) - Host_Error("%s: Bad string '%s'", __FUNCTION__, filename); + Host_Error("%s: Bad string '%s'", __func__, filename); if (g_psv.state == ss_loading) { @@ -2664,7 +2664,7 @@ void EXT_FUNC PF_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, cons ++i; if (i >= 512) - Host_Error("%s: '%s' overflow", __FUNCTION__, filename); + Host_Error("%s: '%s' overflow", __func__, filename); } cnode->check_type = type; @@ -2691,7 +2691,7 @@ void EXT_FUNC PF_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, cons ++cnode; ++i; if (i >= 512) - Host_Error("%s: '%s' Precache can only be done in spawn functions", __FUNCTION__, filename); + Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, filename); } } } diff --git a/rehlds/engine/pr_edict.cpp b/rehlds/engine/pr_edict.cpp index 294f520..45c0c9c 100644 --- a/rehlds/engine/pr_edict.cpp +++ b/rehlds/engine/pr_edict.cpp @@ -57,9 +57,9 @@ edict_t *ED_Alloc(void) { if (!g_psv.max_edicts) { - Sys_Error("%s: no edicts yet", __FUNCTION__); + Sys_Error("%s: no edicts yet", __func__); } - Sys_Error("%s: no free edicts", __FUNCTION__); + Sys_Error("%s: no free edicts", __func__); } // Use new one @@ -221,7 +221,7 @@ char *ED_ParseEdict(char *data, edict_t *ent) } if (!data) { - Host_Error("%s: EOF without closing brace", __FUNCTION__); + Host_Error("%s: EOF without closing brace", __func__); } Q_strncpy(keyname, com_token, ARRAYSIZE(keyname) - 1); @@ -235,11 +235,11 @@ char *ED_ParseEdict(char *data, edict_t *ent) data = COM_Parse(data); if (!data) { - Host_Error("%s: EOF without closing brace", __FUNCTION__); + Host_Error("%s: EOF without closing brace", __func__); } if (com_token[0] == '}') { - Host_Error("%s: closing brace without data", __FUNCTION__); + Host_Error("%s: closing brace without data", __func__); } if (className != NULL && !Q_strcmp(className, com_token)) @@ -300,7 +300,7 @@ void ED_LoadFromFile(char *data) } if (com_token[0] != '{') { - Host_Error("%s: found %s when expecting {", __FUNCTION__, com_token); + Host_Error("%s: found %s when expecting {", __func__, com_token); } if (ent) @@ -353,7 +353,7 @@ edict_t *EDICT_NUM(int n) { if (n < 0 || n >= g_psv.max_edicts) { - Sys_Error("%s: bad number %i", __FUNCTION__, n); + Sys_Error("%s: bad number %i", __func__, n); } return &g_psv.edicts[n]; } @@ -365,7 +365,7 @@ int NUM_FOR_EDICT(const edict_t *e) if (b < 0 || b >= g_psv.num_edicts) { - Sys_Error("%s: bad pointer", __FUNCTION__); + Sys_Error("%s: bad pointer", __func__); } return b; @@ -397,7 +397,7 @@ bool SuckOutClassname(char *szInputStream, edict_t *pEdict) if (kvd.fHandled == FALSE) { - Host_Error("%s: parse error", __FUNCTION__); + Host_Error("%s: parse error", __func__); } return true; @@ -424,7 +424,7 @@ bool SuckOutClassname(char *szInputStream, edict_t *pEdict) if (kvd.fHandled == FALSE) { - Host_Error("%s: parse error", __FUNCTION__); + Host_Error("%s: parse error", __func__); } return true; @@ -525,7 +525,7 @@ int EXT_FUNC IndexOfEdict(const edict_t *pEdict) if (index < 0 || index > g_psv.max_edicts) #endif // REHLDS_FIXES { - Sys_Error("%s: bad entity", __FUNCTION__); + Sys_Error("%s: bad entity", __func__); } } return index; @@ -625,7 +625,7 @@ void EXT_FUNC SaveSpawnParms(edict_t *pEdict) int eoffset = NUM_FOR_EDICT(pEdict); if (eoffset < 1 || eoffset > g_psvs.maxclients) { - Host_Error("%s: Entity is not a client", __FUNCTION__); + Host_Error("%s: Entity is not a client", __func__); } // Nothing more for this function even on client-side } diff --git a/rehlds/engine/r_studio.cpp b/rehlds/engine/r_studio.cpp index 829ddce..db5c48d 100644 --- a/rehlds/engine/r_studio.cpp +++ b/rehlds/engine/r_studio.cpp @@ -628,7 +628,7 @@ hull_t *R_StudioHull(model_t *pModel, float frame, int sequence, const vec_t *an if (r_cachestudio.value != 0) { #ifdef SWDS - Sys_Error("%s: Studio state caching is not used on server", __FUNCTION__); + Sys_Error("%s: Studio state caching is not used on server", __func__); #endif // TODO: Reverse for client-side } @@ -661,7 +661,7 @@ hull_t *R_StudioHull(model_t *pModel, float frame, int sequence, const vec_t *an if (r_cachestudio.value != 0) { #ifdef SWDS - Sys_Error("%s: Studio state caching is not used on server", __FUNCTION__); + Sys_Error("%s: Studio state caching is not used on server", __func__); #endif // TODO: Reverse for client-side // R_AddToStudioCache(float frame, diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index c2da8ab..e58c745 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -327,7 +327,7 @@ delta_t *SV_LookupDelta(char *name) p = p->next; } - Sys_Error("%s: Couldn't find delta for %s\n", __FUNCTION__, name); + Sys_Error("%s: Couldn't find delta for %s\n", __func__, name); return NULL; } @@ -423,7 +423,7 @@ void SV_ReallocateDynamicData(void) { if (!g_psv.max_edicts) { - Con_DPrintf("%s: sv.max_edicts == 0\n", __FUNCTION__); + Con_DPrintf("%s: sv.max_edicts == 0\n", __func__); return; } @@ -784,22 +784,22 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int if (volume < 0 || volume > 255) { - Con_Printf("%s: volume = %i", __FUNCTION__, volume); + Con_Printf("%s: volume = %i", __func__, volume); volume = (volume < 0) ? 0 : 255; } if (attenuation < 0.0f || attenuation > 4.0f) { - Con_Printf("%s: attenuation = %f", __FUNCTION__, attenuation); + Con_Printf("%s: attenuation = %f", __func__, attenuation); attenuation = (attenuation < 0.0f) ? 0.0f : 4.0f; } if (channel < 0 || channel > 7) { - Con_Printf("%s: channel = %i", __FUNCTION__, channel); + Con_Printf("%s: channel = %i", __func__, channel); channel = (channel < 0) ? CHAN_AUTO : CHAN_NETWORKVOICE_BASE; } if (pitch < 0 || pitch > 255) { - Con_Printf("%s: pitch = %i", __FUNCTION__, pitch); + Con_Printf("%s: pitch = %i", __func__, pitch); pitch = (pitch < 0) ? 0 : 255; } @@ -811,7 +811,7 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int sound_num = Q_atoi(sample + 1); if (sound_num >= CVOXFILESENTENCEMAX) { - Con_Printf("%s: invalid sentence number: %s", __FUNCTION__, sample + 1); + Con_Printf("%s: invalid sentence number: %s", __func__, sample + 1); return FALSE; } } @@ -825,7 +825,7 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int sound_num = SV_LookupSoundIndex(sample); if (!sound_num || !g_psv.sound_precache[sound_num]) { - Con_Printf("%s: %s not precached (%d)\n", __FUNCTION__, sample, sound_num); + Con_Printf("%s: %s not precached (%d)\n", __func__, sample, sound_num); return FALSE; } } @@ -934,7 +934,7 @@ void SV_AddSampleToHashedLookupTable(const char *pszSample, int iSampleIndex) index = 0; if (index == starting_index) - Sys_Error("%s: NO FREE SLOTS IN SOUND LOOKUP TABLE", __FUNCTION__); + Sys_Error("%s: NO FREE SLOTS IN SOUND LOOKUP TABLE", __func__); } g_psv.sound_precache_hashedlookup[index] = iSampleIndex; @@ -1857,7 +1857,7 @@ int EXT_FUNC SV_CheckProtocol_internal(netadr_t *adr, int nProtocol) { if (adr == NULL) { - Sys_Error("%s: Null address\n", __FUNCTION__); + Sys_Error("%s: Null address\n", __func__); } if (nProtocol == PROTOCOL_VERSION) @@ -1910,7 +1910,7 @@ bool EXT_FUNC SV_CheckChallenge_api(const netadr_t &adr, int nChallengeValue) { int SV_CheckChallenge(netadr_t *adr, int nChallengeValue) { if (!adr) - Sys_Error("%s: Null address\n", __FUNCTION__); + Sys_Error("%s: Null address\n", __func__); if (NET_IsLocalAddress(*adr)) return 1; @@ -2655,19 +2655,19 @@ void SV_ResetModInfo(void) nFileSize = FS_Size(hLibListFile); if (!nFileSize || (signed int)nFileSize > 256 * 1024) { - Sys_Error("%s: Game listing file size is bogus [%s: size %i]", __FUNCTION__, "liblist.gam", nFileSize); + Sys_Error("%s: Game listing file size is bogus [%s: size %i]", __func__, "liblist.gam", nFileSize); } pszInputStream = (char *)Mem_Malloc(nFileSize + 1); if (!pszInputStream) { - Sys_Error("%s: Could not allocate space for game listing file of %i bytes", __FUNCTION__, nFileSize + 1); + Sys_Error("%s: Could not allocate space for game listing file of %i bytes", __func__, nFileSize + 1); } nBytesRead = FS_Read(pszInputStream, nFileSize, 1, hLibListFile); if (nBytesRead != nFileSize) { - Sys_Error("%s: Error reading in game listing file, expected %i bytes, read %i", __FUNCTION__, nFileSize, nBytesRead); + Sys_Error("%s: Error reading in game listing file, expected %i bytes, read %i", __func__, nFileSize, nBytesRead); } pszInputStream[nFileSize] = 0; @@ -5064,7 +5064,7 @@ int SV_ModelIndex(const char *name) }; #endif - Sys_Error("%s: SV_ModelIndex: model %s not precached", __FUNCTION__, name); + Sys_Error("%s: SV_ModelIndex: model %s not precached", __func__, name); } void EXT_FUNC SV_AddResource(resourcetype_t type, const char *name, int size, unsigned char flags, int index) @@ -5076,7 +5076,7 @@ void EXT_FUNC SV_AddResource(resourcetype_t type, const char *name, int size, un if (g_psv.num_resources >= MAX_RESOURCE_LIST) #endif // REHLDS_FIXES { - Sys_Error("%s: Too many resources on server.", __FUNCTION__); + Sys_Error("%s: Too many resources on server.", __func__); } #ifdef REHLDS_FIXES @@ -5552,7 +5552,7 @@ void SV_BroadcastCommand(char *fmt, ...) MSG_WriteByte(&msg, svc_stufftext); MSG_WriteString(&msg, string); if (msg.flags & SIZEBUF_OVERFLOWED) - Sys_Error("%s: Overflowed on %s, %i is max size\n", __FUNCTION__, string, msg.maxsize); + Sys_Error("%s: Overflowed on %s, %i is max size\n", __func__, string, msg.maxsize); for (int i = 0; i < g_psvs.maxclients; ++i) { @@ -6463,7 +6463,7 @@ void SV_BanId_f(void) } if (id == NULL) { - Con_Printf("%s: Couldn't find #userid %u\n", __FUNCTION__, search); + Con_Printf("%s: Couldn't find #userid %u\n", __func__, search); return; } } @@ -6492,7 +6492,7 @@ void SV_BanId_f(void) if (id == NULL) { - Con_Printf("%s: Couldn't resolve uniqueid %s.\n", __FUNCTION__, idstring); + Con_Printf("%s: Couldn't resolve uniqueid %s.\n", __func__, idstring); Con_Printf("Usage: banid { kick }\n"); Con_Printf("Use 0 minutes for permanent\n"); return; @@ -6510,7 +6510,7 @@ void SV_BanId_f(void) { if (numuserfilters >= MAX_USERFILTERS) { - Con_Printf("%s: User filter list is full\n", __FUNCTION__); + Con_Printf("%s: User filter list is full\n", __func__); return; } numuserfilters++; @@ -6797,7 +6797,7 @@ void SV_RemoveId_f(void) if (!idstring[0]) { - Con_Printf("%s: Id string is empty!\n", __FUNCTION__); + Con_Printf("%s: Id string is empty!\n", __func__); return; } @@ -6806,7 +6806,7 @@ void SV_RemoveId_f(void) int slot = Q_atoi(&idstring[1]); if (slot <= 0 || slot > numuserfilters) { - Con_Printf("%s: invalid slot #%i\n", __FUNCTION__, slot); + Con_Printf("%s: invalid slot #%i\n", __func__, slot); return; } slot--; @@ -7650,7 +7650,7 @@ void SV_RegisterDelta(char *name, char *loadfile) { delta_t *pdesc = NULL; if (!DELTA_Load(name, &pdesc, loadfile)) - Sys_Error("%s: Error parsing %s!!!\n", __FUNCTION__, loadfile); + Sys_Error("%s: Error parsing %s!!!\n", __func__, loadfile); delta_info_t *p = (delta_info_t *)Mem_ZeroMalloc(sizeof(delta_info_t)); p->loadfile = Mem_Strdup(loadfile); @@ -7677,32 +7677,32 @@ void SV_InitDeltas(void) g_pplayerdelta = SV_LookupDelta("entity_state_player_t"); if (!g_pplayerdelta) - Sys_Error("%s: No entity_state_player_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No entity_state_player_t encoder on server!\n", __func__); g_pentitydelta = SV_LookupDelta("entity_state_t"); if (!g_pentitydelta) - Sys_Error("%s: No entity_state_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No entity_state_t encoder on server!\n", __func__); g_pcustomentitydelta = SV_LookupDelta("custom_entity_state_t"); if (!g_pcustomentitydelta) - Sys_Error("%s: No custom_entity_state_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No custom_entity_state_t encoder on server!\n", __func__); g_pclientdelta = SV_LookupDelta("clientdata_t"); if (!g_pclientdelta) - Sys_Error("%s: No clientdata_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No clientdata_t encoder on server!\n", __func__); g_pweapondelta = SV_LookupDelta("weapon_data_t"); if (!g_pweapondelta) - Sys_Error("%s: No weapon_data_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No weapon_data_t encoder on server!\n", __func__); g_peventdelta = SV_LookupDelta("event_t"); if (!g_peventdelta) - Sys_Error("%s: No event_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No event_t encoder on server!\n", __func__); #ifdef REHLDS_OPT_PEDANTIC g_pusercmddelta = SV_LookupDelta("usercmd_t"); if (!g_pusercmddelta) - Sys_Error("%s: No usercmd_t encoder on server!\n", __FUNCTION__); + Sys_Error("%s: No usercmd_t encoder on server!\n", __func__); #endif #if defined(REHLDS_OPT_PEDANTIC) || defined(REHLDS_FIXES) diff --git a/rehlds/engine/sv_phys.cpp b/rehlds/engine/sv_phys.cpp index 29d423e..510e252 100644 --- a/rehlds/engine/sv_phys.cpp +++ b/rehlds/engine/sv_phys.cpp @@ -255,7 +255,7 @@ int SV_FlyMove(edict_t *ent, float time, trace_t *steptrace) break; if (!trace.ent) - Sys_Error("%s: !trace.ent", __FUNCTION__); + Sys_Error("%s: !trace.ent", __func__); if (trace.plane.normal[2] > 0.7) { @@ -621,7 +621,7 @@ int SV_PushRotate(edict_t *pusher, float movetime) ++num_moved; if (num_moved >= g_psv.max_edicts) - Sys_Error("%s: Out of edicts in simulator!\n", __FUNCTION__); + Sys_Error("%s: Out of edicts in simulator!\n", __func__); vec3_t start, end, push, move; @@ -1392,7 +1392,7 @@ void SV_Physics(void) break; default: - Sys_Error("%s: %s bad movetype %d", __FUNCTION__, &pr_strings[ent->v.classname], ent->v.movetype); + Sys_Error("%s: %s bad movetype %d", __func__, &pr_strings[ent->v.classname], ent->v.movetype); } if (ent->v.flags & FL_KILLME) diff --git a/rehlds/engine/sv_upld.cpp b/rehlds/engine/sv_upld.cpp index 9495277..63a266e 100644 --- a/rehlds/engine/sv_upld.cpp +++ b/rehlds/engine/sv_upld.cpp @@ -90,7 +90,7 @@ void SV_ClearResourceLists(client_t *cl) { if (!cl) { - Sys_Error("%s: SV_ClearResourceLists with NULL client!", __FUNCTION__); + Sys_Error("%s: SV_ClearResourceLists with NULL client!", __func__); } SV_ClearResourceList(&cl->resourcesneeded); @@ -165,7 +165,7 @@ void SV_Customization(client_t *pPlayer, resource_t *pResource, qboolean bSkipPl } if (i == g_psvs.maxclients) { - Sys_Error("%s: Couldn't find player index for customization.", __FUNCTION__); + Sys_Error("%s: Couldn't find player index for customization.", __func__); } nPlayerNumber = i; diff --git a/rehlds/engine/sv_user.cpp b/rehlds/engine/sv_user.cpp index 9527375..0278628 100644 --- a/rehlds/engine/sv_user.cpp +++ b/rehlds/engine/sv_user.cpp @@ -315,7 +315,7 @@ int EXT_FUNC SV_TransferConsistencyInfo_internal(void) vec3_t maxs; if (!R_GetStudioBounds(filename, mins, maxs)) - Host_Error("%s: Server unable to get bounds for %s\n", __FUNCTION__, filename); + Host_Error("%s: Server unable to get bounds for %s\n", __func__, filename); Q_memcpy(&r->rguc_reserved[1], mins, sizeof(mins)); Q_memcpy(&r->rguc_reserved[13], maxs, sizeof(maxs)); diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 8650319..6f8e034 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -263,7 +263,7 @@ void __cdecl Sys_InitHardwareTimer() Sys_InitFPUControlWords(); if (!CRehldsPlatformHolder::get()->QueryPerfFreq(&perfFreq)) - Sys_Error("%s: No hardware timer available", __FUNCTION__); + Sys_Error("%s: No hardware timer available", __func__); perfHighPart = perfFreq.HighPart; perfLowPart = perfFreq.LowPart; @@ -308,7 +308,7 @@ const char *Sys_FindFirst(const char *path, char *basename) { if (g_hfind != -1) { - Sys_Error("%s: called without close", __FUNCTION__); + Sys_Error("%s: called without close", __func__); } const char *psz = FS_FindFirst(path, &g_hfind, 0); @@ -334,7 +334,7 @@ const char *Sys_FindFirstPathID(const char *path, char *pathid) //const char *psz;//unused? if (g_hfind != -1) { - Sys_Error("%s: called without close", __FUNCTION__); + Sys_Error("%s: called without close", __func__); } return FS_FindFirst(path, &g_hfind, pathid); @@ -406,7 +406,7 @@ NOXREF void Sys_MakeCodeWriteable(uint32 startaddr, uint32 length) NOXREFCHECK; #ifdef _WIN32 if (!VirtualProtect((LPVOID)startaddr, length, PAGE_EXECUTE_READWRITE, (PDWORD)&length)) - Sys_Error("%s: Protection change failed.", __FUNCTION__); + Sys_Error("%s: Protection change failed.", __func__); #endif // _WIN32 } @@ -905,15 +905,15 @@ void LoadEntityDLLs(const char *szBaseDir) nFileSize = FS_Size(hLibListFile); nFileSize2 = nFileSize; if (!nFileSize || (signed int)nFileSize > 262144) - Sys_Error("%s: Game listing file size is bogus [%s: size %i]", __FUNCTION__, "liblist.gam", nFileSize); + Sys_Error("%s: Game listing file size is bogus [%s: size %i]", __func__, "liblist.gam", nFileSize); pszInputStream = (char *)Mem_Malloc(nFileSize + 1); if (!pszInputStream) - Sys_Error("%s: Could not allocate space for game listing file of %i bytes", __FUNCTION__, nFileSize2 + 1); + Sys_Error("%s: Could not allocate space for game listing file of %i bytes", __func__, nFileSize2 + 1); nBytesRead = FS_Read(pszInputStream, nFileSize2, 1, hLibListFile); if (nBytesRead != nFileSize2) - Sys_Error("%s: Error reading in game listing file, expected %i bytes, read %i", __FUNCTION__, nFileSize2, nBytesRead); + Sys_Error("%s: Error reading in game listing file, expected %i bytes, read %i", __func__, nFileSize2, nBytesRead); pszInputStream[nFileSize2] = 0; pStreamPos = pszInputStream; diff --git a/rehlds/engine/sys_dll.h b/rehlds/engine/sys_dll.h index cc8a1fe..ca009ae 100644 --- a/rehlds/engine/sys_dll.h +++ b/rehlds/engine/sys_dll.h @@ -42,12 +42,12 @@ #define __LINE__AS_STRING __HACK_LINE_AS_STRING__(__LINE__) //Gives you the line number in constant string form #if defined _MSC_VER || defined __INTEL_COMPILER -#define NOXREFCHECK int __retAddr; __asm { __asm mov eax, [ebp + 4] __asm mov __retAddr, eax }; Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __FUNCTION__, __retAddr) +#define NOXREFCHECK int __retAddr; __asm { __asm mov eax, [ebp + 4] __asm mov __retAddr, eax }; Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __func__, __retAddr) #else -// For EBP based stack -#define NOXREFCHECK int __retAddr; __asm__ __volatile__("movl 4(%%ebp), %%eax;" "movl %%eax, %0":"=r"(__retAddr)::"%eax"); Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __FUNCTION__, __retAddr); -// For ESP based stack -#define NOXREFCHECK int __retAddr; __asm__ __volatile__("movl 16(%%esp), %%eax;" "movl %%eax, %0":"=r"(__retAddr)::"%eax"); Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __FUNCTION__, __retAddr); +// For EBP based stack (older gcc) (uncomment version apropriate for your compiler) +//#define NOXREFCHECK int __retAddr; __asm__ __volatile__("movl 4(%%ebp), %%eax;" "movl %%eax, %0":"=r"(__retAddr)::"%eax"); Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __func__, __retAddr); +// For ESP based stack (newer gcc) (uncomment version apropriate for your compiler) +#define NOXREFCHECK int __retAddr; __asm__ __volatile__("movl 16(%%esp), %%eax;" "movl %%eax, %0":"=r"(__retAddr)::"%eax"); Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __func__, __retAddr); #endif diff --git a/rehlds/engine/sys_dll2.cpp b/rehlds/engine/sys_dll2.cpp index 8e1a23d..483c51e 100644 --- a/rehlds/engine/sys_dll2.cpp +++ b/rehlds/engine/sys_dll2.cpp @@ -203,7 +203,7 @@ void Sys_CheckOSVersion(void) Q_memset(&verInfo, 0, sizeof(verInfo)); verInfo.dwOSVersionInfoSize = sizeof(verInfo); if (!GetVersionEx(&verInfo)) - Sys_Error("%s: Couldn't get OS info", __FUNCTION__); + Sys_Error("%s: Couldn't get OS info", __func__); g_WinNTOrHigher = verInfo.dwMajorVersion >= 4; if (verInfo.dwPlatformId == 1 && verInfo.dwMajorVersion == 4) @@ -348,7 +348,7 @@ void Sys_InitMemory(void) if (lpBuffer.dwTotalPhys) { if (lpBuffer.dwTotalPhys < FIFTEEN_MB) - Sys_Error("%s: Available memory less than 15MB!!! %i", __FUNCTION__, host_parms.memsize); + Sys_Error("%s: Available memory less than 15MB!!! %i", __func__, host_parms.memsize); host_parms.memsize = (int)(lpBuffer.dwTotalPhys >> 1); if (host_parms.memsize < MINIMUM_WIN_MEMORY) @@ -376,7 +376,7 @@ void Sys_InitMemory(void) #endif // _WIN32 if (!host_parms.membase) - Sys_Error("%s: Unable to allocate %.2f MB\n", __FUNCTION__, (float)host_parms.memsize / (1024.0f * 1024.0f)); + Sys_Error("%s: Unable to allocate %.2f MB\n", __func__, (float)host_parms.memsize / (1024.0f * 1024.0f)); } void Sys_ShutdownMemory(void) diff --git a/rehlds/engine/sys_engine.cpp b/rehlds/engine/sys_engine.cpp index 7dbace4..3ea8922 100644 --- a/rehlds/engine/sys_engine.cpp +++ b/rehlds/engine/sys_engine.cpp @@ -88,7 +88,7 @@ void ForceReloadProfile() //SDL_GL_SetSwapInterval((gl_vsync.value <= 0.0) - 1); if (g_pcls.state != ca_dedicated) { - Sys_Error("%s: Only dedicated mode is supported", __FUNCTION__); + Sys_Error("%s: Only dedicated mode is supported", __func__); /* v0 = GetRateRegistrySetting(rate.string); Q_strncpy(szRate, v0, 0x20u); diff --git a/rehlds/engine/textures.cpp b/rehlds/engine/textures.cpp index a941ad3..2f160a1 100644 --- a/rehlds/engine/textures.cpp +++ b/rehlds/engine/textures.cpp @@ -55,7 +55,7 @@ cvar_t r_wadtextures; void SafeRead(FileHandle_t f, void *buffer, int count) { if (FS_Read(buffer, count, 1, f) != count) - Sys_Error("%s: File read failure", __FUNCTION__); + Sys_Error("%s: File read failure", __func__); } void CleanupName(char *in, char *out) @@ -122,12 +122,12 @@ qboolean TEX_InitFromWad(char *path) texfile = FS_Open(wadPath, "rb"); texfiles[nTexFiles++] = texfile; if (!texfile) - Sys_Error("%s: couldn't open %s\n", __FUNCTION__, wadPath); + Sys_Error("%s: couldn't open %s\n", __func__, wadPath); Con_DPrintf("Using WAD File: %s\n", wadPath); SafeRead(texfile, &header, 12); if (Q_strncmp(header.identification, "WAD2", 4) && Q_strncmp(header.identification, "WAD3", 4)) - Sys_Error("%s: %s isn't a wadfile", __FUNCTION__, wadPath); + Sys_Error("%s: %s isn't a wadfile", __func__, wadPath); header.numlumps = LittleLong(header.numlumps); header.infotableofs = LittleLong(header.infotableofs); @@ -196,7 +196,7 @@ int FindMiptex(char *name) } if (nummiptex == 512) - Sys_Error("%s: Exceeded MAX_MAP_TEXTURES", __FUNCTION__); + Sys_Error("%s: Exceeded MAX_MAP_TEXTURES", __func__); Q_strncpy(miptex[i], name, 63); miptex[i][63] = 0; diff --git a/rehlds/engine/tmessage.cpp b/rehlds/engine/tmessage.cpp index 9f62272..0b5996f 100644 --- a/rehlds/engine/tmessage.cpp +++ b/rehlds/engine/tmessage.cpp @@ -347,7 +347,7 @@ NOXREF void TextMessageParse(unsigned char *pMemFile, int fileSize) while (memfgets(pMemFile, fileSize, &filePos, buf, 512) != NULL) { if(messageCount >= MAX_MESSAGES) - Sys_Error("%s: messageCount >= MAX_MESSAGES", __FUNCTION__); + Sys_Error("%s: messageCount >= MAX_MESSAGES", __func__); TrimSpace(buf, trim); switch (mode) diff --git a/rehlds/engine/wad.cpp b/rehlds/engine/wad.cpp index 8eb0178..409b94b 100644 --- a/rehlds/engine/wad.cpp +++ b/rehlds/engine/wad.cpp @@ -69,8 +69,8 @@ int W_LoadWadFile(char *filename) if (!wad->wad_base) { if (!slot) - Sys_Error("%s: couldn't load %s", __FUNCTION__, filename); - Con_Printf("WARNING: %s, couldn't load %s\n", __FUNCTION__, filename); + Sys_Error("%s: couldn't load %s", __func__, filename); + Con_Printf("WARNING: %s, couldn't load %s\n", __func__, filename); return -1; } @@ -79,7 +79,7 @@ int W_LoadWadFile(char *filename) wad->wadname[sizeof(wad->wadname) - 1] = 0; wad->loaded = TRUE; if (*(uint32 *)header->identification != MAKEID('W', 'A', 'D', '3')) - Sys_Error("%s: Wad file %s doesn't have WAD3 id\n", __FUNCTION__, filename); + Sys_Error("%s: Wad file %s doesn't have WAD3 id\n", __func__, filename); wad->wad_numlumps = LittleLong(header->numlumps); lumpinfo_t * lump_p = (lumpinfo_t *)&wad->wad_base[LittleLong(header->infotableofs)]; @@ -112,7 +112,7 @@ lumpinfo_t *W_GetLumpinfo(int wad, char *name, qboolean doerror) } if (doerror) - Sys_Error("%s: %s not found", __FUNCTION__, name); + Sys_Error("%s: %s not found", __func__, name); return NULL; } @@ -130,7 +130,7 @@ NOXREF void *W_GetLumpNum(int wad, int num) NOXREFCHECK; lumpinfo_t *lump; if (num < 0 || num > wads[wad].wad_numlumps) - Sys_Error("%s: bad number: %i", __FUNCTION__, num); + Sys_Error("%s: bad number: %i", __func__, num); lump = wads[wad].wad_lumps; return (void *)&wads[wad].wad_base[lump->filepos]; diff --git a/rehlds/engine/world.cpp b/rehlds/engine/world.cpp index 16347e7..68479e2 100644 --- a/rehlds/engine/world.cpp +++ b/rehlds/engine/world.cpp @@ -164,7 +164,7 @@ struct hull_s *SV_HullForBsp(edict_t *ent, const vec_t *mins, const vec_t *maxs, model = Mod_Handle(ent->v.modelindex); if (!model || model->type != mod_brush) - Sys_Error("%s: Hit a %s with no model (%s)", __FUNCTION__, &pr_strings[ent->v.classname], &pr_strings[ent->v.model]); + Sys_Error("%s: Hit a %s with no model (%s)", __func__, &pr_strings[ent->v.classname], &pr_strings[ent->v.model]); float xSize = maxs[0] - mins[0]; if (xSize > 8.0f) @@ -220,7 +220,7 @@ hull_t *SV_HullForEntity(edict_t *ent, const vec_t *mins, const vec_t *maxs, vec if (ent->v.solid == SOLID_BSP) { if (ent->v.movetype != MOVETYPE_PUSH && ent->v.movetype != MOVETYPE_PUSHSTEP) - Sys_Error("%s: SOLID_BSP without MOVETYPE_PUSH", __FUNCTION__); + Sys_Error("%s: SOLID_BSP without MOVETYPE_PUSH", __func__); return SV_HullForBsp(ent, mins, maxs, offset); } @@ -602,7 +602,7 @@ int SV_HullPointContents(hull_t *hull, int num, const vec_t *p) while (i >= 0) { if (hull->firstclipnode > i || hull->lastclipnode < i) - Sys_Error("%s: bad node number", __FUNCTION__); + Sys_Error("%s: bad node number", __func__); node = &hull->clipnodes[i]; plane = &hull->planes[node->planenum]; if (plane->type > 2) @@ -753,7 +753,7 @@ qboolean SV_RecursiveHullCheck(hull_t *hull, int num, float p1f, float p2f, cons if (num >= 0) { if (num < hull->firstclipnode || num > hull->lastclipnode || !hull->planes) - Sys_Error("%s: bad node number", __FUNCTION__); + Sys_Error("%s: bad node number", __func__); node = &hull->clipnodes[num]; plane = &hull->planes[hull->clipnodes[num].planenum]; @@ -893,7 +893,7 @@ qboolean SV_RecursiveHullCheck(hull_t *hull, int num, float p1f, float p2f, cons pdif = p2f - p1f; if (num < hull->firstclipnode || num > hull->lastclipnode || !hull->planes) - Sys_Error("%s: bad node number", __FUNCTION__); + Sys_Error("%s: bad node number", __func__); node = &hull->clipnodes[num]; plane = &hull->planes[hull->clipnodes[num].planenum]; @@ -1185,7 +1185,7 @@ void SV_ClipToLinks(areanode_t *node, moveclip_t *clip) continue; if (touch->v.solid == SOLID_TRIGGER) - Sys_Error("%s: Trigger in clipping list", __FUNCTION__); + Sys_Error("%s: Trigger in clipping list", __func__); if (gNewDLLFunctions.pfnShouldCollide && !gNewDLLFunctions.pfnShouldCollide(touch, clip->passedict)) #ifdef REHLDS_FIXES diff --git a/rehlds/engine/zone.cpp b/rehlds/engine/zone.cpp index b2a9df5..2f67b78 100644 --- a/rehlds/engine/zone.cpp +++ b/rehlds/engine/zone.cpp @@ -98,19 +98,19 @@ void Z_Free(void *ptr) { if (!ptr) { - Sys_Error("%s: NULL pointer", __FUNCTION__); + Sys_Error("%s: NULL pointer", __func__); } memblock_t *block = (memblock_t *)((char *)ptr - sizeof(memblock_t)); if (block->id != ZONEID) { - Sys_Error("%s: freed a pointer without ZONEID", __FUNCTION__); + Sys_Error("%s: freed a pointer without ZONEID", __func__); } if (!block->tag) { - Sys_Error("%s: freed a freed pointer", __FUNCTION__); + Sys_Error("%s: freed a freed pointer", __func__); } block->tag = 0; @@ -154,7 +154,7 @@ void *Z_Malloc(int size) if (!buf) { - Sys_Error("%s: failed on allocation of %i bytes", __FUNCTION__, size); + Sys_Error("%s: failed on allocation of %i bytes", __func__, size); } Q_memset(buf, 0, size); @@ -168,7 +168,7 @@ void *Z_TagMalloc(int size, int tag) if (tag == 0) { - Sys_Error("%s: tried to use a 0 tag", __FUNCTION__); + Sys_Error("%s: tried to use a 0 tag", __func__); } size += sizeof(memblock_t); @@ -266,17 +266,17 @@ void Z_CheckHeap(void) if ((byte *)block + block->size != (byte *)block->next) { - Sys_Error("%s: block size does not touch the next block\n", __FUNCTION__); + Sys_Error("%s: block size does not touch the next block\n", __func__); } if (block->next->prev != block) { - Sys_Error("%s: next block doesn't have proper back link\n", __FUNCTION__); + Sys_Error("%s: next block doesn't have proper back link\n", __func__); } if (!block->tag && !block->next->tag) { - Sys_Error("%s: two consecutive free blocks\n", __FUNCTION__); + Sys_Error("%s: two consecutive free blocks\n", __func__); } } } @@ -320,12 +320,12 @@ void Hunk_Check(void) { if (h->sentinel != HUNK_SENTINEL) { - Sys_Error("%s: trahsed sentinel", __FUNCTION__); + Sys_Error("%s: trahsed sentinel", __func__); } if (h->size < 16 || h->size + (byte *)h - hunk_base > hunk_size) { - Sys_Error("%s: bad size", __FUNCTION__); + Sys_Error("%s: bad size", __func__); } } } @@ -384,9 +384,9 @@ NOXREF void Hunk_Print(qboolean all) // run consistancy checks // if (h->sentinel != HUNK_SENTINEL) - Sys_Error("%s: trahsed sentinal", __FUNCTION__); + Sys_Error("%s: trahsed sentinal", __func__); if (h->size < 16 || h->size + (byte *)h - hunk_base > hunk_size) - Sys_Error("%s: bad size", __FUNCTION__); + Sys_Error("%s: bad size", __func__); next = (hunk_t *)((byte *)h + h->size); count++; @@ -429,14 +429,14 @@ void *Hunk_AllocName(int size, const char *name) { if (size < 0) { - Sys_Error("%s: bad size: %i", __FUNCTION__, size); + Sys_Error("%s: bad size: %i", __func__, size); } int totalsize = ((size + 15) & ~15) + sizeof(hunk_t); if (hunk_size - hunk_high_used - hunk_low_used < totalsize) { - Sys_Error("%s: failed on %i bytes", __FUNCTION__, totalsize); + Sys_Error("%s: failed on %i bytes", __func__, totalsize); } hunk_t *h = (hunk_t *)(hunk_base + hunk_low_used); @@ -467,7 +467,7 @@ void Hunk_FreeToLowMark(int mark) { if (mark < 0 || mark > hunk_low_used) { - Sys_Error("%s: bad mark %i", __FUNCTION__, mark); + Sys_Error("%s: bad mark %i", __func__, mark); } hunk_low_used = mark; @@ -494,7 +494,7 @@ void Hunk_FreeToHighMark(int mark) if (mark < 0 || mark > hunk_high_used) { - Sys_Error("%s: bad mark %i", __FUNCTION__, mark); + Sys_Error("%s: bad mark %i", __func__, mark); } hunk_high_used = mark; @@ -511,7 +511,7 @@ void *Hunk_HighAllocName(int size, const char *name) hunk_t *h; if (size < 0) { - Sys_Error("%s: bad size: %i", __FUNCTION__, size); + Sys_Error("%s: bad size: %i", __func__, size); } if (hunk_tempactive) @@ -524,7 +524,7 @@ void *Hunk_HighAllocName(int size, const char *name) if (hunk_size - hunk_high_used - hunk_low_used < size) { - Con_Printf("%s: failed on %i bytes\n", __FUNCTION__, size); + Con_Printf("%s: failed on %i bytes\n", __func__, size); return 0; } @@ -675,7 +675,7 @@ void Cache_UnlinkLRU(cache_system_t *cs) { if (!cs->lru_next || !cs->lru_prev) { - Sys_Error("%s: NULL link", __FUNCTION__); + Sys_Error("%s: NULL link", __func__); } cs->lru_next->lru_prev = cs->lru_prev; @@ -687,7 +687,7 @@ void Cache_MakeLRU(cache_system_t *cs) { if (cs->lru_next || cs->lru_prev) { - Sys_Error("%s: active link", __FUNCTION__); + Sys_Error("%s: active link", __func__); } cache_head.lru_next->lru_prev = cs; @@ -714,7 +714,7 @@ cache_system_t *Cache_TryAlloc(int size, qboolean nobottom) { if (hunk_size - hunk_low_used - hunk_high_used < size) { - Sys_Error("%s: %i is greater then free hunk", __FUNCTION__, size); + Sys_Error("%s: %i is greater then free hunk", __func__, size); } newmem = (cache_system_t *)(hunk_base + hunk_low_used); @@ -955,7 +955,7 @@ void Cache_Free(cache_user_t *c) { if (!c->data) { - Sys_Error("%s: not allocated", __FUNCTION__); + Sys_Error("%s: not allocated", __func__); } cache_system_t *cs = ((cache_system_t *)c->data - 1); @@ -1012,12 +1012,12 @@ void *Cache_Alloc(cache_user_t *c, int size, char *name) if (c->data) { - Sys_Error("%s: already allocated", __FUNCTION__); + Sys_Error("%s: already allocated", __func__); } if (size <= 0) { - Sys_Error("%s: size %i", __FUNCTION__, size); + Sys_Error("%s: size %i", __func__, size); } while (true) @@ -1036,7 +1036,7 @@ void *Cache_Alloc(cache_user_t *c, int size, char *name) if (cache_head.lru_prev == &cache_head) { - Sys_Error("%s: out of memory", __FUNCTION__); + Sys_Error("%s: out of memory", __func__); } Cache_Free(cache_head.lru_prev->user); @@ -1072,7 +1072,7 @@ void Memory_Init(void *buf, int size) } else { - Sys_Error("%s: you must specify a size in KB after -zone", __FUNCTION__); + Sys_Error("%s: you must specify a size in KB after -zone", __func__); } } diff --git a/rehlds/hookers/hooker.cpp b/rehlds/hookers/hooker.cpp index bf54d54..d2417fd 100644 --- a/rehlds/hookers/hooker.cpp +++ b/rehlds/hookers/hooker.cpp @@ -44,7 +44,7 @@ void *GetOriginalFuncAddrOrDie(const char *funcName) return (void*) cfh->originalAddress; } - rehlds_syserror("%s: Could not find function '%s'", __FUNCTION__, funcName); + rehlds_syserror("%s: Could not find function '%s'", __func__, funcName); return NULL; } @@ -67,7 +67,7 @@ void *GetFuncRefAddrOrDie(const char *funcName) return (void*)cfh->originalAddress; } - rehlds_syserror("%s: Could not find function '%s'", __FUNCTION__, funcName); + rehlds_syserror("%s: Could not find function '%s'", __func__, funcName); return NULL; } @@ -98,7 +98,7 @@ int HookEngine(size_t addr) if (!GetAddress(&g_EngineModule, (Address*)refData, g_BaseOffset)) { #if _DEBUG - printf("%s: symbol not found \"%s\", symbol index: %i\n", __FUNCTION__, refData->symbolName, refData->symbolIndex); + printf("%s: symbol not found \"%s\", symbol index: %i\n", __func__, refData->symbolName, refData->symbolIndex); success = false; #endif } @@ -111,7 +111,7 @@ int HookEngine(size_t addr) if (!GetAddress(&g_EngineModule, (Address*)refFunc, g_BaseOffset)) { #if _DEBUG - printf("%s: symbol not found \"%s\", symbol index: %i\n", __FUNCTION__, refData->symbolName, refData->symbolIndex); + printf("%s: symbol not found \"%s\", symbol index: %i\n", __func__, refData->symbolName, refData->symbolIndex); success = false; #endif } @@ -124,7 +124,7 @@ int HookEngine(size_t addr) if (!GetAddress(&g_EngineModule, (Address*)hookFunc, g_BaseOffset)) { #if _DEBUG - printf("%s: symbol not found \"%s\", symbol index: %i\n", __FUNCTION__, refData->symbolName, refData->symbolIndex); + printf("%s: symbol not found \"%s\", symbol index: %i\n", __func__, refData->symbolName, refData->symbolIndex); success = false; #endif } @@ -134,7 +134,7 @@ int HookEngine(size_t addr) if (!success) { #if _DEBUG - printf("%s: failed to hook engine!\n", __FUNCTION__); + printf("%s: failed to hook engine!\n", __func__); #endif return (FALSE); } diff --git a/rehlds/hookers/memory.cpp b/rehlds/hookers/memory.cpp index 55bcdc8..d069c89 100644 --- a/rehlds/hookers/memory.cpp +++ b/rehlds/hookers/memory.cpp @@ -420,13 +420,13 @@ void ProcessModuleData(Module *module) int i = 0; PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)module->base; if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE) { - rehlds_syserror("%s: Invalid DOS header signature", __FUNCTION__); + rehlds_syserror("%s: Invalid DOS header signature", __func__); return; } PIMAGE_NT_HEADERS NTHeaders = (PIMAGE_NT_HEADERS)((size_t)module->base + dosHeader->e_lfanew); if (NTHeaders->Signature != 0x4550) { - rehlds_syserror("%s: Invalid NT header signature", __FUNCTION__); + rehlds_syserror("%s: Invalid NT header signature", __func__); return; } @@ -440,7 +440,7 @@ void ProcessModuleData(Module *module) } if (CodeSection == NULL) { - rehlds_syserror("%s: Code section not found", __FUNCTION__); + rehlds_syserror("%s: Code section not found", __func__); return; } diff --git a/rehlds/public/rehlds/osconfig.h b/rehlds/public/rehlds/osconfig.h index 7231d63..b47fd36 100644 --- a/rehlds/public/rehlds/osconfig.h +++ b/rehlds/public/rehlds/osconfig.h @@ -79,9 +79,6 @@ #include #include #include - - // Deail with stupid macro in kernel.h - #undef __FUNCTION__ #endif // _WIN32 #include @@ -129,11 +126,6 @@ VirtualFree(ptr, 0, MEM_RELEASE); } #else // _WIN32 - #ifdef __FUNCTION__ - #undef __FUNCTION__ - #endif - #define __FUNCTION__ __func__ - #ifndef PAGESIZE #define PAGESIZE 4096 #endif diff --git a/rehlds/public/rehlds/static_map.h b/rehlds/public/rehlds/static_map.h index 7956374..11235d7 100644 --- a/rehlds/public/rehlds/static_map.h +++ b/rehlds/public/rehlds/static_map.h @@ -44,7 +44,7 @@ private: // this was a root node unsigned int rootId = GetRoodNodeId(node->key); if (m_RootNodes[rootId] != node) { - Sys_Error("%s: invalid root node", __FUNCTION__); + Sys_Error("%s: invalid root node", __func__); return; } diff --git a/rehlds/rehlds/FlightRecorderImpl.cpp b/rehlds/rehlds/FlightRecorderImpl.cpp index cb3eeed..b52e44a 100644 --- a/rehlds/rehlds/FlightRecorderImpl.cpp +++ b/rehlds/rehlds/FlightRecorderImpl.cpp @@ -22,7 +22,7 @@ CRehldsFlightRecorder::CRehldsFlightRecorder() { m_DataRegion = (uint8*) sys_allocmem(DATA_REGION_SIZE); if (!m_MetaRegion || !m_DataRegion) { - Sys_Error("%s: direct allocation failed", __FUNCTION__); + Sys_Error("%s: direct allocation failed", __func__); } //initialize meta region header @@ -36,7 +36,7 @@ CRehldsFlightRecorder::CRehldsFlightRecorder() { metaPos += sizeof(recorder_state); if ((metaPos - (char*)m_MetaRegion) > META_REGION_HEADER) { - Sys_Error("%s: Meta header overflow", __FUNCTION__); + Sys_Error("%s: Meta header overflow", __func__); } //initialize data region header @@ -48,7 +48,7 @@ CRehldsFlightRecorder::CRehldsFlightRecorder() { dataPos += sizeof(data_header); if ((dataPos - (char*)m_pDataHeader) > DATA_REGION_HEADER) { - Sys_Error("%s: Data header overflow", __FUNCTION__); + Sys_Error("%s: Data header overflow", __func__); } InitHeadersContent(); @@ -93,7 +93,7 @@ void CRehldsFlightRecorder::MoveToStart() { void CRehldsFlightRecorder::StartMessage(uint16 msg, bool entrance) { if (msg == 0 || msg > m_pMetaHeader->numMessages) { - Sys_Error("%s: Invalid message id %u", __FUNCTION__, msg); + Sys_Error("%s: Invalid message id %u", __func__, msg); } if (entrance) { @@ -101,7 +101,7 @@ void CRehldsFlightRecorder::StartMessage(uint16 msg, bool entrance) { } if (m_pRecorderState->curMessage != 0) { - Sys_Error("%s: overlapping messages", __FUNCTION__); + Sys_Error("%s: overlapping messages", __func__); } unsigned int sz = DATA_REGION_MAIN_SIZE - m_pRecorderState->wpos; @@ -121,7 +121,7 @@ void CRehldsFlightRecorder::EndMessage(uint16 msg, bool entrance) { } if (m_pRecorderState->curMessage != msg) { - Sys_Error("%s: invalid message %u", __FUNCTION__, msg); + Sys_Error("%s: invalid message %u", __func__, msg); } unsigned int freeSz = DATA_REGION_MAIN_SIZE - m_pRecorderState->wpos; @@ -131,7 +131,7 @@ void CRehldsFlightRecorder::EndMessage(uint16 msg, bool entrance) { unsigned int msgSize = m_pRecorderState->wpos - m_pRecorderState->lastMsgBeginPos; if (msgSize > MSG_MAX_SIZE) { - Sys_Error("%s: too big message %u; size %u", __FUNCTION__, msg, msgSize); + Sys_Error("%s: too big message %u; size %u", __func__, msg, msgSize); } *(uint16*)(m_DataRegionPtr + m_pRecorderState->wpos) = msgSize; m_pRecorderState->wpos += 2; @@ -142,13 +142,13 @@ void CRehldsFlightRecorder::EndMessage(uint16 msg, bool entrance) { void CRehldsFlightRecorder::CheckSize(unsigned int wantToWriteLen) { unsigned int msgSize = m_pRecorderState->wpos - m_pRecorderState->lastMsgBeginPos; if (msgSize + wantToWriteLen > MSG_MAX_SIZE) { - Sys_Error("%s: too big message %u; size %u", __FUNCTION__, m_pRecorderState->curMessage, msgSize); + Sys_Error("%s: too big message %u; size %u", __func__, m_pRecorderState->curMessage, msgSize); } } void CRehldsFlightRecorder::WriteBuffer(const void* data, unsigned int len) { if (m_pRecorderState->curMessage == 0) { - Sys_Error("%s: Could not write, invalid state", __FUNCTION__); + Sys_Error("%s: Could not write, invalid state", __func__); } CheckSize(len); @@ -207,7 +207,7 @@ void CRehldsFlightRecorder::WriteDouble(double v) { uint16 CRehldsFlightRecorder::RegisterMessage(const char* module, const char *message, unsigned int version, bool inOut) { if (m_pMetaHeader->numMessages >= MSG_MAX_ID) { - Sys_Error("%s: can't register message; limit exceeded", __FUNCTION__); + Sys_Error("%s: can't register message; limit exceeded", __func__); } uint16 msgId = ++m_pMetaHeader->numMessages; diff --git a/rehlds/rehlds/FlightRecorderImpl.h b/rehlds/rehlds/FlightRecorderImpl.h index 2b2ec1b..7356cce 100644 --- a/rehlds/rehlds/FlightRecorderImpl.h +++ b/rehlds/rehlds/FlightRecorderImpl.h @@ -79,7 +79,7 @@ private: template void WritePrimitive(T v) { if (m_pRecorderState->curMessage == 0) { - Sys_Error("%s: Could not write, invalid state", __FUNCTION__); + Sys_Error("%s: Could not write, invalid state", __func__); } CheckSize(sizeof(T)); diff --git a/rehlds/rehlds/RehldsRuntimeConfig.cpp b/rehlds/rehlds/RehldsRuntimeConfig.cpp index 5eb9ddc..415c910 100644 --- a/rehlds/rehlds/RehldsRuntimeConfig.cpp +++ b/rehlds/rehlds/RehldsRuntimeConfig.cpp @@ -11,7 +11,7 @@ CRehldsRuntimeConfig::CRehldsRuntimeConfig() void CRehldsRuntimeConfig::parseFromCommandLine(const char* cmdLine) { char localBuf[2048]; - if (strlen(cmdLine) >= sizeof(localBuf)) rehlds_syserror("%s: too long cmdline", __FUNCTION__); + if (strlen(cmdLine) >= sizeof(localBuf)) rehlds_syserror("%s: too long cmdline", __func__); strcpy(localBuf, cmdLine); char* cpos = localBuf; @@ -23,7 +23,7 @@ void CRehldsRuntimeConfig::parseFromCommandLine(const char* cmdLine) { if (!strcmp(token, "--rehlds-test-record")) { const char* fname = getNextToken(&cpos); - if (fname == NULL) rehlds_syserror("%s: usage: --rehlds-test-record ", __FUNCTION__); + if (fname == NULL) rehlds_syserror("%s: usage: --rehlds-test-record ", __func__); strncpy(testRecordingFileName, fname, sizeof(testRecordingFileName)); testRecordingFileName[sizeof(testRecordingFileName) - 1] = 0; testPlayerMode = TPM_RECORD; @@ -31,7 +31,7 @@ void CRehldsRuntimeConfig::parseFromCommandLine(const char* cmdLine) { else if (!strcmp(token, "--rehlds-test-play")) { const char* fname = getNextToken(&cpos); - if (fname == NULL) rehlds_syserror("%s: usage: --rehlds-test-play ", __FUNCTION__); + if (fname == NULL) rehlds_syserror("%s: usage: --rehlds-test-play ", __func__); strncpy(testRecordingFileName, fname, sizeof(testRecordingFileName)); testRecordingFileName[sizeof(testRecordingFileName) - 1] = 0; testPlayerMode = TPM_PLAY; @@ -39,7 +39,7 @@ void CRehldsRuntimeConfig::parseFromCommandLine(const char* cmdLine) { else if (!strcmp(token, "--rehlds-test-anon")) { const char* fname = getNextToken(&cpos); - if (fname == NULL) rehlds_syserror("%s: usage: --rehlds-test-anon ", __FUNCTION__); + if (fname == NULL) rehlds_syserror("%s: usage: --rehlds-test-anon ", __func__); strncpy(testRecordingFileName, fname, sizeof(testRecordingFileName)); testRecordingFileName[sizeof(testRecordingFileName) - 1] = 0; testPlayerMode = TPM_ANONYMIZE; diff --git a/rehlds/rehlds/hookchains_impl.cpp b/rehlds/rehlds/hookchains_impl.cpp index 6640317..13f6e36 100644 --- a/rehlds/rehlds/hookchains_impl.cpp +++ b/rehlds/rehlds/hookchains_impl.cpp @@ -40,11 +40,11 @@ bool AbstractHookChainRegistry::findHook(void* hookFunc) const void AbstractHookChainRegistry::addHook(void* hookFunc, int priority) { if (!hookFunc) { - Sys_Error("%s: Parameter hookFunc can't be a nullptr", __FUNCTION__); + Sys_Error("%s: Parameter hookFunc can't be a nullptr", __func__); } if (findHook(hookFunc)) { - Sys_Error("%s: The same handler can't be used twice on the hookchain.", __FUNCTION__); + Sys_Error("%s: The same handler can't be used twice on the hookchain.", __func__); } for (auto i = 0; i < MAX_HOOKS_IN_CHAIN; i++) @@ -63,7 +63,7 @@ void AbstractHookChainRegistry::addHook(void* hookFunc, int priority) } if (m_NumHooks >= MAX_HOOKS_IN_CHAIN) { - Sys_Error("%s: MAX_HOOKS_IN_CHAIN limit hit", __FUNCTION__); + Sys_Error("%s: MAX_HOOKS_IN_CHAIN limit hit", __func__); } m_NumHooks++; diff --git a/rehlds/rehlds/hookchains_impl.h b/rehlds/rehlds/hookchains_impl.h index affffaa..0c79d68 100644 --- a/rehlds/rehlds/hookchains_impl.h +++ b/rehlds/rehlds/hookchains_impl.h @@ -40,7 +40,7 @@ public: IHookChainImpl(void** hooks, origfunc_t orig) : m_Hooks(hooks), m_OriginalFunc(orig) { if (orig == NULL) - Sys_Error("%s: Non-void HookChain without original function.", __FUNCTION__); + Sys_Error("%s: Non-void HookChain without original function.", __func__); } virtual ~IHookChainImpl() {} diff --git a/rehlds/rehlds/platform.cpp b/rehlds/rehlds/platform.cpp index f59f479..21a08f6 100644 --- a/rehlds/rehlds/platform.cpp +++ b/rehlds/rehlds/platform.cpp @@ -19,7 +19,7 @@ CSimplePlatform::CSimplePlatform() { wsock = LoadLibraryA("wsock32.dll"); setsockopt_v11 = (setsockopt_proto)GetProcAddress(wsock, "setsockopt"); if (setsockopt_v11 == NULL) - rehlds_syserror("%s: setsockopt_v11 not found", __FUNCTION__); + rehlds_syserror("%s: setsockopt_v11 not found", __func__); #endif } diff --git a/rehlds/rehlds/rehlds_interfaces_impl.cpp b/rehlds/rehlds/rehlds_interfaces_impl.cpp index bc0bf53..17d5a19 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.cpp +++ b/rehlds/rehlds/rehlds_interfaces_impl.cpp @@ -160,7 +160,7 @@ bool EXT_FUNC CRehldsServerStatic::IsLogActive() IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id) { if (id < 0 || id >= g_psvs.maxclients) - Sys_Error("%s: invalid id provided: %d", __FUNCTION__, id); + Sys_Error("%s: invalid id provided: %d", __func__, id); return g_GameClients[id]; } @@ -168,7 +168,7 @@ IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id) client_t* EXT_FUNC CRehldsServerStatic::GetClient_t(int id) { if (id < 0 || id >= g_psvs.maxclients) - Sys_Error("%s: invalid id provided: %d", __FUNCTION__, id); + Sys_Error("%s: invalid id provided: %d", __func__, id); return &g_psvs.clients[id]; } @@ -285,7 +285,7 @@ IGameClient* GetRehldsApiClient(client_t* cl) int idx = cl - g_psvs.clients; if (idx < 0 || idx >= g_psvs.maxclients) { - Sys_Error("%s: Invalid client index %d", __FUNCTION__, idx); + Sys_Error("%s: Invalid client index %d", __func__, idx); } return g_GameClients[idx]; diff --git a/rehlds/testsuite/anonymizer.cpp b/rehlds/testsuite/anonymizer.cpp index b1d96b3..e59806d 100644 --- a/rehlds/testsuite/anonymizer.cpp +++ b/rehlds/testsuite/anonymizer.cpp @@ -16,7 +16,7 @@ void* CSteamCallbackAnonymizingWrapper::Anonymize(void* data) { { static GSClientApprove_t cbdata; cbdata = *(GSClientApprove_t*)data; - cbdata.m_SteamID = m_Anonymizer->Real2FakeSteamId(cbdata.m_SteamID, __FUNCTION__); + cbdata.m_SteamID = m_Anonymizer->Real2FakeSteamId(cbdata.m_SteamID, __func__); return &cbdata; } @@ -24,7 +24,7 @@ void* CSteamCallbackAnonymizingWrapper::Anonymize(void* data) { { static GSClientDeny_t cbdata; cbdata = *(GSClientDeny_t*)data; - cbdata.m_SteamID = m_Anonymizer->Real2FakeSteamId(cbdata.m_SteamID, __FUNCTION__); + cbdata.m_SteamID = m_Anonymizer->Real2FakeSteamId(cbdata.m_SteamID, __func__); return &cbdata; } @@ -32,7 +32,7 @@ void* CSteamCallbackAnonymizingWrapper::Anonymize(void* data) { { static GSClientKick_t cbdata; cbdata = *(GSClientKick_t*)data; - cbdata.m_SteamID = m_Anonymizer->Real2FakeSteamId(cbdata.m_SteamID, __FUNCTION__); + cbdata.m_SteamID = m_Anonymizer->Real2FakeSteamId(cbdata.m_SteamID, __func__); return &cbdata; } @@ -42,22 +42,22 @@ void* CSteamCallbackAnonymizingWrapper::Anonymize(void* data) { return data; default: - rehlds_syserror("%s: unsupported callback %u", __FUNCTION__, m_iCallback); + rehlds_syserror("%s: unsupported callback %u", __func__, m_iCallback); } return NULL; } void* CSteamCallbackAnonymizingWrapper::Anonymize(void* data, bool bIOFailure, SteamAPICall_t hSteamAPICall) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return NULL; } void CSteamCallbackAnonymizingWrapper::Run(void *pvParam) { - if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __FUNCTION__); - if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __func__); + if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __func__); m_Wrapped->Run(Anonymize(pvParam)); this->SetFlags(m_Wrapped->GetFlags()); @@ -66,8 +66,8 @@ void CSteamCallbackAnonymizingWrapper::Run(void *pvParam) void CSteamCallbackAnonymizingWrapper::Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall) { - if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __FUNCTION__); - if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __func__); + if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __func__); m_Wrapped->Run(Anonymize(pvParam, bIOFailure, hSteamAPICall), bIOFailure, hSteamAPICall); this->SetFlags(m_Wrapped->GetFlags()); @@ -91,25 +91,25 @@ CSteamAppsAnonymizingWrapper::CSteamAppsAnonymizingWrapper(ISteamApps* original, bool CSteamAppsAnonymizingWrapper::BIsSubscribed() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsAnonymizingWrapper::BIsLowViolence() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsAnonymizingWrapper::BIsCybercafe() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsAnonymizingWrapper::BIsVACBanned() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } @@ -121,82 +121,82 @@ const char* CSteamAppsAnonymizingWrapper::GetCurrentGameLanguage() const char* CSteamAppsAnonymizingWrapper::GetAvailableGameLanguages() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return NULL; } bool CSteamAppsAnonymizingWrapper::BIsSubscribedApp(AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsAnonymizingWrapper::BIsDlcInstalled(AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } uint32 CSteamAppsAnonymizingWrapper::GetEarliestPurchaseUnixTime(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamAppsAnonymizingWrapper::BIsSubscribedFromFreeWeekend() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } int CSteamAppsAnonymizingWrapper::GetDLCCount() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamAppsAnonymizingWrapper::BGetDLCDataByIndex(int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamAppsAnonymizingWrapper::InstallDLC(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamAppsAnonymizingWrapper::UninstallDLC(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamAppsAnonymizingWrapper::RequestAppProofOfPurchaseKey(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } bool CSteamAppsAnonymizingWrapper::GetCurrentBetaName(char *pchName, int cchNameBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsAnonymizingWrapper::MarkContentCorrupt(bool bMissingFilesOnly) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } uint32 CSteamAppsAnonymizingWrapper::GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } uint32 CSteamAppsAnonymizingWrapper::GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } @@ -213,7 +213,7 @@ CSteamGameServerAnonymizingWrapper::CSteamGameServerAnonymizingWrapper(ISteamGam bool CSteamGameServerAnonymizingWrapper::InitGameServer(uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } @@ -239,7 +239,7 @@ void CSteamGameServerAnonymizingWrapper::SetDedicatedServer(bool bDedicated) void CSteamGameServerAnonymizingWrapper::LogOn(const char *pszAccountName, const char *pszPassword) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerAnonymizingWrapper::LogOnAnonymous() @@ -303,12 +303,12 @@ void CSteamGameServerAnonymizingWrapper::SetPasswordProtected(bool bPasswordProt void CSteamGameServerAnonymizingWrapper::SetSpectatorPort(uint16 unSpectatorPort) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerAnonymizingWrapper::SetSpectatorServerName(const char *pszSpectatorServerName) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerAnonymizingWrapper::ClearAllKeyValues() @@ -323,25 +323,25 @@ void CSteamGameServerAnonymizingWrapper::SetKeyValue(const char *pKey, const cha void CSteamGameServerAnonymizingWrapper::SetGameTags(const char *pchGameTags) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerAnonymizingWrapper::SetGameData(const char *pchGameData) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerAnonymizingWrapper::SetRegion(const char *pszRegion) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } bool CSteamGameServerAnonymizingWrapper::SendUserConnectAndAuthenticate(uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser) { - uint32 realIp = m_Anonymizer->Fake2RealIp(ntohl(unIPClient), __FUNCTION__); + uint32 realIp = m_Anonymizer->Fake2RealIp(ntohl(unIPClient), __func__); bool res = m_Wrapped->SendUserConnectAndAuthenticate(htonl(realIp), pvAuthBlob, cubAuthBlobSize, pSteamIDUser); if (res) { - *pSteamIDUser = m_Anonymizer->Real2FakeSteamId(*pSteamIDUser, __FUNCTION__); + *pSteamIDUser = m_Anonymizer->Real2FakeSteamId(*pSteamIDUser, __func__); } return res; } @@ -354,14 +354,14 @@ CSteamID CSteamGameServerAnonymizingWrapper::CreateUnauthenticatedUserConnection void CSteamGameServerAnonymizingWrapper::SendUserDisconnect(CSteamID steamIDUser) { - CSteamID real = m_Anonymizer->Fake2RealSteamId(steamIDUser, __FUNCTION__); + CSteamID real = m_Anonymizer->Fake2RealSteamId(steamIDUser, __func__); m_Wrapped->SendUserDisconnect(real); } bool CSteamGameServerAnonymizingWrapper::BUpdateUserData(CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore) { - CSteamID real = steamIDUser.BAnonAccount() ? steamIDUser : m_Anonymizer->Fake2RealSteamId(steamIDUser, __FUNCTION__); - std::string realName = m_Anonymizer->Fake2RealName(pchPlayerName, __FUNCTION__); + CSteamID real = steamIDUser.BAnonAccount() ? steamIDUser : m_Anonymizer->Fake2RealSteamId(steamIDUser, __func__); + std::string realName = m_Anonymizer->Fake2RealName(pchPlayerName, __func__); bool res = m_Wrapped->BUpdateUserData(real, realName.c_str(), uScore); return res; @@ -369,58 +369,58 @@ bool CSteamGameServerAnonymizingWrapper::BUpdateUserData(CSteamID steamIDUser, c HAuthTicket CSteamGameServerAnonymizingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_HAuthTicketInvalid; } EBeginAuthSessionResult CSteamGameServerAnonymizingWrapper::BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_EBeginAuthSessionResultInvalidTicket; } void CSteamGameServerAnonymizingWrapper::EndAuthSession(CSteamID steamID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerAnonymizingWrapper::CancelAuthTicket(HAuthTicket hAuthTicket) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } EUserHasLicenseForAppResult CSteamGameServerAnonymizingWrapper::UserHasLicenseForApp(CSteamID steamID, AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_EUserHasLicenseResultDoesNotHaveLicense; } bool CSteamGameServerAnonymizingWrapper::RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamGameServerAnonymizingWrapper::GetGameplayStats() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } SteamAPICall_t CSteamGameServerAnonymizingWrapper::GetServerReputation() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } uint32 CSteamGameServerAnonymizingWrapper::GetPublicIP() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamGameServerAnonymizingWrapper::HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort) { - uint32 realIp = m_Anonymizer->Fake2RealIp(htonl(srcIP), __FUNCTION__); + uint32 realIp = m_Anonymizer->Fake2RealIp(htonl(srcIP), __func__); bool res; if (m_Anonymizer->m_OriginalConnectPacketLen) { @@ -438,7 +438,7 @@ int CSteamGameServerAnonymizingWrapper::GetNextOutgoingPacket(void *pOut, int cb { int res = m_Wrapped->GetNextOutgoingPacket(pOut, cbMaxOut, pNetAdr, pPort); if (res > 0) { - uint32 fakeIp = m_Anonymizer->Real2FakeIp(ntohl(*pNetAdr), __FUNCTION__); + uint32 fakeIp = m_Anonymizer->Real2FakeIp(ntohl(*pNetAdr), __func__); *pNetAdr = htonl(fakeIp); //Clear players list @@ -466,18 +466,18 @@ void CSteamGameServerAnonymizingWrapper::SetHeartbeatInterval(int iHeartbeatInte void CSteamGameServerAnonymizingWrapper::ForceHeartbeat() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } SteamAPICall_t CSteamGameServerAnonymizingWrapper::AssociateWithClan(CSteamID steamIDClan) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } SteamAPICall_t CSteamGameServerAnonymizingWrapper::ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } @@ -598,7 +598,7 @@ int CAnonymizingEngExtInterceptor::recvfrom(SOCKET s, char* buf, int len, int fl { int res = m_BasePlatform->recvfrom(s, buf, len, flags, from, fromlen); if (res > 0) { - Real2FakeSockaddr(from, __FUNCTION__); + Real2FakeSockaddr(from, __func__); if (res > 4 && (*(uint32*)buf) == 0xFFFFFFFF) { unsigned int localLen = res; ProcessConnectionlessPacket((uint8*)buf, &localLen); @@ -613,7 +613,7 @@ int CAnonymizingEngExtInterceptor::sendto(SOCKET s, const char* buf, int len, in sockaddr saddr; memcpy(&saddr, to, sizeof(sockaddr_in)); - Fake2RealSockaddr(&saddr, __FUNCTION__); + Fake2RealSockaddr(&saddr, __func__); int res = m_BasePlatform->sendto(s, buf, len, flags, &saddr, tolen); return res; @@ -639,7 +639,7 @@ int CAnonymizingEngExtInterceptor::WSAGetLastError() struct hostent* CAnonymizingEngExtInterceptor::gethostbyname(const char *name) { - auto s = Fake2RealHost(name, __FUNCTION__); + auto s = Fake2RealHost(name, __func__); struct hostent* res = m_BasePlatform->gethostbyname(s.c_str()); return res; } @@ -648,7 +648,7 @@ int CAnonymizingEngExtInterceptor::gethostname(char *name, int namelen) { int res = m_BasePlatform->gethostname(name, namelen); if (res == 0) { - auto s = Real2FakeHost(name, __FUNCTION__); + auto s = Real2FakeHost(name, __func__); strncpy(name, s.c_str(), namelen); name[namelen - 1] = 0; } @@ -675,8 +675,8 @@ void CAnonymizingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCa { CSteamCallbackAnonymizingWrapper* wrappee = getOrCreateCallbackWrapper(pCallback); - if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); - //if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __func__); + //if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__); m_BasePlatform->SteamAPI_RegisterCallback(wrappee, iCallback); @@ -695,8 +695,8 @@ void CAnonymizingEngExtInterceptor::SteamAPI_UnregisterCallResult(class CCallbac { CSteamCallbackAnonymizingWrapper* wrappee = getOrCreateCallbackWrapper(pCallback); - if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); - if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __func__); + if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__); m_BasePlatform->SteamAPI_UnregisterCallResult(wrappee, hAPICall); @@ -768,8 +768,8 @@ void CAnonymizingEngExtInterceptor::SteamAPI_UnregisterCallback(CCallbackBase *p { CSteamCallbackAnonymizingWrapper* wrappee = getOrCreateCallbackWrapper(pCallback); - if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); - if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __func__); + if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__); m_BasePlatform->SteamAPI_UnregisterCallback(wrappee); @@ -782,11 +782,11 @@ void CAnonymizingEngExtInterceptor::AnonymizeAddr(const char* real, const char* netadr_t fakeAdr; if (!NET_StringToAdr(real, &realAdr)) { - rehlds_syserror("%s: Invalid address %s", __FUNCTION__, realAdr); + rehlds_syserror("%s: Invalid address %s", __func__, realAdr); } if (!NET_StringToAdr(fake, &fakeAdr)) { - rehlds_syserror("%s: Invalid address %s", __FUNCTION__, realAdr); + rehlds_syserror("%s: Invalid address %s", __func__, realAdr); } AnonymizeAddr(realAdr, fakeAdr); @@ -945,7 +945,7 @@ void CAnonymizingEngExtInterceptor::ProcessConnectPacket(uint8* data, unsigned i bool isSteam = (3 == atoi(Info_ValueForKey(protinfo, "prot"))); - std::string newName = Real2FakeName(Info_ValueForKey(origuserinfo, "name"), __FUNCTION__); + std::string newName = Real2FakeName(Info_ValueForKey(origuserinfo, "name"), __func__); Info_SetValueForKey(origuserinfo, "name", newName.c_str(), MAX_INFO_STRING); userinfo[0] = 0; diff --git a/rehlds/testsuite/funccalls.cpp b/rehlds/testsuite/funccalls.cpp index a817cd3..43904bc 100644 --- a/rehlds/testsuite/funccalls.cpp +++ b/rehlds/testsuite/funccalls.cpp @@ -66,7 +66,7 @@ bool CompareSockAddrs(void* ps1, void* ps2) { break; default: - rehlds_syserror("%s: Unknown sockaddr family %u", __FUNCTION__, sa1->sa_family); + rehlds_syserror("%s: Unknown sockaddr family %u", __func__, sa1->sa_family); } return 0 == memcmp(ps1, ps2, compareSize); @@ -599,10 +599,10 @@ bool CRecvFromCall::compareInputArgs(IEngExtCall* other, bool strict) void CRecvFromCall::setResult(const void* data, const void* from, int fromLen, int res) { if (res > 0 && res > sizeof(m_Data)) - rehlds_syserror("%s: too large datalen (%d max %d)", __FUNCTION__, res, sizeof(m_Data)); + rehlds_syserror("%s: too large datalen (%d max %d)", __func__, res, sizeof(m_Data)); if (fromLen > sizeof(m_From)) - rehlds_syserror("%s: too large fromlen (%d max %d)", __FUNCTION__, res, sizeof(m_From)); + rehlds_syserror("%s: too large fromlen (%d max %d)", __func__, res, sizeof(m_From)); m_FromLenOut = fromLen; m_Res = res; @@ -657,10 +657,10 @@ void CRecvFromCall::readEpilogue(std::istream &stream) { CSendToCall::CSendToCall(SOCKET s, const void* buf, int len, int flags, const void* to, int tolen) { if (len > sizeof(m_Data)) - rehlds_syserror("%s: too large datalen (%d max %d)", __FUNCTION__, len, sizeof(m_Data)); + rehlds_syserror("%s: too large datalen (%d max %d)", __func__, len, sizeof(m_Data)); if (tolen > sizeof(m_To)) - rehlds_syserror("%s: too large tolen (%d max %d)", __FUNCTION__, tolen, sizeof(m_To)); + rehlds_syserror("%s: too large tolen (%d max %d)", __func__, tolen, sizeof(m_To)); m_Socket = s; m_Len = len; @@ -770,7 +770,7 @@ void CSendToCall::readEpilogue(std::istream &stream) { CBindCall::CBindCall(SOCKET s, const void* addr, int addrlen) { if (addrlen > sizeof(m_Addr)) - rehlds_syserror("%s: too large tolen (%d max %d)", __FUNCTION__, addrlen, sizeof(m_Addr)); + rehlds_syserror("%s: too large tolen (%d max %d)", __func__, addrlen, sizeof(m_Addr)); m_Socket = s; m_AddrLen = addrlen; @@ -854,7 +854,7 @@ std::string CGetSockNameCall::toString() void CGetSockNameCall::setResult(const void* addr, int addrlen, int res) { if (addrlen > sizeof(m_Addr)) - rehlds_syserror("%s: too large tolen (%d max %d)", __FUNCTION__, addrlen, sizeof(m_Addr)); + rehlds_syserror("%s: too large tolen (%d max %d)", __func__, addrlen, sizeof(m_Addr)); m_Res = res; m_AddrLenOut = addrlen; @@ -946,7 +946,7 @@ void CWSAGetLastErrorCall::readEpilogue(std::istream &stream) { CSteamCallbackCall1::CSteamCallbackCall1(int cbId, void* data, int dataSize, CCallbackBase* cb) { if (dataSize > sizeof(m_Data)) - rehlds_syserror("%s: too large data (%d, max %d)", __FUNCTION__, dataSize, sizeof(m_Data)); + rehlds_syserror("%s: too large data (%d, max %d)", __func__, dataSize, sizeof(m_Data)); m_CallbackId = cbId; m_DataSize = dataSize; @@ -1009,7 +1009,7 @@ void CSteamCallbackCall1::readEpilogue(std::istream &stream) { CSteamCallbackCall2::CSteamCallbackCall2(int cbId, void* data, int dataSize, bool ioFailure, SteamAPICall_t apiCall, CCallbackBase* cb) { if (dataSize > sizeof(m_Data)) - rehlds_syserror("%s: too large data (%d, max %d)", __FUNCTION__, dataSize, sizeof(m_Data)); + rehlds_syserror("%s: too large data (%d, max %d)", __func__, dataSize, sizeof(m_Data)); m_CallbackId = cbId; m_DataSize = dataSize; @@ -1273,11 +1273,11 @@ std::string CSteamAppGetCurrentGameLanguageCall::toString() void CSteamAppGetCurrentGameLanguageCall::setResult(const char* res) { if (res == NULL) - rehlds_syserror("%s: null result", __FUNCTION__); + rehlds_syserror("%s: null result", __func__); m_ResLen = strlen(res) + 1; if (m_ResLen > sizeof(m_Res)) - rehlds_syserror("%s: too large result", __FUNCTION__); + rehlds_syserror("%s: too large result", __func__); memcpy(m_Res, res, m_ResLen); } @@ -1312,11 +1312,11 @@ void CSteamAppGetCurrentGameLanguageCall::readEpilogue(std::istream &stream) { CSteamGameServerInitCall::CSteamGameServerInitCall(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString) { if (pchVersionString == NULL) - rehlds_syserror("%s: version is null", __FUNCTION__); + rehlds_syserror("%s: version is null", __func__); m_VersionLen = strlen(pchVersionString) + 1; if (m_VersionLen > sizeof(m_Version)) - rehlds_syserror("%s: too long version string", __FUNCTION__); + rehlds_syserror("%s: too long version string", __func__); memcpy(m_Version, pchVersionString, m_VersionLen); m_IP = unIP; @@ -1439,11 +1439,11 @@ void CSteamGameServerCall::readEpilogue(std::istream &stream) { CGameServerSetProductCall::CGameServerSetProductCall(const char* product) { if (product == NULL) - rehlds_syserror("%s: product is null", __FUNCTION__); + rehlds_syserror("%s: product is null", __func__); m_ProductLen = strlen(product) + 1; if (m_ProductLen > sizeof(m_Product)) - rehlds_syserror("%s: too long product string", __FUNCTION__); + rehlds_syserror("%s: too long product string", __func__); memcpy(m_Product, product, m_ProductLen); } @@ -1491,11 +1491,11 @@ void CGameServerSetProductCall::readPrologue(std::istream &stream) { CGameServerSetModDirCall::CGameServerSetModDirCall(const char* dir) { if (dir == NULL) - rehlds_syserror("%s: dir is null", __FUNCTION__); + rehlds_syserror("%s: dir is null", __func__); m_DirLen = strlen(dir) + 1; if (m_DirLen > sizeof(m_Dir)) - rehlds_syserror("%s: too long dir string", __FUNCTION__); + rehlds_syserror("%s: too long dir string", __func__); memcpy(m_Dir, dir, m_DirLen); } @@ -1583,11 +1583,11 @@ void CGameServerSetDedicatedServerCall::readPrologue(std::istream &stream) { CGameServerSetGameDescCall::CGameServerSetGameDescCall(const char* desc) { if (desc == NULL) - rehlds_syserror("%s: desc is null", __FUNCTION__); + rehlds_syserror("%s: desc is null", __func__); m_DescLen = strlen(desc) + 1; if (m_DescLen > sizeof(m_Desc)) - rehlds_syserror("%s: too long dir string", __FUNCTION__); + rehlds_syserror("%s: too long dir string", __func__); memcpy(m_Desc, desc, m_DescLen); } @@ -1813,11 +1813,11 @@ void CGameServerSetBotCountCall::readPrologue(std::istream &stream) { CGameServerSetServerNameCall::CGameServerSetServerNameCall(const char* serverName) { if (serverName == NULL) - rehlds_syserror("%s: serverName is null", __FUNCTION__); + rehlds_syserror("%s: serverName is null", __func__); m_ServerNameLen = strlen(serverName) + 1; if (m_ServerNameLen > sizeof(m_ServerName)) - rehlds_syserror("%s: too long serverName string", __FUNCTION__); + rehlds_syserror("%s: too long serverName string", __func__); memcpy(m_ServerName, serverName, m_ServerNameLen); } @@ -1865,11 +1865,11 @@ void CGameServerSetServerNameCall::readPrologue(std::istream &stream) { CGameServerSetMapNameCall::CGameServerSetMapNameCall(const char* mapName) { if (mapName == NULL) - rehlds_syserror("%s: serverName is null", __FUNCTION__); + rehlds_syserror("%s: serverName is null", __func__); m_MapNameLen = strlen(mapName) + 1; if (m_MapNameLen > sizeof(m_MapName)) - rehlds_syserror("%s: too long mapName string", __FUNCTION__); + rehlds_syserror("%s: too long mapName string", __func__); memcpy(m_MapName, mapName, m_MapNameLen); } @@ -1980,20 +1980,20 @@ bool CGameServerClearAllKVsCall::compareInputArgs(IEngExtCall* other, bool stric CGameServerSetKeyValueCall::CGameServerSetKeyValueCall(const char* key, const char* value) { if (key == NULL) - rehlds_syserror("%s: key is null", __FUNCTION__); + rehlds_syserror("%s: key is null", __func__); m_KeyLen = strlen(key) + 1; if (m_KeyLen > sizeof(m_Key)) - rehlds_syserror("%s: too long key string", __FUNCTION__); + rehlds_syserror("%s: too long key string", __func__); memcpy(m_Key, key, m_KeyLen); if (value == NULL) - rehlds_syserror("%s: value is null", __FUNCTION__); + rehlds_syserror("%s: value is null", __func__); m_ValueLen = strlen(value) + 1; if (m_ValueLen > sizeof(m_Value)) - rehlds_syserror("%s: too long value string", __FUNCTION__); + rehlds_syserror("%s: too long value string", __func__); memcpy(m_Value, value, m_ValueLen); } @@ -2156,17 +2156,17 @@ void CGameServerGetNextOutgoingPacketCall::setResult(void* buf, int res, uint32* m_BufLen = res > 0 ? res : 0; if (m_BufLen > 0) { if (m_BufLen > sizeof(m_Buf)) - rehlds_syserror("%s: too long buffer returned", __FUNCTION__); + rehlds_syserror("%s: too long buffer returned", __func__); memcpy(m_Buf, buf, m_BufLen); } m_Result = res; if (pAddr == NULL) - rehlds_syserror("%s: pAddr is NULL", __FUNCTION__); + rehlds_syserror("%s: pAddr is NULL", __func__); if (pPort == NULL) - rehlds_syserror("%s: pPort is NULL", __FUNCTION__); + rehlds_syserror("%s: pPort is NULL", __func__); m_Addr = *pAddr; m_Port = *pPort; @@ -2318,7 +2318,7 @@ CGameServerHandleIncomingPacketCall::CGameServerHandleIncomingPacketCall(const v { m_Len = cbData; if (m_Len > sizeof(m_Data)) - rehlds_syserror("%s: too long packet", __FUNCTION__); + rehlds_syserror("%s: too long packet", __func__); memcpy(m_Data, pData, m_Len); m_Ip = srcIP; @@ -2390,7 +2390,7 @@ CGameServerSendUserConnectAndAuthenticateCall::CGameServerSendUserConnectAndAuth { m_AuthBlobLen = cubAuthBlobSize; if (m_AuthBlobLen > sizeof(m_AuthBlob)) - rehlds_syserror("%s: too long auth blob", __FUNCTION__); + rehlds_syserror("%s: too long auth blob", __func__); memcpy(m_AuthBlob, pvAuthBlob, m_AuthBlobLen); m_IP = unIPClient; @@ -2500,7 +2500,7 @@ CGameServerBUpdateUserDataCall::CGameServerBUpdateUserDataCall(CSteamID steamIDU { m_PlayerNameLen = strlen(pchPlayerName) + 1; if (m_PlayerNameLen > sizeof(m_PlayerName)) - rehlds_syserror("%s: too long player name", __FUNCTION__); + rehlds_syserror("%s: too long player name", __func__); memcpy(m_PlayerName, pchPlayerName, m_PlayerNameLen); m_SteamId = steamIDUser.ConvertToUint64(); @@ -2626,7 +2626,7 @@ void CGetHostNameCall::setResult(char* hostName, int res) { m_NameLenOut = strlen(hostName) + 1; if (m_NameLenOut > sizeof(m_Name)) - rehlds_syserror("%s: too long host name", __FUNCTION__); + rehlds_syserror("%s: too long host name", __func__); strcpy(m_Name, hostName); m_Res = res; @@ -2665,7 +2665,7 @@ CGetHostByNameCall::CGetHostByNameCall(const char* name) { m_NameLen = strlen(name) + 1; if (m_NameLen > sizeof(m_Name)) - rehlds_syserror("%s: too long name", __FUNCTION__); + rehlds_syserror("%s: too long name", __func__); strcpy(m_Name, name); } @@ -2696,19 +2696,19 @@ bool CGetHostByNameCall::compareInputArgs(IEngExtCall* other, bool strict) void CGetHostByNameCall::setResult(const hostent* hostEnt) { m_HostentData.hostNameLen = strlen(hostEnt->h_name) + 1; if (m_HostentData.hostNameLen > sizeof(m_HostentData.hostName)) { - rehlds_syserror("%s: too long host name", __FUNCTION__); + rehlds_syserror("%s: too long host name", __func__); } strcpy(m_HostentData.hostName, hostEnt->h_name); int i = 0; while (hostEnt->h_aliases[i]) { if (i >= HOSTENT_DATA_MAX_ALIASES) { - rehlds_syserror("%s: too many aliases", __FUNCTION__); + rehlds_syserror("%s: too many aliases", __func__); } m_HostentData.aliasesLengths[i] = strlen(hostEnt->h_aliases[i]) + 1; if (m_HostentData.aliasesLengths[i] > sizeof(m_HostentData.aliases[i])) { - rehlds_syserror("%s: too long alias", __FUNCTION__); + rehlds_syserror("%s: too long alias", __func__); } strcpy(m_HostentData.aliases[i], hostEnt->h_aliases[i]); @@ -2719,13 +2719,13 @@ void CGetHostByNameCall::setResult(const hostent* hostEnt) { m_HostentData.addrtype = hostEnt->h_addrtype; m_HostentData.addrLen = hostEnt->h_length; if (m_HostentData.addrLen > sizeof(m_HostentData.addrs[0])) { - rehlds_syserror("%s: too long addr", __FUNCTION__); + rehlds_syserror("%s: too long addr", __func__); } i = 0; while (hostEnt->h_addr_list[i]) { if (i >= HOSTENT_DATA_MAX_ADDRS) { - rehlds_syserror("%s: too many addrs", __FUNCTION__); + rehlds_syserror("%s: too many addrs", __func__); } memcpy(m_HostentData.addrs[i], hostEnt->h_addr_list[i], m_HostentData.addrLen); @@ -3205,7 +3205,7 @@ virtual void readEpilogue(std::istream &stream); */ #define IEngExtCallFactory_CreateFuncCall(clazz, buf, bufLen) \ - if (sizeof(clazz) > bufLen) rehlds_syserror("%s: buffer to small", __FUNCTION__); \ + if (sizeof(clazz) > bufLen) rehlds_syserror("%s: buffer to small", __func__); \ return new(buf) clazz(); IEngExtCall* IEngExtCallFactory::createByOpcode(ExtCallFuncs opc, void* buf, int ptrSize) { @@ -3286,7 +3286,7 @@ IEngExtCall* IEngExtCallFactory::createByOpcode(ExtCallFuncs opc, void* buf, int default: - rehlds_syserror("%s: unknown funccall opcode %d", __FUNCTION__, opc); + rehlds_syserror("%s: unknown funccall opcode %d", __func__, opc); return NULL; } } diff --git a/rehlds/testsuite/player.cpp b/rehlds/testsuite/player.cpp index 5caf865..8411772 100644 --- a/rehlds/testsuite/player.cpp +++ b/rehlds/testsuite/player.cpp @@ -36,16 +36,16 @@ CPlayingEngExtInterceptor::CPlayingEngExtInterceptor(const char* fname, bool str m_InStream.read((char*)&versionMinor, 2).read((char*)&versionMajor, 2); if (versionMajor != TESTSUITE_PROTOCOL_VERSION_MAJOR) { - rehlds_syserror("%s: protocol major version mismatch; need %d, got %d", __FUNCTION__, TESTSUITE_PROTOCOL_VERSION_MAJOR, versionMajor); + rehlds_syserror("%s: protocol major version mismatch; need %d, got %d", __func__, TESTSUITE_PROTOCOL_VERSION_MAJOR, versionMajor); } if (versionMinor > TESTSUITE_PROTOCOL_VERSION_MINOR) { - rehlds_syserror("%s: protocol minor version mismatch; need <= %d, got %d", __FUNCTION__, TESTSUITE_PROTOCOL_VERSION_MINOR, versionMinor); + rehlds_syserror("%s: protocol minor version mismatch; need <= %d, got %d", __func__, TESTSUITE_PROTOCOL_VERSION_MINOR, versionMinor); } m_InStream.read((char*)&cmdlineLen, 4); if (cmdlineLen > sizeof(cmdLine)) { - rehlds_syserror("%s: too long cmdline", __FUNCTION__); + rehlds_syserror("%s: too long cmdline", __func__); } m_InStream.read(cmdLine, cmdlineLen); @@ -66,7 +66,7 @@ void* CPlayingEngExtInterceptor::allocFuncCall() } } - rehlds_syserror("%s: running out of free slots", __FUNCTION__); + rehlds_syserror("%s: running out of free slots", __func__); return NULL; } @@ -81,7 +81,7 @@ void CPlayingEngExtInterceptor::freeFuncCall(void* fcall) } } - rehlds_syserror("%s: invalid pointer provided: %p", __FUNCTION__, fcall); + rehlds_syserror("%s: invalid pointer provided: %p", __func__, fcall); } bool CPlayingEngExtInterceptor::readFuncCall() { @@ -127,7 +127,7 @@ IEngExtCall* CPlayingEngExtInterceptor::getNextCallInternal(bool peek) { } if (m_CommandsQueue.empty()) { - rehlds_syserror("%s: command queue is empty!", __FUNCTION__); + rehlds_syserror("%s: command queue is empty!", __func__); } IEngExtCall* next = m_CommandsQueue.front(); @@ -164,7 +164,7 @@ IEngExtCall* CPlayingEngExtInterceptor::getNextCall(bool peek, bool processCallb IEngCallbackCall* callback = dynamic_cast(cmd); if (callback != NULL && callback->m_Start) { if (!processCallbacks) { - rehlds_syserror("%s: read a callback, but it's not allowed here", __FUNCTION__); + rehlds_syserror("%s: read a callback, but it's not allowed here", __func__); return NULL; } @@ -176,13 +176,13 @@ IEngExtCall* CPlayingEngExtInterceptor::getNextCall(bool peek, bool processCallb } if (cmd->getOpcode() != expectedOpcode) { - rehlds_syserror("%s: bad opcode; expected %d got %d; size left: %d", __FUNCTION__, expectedOpcode, cmd->getOpcode(), sizeLeft); + rehlds_syserror("%s: bad opcode; expected %d got %d; size left: %d", __func__, expectedOpcode, cmd->getOpcode(), sizeLeft); } if (needStart) { - if (!cmd->m_Start) rehlds_syserror("%s: bad fcall %d; expected start flag", __FUNCTION__, cmd->getOpcode()); + if (!cmd->m_Start) rehlds_syserror("%s: bad fcall %d; expected start flag", __func__, cmd->getOpcode()); } else { - if (!cmd->m_End) rehlds_syserror("%s: bad fcall %d; expected end flag", __FUNCTION__, cmd->getOpcode()); + if (!cmd->m_End) rehlds_syserror("%s: bad fcall %d; expected end flag", __func__, cmd->getOpcode()); } return cmd; @@ -200,42 +200,42 @@ void CPlayingEngExtInterceptor::playCallback(IEngCallbackCall* cb) { return; default: - rehlds_syserror("%s: unknown callback", __FUNCTION__); + rehlds_syserror("%s: unknown callback", __func__); } } void CPlayingEngExtInterceptor::playSteamCallback1(CSteamCallbackCall1* cb) { auto itr = m_SteamCallbacks.find(cb->m_CallbackId); - if (itr == m_SteamCallbacks.end()) rehlds_syserror("%s: callback %d not found", __FUNCTION__, cb->m_CallbackId); + if (itr == m_SteamCallbacks.end()) rehlds_syserror("%s: callback %d not found", __func__, cb->m_CallbackId); CCallbackBase* steamCallback = (*itr).second; - if (steamCallback->GetFlags() != cb->m_InState.m_nCallbackFlags) rehlds_syserror("%s: PRE flags desync", __FUNCTION__); - if (steamCallback->GetICallback() != cb->m_InState.m_iCallback) rehlds_syserror("%s: PRE flags desync", __FUNCTION__); + if (steamCallback->GetFlags() != cb->m_InState.m_nCallbackFlags) rehlds_syserror("%s: PRE flags desync", __func__); + if (steamCallback->GetICallback() != cb->m_InState.m_iCallback) rehlds_syserror("%s: PRE flags desync", __func__); steamCallback->Run(cb->m_Data); - CSteamCallbackCall1* endCallback = (CSteamCallbackCall1*)getNextCall(false, true, cb->getOpcode(), false, __FUNCTION__); + CSteamCallbackCall1* endCallback = (CSteamCallbackCall1*)getNextCall(false, true, cb->getOpcode(), false, __func__); - if (steamCallback->GetFlags() != endCallback->m_OutState.m_nCallbackFlags) rehlds_syserror("%s: POST flags desync", __FUNCTION__); - if (steamCallback->GetICallback() != endCallback->m_OutState.m_iCallback) rehlds_syserror("%s: POST flags desync", __FUNCTION__); + if (steamCallback->GetFlags() != endCallback->m_OutState.m_nCallbackFlags) rehlds_syserror("%s: POST flags desync", __func__); + if (steamCallback->GetICallback() != endCallback->m_OutState.m_iCallback) rehlds_syserror("%s: POST flags desync", __func__); freeFuncCall(cb); freeFuncCall(endCallback); } void CPlayingEngExtInterceptor::playSteamCallback2(CSteamCallbackCall2* cb) { auto itr = m_SteamCallbacks.find(cb->m_CallbackId); - if (itr == m_SteamCallbacks.end()) rehlds_syserror("%s: callback %d not found", __FUNCTION__, cb->m_CallbackId); + if (itr == m_SteamCallbacks.end()) rehlds_syserror("%s: callback %d not found", __func__, cb->m_CallbackId); CCallbackBase* steamCallback = (*itr).second; - if (steamCallback->GetFlags() != cb->m_InState.m_nCallbackFlags) rehlds_syserror("%s: PRE flags desync", __FUNCTION__); - if (steamCallback->GetICallback() != cb->m_InState.m_iCallback) rehlds_syserror("%s: PRE flags desync", __FUNCTION__); + if (steamCallback->GetFlags() != cb->m_InState.m_nCallbackFlags) rehlds_syserror("%s: PRE flags desync", __func__); + if (steamCallback->GetICallback() != cb->m_InState.m_iCallback) rehlds_syserror("%s: PRE flags desync", __func__); steamCallback->Run(cb->m_Data, cb->m_bIOFailure, cb->m_SteamAPICall); - CSteamCallbackCall2* endCallback = (CSteamCallbackCall2*)getNextCall(false, true, cb->getOpcode(), false, __FUNCTION__); + CSteamCallbackCall2* endCallback = (CSteamCallbackCall2*)getNextCall(false, true, cb->getOpcode(), false, __func__); - if (steamCallback->GetFlags() != endCallback->m_OutState.m_nCallbackFlags) rehlds_syserror("%s: POST flags desync", __FUNCTION__); - if (steamCallback->GetICallback() != endCallback->m_OutState.m_iCallback) rehlds_syserror("%s: POST flags desync", __FUNCTION__); + if (steamCallback->GetFlags() != endCallback->m_OutState.m_nCallbackFlags) rehlds_syserror("%s: POST flags desync", __func__); + if (steamCallback->GetICallback() != endCallback->m_OutState.m_iCallback) rehlds_syserror("%s: POST flags desync", __func__); freeFuncCall(cb); freeFuncCall(endCallback); } @@ -256,15 +256,15 @@ int CPlayingEngExtInterceptor::getOrRegisterSteamCallback(CCallbackBase* cb) { void CPlayingEngExtInterceptor::maybeHeartBeat(int readPos) { if (m_PrevHeartBeat + m_HeartBeatInterval <= readPos) { m_PrevHeartBeat = readPos; - Con_Printf("%s: readPos=%u\n", __FUNCTION__, readPos); + Con_Printf("%s: readPos=%u\n", __func__, readPos); } } uint32 CPlayingEngExtInterceptor::time(uint32* pTime) { - CStdTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_TIME, true, __FUNCTION__)); - CStdTimeCall(pTime).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CStdTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_TIME, false, __FUNCTION__)); + CStdTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_TIME, true, __func__)); + CStdTimeCall(pTime).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CStdTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_TIME, false, __func__)); uint32 res = playEndCall->m_Res; if (pTime != NULL) *pTime = res; @@ -276,9 +276,9 @@ uint32 CPlayingEngExtInterceptor::time(uint32* pTime) struct tm* CPlayingEngExtInterceptor::localtime(uint32 time) { - CStdLocalTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_LOCALTIME, true, __FUNCTION__)); - CStdLocalTimeCall(time).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CStdLocalTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_LOCALTIME, false, __FUNCTION__)); + CStdLocalTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_LOCALTIME, true, __func__)); + CStdLocalTimeCall(time).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CStdLocalTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_LOCALTIME, false, __func__)); setCurrentTm(&playEndCall->m_Res); @@ -289,17 +289,17 @@ struct tm* CPlayingEngExtInterceptor::localtime(uint32 time) void CPlayingEngExtInterceptor::srand(uint32 seed) { - CStdSrandCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_SRAND_CALL, true, __FUNCTION__)); - CStdSrandCall(seed).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CStdSrandCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_SRAND_CALL, false, __FUNCTION__)); + CStdSrandCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_SRAND_CALL, true, __func__)); + CStdSrandCall(seed).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CStdSrandCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_SRAND_CALL, false, __func__)); freeFuncCall(playCall); freeFuncCall(playEndCall); } int CPlayingEngExtInterceptor::rand() { - CStdRandCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_RAND_CALL, true, __FUNCTION__)); - CStdRandCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_RAND_CALL, false, __FUNCTION__)); + CStdRandCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CSTD_RAND_CALL, true, __func__)); + CStdRandCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CSTD_RAND_CALL, false, __func__)); int res = playEndCall->m_Res; @@ -309,16 +309,16 @@ int CPlayingEngExtInterceptor::rand() } void CPlayingEngExtInterceptor::Sleep(DWORD msec) { - CSleepExtCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SLEEP, true, __FUNCTION__)); - CSleepExtCall(msec).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSleepExtCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SLEEP, false, __FUNCTION__)); + CSleepExtCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SLEEP, true, __func__)); + CSleepExtCall(msec).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSleepExtCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SLEEP, false, __func__)); freeFuncCall(playCall); freeFuncCall(playEndCall); } BOOL CPlayingEngExtInterceptor::QueryPerfCounter(LARGE_INTEGER* counter) { - CQueryPerfCounterCall* playCall = dynamic_cast(getNextCall(false, false, ECF_QUERY_PERF_COUNTER, true, __FUNCTION__)); - CQueryPerfCounterCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_QUERY_PERF_COUNTER, false, __FUNCTION__)); + CQueryPerfCounterCall* playCall = dynamic_cast(getNextCall(false, false, ECF_QUERY_PERF_COUNTER, true, __func__)); + CQueryPerfCounterCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_QUERY_PERF_COUNTER, false, __func__)); counter->QuadPart = playEndCall->m_Counter; BOOL res = playEndCall->m_Res; @@ -328,8 +328,8 @@ BOOL CPlayingEngExtInterceptor::QueryPerfCounter(LARGE_INTEGER* counter) { } BOOL CPlayingEngExtInterceptor::QueryPerfFreq(LARGE_INTEGER* freq) { - CQueryPerfFreqCall* playCall = dynamic_cast(getNextCall(false, false, ECF_QUERY_PERF_FREQ, true, __FUNCTION__)); - CQueryPerfFreqCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_QUERY_PERF_FREQ, false, __FUNCTION__)); + CQueryPerfFreqCall* playCall = dynamic_cast(getNextCall(false, false, ECF_QUERY_PERF_FREQ, true, __func__)); + CQueryPerfFreqCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_QUERY_PERF_FREQ, false, __func__)); freq->QuadPart = playEndCall->m_Freq; BOOL res = playEndCall->m_Res; @@ -339,8 +339,8 @@ BOOL CPlayingEngExtInterceptor::QueryPerfFreq(LARGE_INTEGER* freq) { } DWORD CPlayingEngExtInterceptor::GetTickCount() { - CGetTickCountCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_TICK_COUNT, true, __FUNCTION__)); - CGetTickCountCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_TICK_COUNT, false, __FUNCTION__)); + CGetTickCountCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_TICK_COUNT, true, __func__)); + CGetTickCountCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_TICK_COUNT, false, __func__)); DWORD res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -349,24 +349,24 @@ DWORD CPlayingEngExtInterceptor::GetTickCount() { } void CPlayingEngExtInterceptor::GetLocalTime(LPSYSTEMTIME time) { - CGetLocalTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_LOCAL_TIME, true, __FUNCTION__)); - CGetLocalTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_LOCAL_TIME, false, __FUNCTION__)); + CGetLocalTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_LOCAL_TIME, true, __func__)); + CGetLocalTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_LOCAL_TIME, false, __func__)); memcpy(time, &playEndCall->m_Res, sizeof(SYSTEMTIME)); freeFuncCall(playCall); freeFuncCall(playEndCall); } void CPlayingEngExtInterceptor::GetSystemTime(LPSYSTEMTIME time) { - CGetSystemTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_SYSTEM_TIME, true, __FUNCTION__)); - CGetSystemTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_SYSTEM_TIME, false, __FUNCTION__)); + CGetSystemTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_SYSTEM_TIME, true, __func__)); + CGetSystemTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_SYSTEM_TIME, false, __func__)); memcpy(time, &playEndCall->m_Res, sizeof(SYSTEMTIME)); freeFuncCall(playCall); freeFuncCall(playEndCall); } void CPlayingEngExtInterceptor::GetTimeZoneInfo(LPTIME_ZONE_INFORMATION zinfo) { - CGetTimeZoneInfoCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_TIMEZONE_INFO, true, __FUNCTION__)); - CGetTimeZoneInfoCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_TIMEZONE_INFO, false, __FUNCTION__)); + CGetTimeZoneInfoCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_TIMEZONE_INFO, true, __func__)); + CGetTimeZoneInfoCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_TIMEZONE_INFO, false, __func__)); memcpy(zinfo, &playEndCall->m_Res, sizeof(TIME_ZONE_INFORMATION)); freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -374,8 +374,8 @@ void CPlayingEngExtInterceptor::GetTimeZoneInfo(LPTIME_ZONE_INFORMATION zinfo) { BOOL CPlayingEngExtInterceptor::GetProcessTimes(HANDLE hProcess, LPFILETIME lpCreationTime, LPFILETIME lpExitTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime) { - CGetProcessTimesCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_PROCESS_TIMES, true, __FUNCTION__)); - CGetProcessTimesCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_PROCESS_TIMES, false, __FUNCTION__)); + CGetProcessTimesCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_PROCESS_TIMES, true, __func__)); + CGetProcessTimesCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_PROCESS_TIMES, false, __func__)); BOOL res = playEndCall->m_Res; memcpy(lpCreationTime, &playEndCall->m_CreationTime, sizeof(FILETIME)); @@ -389,8 +389,8 @@ BOOL CPlayingEngExtInterceptor::GetProcessTimes(HANDLE hProcess, LPFILETIME lpCr void CPlayingEngExtInterceptor::GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime) { - CGetSystemTimeAsFileTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_SYSTEM_TIME_AS_FILE_TIME, true, __FUNCTION__)); - CGetSystemTimeAsFileTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_SYSTEM_TIME_AS_FILE_TIME, false, __FUNCTION__)); + CGetSystemTimeAsFileTimeCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_SYSTEM_TIME_AS_FILE_TIME, true, __func__)); + CGetSystemTimeAsFileTimeCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_SYSTEM_TIME_AS_FILE_TIME, false, __func__)); memcpy(lpSystemTimeAsFileTime, &playEndCall->m_SystemTime, sizeof(FILETIME)); freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -398,9 +398,9 @@ void CPlayingEngExtInterceptor::GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeA SOCKET CPlayingEngExtInterceptor::socket(int af, int type, int protocol) { - CSocketCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SOCKET, true, __FUNCTION__)); - CSocketCall(af, type, protocol).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSocketCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SOCKET, false, __FUNCTION__)); + CSocketCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SOCKET, true, __func__)); + CSocketCall(af, type, protocol).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSocketCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SOCKET, false, __func__)); SOCKET res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -409,9 +409,9 @@ SOCKET CPlayingEngExtInterceptor::socket(int af, int type, int protocol) { } int CPlayingEngExtInterceptor::ioctlsocket(SOCKET s, long cmd, u_long *argp) { - CIoCtlSocketCall* playCall = dynamic_cast(getNextCall(false, false, ECF_IOCTL_SOCKET, true, __FUNCTION__)); - CIoCtlSocketCall(s, cmd, *argp).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CIoCtlSocketCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_IOCTL_SOCKET, false, __FUNCTION__)); + CIoCtlSocketCall* playCall = dynamic_cast(getNextCall(false, false, ECF_IOCTL_SOCKET, true, __func__)); + CIoCtlSocketCall(s, cmd, *argp).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CIoCtlSocketCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_IOCTL_SOCKET, false, __func__)); int res = playEndCall->m_Res; *argp = playEndCall->m_OutValue; @@ -421,9 +421,9 @@ int CPlayingEngExtInterceptor::ioctlsocket(SOCKET s, long cmd, u_long *argp) { } int CPlayingEngExtInterceptor::setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen) { - CSetSockOptCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SET_SOCK_OPT, true, __FUNCTION__)); - CSetSockOptCall(s, level, optname, optval, optlen).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSetSockOptCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SET_SOCK_OPT, false, __FUNCTION__)); + CSetSockOptCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SET_SOCK_OPT, true, __func__)); + CSetSockOptCall(s, level, optname, optval, optlen).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSetSockOptCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SET_SOCK_OPT, false, __func__)); int res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -432,9 +432,9 @@ int CPlayingEngExtInterceptor::setsockopt(SOCKET s, int level, int optname, cons } int CPlayingEngExtInterceptor::closesocket(SOCKET s) { - CCloseSocketCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CLOSE_SOCKET, true, __FUNCTION__)); - CCloseSocketCall(s).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CCloseSocketCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CLOSE_SOCKET, false, __FUNCTION__)); + CCloseSocketCall* playCall = dynamic_cast(getNextCall(false, false, ECF_CLOSE_SOCKET, true, __func__)); + CCloseSocketCall(s).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CCloseSocketCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_CLOSE_SOCKET, false, __func__)); int res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -443,9 +443,9 @@ int CPlayingEngExtInterceptor::closesocket(SOCKET s) { } int CPlayingEngExtInterceptor::recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, socklen_t *fromlen) { - CRecvFromCall* playCall = dynamic_cast(getNextCall(false, false, ECF_RECVFROM, true, __FUNCTION__)); - CRecvFromCall(s, len, flags, *fromlen).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CRecvFromCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_RECVFROM, false, __FUNCTION__)); + CRecvFromCall* playCall = dynamic_cast(getNextCall(false, false, ECF_RECVFROM, true, __func__)); + CRecvFromCall(s, len, flags, *fromlen).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CRecvFromCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_RECVFROM, false, __func__)); int res = playEndCall->m_Res; *fromlen = playEndCall->m_FromLenOut; @@ -464,9 +464,9 @@ int CPlayingEngExtInterceptor::recvfrom(SOCKET s, char* buf, int len, int flags, } int CPlayingEngExtInterceptor::sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen) { - CSendToCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SENDTO, true, __FUNCTION__)); - CSendToCall(s, buf, len, flags, to, tolen).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSendToCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SENDTO, false, __FUNCTION__)); + CSendToCall* playCall = dynamic_cast(getNextCall(false, false, ECF_SENDTO, true, __func__)); + CSendToCall(s, buf, len, flags, to, tolen).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSendToCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_SENDTO, false, __func__)); int res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -475,9 +475,9 @@ int CPlayingEngExtInterceptor::sendto(SOCKET s, const char* buf, int len, int fl } int CPlayingEngExtInterceptor::bind(SOCKET s, const struct sockaddr* addr, int namelen) { - CBindCall* playCall = dynamic_cast(getNextCall(false, false, ECF_BIND, true, __FUNCTION__)); - CBindCall(s, addr, namelen).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CBindCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_BIND, false, __FUNCTION__)); + CBindCall* playCall = dynamic_cast(getNextCall(false, false, ECF_BIND, true, __func__)); + CBindCall(s, addr, namelen).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CBindCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_BIND, false, __func__)); int res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -486,9 +486,9 @@ int CPlayingEngExtInterceptor::bind(SOCKET s, const struct sockaddr* addr, int n } int CPlayingEngExtInterceptor::getsockname(SOCKET s, struct sockaddr* name, socklen_t* namelen) { - CGetSockNameCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_SOCK_NAME, true, __FUNCTION__)); - CGetSockNameCall(s, *namelen).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGetSockNameCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_SOCK_NAME, false, __FUNCTION__)); + CGetSockNameCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_SOCK_NAME, true, __func__)); + CGetSockNameCall(s, *namelen).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGetSockNameCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_SOCK_NAME, false, __func__)); int res = playEndCall->m_Res; *namelen = playEndCall->m_AddrLenOut; @@ -502,8 +502,8 @@ int CPlayingEngExtInterceptor::getsockname(SOCKET s, struct sockaddr* name, sock } int CPlayingEngExtInterceptor::WSAGetLastError() { - CWSAGetLastErrorCall* playCall = dynamic_cast(getNextCall(false, false, ECF_WSA_GET_LAST_ERROR, true, __FUNCTION__)); - CWSAGetLastErrorCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_WSA_GET_LAST_ERROR, false, __FUNCTION__)); + CWSAGetLastErrorCall* playCall = dynamic_cast(getNextCall(false, false, ECF_WSA_GET_LAST_ERROR, true, __func__)); + CWSAGetLastErrorCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_WSA_GET_LAST_ERROR, false, __func__)); int res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -512,9 +512,9 @@ int CPlayingEngExtInterceptor::WSAGetLastError() { } struct hostent* CPlayingEngExtInterceptor::gethostbyname(const char *name) { - CGetHostByNameCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_HOST_BY_NAME, true, __FUNCTION__)); - CGetHostByNameCall(name).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGetHostByNameCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_HOST_BY_NAME, false, __FUNCTION__)); + CGetHostByNameCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_HOST_BY_NAME, true, __func__)); + CGetHostByNameCall(name).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGetHostByNameCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_HOST_BY_NAME, false, __func__)); setCurrentHostent(&playEndCall->m_HostentData); @@ -524,9 +524,9 @@ struct hostent* CPlayingEngExtInterceptor::gethostbyname(const char *name) { } int CPlayingEngExtInterceptor::gethostname(char *name, int namelen) { - CGetHostNameCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_HOST_NAME, true, __FUNCTION__)); - CGetHostNameCall(namelen).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGetHostNameCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_HOST_NAME, false, __FUNCTION__)); + CGetHostNameCall* playCall = dynamic_cast(getNextCall(false, false, ECF_GET_HOST_NAME, true, __func__)); + CGetHostNameCall(namelen).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGetHostNameCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_GET_HOST_NAME, false, __func__)); int res = playEndCall->m_Res; strcpy(name, playEndCall->m_Name); @@ -560,9 +560,9 @@ void CPlayingEngExtInterceptor::setCurrentTm(struct tm* t) { } void CPlayingEngExtInterceptor::SteamAPI_SetBreakpadAppID(uint32 unAppID) { - CSteamApiSetBreakpadAppIdCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_SET_BREAKPAD_APP_ID, true, __FUNCTION__)); - CSteamApiSetBreakpadAppIdCall(unAppID).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSteamApiSetBreakpadAppIdCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_SET_BREAKPAD_APP_ID, false, __FUNCTION__)); + CSteamApiSetBreakpadAppIdCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_SET_BREAKPAD_APP_ID, true, __func__)); + CSteamApiSetBreakpadAppIdCall(unAppID).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSteamApiSetBreakpadAppIdCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_SET_BREAKPAD_APP_ID, false, __func__)); freeFuncCall(playCall); freeFuncCall(playEndCall); } @@ -574,9 +574,9 @@ void CPlayingEngExtInterceptor::SteamAPI_UseBreakpadCrashHandler(char const *pch void CPlayingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iCallback) { int rehldsId = getOrRegisterSteamCallback(pCallback); - CSteamApiRegisterCallbackCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_REGISTER_CALLBACK, true, __FUNCTION__)); - CSteamApiRegisterCallbackCall(rehldsId, iCallback, pCallback).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSteamApiRegisterCallbackCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_REGISTER_CALLBACK, false, __FUNCTION__)); + CSteamApiRegisterCallbackCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_REGISTER_CALLBACK, true, __func__)); + CSteamApiRegisterCallbackCall(rehldsId, iCallback, pCallback).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSteamApiRegisterCallbackCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_REGISTER_CALLBACK, false, __func__)); pCallback->SetFlags(playEndCall->m_OutState.m_nCallbackFlags); pCallback->SetICallback(playEndCall->m_OutState.m_iCallback); @@ -584,8 +584,8 @@ void CPlayingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCallba } bool CPlayingEngExtInterceptor::SteamAPI_Init() { - CSteamApiInitCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_INIT, true, __FUNCTION__)); - CSteamApiInitCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_INIT, false, __FUNCTION__)); + CSteamApiInitCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_INIT, true, __func__)); + CSteamApiInitCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_INIT, false, __func__)); bool res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -596,9 +596,9 @@ bool CPlayingEngExtInterceptor::SteamAPI_Init() { void CPlayingEngExtInterceptor::SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall) { int rehldsId = getOrRegisterSteamCallback(pCallback); - CSteamApiUnrigestierCallResultCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_UNREGISTER_CALL_RESULT, true, __FUNCTION__)); - CSteamApiUnrigestierCallResultCall(rehldsId, hAPICall, pCallback).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSteamApiUnrigestierCallResultCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_UNREGISTER_CALL_RESULT, false, __FUNCTION__)); + CSteamApiUnrigestierCallResultCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_UNREGISTER_CALL_RESULT, true, __func__)); + CSteamApiUnrigestierCallResultCall(rehldsId, hAPICall, pCallback).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSteamApiUnrigestierCallResultCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_UNREGISTER_CALL_RESULT, false, __func__)); pCallback->SetFlags(playEndCall->m_OutState.m_nCallbackFlags); pCallback->SetICallback(playEndCall->m_OutState.m_iCallback); @@ -606,8 +606,8 @@ void CPlayingEngExtInterceptor::SteamAPI_UnregisterCallResult(class CCallbackBas } ISteamApps* CPlayingEngExtInterceptor::SteamApps() { - CSteamAppsCall* playCall = (CSteamAppsCall*)getNextCall(false, false, ECF_STEAMAPPS, true, __FUNCTION__); - CSteamAppsCall* playEndCall = (CSteamAppsCall*)getNextCall(false, true, ECF_STEAMAPPS, false, __FUNCTION__); + CSteamAppsCall* playCall = (CSteamAppsCall*)getNextCall(false, false, ECF_STEAMAPPS, true, __func__); + CSteamAppsCall* playEndCall = (CSteamAppsCall*)getNextCall(false, true, ECF_STEAMAPPS, false, __func__); ISteamApps* res = NULL; if (!playEndCall->m_ReturnNull) { @@ -620,9 +620,9 @@ ISteamApps* CPlayingEngExtInterceptor::SteamApps() { } bool CPlayingEngExtInterceptor::SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString) { - CSteamGameServerInitCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER_INIT, true, __FUNCTION__)); - CSteamGameServerInitCall(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSteamGameServerInitCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER_INIT, false, __FUNCTION__)); + CSteamGameServerInitCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER_INIT, true, __func__)); + CSteamGameServerInitCall(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSteamGameServerInitCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER_INIT, false, __func__)); bool res = playEndCall->m_Res; freeFuncCall(playCall); freeFuncCall(playEndCall); @@ -631,8 +631,8 @@ bool CPlayingEngExtInterceptor::SteamGameServer_Init(uint32 unIP, uint16 usSteam } ISteamGameServer* CPlayingEngExtInterceptor::SteamGameServer() { - CSteamGameServerCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER, true, __FUNCTION__)); - CSteamGameServerCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER, false, __FUNCTION__)); + CSteamGameServerCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER, true, __func__)); + CSteamGameServerCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER, false, __func__)); ISteamGameServer* res = NULL; if (!playEndCall->m_ReturnNull) { @@ -645,23 +645,23 @@ ISteamGameServer* CPlayingEngExtInterceptor::SteamGameServer() { } void CPlayingEngExtInterceptor::SteamGameServer_RunCallbacks() { - CSteamGameServerRunCallbacksCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER_RUN_CALLBACKS, true, __FUNCTION__)); - CSteamGameServerRunCallbacksCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER_RUN_CALLBACKS, false, __FUNCTION__)); + CSteamGameServerRunCallbacksCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER_RUN_CALLBACKS, true, __func__)); + CSteamGameServerRunCallbacksCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER_RUN_CALLBACKS, false, __func__)); freeFuncCall(playCall); freeFuncCall(playEndCall); } void CPlayingEngExtInterceptor::SteamAPI_RunCallbacks() { - CSteamApiRunCallbacksCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_RUN_CALLBACKS, true, __FUNCTION__)); - CSteamApiRunCallbacksCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_RUN_CALLBACKS, false, __FUNCTION__)); + CSteamApiRunCallbacksCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_RUN_CALLBACKS, true, __func__)); + CSteamApiRunCallbacksCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_RUN_CALLBACKS, false, __func__)); freeFuncCall(playCall); freeFuncCall(playEndCall); } void CPlayingEngExtInterceptor::SteamGameServer_Shutdown() { - CSteamGameServerShutdownCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER_SHUTDOWN, true, __FUNCTION__)); - CSteamGameServerShutdownCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER_SHUTDOWN, false, __FUNCTION__)); + CSteamGameServerShutdownCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAMGAMESERVER_SHUTDOWN, true, __func__)); + CSteamGameServerShutdownCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAMGAMESERVER_SHUTDOWN, false, __func__)); freeFuncCall(playCall); freeFuncCall(playEndCall); } @@ -670,9 +670,9 @@ void CPlayingEngExtInterceptor::SteamGameServer_Shutdown() void CPlayingEngExtInterceptor::SteamAPI_UnregisterCallback(CCallbackBase *pCallback) { int rehldsId = getOrRegisterSteamCallback(pCallback); - CSteamApiUnregisterCallbackCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_UNREGISTER_CALLBACK, true, __FUNCTION__)); - CSteamApiUnregisterCallbackCall(rehldsId, pCallback).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CSteamApiUnregisterCallbackCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_UNREGISTER_CALLBACK, false, __FUNCTION__)); + CSteamApiUnregisterCallbackCall* playCall = dynamic_cast(getNextCall(false, false, ECF_STEAM_API_UNREGISTER_CALLBACK, true, __func__)); + CSteamApiUnregisterCallbackCall(rehldsId, pCallback).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CSteamApiUnregisterCallbackCall* playEndCall = dynamic_cast(getNextCall(false, true, ECF_STEAM_API_UNREGISTER_CALLBACK, false, __func__)); pCallback->SetFlags(playEndCall->m_OutState.m_nCallbackFlags); pCallback->SetICallback(playEndCall->m_OutState.m_iCallback); @@ -689,63 +689,63 @@ CSteamGameServerPlayingWrapper::CSteamGameServerPlayingWrapper(CPlayingEngExtInt } bool CSteamGameServerPlayingWrapper::InitGameServer(uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamGameServerPlayingWrapper::SetProduct(const char *pszProduct) { - CGameServerSetProductCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_PRODUCT, true, __FUNCTION__)); - CGameServerSetProductCall(pszProduct).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetProductCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_PRODUCT, false, __FUNCTION__)); + CGameServerSetProductCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_PRODUCT, true, __func__)); + CGameServerSetProductCall(pszProduct).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetProductCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_PRODUCT, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetGameDescription(const char *pszGameDescription) { - CGameServerSetGameDescCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_GAME_DESC, true, __FUNCTION__)); - CGameServerSetGameDescCall(pszGameDescription).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetGameDescCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_GAME_DESC, false, __FUNCTION__)); + CGameServerSetGameDescCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_GAME_DESC, true, __func__)); + CGameServerSetGameDescCall(pszGameDescription).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetGameDescCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_GAME_DESC, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetModDir(const char *pszModDir) { - CGameServerSetModDirCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_GAME_DIR, true, __FUNCTION__)); - CGameServerSetModDirCall(pszModDir).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetModDirCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_GAME_DIR, false, __FUNCTION__)); + CGameServerSetModDirCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_GAME_DIR, true, __func__)); + CGameServerSetModDirCall(pszModDir).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetModDirCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_GAME_DIR, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetDedicatedServer(bool bDedicated) { - CGameServerSetDedicatedServerCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_DEDICATED_SERVER, true, __FUNCTION__)); - CGameServerSetDedicatedServerCall(bDedicated).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetDedicatedServerCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_DEDICATED_SERVER, false, __FUNCTION__)); + CGameServerSetDedicatedServerCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_DEDICATED_SERVER, true, __func__)); + CGameServerSetDedicatedServerCall(bDedicated).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetDedicatedServerCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_DEDICATED_SERVER, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::LogOn(const char *pszAccountName, const char *pszPassword) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerPlayingWrapper::LogOnAnonymous() { - CGameServerLogOnAnonymousCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_LOG_ON_ANONYMOUS, true, __FUNCTION__)); - CGameServerLogOnAnonymousCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_LOG_ON_ANONYMOUS, false, __FUNCTION__)); + CGameServerLogOnAnonymousCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_LOG_ON_ANONYMOUS, true, __func__)); + CGameServerLogOnAnonymousCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_LOG_ON_ANONYMOUS, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::LogOff() { - CGameServerLogOffCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_LOGOFF, true, __FUNCTION__)); - CGameServerLogOffCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_LOGOFF, false, __FUNCTION__)); + CGameServerLogOffCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_LOGOFF, true, __func__)); + CGameServerLogOffCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_LOGOFF, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } bool CSteamGameServerPlayingWrapper::BLoggedOn() { - CGameServerBLoggedOnCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_BLOGGEDON, true, __FUNCTION__)); - CGameServerBLoggedOnCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_BLOGGEDON, false, __FUNCTION__)); + CGameServerBLoggedOnCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_BLOGGEDON, true, __func__)); + CGameServerBLoggedOnCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_BLOGGEDON, false, __func__)); bool res = playEndCall->m_Res; m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -754,8 +754,8 @@ bool CSteamGameServerPlayingWrapper::BLoggedOn() { } bool CSteamGameServerPlayingWrapper::BSecure() { - CGameServerBSecureCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_BSECURE, true, __FUNCTION__)); - CGameServerBSecureCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_BSECURE, false, __FUNCTION__)); + CGameServerBSecureCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_BSECURE, true, __func__)); + CGameServerBSecureCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_BSECURE, false, __func__)); bool res = playEndCall->m_Res; m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -764,8 +764,8 @@ bool CSteamGameServerPlayingWrapper::BSecure() { } CSteamID CSteamGameServerPlayingWrapper::GetSteamID() { - CGameServerGetSteamIdCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_GET_STEAM_ID, true, __FUNCTION__)); - CGameServerGetSteamIdCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_GET_STEAM_ID, false, __FUNCTION__)); + CGameServerGetSteamIdCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_GET_STEAM_ID, true, __func__)); + CGameServerGetSteamIdCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_GET_STEAM_ID, false, __func__)); CSteamID res(playEndCall->m_SteamId); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -774,8 +774,8 @@ CSteamID CSteamGameServerPlayingWrapper::GetSteamID() { } bool CSteamGameServerPlayingWrapper::WasRestartRequested() { - CGameServerWasRestartRequestedCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_WAS_RESTART_REQUESTED, true, __FUNCTION__)); - CGameServerWasRestartRequestedCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_WAS_RESTART_REQUESTED, false, __FUNCTION__)); + CGameServerWasRestartRequestedCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_WAS_RESTART_REQUESTED, true, __func__)); + CGameServerWasRestartRequestedCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_WAS_RESTART_REQUESTED, false, __func__)); bool res = playEndCall->m_Result; m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -784,84 +784,84 @@ bool CSteamGameServerPlayingWrapper::WasRestartRequested() { } void CSteamGameServerPlayingWrapper::SetMaxPlayerCount(int cPlayersMax) { - CGameServerSetMaxPlayersCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_MAX_PLAYERS_COUNT, true, __FUNCTION__)); - CGameServerSetMaxPlayersCall(cPlayersMax).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetMaxPlayersCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_MAX_PLAYERS_COUNT, false, __FUNCTION__)); + CGameServerSetMaxPlayersCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_MAX_PLAYERS_COUNT, true, __func__)); + CGameServerSetMaxPlayersCall(cPlayersMax).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetMaxPlayersCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_MAX_PLAYERS_COUNT, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetBotPlayerCount(int cBotplayers) { - CGameServerSetBotCountCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_BOT_PLAYERS_COUNT, true, __FUNCTION__)); - CGameServerSetBotCountCall(cBotplayers).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetBotCountCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_BOT_PLAYERS_COUNT, false, __FUNCTION__)); + CGameServerSetBotCountCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_BOT_PLAYERS_COUNT, true, __func__)); + CGameServerSetBotCountCall(cBotplayers).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetBotCountCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_BOT_PLAYERS_COUNT, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetServerName(const char *pszServerName) { - CGameServerSetServerNameCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_SERVER_NAME, true, __FUNCTION__)); - CGameServerSetServerNameCall(pszServerName).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetServerNameCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_SERVER_NAME, false, __FUNCTION__)); + CGameServerSetServerNameCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_SERVER_NAME, true, __func__)); + CGameServerSetServerNameCall(pszServerName).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetServerNameCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_SERVER_NAME, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetMapName(const char *pszMapName) { - CGameServerSetMapNameCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_MAP_NAME, true, __FUNCTION__)); - CGameServerSetMapNameCall(pszMapName).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetMapNameCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_MAP_NAME, false, __FUNCTION__)); + CGameServerSetMapNameCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_MAP_NAME, true, __func__)); + CGameServerSetMapNameCall(pszMapName).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetMapNameCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_MAP_NAME, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetPasswordProtected(bool bPasswordProtected) { - CGameServerSetPasswordProtectedCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_PASSWORD_PROTECTED, true, __FUNCTION__)); - CGameServerSetPasswordProtectedCall(bPasswordProtected).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetPasswordProtectedCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_PASSWORD_PROTECTED, false, __FUNCTION__)); + CGameServerSetPasswordProtectedCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_PASSWORD_PROTECTED, true, __func__)); + CGameServerSetPasswordProtectedCall(bPasswordProtected).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetPasswordProtectedCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_PASSWORD_PROTECTED, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetSpectatorPort(uint16 unSpectatorPort) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerPlayingWrapper::SetSpectatorServerName(const char *pszSpectatorServerName) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerPlayingWrapper::ClearAllKeyValues() { - CGameServerClearAllKVsCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_CLEAR_ALL_KEY_VALUES, true, __FUNCTION__)); - CGameServerClearAllKVsCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_CLEAR_ALL_KEY_VALUES, false, __FUNCTION__)); + CGameServerClearAllKVsCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_CLEAR_ALL_KEY_VALUES, true, __func__)); + CGameServerClearAllKVsCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_CLEAR_ALL_KEY_VALUES, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetKeyValue(const char *pKey, const char *pValue) { - CGameServerSetKeyValueCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_KEY_VALUE, true, __FUNCTION__)); - CGameServerSetKeyValueCall(pKey, pValue).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetKeyValueCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_KEY_VALUE, false, __FUNCTION__)); + CGameServerSetKeyValueCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_KEY_VALUE, true, __func__)); + CGameServerSetKeyValueCall(pKey, pValue).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetKeyValueCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_KEY_VALUE, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetGameTags(const char *pchGameTags) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerPlayingWrapper::SetGameData(const char *pchGameData) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerPlayingWrapper::SetRegion(const char *pszRegion) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } bool CSteamGameServerPlayingWrapper::SendUserConnectAndAuthenticate(uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser) { - CGameServerSendUserConnectAndAuthenticateCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SEND_USER_CONNECT_AND_AUTHENTICATE, true, __FUNCTION__)); - CGameServerSendUserConnectAndAuthenticateCall(unIPClient, pvAuthBlob, cubAuthBlobSize).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSendUserConnectAndAuthenticateCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SEND_USER_CONNECT_AND_AUTHENTICATE, false, __FUNCTION__)); + CGameServerSendUserConnectAndAuthenticateCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SEND_USER_CONNECT_AND_AUTHENTICATE, true, __func__)); + CGameServerSendUserConnectAndAuthenticateCall(unIPClient, pvAuthBlob, cubAuthBlobSize).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSendUserConnectAndAuthenticateCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SEND_USER_CONNECT_AND_AUTHENTICATE, false, __func__)); bool res = playEndCall->m_Res; *pSteamIDUser = CSteamID(playEndCall->m_OutSteamId); @@ -871,8 +871,8 @@ bool CSteamGameServerPlayingWrapper::SendUserConnectAndAuthenticate(uint32 unIPC } CSteamID CSteamGameServerPlayingWrapper::CreateUnauthenticatedUserConnection() { - CGameServerCreateUnauthUserConnectionCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_CREATE_UNAUTH_USER_CONNECTION, true, __FUNCTION__)); - CGameServerCreateUnauthUserConnectionCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_CREATE_UNAUTH_USER_CONNECTION, false, __FUNCTION__)); + CGameServerCreateUnauthUserConnectionCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_CREATE_UNAUTH_USER_CONNECTION, true, __func__)); + CGameServerCreateUnauthUserConnectionCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_CREATE_UNAUTH_USER_CONNECTION, false, __func__)); CSteamID res = playEndCall->m_SteamId; m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -881,17 +881,17 @@ CSteamID CSteamGameServerPlayingWrapper::CreateUnauthenticatedUserConnection() { } void CSteamGameServerPlayingWrapper::SendUserDisconnect(CSteamID steamIDUser) { - CGameServerSendUserDisconnectCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SEND_USER_DISCONNECT, true, __FUNCTION__)); - CGameServerSendUserDisconnectCall(steamIDUser).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSendUserDisconnectCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SEND_USER_DISCONNECT, false, __FUNCTION__)); + CGameServerSendUserDisconnectCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SEND_USER_DISCONNECT, true, __func__)); + CGameServerSendUserDisconnectCall(steamIDUser).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSendUserDisconnectCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SEND_USER_DISCONNECT, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } bool CSteamGameServerPlayingWrapper::BUpdateUserData(CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore) { - CGameServerBUpdateUserDataCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_BUPDATE_USER_DATA, true, __FUNCTION__)); - CGameServerBUpdateUserDataCall(steamIDUser, pchPlayerName, uScore).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerBUpdateUserDataCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_BUPDATE_USER_DATA, false, __FUNCTION__)); + CGameServerBUpdateUserDataCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_BUPDATE_USER_DATA, true, __func__)); + CGameServerBUpdateUserDataCall(steamIDUser, pchPlayerName, uScore).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerBUpdateUserDataCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_BUPDATE_USER_DATA, false, __func__)); bool res = playEndCall->m_Res; m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -900,51 +900,51 @@ bool CSteamGameServerPlayingWrapper::BUpdateUserData(CSteamID steamIDUser, const } HAuthTicket CSteamGameServerPlayingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_HAuthTicketInvalid; } EBeginAuthSessionResult CSteamGameServerPlayingWrapper::BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_EBeginAuthSessionResultInvalidTicket; } void CSteamGameServerPlayingWrapper::EndAuthSession(CSteamID steamID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerPlayingWrapper::CancelAuthTicket(HAuthTicket hAuthTicket) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } EUserHasLicenseForAppResult CSteamGameServerPlayingWrapper::UserHasLicenseForApp(CSteamID steamID, AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_EUserHasLicenseResultHasLicense; } bool CSteamGameServerPlayingWrapper::RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamGameServerPlayingWrapper::GetGameplayStats() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } SteamAPICall_t CSteamGameServerPlayingWrapper::GetServerReputation() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } uint32 CSteamGameServerPlayingWrapper::GetPublicIP() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamGameServerPlayingWrapper::HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort) { - CGameServerHandleIncomingPacketCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_HANDLE_INCOMING_PACKET, true, __FUNCTION__)); - CGameServerHandleIncomingPacketCall(pData, cbData, srcIP, srcPort).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerHandleIncomingPacketCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_HANDLE_INCOMING_PACKET, false, __FUNCTION__)); + CGameServerHandleIncomingPacketCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_HANDLE_INCOMING_PACKET, true, __func__)); + CGameServerHandleIncomingPacketCall(pData, cbData, srcIP, srcPort).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerHandleIncomingPacketCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_HANDLE_INCOMING_PACKET, false, __func__)); bool res = playEndCall->m_Res; m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); @@ -953,9 +953,9 @@ bool CSteamGameServerPlayingWrapper::HandleIncomingPacket(const void *pData, int } int CSteamGameServerPlayingWrapper::GetNextOutgoingPacket(void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort) { - CGameServerGetNextOutgoingPacketCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_GET_NEXT_OUTGOING_PACKET, true, __FUNCTION__)); - CGameServerGetNextOutgoingPacketCall(cbMaxOut).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerGetNextOutgoingPacketCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_GET_NEXT_OUTGOING_PACKET, false, __FUNCTION__)); + CGameServerGetNextOutgoingPacketCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_GET_NEXT_OUTGOING_PACKET, true, __func__)); + CGameServerGetNextOutgoingPacketCall(cbMaxOut).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerGetNextOutgoingPacketCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_GET_NEXT_OUTGOING_PACKET, false, __func__)); int res = playEndCall->m_Result; *pNetAdr = playEndCall->m_Addr; @@ -967,32 +967,32 @@ int CSteamGameServerPlayingWrapper::GetNextOutgoingPacket(void *pOut, int cbMaxO } void CSteamGameServerPlayingWrapper::EnableHeartbeats(bool bActive) { - CGameServerEnableHeartbeatsCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_ENABLE_HEARTBEATS, true, __FUNCTION__)); - CGameServerEnableHeartbeatsCall(bActive).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerEnableHeartbeatsCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_ENABLE_HEARTBEATS, false, __FUNCTION__)); + CGameServerEnableHeartbeatsCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_ENABLE_HEARTBEATS, true, __func__)); + CGameServerEnableHeartbeatsCall(bActive).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerEnableHeartbeatsCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_ENABLE_HEARTBEATS, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::SetHeartbeatInterval(int iHeartbeatInterval) { - CGameServerSetHeartbeatIntervalCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_HEARTBEATS_INTERVAL, true, __FUNCTION__)); - CGameServerSetHeartbeatIntervalCall(iHeartbeatInterval).ensureArgsAreEqual(playCall, m_bStrictChecks, __FUNCTION__); - CGameServerSetHeartbeatIntervalCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_HEARTBEATS_INTERVAL, false, __FUNCTION__)); + CGameServerSetHeartbeatIntervalCall* playCall = dynamic_cast(m_Player->getNextCall(false, false, ECF_GS_SET_HEARTBEATS_INTERVAL, true, __func__)); + CGameServerSetHeartbeatIntervalCall(iHeartbeatInterval).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__); + CGameServerSetHeartbeatIntervalCall* playEndCall = dynamic_cast(m_Player->getNextCall(false, true, ECF_GS_SET_HEARTBEATS_INTERVAL, false, __func__)); m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall); } void CSteamGameServerPlayingWrapper::ForceHeartbeat() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } SteamAPICall_t CSteamGameServerPlayingWrapper::AssociateWithClan(CSteamID steamIDClan) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } SteamAPICall_t CSteamGameServerPlayingWrapper::ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } @@ -1008,93 +1008,93 @@ CSteamAppsPlayingWrapper::CSteamAppsPlayingWrapper(CPlayingEngExtInterceptor* pl } bool CSteamAppsPlayingWrapper::BIsSubscribed() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsPlayingWrapper::BIsLowViolence() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsPlayingWrapper::BIsCybercafe() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsPlayingWrapper::BIsVACBanned() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } const char* CSteamAppsPlayingWrapper::GetCurrentGameLanguage() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return ""; } const char* CSteamAppsPlayingWrapper::GetAvailableGameLanguages() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return ""; } bool CSteamAppsPlayingWrapper::BIsSubscribedApp(AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsPlayingWrapper::BIsDlcInstalled(AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } uint32 CSteamAppsPlayingWrapper::GetEarliestPurchaseUnixTime(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamAppsPlayingWrapper::BIsSubscribedFromFreeWeekend() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } int CSteamAppsPlayingWrapper::GetDLCCount() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamAppsPlayingWrapper::BGetDLCDataByIndex(int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamAppsPlayingWrapper::InstallDLC(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamAppsPlayingWrapper::UninstallDLC(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamAppsPlayingWrapper::RequestAppProofOfPurchaseKey(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } bool CSteamAppsPlayingWrapper::GetCurrentBetaName(char *pchName, int cchNameBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsPlayingWrapper::MarkContentCorrupt(bool bMissingFilesOnly) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } uint32 CSteamAppsPlayingWrapper::GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } uint32 CSteamAppsPlayingWrapper::GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } diff --git a/rehlds/testsuite/recorder.cpp b/rehlds/testsuite/recorder.cpp index c0eb676..368f22b 100644 --- a/rehlds/testsuite/recorder.cpp +++ b/rehlds/testsuite/recorder.cpp @@ -19,8 +19,8 @@ CSteamCallbackRecordingWrapper::CSteamCallbackRecordingWrapper(CRecordingEngExtI void CSteamCallbackRecordingWrapper::Run(void *pvParam) { - if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __FUNCTION__); - if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __func__); + if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __func__); CSteamCallbackCall1 fcall(m_Id, pvParam, m_Size, m_Wrapped); CRecorderFuncCall frec(&fcall); m_Recorder->PushFunc(&frec); @@ -33,8 +33,8 @@ void CSteamCallbackRecordingWrapper::Run(void *pvParam) void CSteamCallbackRecordingWrapper::Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall) { - if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __FUNCTION__); - if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (m_Wrapped->GetICallback() != this->GetICallback()) rehlds_syserror("%s: iCallback desync", __func__); + if (m_Wrapped->GetFlags() != this->GetFlags()) rehlds_syserror("%s: flags desync", __func__); CSteamCallbackCall2 fcall(m_Id, pvParam, m_Size, bIOFailure, hSteamAPICall, m_Wrapped); CRecorderFuncCall frec(&fcall); m_Recorder->PushFunc(&frec); @@ -61,25 +61,25 @@ CSteamAppsRecordingWrapper::CSteamAppsRecordingWrapper(ISteamApps* original, CRe bool CSteamAppsRecordingWrapper::BIsSubscribed() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsRecordingWrapper::BIsLowViolence() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsRecordingWrapper::BIsCybercafe() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsRecordingWrapper::BIsVACBanned() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } @@ -95,82 +95,82 @@ const char* CSteamAppsRecordingWrapper::GetCurrentGameLanguage() const char* CSteamAppsRecordingWrapper::GetAvailableGameLanguages() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return NULL; } bool CSteamAppsRecordingWrapper::BIsSubscribedApp(AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsRecordingWrapper::BIsDlcInstalled(AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } uint32 CSteamAppsRecordingWrapper::GetEarliestPurchaseUnixTime(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamAppsRecordingWrapper::BIsSubscribedFromFreeWeekend() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } int CSteamAppsRecordingWrapper::GetDLCCount() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } bool CSteamAppsRecordingWrapper::BGetDLCDataByIndex(int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamAppsRecordingWrapper::InstallDLC(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamAppsRecordingWrapper::UninstallDLC(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamAppsRecordingWrapper::RequestAppProofOfPurchaseKey(AppId_t nAppID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } bool CSteamAppsRecordingWrapper::GetCurrentBetaName(char *pchName, int cchNameBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } bool CSteamAppsRecordingWrapper::MarkContentCorrupt(bool bMissingFilesOnly) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } uint32 CSteamAppsRecordingWrapper::GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } uint32 CSteamAppsRecordingWrapper::GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } @@ -183,7 +183,7 @@ CSteamGameServerRecordingWrapper::CSteamGameServerRecordingWrapper(ISteamGameSer bool CSteamGameServerRecordingWrapper::InitGameServer(uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } @@ -221,7 +221,7 @@ void CSteamGameServerRecordingWrapper::SetDedicatedServer(bool bDedicated) void CSteamGameServerRecordingWrapper::LogOn(const char *pszAccountName, const char *pszPassword) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerRecordingWrapper::LogOnAnonymous() @@ -322,12 +322,12 @@ void CSteamGameServerRecordingWrapper::SetPasswordProtected(bool bPasswordProtec void CSteamGameServerRecordingWrapper::SetSpectatorPort(uint16 unSpectatorPort) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerRecordingWrapper::SetSpectatorServerName(const char *pszSpectatorServerName) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerRecordingWrapper::ClearAllKeyValues() @@ -348,17 +348,17 @@ void CSteamGameServerRecordingWrapper::SetKeyValue(const char *pKey, const char void CSteamGameServerRecordingWrapper::SetGameTags(const char *pchGameTags) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerRecordingWrapper::SetGameData(const char *pchGameData) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerRecordingWrapper::SetRegion(const char *pszRegion) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } bool CSteamGameServerRecordingWrapper::SendUserConnectAndAuthenticate(uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser) @@ -401,52 +401,52 @@ bool CSteamGameServerRecordingWrapper::BUpdateUserData(CSteamID steamIDUser, con HAuthTicket CSteamGameServerRecordingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_HAuthTicketInvalid; } EBeginAuthSessionResult CSteamGameServerRecordingWrapper::BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_EBeginAuthSessionResultInvalidTicket; } void CSteamGameServerRecordingWrapper::EndAuthSession(CSteamID steamID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void CSteamGameServerRecordingWrapper::CancelAuthTicket(HAuthTicket hAuthTicket) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } EUserHasLicenseForAppResult CSteamGameServerRecordingWrapper::UserHasLicenseForApp(CSteamID steamID, AppId_t appID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_EUserHasLicenseResultDoesNotHaveLicense; } bool CSteamGameServerRecordingWrapper::RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return false; } void CSteamGameServerRecordingWrapper::GetGameplayStats() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } SteamAPICall_t CSteamGameServerRecordingWrapper::GetServerReputation() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } uint32 CSteamGameServerRecordingWrapper::GetPublicIP() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return 0; } @@ -488,18 +488,18 @@ void CSteamGameServerRecordingWrapper::SetHeartbeatInterval(int iHeartbeatInterv void CSteamGameServerRecordingWrapper::ForceHeartbeat() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } SteamAPICall_t CSteamGameServerRecordingWrapper::AssociateWithClan(CSteamID steamIDClan) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } SteamAPICall_t CSteamGameServerRecordingWrapper::ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return k_uAPICallInvalid; } @@ -574,7 +574,7 @@ void CRecordingEngExtInterceptor::PushFunc(CRecorderFuncCall* func) void CRecordingEngExtInterceptor::PopFunc(CRecorderFuncCall* func) { if (func != m_LastFunc) - rehlds_syserror("%s: stack corrupted", __FUNCTION__); + rehlds_syserror("%s: stack corrupted", __func__); writeCall(!func->m_StartWritten, true, func->m_FuncCall); if (m_LastFunc->m_Prev == NULL) { @@ -842,8 +842,8 @@ void CRecordingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCall { CSteamCallbackRecordingWrapper* wrappee = getOrCreateCallbackWrapper(pCallback); - if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); - //if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __func__); + //if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__); CSteamApiRegisterCallbackCall fcall(wrappee->getRehldsCallbackId(), iCallback, wrappee); CRecorderFuncCall frec(&fcall); PushFunc(&frec); @@ -870,8 +870,8 @@ void CRecordingEngExtInterceptor::SteamAPI_UnregisterCallResult(class CCallbackB { CSteamCallbackRecordingWrapper* wrappee = getOrCreateCallbackWrapper(pCallback); - if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); - if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __func__); + if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__); CSteamApiUnrigestierCallResultCall fcall(wrappee->getRehldsCallbackId(), hAPICall, wrappee); CRecorderFuncCall frec(&fcall); @@ -981,8 +981,8 @@ void CRecordingEngExtInterceptor::SteamAPI_UnregisterCallback(CCallbackBase *pCa { CSteamCallbackRecordingWrapper* wrappee = getOrCreateCallbackWrapper(pCallback); - if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __FUNCTION__); - if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __FUNCTION__); + if (wrappee->GetFlags() != pCallback->GetFlags()) rehlds_syserror("%s: flags desync", __func__); + if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__); CSteamApiUnregisterCallbackCall fcall(wrappee->getRehldsCallbackId(), wrappee); CRecorderFuncCall frec(&fcall); PushFunc(&frec); diff --git a/rehlds/testsuite/testsuite.cpp b/rehlds/testsuite/testsuite.cpp index 284618a..90c9b2b 100644 --- a/rehlds/testsuite/testsuite.cpp +++ b/rehlds/testsuite/testsuite.cpp @@ -12,7 +12,7 @@ uint32 __cdecl time_hooked(uint32* pTime) struct tm* __cdecl localtime_hooked(uint32* pTime) { if (pTime == NULL) - rehlds_syserror("%s: pTime is NULL", __FUNCTION__); + rehlds_syserror("%s: pTime is NULL", __func__); return CRehldsPlatformHolder::get()->localtime(*pTime); } @@ -119,12 +119,12 @@ int __stdcall gethostname_hooked(char *name, int namelen) void __cdecl SteamAPI_SetMiniDumpComment_hooked(const char *pchMsg) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void __cdecl SteamAPI_WriteMiniDump_hooked(uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void __cdecl SteamAPI_RegisterCallback_hooked(class CCallbackBase *pCallback, int iCallback) @@ -144,13 +144,13 @@ bool __cdecl SteamAPI_Init_hooked() ISteamUser* __cdecl SteamUser_hooked() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return NULL; } ISteamFriends* __cdecl SteamFriends_hooked() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return NULL; } @@ -161,7 +161,7 @@ void __cdecl SteamGameServer_RunCallbacks_hooked() void __cdecl SteamAPI_Shutdown_hooked() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } void __cdecl SteamGameServer_Shutdown_hooked() @@ -191,12 +191,12 @@ void __cdecl SteamAPI_SetBreakpadAppID_hooked(uint32 unAppID) void __cdecl SteamAPI_RegisterCallResult_hooked(class CCallbackBase *pCallback, SteamAPICall_t hAPICall) { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); } ISteamHTTP* __cdecl SteamHTTP_hooked() { - rehlds_syserror("%s: not implemented", __FUNCTION__); + rehlds_syserror("%s: not implemented", __func__); return NULL; }