enable "Wzero-as-null-pointer-constant", fix cases of it
prevent ambiguity shoutout blankart for making me aware this exists
This commit is contained in:
1 parent
5528afaa35
commit
5fffb5fa3b
32 files changed
+144
-143
No files matched your search
@@ -20,7 +20,7 @@ $(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
|
||||
CXXFLAGS+= -Wno-aggregate-return
|
||||
|
||||
# -W -Wno-unused
|
||||
WFLAGS:=-Wall -Wno-trigraphs -Wnull-dereference
|
||||
WFLAGS:=-Wall -Wno-trigraphs -Wnull-dereference -Wzero-as-null-pointer-constant
|
||||
ifndef GCC295
|
||||
#WFLAGS+=-Wno-packed
|
||||
endif
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ static int str_find_aux (lua_State *L, int find) {
|
||||
if (find) {
|
||||
lua_pushinteger(L, s1-s+1); /* start */
|
||||
lua_pushinteger(L, res-s); /* end */
|
||||
return push_captures(&ms, NULL, 0) + 2;
|
||||
return push_captures(&ms, NULL, NULL) + 2;
|
||||
}
|
||||
else
|
||||
return push_captures(&ms, s1, res);
|
||||
|
||||
+3
-3
@@ -772,10 +772,10 @@ union luai_Cast { double l_d; long l_l; };
|
||||
|
||||
#include <stdio.h>
|
||||
#if defined(__GNUC__)
|
||||
#define l_likely(x) (__builtin_expect(((x) != 0), 1))
|
||||
#define l_unlikely(x) (__builtin_expect(((x) != 0), 0))
|
||||
#define l_likely(x) (__builtin_expect(!!(x), 1))
|
||||
#define l_unlikely(x) (__builtin_expect(!!(x), 0))
|
||||
#else
|
||||
#define l_likely(x) (x)
|
||||
#define l_likely(x) (x)
|
||||
#define l_unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
|
||||
+9
-9
@@ -330,7 +330,7 @@ void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(const UINT8 **p, INT32 playernu
|
||||
#ifdef PARANOIA
|
||||
if (id >= MAXNETXCMD)
|
||||
I_Error("Command id %d too big", id);
|
||||
if (listnetxcmd[id] != 0)
|
||||
if (listnetxcmd[id] != NULL)
|
||||
I_Error("Command id %d already used", id);
|
||||
#endif
|
||||
listnetxcmd[id] = cmd_f;
|
||||
@@ -1234,7 +1234,7 @@ static void CL_DrawConnectionStatus(void)
|
||||
va(" %4uK/%4uK", currentsize>>10, totalsize>>10));
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
va("%3.1fK/s ", ((double)getbps)/1024));
|
||||
va("%3.1fK/s ", ((double)getbps)/1024.0));
|
||||
}
|
||||
else
|
||||
cltext = M_GetText("Waiting to download game state...");
|
||||
@@ -1963,7 +1963,7 @@ static boolean SV_ResendingSavegameToAnyone(void)
|
||||
static void SV_SendSaveGame(INT32 node, boolean resending)
|
||||
{
|
||||
size_t length, compressedlen;
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
UINT8 *compressedsave;
|
||||
UINT8 *buffertosend;
|
||||
|
||||
@@ -2033,7 +2033,7 @@ static consvar_t cv_dumpconsistency = {"dumpconsistency", "Off", CV_NETVAR, CV_O
|
||||
static void SV_SavedGame(void)
|
||||
{
|
||||
size_t length;
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
char tmpsave[264];
|
||||
|
||||
if (!cv_dumpconsistency.value)
|
||||
@@ -2073,7 +2073,7 @@ static void SV_SavedGame(void)
|
||||
|
||||
static void CL_LoadReceivedSavegame(boolean reloading)
|
||||
{
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
size_t length, decompressedlen;
|
||||
char tmpsave[264];
|
||||
|
||||
@@ -4961,8 +4961,6 @@ static void PT_ClientJoin(SINT8 node)
|
||||
if (client || nodeingame[node] || levelloading)
|
||||
return;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
const char *refuse = GetRefuseMessage(node);
|
||||
|
||||
if (refuse)
|
||||
@@ -4971,6 +4969,8 @@ static void PT_ClientJoin(SINT8 node)
|
||||
return;
|
||||
}
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
// client authorised to join
|
||||
nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]);
|
||||
|
||||
@@ -7293,7 +7293,7 @@ void CL_ClearRewinds(void)
|
||||
|
||||
rewind_t *CL_SaveRewindPoint(size_t demopos)
|
||||
{
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
rewind_t *rewind;
|
||||
|
||||
if (rewindhead && rewindhead->leveltime + REWIND_POINT_INTERVAL > leveltime)
|
||||
@@ -7316,7 +7316,7 @@ rewind_t *CL_SaveRewindPoint(size_t demopos)
|
||||
|
||||
rewind_t *CL_RewindToTime(tic_t time)
|
||||
{
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
rewind_t *rewind;
|
||||
|
||||
while (rewindhead && rewindhead->leveltime > time)
|
||||
|
||||
+2
-1
@@ -1953,7 +1953,8 @@ void D_SRB2Main(void)
|
||||
if (M_CheckParm("-warp") && M_IsNextParm())
|
||||
{
|
||||
const char *word = M_GetNextParm();
|
||||
pstartmap = G_FindMapByNameOrCode(word, 0);
|
||||
pstartmap = G_FindMapByNameOrCode(word, NULL);
|
||||
|
||||
if (! pstartmap)
|
||||
I_Error("Cannot find a map remotely named '%s'\n", word);
|
||||
else
|
||||
|
||||
+7
-7
@@ -249,7 +249,7 @@ consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEA
|
||||
|
||||
#ifdef SEENAMES
|
||||
static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
|
||||
consvar_t cv_seenames = {"seenames", "Off", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_seenames = {"seenames", "Off", CV_SAVE, seenames_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_allowseenames = {"allowseenames", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
@@ -458,16 +458,16 @@ consvar_t cv_showping = {"showping", "Always", CV_SAVE, showping_cons_t, NULL, 0
|
||||
|
||||
static CV_PossibleValue_t pingmeasurement_cons_t[] = {{0, "Frames"}, {1, "Milliseconds"}, {0, NULL}};
|
||||
consvar_t cv_pingmeasurement = {"pingmeasurement", "Frames", CV_SAVE, pingmeasurement_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_pingicon = {"pingicon", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_pingicon = {"pingicon", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t cv_pingstyle_cons_t[] = {{0, "New"}, {1, "Old"}, {0, NULL}};
|
||||
consvar_t cv_pingstyle = {"pingstyle", "New", CV_SAVE, cv_pingstyle_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_pingstyle = {"pingstyle", "New", CV_SAVE, cv_pingstyle_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_luaimmersion = {"luaimmersion", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_luaimmersion = {"luaimmersion", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showviewpointtext = {"showviewpointtext", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_showviewpointtext = {"showviewpointtext", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showdownloadprompt = {"showdownloadprompt", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_showdownloadprompt = {"showdownloadprompt", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Intermission time Tails 04-19-2002
|
||||
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
@@ -2447,7 +2447,7 @@ static void Command_Map_f(void)
|
||||
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
||||
else
|
||||
{
|
||||
if (!mapheaderinfo[newmapnum-1])
|
||||
if (mapheaderinfo[newmapnum-1] == NULL)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Invalid mapheaderinfo for Course %s (%s)\n"), realmapname, G_BuildMapName(newmapnum));
|
||||
return;
|
||||
|
||||
+1
-1
@@ -1318,7 +1318,7 @@ boolean F_ContinueResponder(event_t *event)
|
||||
keypressed = true;
|
||||
imcontinuing = true;
|
||||
continuetime = TICRATE;
|
||||
S_StartSound(0, sfx_itemup);
|
||||
S_StartSound(NULL, sfx_itemup);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ static tic_t demostarttime; // for comparative timing purposes
|
||||
|
||||
//@TODO put these all in a struct for namespacing purposes?
|
||||
static char demoname[128];
|
||||
savebuffer_t demobuf = {0};
|
||||
savebuffer_t demobuf = {};
|
||||
static UINT8 *demotime_p, *demoinfo_p;
|
||||
static UINT8 *demoend;
|
||||
static UINT8 demoflags;
|
||||
|
||||
+7
-7
@@ -3510,7 +3510,7 @@ void G_LoadGameData(void)
|
||||
INT32 i, j;
|
||||
UINT8 modded = false;
|
||||
UINT8 rtemp;
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
|
||||
//For records
|
||||
tic_t rectime;
|
||||
@@ -3643,7 +3643,7 @@ void G_SaveGameData(boolean force)
|
||||
size_t length;
|
||||
INT32 i, j;
|
||||
UINT8 btemp;
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
(void)force;
|
||||
char backupfile[MAX_WADPATH+4];
|
||||
|
||||
@@ -3814,7 +3814,7 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
||||
size_t length;
|
||||
char vcheck[VERSIONSIZE];
|
||||
char savename[255];
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
|
||||
// memset savedata to all 0, fixes calling perfectly valid saves corrupt because of bots
|
||||
memset(&savedata, 0, sizeof(savedata));
|
||||
@@ -3900,7 +3900,7 @@ void G_SaveGame(UINT32 savegameslot)
|
||||
boolean saved;
|
||||
char savename[256] = "";
|
||||
const char *backup;
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
|
||||
sprintf(savename, savegamename, savegameslot);
|
||||
backup = va("%s",savename);
|
||||
@@ -4170,7 +4170,7 @@ static void measurekeywords(mapsearchfreq_t *fr,
|
||||
PU_STATIC, NULL);
|
||||
for (qp = strtok(va("%s", q), " ");
|
||||
qp && fr->total < 255;
|
||||
qp = strtok(0, " "))
|
||||
qp = strtok(NULL, " "))
|
||||
{
|
||||
if (( sp = strcasestr(s, qp) ))
|
||||
{
|
||||
@@ -4251,7 +4251,7 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
|
||||
{
|
||||
newmapnum = mapnum;
|
||||
newmapname = realmapname;
|
||||
realmapname = 0;
|
||||
realmapname = NULL;
|
||||
Z_Free(apromapname);
|
||||
if (!wanttable)
|
||||
break;
|
||||
@@ -4272,7 +4272,7 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
|
||||
{
|
||||
apromapnum = mapnum;
|
||||
apromapname = realmapname;
|
||||
realmapname = 0;
|
||||
realmapname = NULL;
|
||||
}
|
||||
}
|
||||
else/* ...match individual keywords */
|
||||
|
||||
@@ -396,7 +396,7 @@ void HWR_RenderBatches(boolean sort)
|
||||
nextSurfaceInfo = nextEntry->surf;
|
||||
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
nextTexture = NULL;
|
||||
|
||||
if (useshader && currentShader != nextShader)
|
||||
{
|
||||
|
||||
+14
-14
@@ -274,7 +274,7 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
if (!f)
|
||||
return NULL;
|
||||
|
||||
retModel = (model_t*)Z_Calloc(sizeof(model_t), ztag, 0);
|
||||
retModel = (model_t*)Z_Calloc(sizeof(model_t), ztag, NULL);
|
||||
|
||||
//size_t fileLen;
|
||||
|
||||
@@ -288,13 +288,13 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
{
|
||||
texPos++;
|
||||
namelen = strlen(texPos) + 1;
|
||||
texturefilename = (char*)Z_Malloc(namelen, PU_CACHE, 0);
|
||||
texturefilename = (char*)Z_Malloc(namelen, PU_CACHE, NULL);
|
||||
strcpy(texturefilename, texPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
namelen = strlen(fileName) + 1;
|
||||
texturefilename = (char*)Z_Malloc(namelen, PU_CACHE, 0);
|
||||
texturefilename = (char*)Z_Malloc(namelen, PU_CACHE, NULL);
|
||||
strcpy(texturefilename, fileName);
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
header = (md2header_t*)buffer;
|
||||
|
||||
retModel->numMeshes = 1; // MD2 only has one mesh
|
||||
retModel->meshes = (mesh_t*)Z_Calloc(sizeof(mesh_t) * retModel->numMeshes, ztag, 0);
|
||||
retModel->meshes = (mesh_t*)Z_Calloc(sizeof(mesh_t) * retModel->numMeshes, ztag, NULL);
|
||||
retModel->meshes[0].numFrames = header->numFrames;
|
||||
// const float WUNITS = 1.0f;
|
||||
// float dataScale = WUNITS;
|
||||
@@ -332,7 +332,7 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
if (retModel->numMaterials <= 0) // Always at least one skin, duh
|
||||
retModel->numMaterials = 1;
|
||||
|
||||
retModel->materials = (material_t*)Z_Calloc(sizeof(material_t)*retModel->numMaterials, ztag, 0);
|
||||
retModel->materials = (material_t*)Z_Calloc(sizeof(material_t)*retModel->numMaterials, ztag, NULL);
|
||||
|
||||
// int t;
|
||||
for (t = 0; t < retModel->numMaterials; t++)
|
||||
@@ -409,9 +409,9 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
float *uvptr;
|
||||
|
||||
dataScale = 0.015624f; // 1 / 64.0f
|
||||
retModel->meshes[0].tinyframes = (tinyframe_t*)Z_Calloc(sizeof(tinyframe_t)*header->numFrames, ztag, 0);
|
||||
retModel->meshes[0].tinyframes = (tinyframe_t*)Z_Calloc(sizeof(tinyframe_t)*header->numFrames, ztag, NULL);
|
||||
retModel->meshes[0].numVertices = header->numXYZ;
|
||||
retModel->meshes[0].uvs = (float*)Z_Malloc(sizeof(float) * 2 * retModel->meshes[0].numVertices, ztag, 0);
|
||||
retModel->meshes[0].uvs = (float*)Z_Malloc(sizeof(float) * 2 * retModel->meshes[0].numVertices, ztag, NULL);
|
||||
|
||||
ptr = (char*)frames;
|
||||
for (i = 0; i < header->numFrames; i++, ptr += header->framesize)
|
||||
@@ -423,12 +423,12 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
md2vertex_t *vertex;
|
||||
|
||||
md2frame_t *framePtr = (md2frame_t*)ptr;
|
||||
retModel->meshes[0].tinyframes[i].vertices = (short*)Z_Malloc(sizeof(short) * 3 * header->numXYZ, ztag, 0);
|
||||
retModel->meshes[0].tinyframes[i].normals = (char*)Z_Malloc(sizeof(char) * 3 * header->numXYZ, ztag, 0);
|
||||
retModel->meshes[0].tinyframes[i].vertices = (short*)Z_Malloc(sizeof(short) * 3 * header->numXYZ, ztag, NULL);
|
||||
retModel->meshes[0].tinyframes[i].normals = (char*)Z_Malloc(sizeof(char) * 3 * header->numXYZ, ztag, NULL);
|
||||
|
||||
// if (retModel->materials[0].lightmap)
|
||||
// retModel->meshes[0].tinyframes[i].tangents = (char*)malloc(sizeof(char));//(char*)Z_Malloc(sizeof(char)*3*header->numVerts, ztag);
|
||||
retModel->meshes[0].indices = (unsigned short*)Z_Malloc(sizeof(unsigned short) * 3 * header->numTris, ztag, 0);
|
||||
retModel->meshes[0].indices = (unsigned short*)Z_Malloc(sizeof(unsigned short) * 3 * header->numTris, ztag, NULL);
|
||||
|
||||
vertptr = retModel->meshes[0].tinyframes[i].vertices;
|
||||
normptr = retModel->meshes[0].tinyframes[i].normals;
|
||||
@@ -484,8 +484,8 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
char *ptr;
|
||||
|
||||
retModel->meshes[0].numVertices = header->numTris * 3;
|
||||
retModel->meshes[0].frames = (mdlframe_t*)Z_Calloc(sizeof(mdlframe_t)*header->numFrames, ztag, 0);
|
||||
retModel->meshes[0].uvs = (float*)Z_Malloc(sizeof(float) * 2 * retModel->meshes[0].numVertices, ztag, 0);
|
||||
retModel->meshes[0].frames = (mdlframe_t*)Z_Calloc(sizeof(mdlframe_t)*header->numFrames, ztag, NULL);
|
||||
retModel->meshes[0].uvs = (float*)Z_Malloc(sizeof(float) * 2 * retModel->meshes[0].numVertices, ztag, NULL);
|
||||
|
||||
trisPtr = tris;
|
||||
uvptr = retModel->meshes[0].uvs;
|
||||
@@ -507,8 +507,8 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
md2vertex_t *vertex;
|
||||
|
||||
md2frame_t *framePtr = (md2frame_t*)ptr;
|
||||
retModel->meshes[0].frames[i].normals = (float*)Z_Malloc(sizeof(float) * 3 * header->numTris * 3, ztag, 0);
|
||||
retModel->meshes[0].frames[i].vertices = (float*)Z_Malloc(sizeof(float) * 3 * header->numTris * 3, ztag, 0);
|
||||
retModel->meshes[0].frames[i].normals = (float*)Z_Malloc(sizeof(float) * 3 * header->numTris * 3, ztag, NULL);
|
||||
retModel->meshes[0].frames[i].vertices = (float*)Z_Malloc(sizeof(float) * 3 * header->numTris * 3, ztag, NULL);
|
||||
// if (retModel->materials[0].lightmap)
|
||||
// retModel->meshes[0].frames[i].tangents = (float*)malloc(sizeof(float));//(float*)Z_Malloc(sizeof(float)*3*header->numTris*3, ztag);
|
||||
//float *vertptr, *normptr;
|
||||
|
||||
+12
-12
@@ -168,7 +168,7 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
if (!f)
|
||||
return NULL;
|
||||
|
||||
retModel = (model_t*)Z_Calloc(sizeof(model_t), ztag, 0);
|
||||
retModel = (model_t*)Z_Calloc(sizeof(model_t), ztag, NULL);
|
||||
|
||||
// find length of file
|
||||
fseek(f, 0, SEEK_END);
|
||||
@@ -201,7 +201,7 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
if (retModel->numMaterials <= 0) // Always at least one skin, duh
|
||||
retModel->numMaterials = 1;
|
||||
|
||||
retModel->materials = (material_t*)Z_Calloc(sizeof(material_t)*retModel->numMaterials, ztag, 0);
|
||||
retModel->materials = (material_t*)Z_Calloc(sizeof(material_t)*retModel->numMaterials, ztag, NULL);
|
||||
|
||||
for (t = 0; t < retModel->numMaterials; t++)
|
||||
{
|
||||
@@ -225,7 +225,7 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
retModel->materials[t].spheremap = false;
|
||||
}
|
||||
|
||||
retModel->meshes = (mesh_t*)Z_Calloc(sizeof(mesh_t)*retModel->numMeshes, ztag, 0);
|
||||
retModel->meshes = (mesh_t*)Z_Calloc(sizeof(mesh_t)*retModel->numMeshes, ztag, NULL);
|
||||
|
||||
matCount = 0;
|
||||
for (i = 0, surfEnd = 0; i < mdh->numSurfaces; i++)
|
||||
@@ -298,9 +298,9 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
unsigned short *indexptr;
|
||||
md3Triangle *mdT;
|
||||
|
||||
retModel->meshes[i].tinyframes = (tinyframe_t*)Z_Calloc(sizeof(tinyframe_t)*mdS->numFrames, ztag, 0);
|
||||
retModel->meshes[i].tinyframes = (tinyframe_t*)Z_Calloc(sizeof(tinyframe_t)*mdS->numFrames, ztag, NULL);
|
||||
retModel->meshes[i].numVertices = mdS->numVerts;
|
||||
retModel->meshes[i].uvs = (float*)Z_Malloc(sizeof(float)*2*mdS->numVerts, ztag, 0);
|
||||
retModel->meshes[i].uvs = (float*)Z_Malloc(sizeof(float)*2*mdS->numVerts, ztag, NULL);
|
||||
for (j = 0; j < mdS->numFrames; j++)
|
||||
{
|
||||
short *vertptr;
|
||||
@@ -308,12 +308,12 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
// char *tanptr;
|
||||
int k;
|
||||
md3Vertex *mdV = (md3Vertex*)((char*)mdS + mdS->offsetXYZNormal + (mdS->numVerts*j*sizeof(md3Vertex)));
|
||||
retModel->meshes[i].tinyframes[j].vertices = (short*)Z_Malloc(sizeof(short)*3*mdS->numVerts, ztag, 0);
|
||||
retModel->meshes[i].tinyframes[j].normals = (char*)Z_Malloc(sizeof(char)*3*mdS->numVerts, ztag, 0);
|
||||
retModel->meshes[i].tinyframes[j].vertices = (short*)Z_Malloc(sizeof(short)*3*mdS->numVerts, ztag, NULL);
|
||||
retModel->meshes[i].tinyframes[j].normals = (char*)Z_Malloc(sizeof(char)*3*mdS->numVerts, ztag, NULL);
|
||||
|
||||
// if (retModel->materials[0].lightmap)
|
||||
// retModel->meshes[i].tinyframes[j].tangents = (char*)malloc(sizeof(char));//(char*)Z_Malloc(sizeof(char)*3*mdS->numVerts, ztag);
|
||||
retModel->meshes[i].indices = (unsigned short*)Z_Malloc(sizeof(unsigned short) * 3 * mdS->numTriangles, ztag, 0);
|
||||
retModel->meshes[i].indices = (unsigned short*)Z_Malloc(sizeof(unsigned short) * 3 * mdS->numTriangles, ztag, NULL);
|
||||
vertptr = retModel->meshes[i].tinyframes[j].vertices;
|
||||
normptr = retModel->meshes[i].tinyframes[j].normals;
|
||||
|
||||
@@ -374,16 +374,16 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||
int k;
|
||||
|
||||
retModel->meshes[i].numVertices = mdS->numTriangles * 3;//mdS->numVerts;
|
||||
retModel->meshes[i].frames = (mdlframe_t*)Z_Calloc(sizeof(mdlframe_t)*mdS->numFrames, ztag, 0);
|
||||
retModel->meshes[i].uvs = (float*)Z_Malloc(sizeof(float)*2*mdS->numTriangles*3, ztag, 0);
|
||||
retModel->meshes[i].frames = (mdlframe_t*)Z_Calloc(sizeof(mdlframe_t)*mdS->numFrames, ztag, NULL);
|
||||
retModel->meshes[i].uvs = (float*)Z_Malloc(sizeof(float)*2*mdS->numTriangles*3, ztag, NULL);
|
||||
|
||||
for (j = 0; j < mdS->numFrames; j++)
|
||||
{
|
||||
float *vertptr;
|
||||
float *normptr;
|
||||
md3Vertex *mdV = (md3Vertex*)((char*)mdS + mdS->offsetXYZNormal + (mdS->numVerts*j*sizeof(md3Vertex)));
|
||||
retModel->meshes[i].frames[j].vertices = (float*)Z_Malloc(sizeof(float)*3*mdS->numTriangles*3, ztag, 0);
|
||||
retModel->meshes[i].frames[j].normals = (float*)Z_Malloc(sizeof(float)*3*mdS->numTriangles*3, ztag, 0);
|
||||
retModel->meshes[i].frames[j].vertices = (float*)Z_Malloc(sizeof(float)*3*mdS->numTriangles*3, ztag, NULL);
|
||||
retModel->meshes[i].frames[j].normals = (float*)Z_Malloc(sizeof(float)*3*mdS->numTriangles*3, ztag, NULL);
|
||||
// if (retModel->materials[i].lightmap)
|
||||
// retModel->meshes[i].frames[j].tangents = (float*)malloc(sizeof(float));//(float*)Z_Malloc(sizeof(float)*3*mdS->numTriangles*3, ztag);
|
||||
vertptr = retModel->meshes[i].frames[j].vertices;
|
||||
|
||||
@@ -189,7 +189,7 @@ model_t *LoadModel(const char *filename, int ztag)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
model->mdlFilename = (char*)Z_Malloc(strlen(filename)+1, ztag, 0);
|
||||
model->mdlFilename = (char*)Z_Malloc(strlen(filename)+1, ztag, NULL);
|
||||
strcpy(model->mdlFilename, filename);
|
||||
|
||||
Optimize(model);
|
||||
@@ -237,7 +237,7 @@ void GenerateVertexNormals(model_t *model)
|
||||
{
|
||||
mdlframe_t *frame = &mesh->frames[j];
|
||||
int memTag = PU_STATIC;
|
||||
float *newNormals = (float*)Z_Malloc(sizeof(float)*3*mesh->numTriangles*3, memTag, 0);
|
||||
float *newNormals = (float*)Z_Malloc(sizeof(float)*3*mesh->numTriangles*3, memTag, NULL);
|
||||
int k;
|
||||
float *vertPtr = frame->vertices;
|
||||
float *oldNormals;
|
||||
@@ -309,7 +309,7 @@ static boolean AddMaterialToList(materiallist_t **head, material_t *material)
|
||||
}
|
||||
|
||||
// Didn't find it, so add to the list
|
||||
newMatNode = (materiallist_t*)Z_Malloc(sizeof(materiallist_t), PU_CACHE, 0);
|
||||
newMatNode = (materiallist_t*)Z_Malloc(sizeof(materiallist_t), PU_CACHE, NULL);
|
||||
newMatNode->material = material;
|
||||
ListAdd(newMatNode, (listitem_t**)head);
|
||||
return true;
|
||||
@@ -351,7 +351,7 @@ void Optimize(model_t *model)
|
||||
}
|
||||
|
||||
memTag = PU_STATIC;
|
||||
newMeshes = (mesh_t*)Z_Calloc(sizeof(mesh_t) * numMeshes, memTag, 0);
|
||||
newMeshes = (mesh_t*)Z_Calloc(sizeof(mesh_t) * numMeshes, memTag, NULL);
|
||||
|
||||
i = 0;
|
||||
for (node = matListHead; node; node = node->next)
|
||||
@@ -377,14 +377,14 @@ void Optimize(model_t *model)
|
||||
newMesh->numFrames = 1;
|
||||
newMesh->numTriangles = numTriangles;
|
||||
newMesh->numVertices = numTriangles * 3;
|
||||
newMesh->uvs = (float*)Z_Malloc(sizeof(float)*2*numTriangles*3, memTag, 0);
|
||||
newMesh->frames = (mdlframe_t*)Z_Calloc(sizeof(mdlframe_t), memTag, 0);
|
||||
newMesh->uvs = (float*)Z_Malloc(sizeof(float)*2*numTriangles*3, memTag, NULL);
|
||||
newMesh->frames = (mdlframe_t*)Z_Calloc(sizeof(mdlframe_t), memTag, NULL);
|
||||
curFrame = &newMesh->frames[0];
|
||||
|
||||
curFrame->material = curMat;
|
||||
curFrame->normals = (float*)Z_Malloc(sizeof(float)*3*numTriangles*3, memTag, 0);
|
||||
curFrame->vertices = (float*)Z_Malloc(sizeof(float)*3*numTriangles*3, memTag, 0);
|
||||
curFrame->colors = (char*)Z_Malloc(sizeof(char)*4*numTriangles*3, memTag, 0);
|
||||
curFrame->normals = (float*)Z_Malloc(sizeof(float)*3*numTriangles*3, memTag, NULL);
|
||||
curFrame->vertices = (float*)Z_Malloc(sizeof(float)*3*numTriangles*3, memTag, NULL);
|
||||
curFrame->colors = (char*)Z_Malloc(sizeof(char)*4*numTriangles*3, memTag, NULL);
|
||||
|
||||
// Now traverse the meshes of the model, adding in
|
||||
// vertices/normals/uvs that match the current material
|
||||
|
||||
@@ -98,10 +98,10 @@ static size_t textureBufferSize = 0;
|
||||
static LTListItem *LightTablesTail = NULL;
|
||||
static LTListItem *LightTablesHead = NULL;
|
||||
|
||||
static RGBA_t screenPalette[256] = {0}; // the palette for the postprocessing step in palette rendering
|
||||
static RGBA_t screenPalette[256] = {}; // the palette for the postprocessing step in palette rendering
|
||||
static GLuint screenPaletteTex = 0; // 1D texture containing the screen palette
|
||||
static GLuint paletteLookupTex = 0; // 3D texture containing RGB -> palette index lookup table
|
||||
RGBA_t myPaletteData[256] = {0}; // the palette for converting textures to RGBA
|
||||
RGBA_t myPaletteData[256] = {}; // the palette for converting textures to RGBA
|
||||
|
||||
static GLint gltexformat = GL_RGB5_A1;
|
||||
GLint screen_width = 0; // used by Draw2DLine()
|
||||
@@ -127,9 +127,9 @@ GLuint gl_num_extensions;
|
||||
int majorGL = 0, minorGL = 0;
|
||||
|
||||
//Hurdler: 04/10/2000: added for the kick ass coronas as Boris wanted;-)
|
||||
GLfloat modelMatrix[16] = {0};
|
||||
GLfloat projMatrix[16] = {0};
|
||||
static GLint viewport[4];
|
||||
GLfloat modelMatrix[16] = {};
|
||||
GLfloat projMatrix[16] = {};
|
||||
static GLint viewport[4];
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
enum
|
||||
@@ -172,7 +172,7 @@ boolean supportstencil = false;
|
||||
// flush all of the stored textures, leaving them unavailable at times such as between levels
|
||||
// These need to start at 0 and be set to their number, and be reset to 0 when deleted so that Intel GPUs
|
||||
// can know when the textures aren't there, as textures are always considered resident in their virtual memory
|
||||
static GLuint screenTextures[NUMSCREENTEXTURES] = {0};
|
||||
static GLuint screenTextures[NUMSCREENTEXTURES] = {};
|
||||
|
||||
#define byte2float(byte) (GLfloat)(byte / 255.0f)
|
||||
|
||||
|
||||
+4
-4
@@ -189,7 +189,7 @@ HMS_connect (const char *format, ...)
|
||||
seek = strlen(hms_api) + 1;/* + '/' */
|
||||
|
||||
va_start (ap, format);
|
||||
url = malloc(seek + vsnprintf(0, 0, format, ap) + sizeof HMS_QUERY_VERSION - 1 + token_length + 1);
|
||||
url = malloc(seek + vsnprintf(NULL, 0, format, ap) + sizeof HMS_QUERY_VERSION - 1 + token_length + 1);
|
||||
va_end (ap);
|
||||
|
||||
sprintf(url, "%s/", hms_api);
|
||||
@@ -471,8 +471,8 @@ HMS_fetch_servers (msg_server_t *list, int query_id)
|
||||
*end = '\0';
|
||||
|
||||
address = strtok(p, " ");
|
||||
port = strtok(0, " ");
|
||||
contact = strtok(0, "");
|
||||
port = strtok(NULL, " ");
|
||||
contact = strtok(NULL, "");
|
||||
|
||||
if (address && port)
|
||||
{
|
||||
@@ -539,7 +539,7 @@ HMS_compare_mod_version (char *buffer, size_t buffer_size)
|
||||
if (HMS_do(hms))
|
||||
{
|
||||
version = strtok(hms->buffer, " ");
|
||||
version_name = strtok(0, "\n");
|
||||
version_name = strtok(NULL, "\n");
|
||||
|
||||
if (version && version_name)
|
||||
{
|
||||
|
||||
+1
-1
@@ -475,7 +475,7 @@ int mobj_localskin_setter(lua_State *L)
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->localskin = 0;
|
||||
mo->localskin = NULL;
|
||||
mo->skinlocal = false;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -80,7 +80,7 @@ static UINT8 cheatf_warp(void)
|
||||
if (success)
|
||||
{
|
||||
G_SaveGameData(true); //G_SetGameModified(false);
|
||||
S_StartSound(0, sfx_kc42);
|
||||
S_StartSound(NULL, sfx_kc42);
|
||||
}
|
||||
|
||||
// Refresh secrets menu existing.
|
||||
@@ -117,13 +117,13 @@ static UINT8 cheatf_devmode(void)
|
||||
#endif
|
||||
|
||||
static cheatseq_t cheat_warp = {
|
||||
0, cheatf_warp,
|
||||
NULL, cheatf_warp,
|
||||
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
|
||||
{ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff }
|
||||
};
|
||||
|
||||
static cheatseq_t cheat_warp_joy = {
|
||||
0, cheatf_warp,
|
||||
NULL, cheatf_warp,
|
||||
/*{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
|
||||
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW),
|
||||
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
|
||||
@@ -136,7 +136,7 @@ static cheatseq_t cheat_warp_joy = {
|
||||
|
||||
#ifdef DEVELOP
|
||||
static cheatseq_t cheat_devmode = {
|
||||
0, cheatf_devmode,
|
||||
NULL, cheatf_devmode,
|
||||
{ SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff }
|
||||
};
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ void M_AddRawCondition(UINT8 set, UINT8 id, conditiontype_t c, INT32 r, INT16 x1
|
||||
wnum = conditionSets[set - 1].numconditions;
|
||||
num = ++conditionSets[set - 1].numconditions;
|
||||
|
||||
conditionSets[set - 1].condition = Z_Realloc(conditionSets[set - 1].condition, sizeof(condition_t)*num, PU_STATIC, 0);
|
||||
conditionSets[set - 1].condition = Z_Realloc(conditionSets[set - 1].condition, sizeof(condition_t)*num, PU_STATIC, NULL);
|
||||
|
||||
cond = conditionSets[set - 1].condition;
|
||||
|
||||
|
||||
+4
-4
@@ -5384,7 +5384,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
{
|
||||
CONS_Printf("custom settings menu initiation\n");
|
||||
for (CVARSETUP = 0; CVARSETUP < MAXMENUCCVARS; ++CVARSETUP)
|
||||
OP_CustomCvarMenu[CVARSETUP] = (menuitem_t){IT_DISABLED, NULL, "", 0, INT16_MAX};
|
||||
OP_CustomCvarMenu[CVARSETUP] = (menuitem_t){IT_DISABLED, NULL, "", NULL, INT16_MAX};
|
||||
}
|
||||
|
||||
if (category && ((ccvarposition == 0 && category[0] != '\0') || !fasticmp(category, OP_CustomCvarMenu[ccvarlaststheader].text)))
|
||||
@@ -7493,7 +7493,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
|
||||
if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR)
|
||||
mappingforencore = (patch_t *)W_CachePatchNum(lumpnum, PU_PATCH);*/
|
||||
|
||||
V_DrawFixedPatch((x+w)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP, PictureOfLevel, 0);
|
||||
V_DrawFixedPatch((x+w)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP, PictureOfLevel, NULL);
|
||||
|
||||
{
|
||||
static angle_t rubyfloattime = 0;
|
||||
@@ -8158,7 +8158,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
V_DrawFixedPatch(((statx+61+GRIDSTATOFFSET)<<FRACBITS) + (FRACUNIT>>1), (staty+67)<<FRACBITS, FRACUNIT>>1, 0, statlr, flashcol);
|
||||
V_DrawFixedPatch((statx+40+GRIDSTATOFFSET)<<FRACBITS, (staty+80)<<FRACBITS, FRACUNIT>>1, 0, statud, flashcol);
|
||||
// bg
|
||||
V_DrawFixedPatch(((statx+48+GRIDSTATOFFSET)<<FRACBITS)+(FRACUNIT>>1), (staty+73)<<FRACBITS, FRACUNIT>>1, 0, statbg, 0);
|
||||
V_DrawFixedPatch(((statx+48+GRIDSTATOFFSET)<<FRACBITS)+(FRACUNIT>>1), (staty+73)<<FRACBITS, FRACUNIT>>1, 0, statbg, NULL);
|
||||
|
||||
for (i = 0; i < numskins; i++) // draw the stat dots
|
||||
{
|
||||
@@ -8217,7 +8217,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
V_DrawFixedPatch((statx+64)<<FRACBITS, staty<<FRACBITS, FRACUNIT, 0, statlr, flashcol);
|
||||
V_DrawFixedPatch((statx+24)<<FRACBITS, (staty+22)<<FRACBITS, FRACUNIT, 0, statud, flashcol);
|
||||
// bg
|
||||
V_DrawFixedPatch((statx+34)<<FRACBITS, (staty+10)<<FRACBITS, FRACUNIT, 0, statbg, 0);
|
||||
V_DrawFixedPatch((statx+34)<<FRACBITS, (staty+10)<<FRACBITS, FRACUNIT, 0, statbg, NULL);
|
||||
|
||||
for (i = 0; i < numskins; i++) // draw the stat dots
|
||||
{
|
||||
|
||||
+9
-9
@@ -110,12 +110,12 @@ perfstatrow_t rendertime_rows[] = {
|
||||
|
||||
{"ui ", "UI render: ", &ps_uitime, PS_TIME},
|
||||
{"finupdt", "I_FinishUpdate:", &ps_swaptime, PS_TIME},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
perfstatrow_t gamelogicbrief_row[] = {
|
||||
{"logic ", "Game logic: ", &ps_tictime, PS_TIME},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
perfstatrow_t commoncounter_rows[] = {
|
||||
@@ -123,20 +123,20 @@ perfstatrow_t commoncounter_rows[] = {
|
||||
{"sprites", "Sprites: ", &ps_numsprites, 0},
|
||||
{"drwnode", "Drawnodes: ", &ps_numdrawnodes, 0},
|
||||
{"plyobjs", "Polyobjects: ", &ps_numpolyobjects, 0},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
perfstatrow_t interpolation_rows[] = {
|
||||
{"intpfrc", "Interp frac: ", &ps_interp_frac, 0},
|
||||
{"intplag", "Interp lag: ", &ps_interp_lag, 0},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
#ifdef HWRENDER
|
||||
perfstatrow_t batchcount_rows[] = {
|
||||
{"polygon", "Polygons: ", &ps_hw_numpolys, 0},
|
||||
{"vertex ", "Vertices: ", &ps_hw_numverts, 0},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
perfstatrow_t batchcalls_rows[] = {
|
||||
@@ -145,7 +145,7 @@ perfstatrow_t batchcalls_rows[] = {
|
||||
{"texture", "Textures: ", &ps_hw_numtextures, 0},
|
||||
{"polyflg", "Polyflags: ", &ps_hw_numpolyflags, 0},
|
||||
{"colors ", "Colors: ", &ps_hw_numcolors, 0},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -164,7 +164,7 @@ perfstatrow_t gamelogic_rows[] = {
|
||||
{" lthinkf", " LUAh_ThinkFrame:", &ps_lua_thinkframe_time, PS_TIME|PS_LEVEL},
|
||||
{" lpostthinkf", " LUAh_PostThinkFrame:", &ps_lua_postthinkframe_time, PS_TIME|PS_LEVEL},
|
||||
{" other ", " Other: ", &ps_otherlogictime, PS_TIME|PS_LEVEL},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
perfstatrow_t thinkercount_rows[] = {
|
||||
@@ -176,13 +176,13 @@ perfstatrow_t thinkercount_rows[] = {
|
||||
{" precip ", " Precipitation: ", &ps_precipcount, PS_LEVEL},
|
||||
{" other ", " Other: ", &ps_otherthcount, PS_LEVEL},
|
||||
{" remove ", " Pending removal:", &ps_removecount, PS_LEVEL},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
perfstatrow_t misc_calls_rows[] = {
|
||||
{"lmhook", "Lua mobj hooks: ", &ps_lua_mobjhooks, PS_LEVEL},
|
||||
{"chkpos", "P_CheckPosition:", &ps_checkposition_calls, PS_LEVEL},
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
// Sample collection status for averaging.
|
||||
|
||||
+4
-4
@@ -5977,7 +5977,7 @@ void A_Boss7Chase(void *thing)
|
||||
if (actor->flags2 & MF2_FRET)
|
||||
{
|
||||
P_SetMobjState(actor, S_BLACKEGG_DESTROYPLAT1);
|
||||
S_StartSound(0, sfx_s3k53);
|
||||
S_StartSound(NULL, sfx_s3k53);
|
||||
actor->flags2 &= ~MF2_FRET;
|
||||
return;
|
||||
}
|
||||
@@ -6011,7 +6011,7 @@ void A_Boss7Chase(void *thing)
|
||||
{
|
||||
// Punch him!
|
||||
P_SetMobjState(actor, actor->info->meleestate);
|
||||
S_StartSound(0, sfx_begrnd); // warning sound
|
||||
S_StartSound(NULL, sfx_begrnd); // warning sound
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -6057,7 +6057,7 @@ void A_Boss7Chase(void *thing)
|
||||
case 2: // Homing Missile
|
||||
A_FaceTarget(actor);
|
||||
P_SetMobjState(actor, actor->info->missilestate);
|
||||
S_StartSound(0, sfx_beflap);
|
||||
S_StartSound(NULL, sfx_beflap);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10739,7 +10739,7 @@ void A_BrakChase(void *thing)
|
||||
{
|
||||
actor->reactiontime--;
|
||||
if (actor->reactiontime == 0 && actor->type == MT_CYBRAKDEMON)
|
||||
S_StartSound(0, sfx_bewar1 + P_RandomKey(4));
|
||||
S_StartSound(NULL, sfx_bewar1 + P_RandomKey(4));
|
||||
}
|
||||
|
||||
// modify target threshold
|
||||
|
||||
+12
-12
@@ -3686,10 +3686,10 @@ static void P_CalculatePrecipFloor(precipmobj_t *mobj)
|
||||
// Just the identification of a precip thinker. The thinker
|
||||
// should never actually be called!
|
||||
//
|
||||
void P_NullPrecipThinker(precipmobj_t *mobj)
|
||||
FUNCNORETURN void P_NullPrecipThinker(precipmobj_t *mobj)
|
||||
{
|
||||
(void)mobj;
|
||||
I_Assert("P_NullPrecipThinker should not be called" == 0);
|
||||
I_Error("P_NullPrecipThinker should not be called");
|
||||
}
|
||||
|
||||
boolean P_PrecipThinker(precipmobj_t *mobj)
|
||||
@@ -4092,7 +4092,7 @@ static void P_Boss3Thinker(mobj_t *mobj)
|
||||
if ((UINT32)mobj->extravalue1 + TICRATE*2 < leveltime)
|
||||
{
|
||||
mobj->extravalue1 = (INT32)leveltime;
|
||||
S_StartSound(0, sfx_buzz1);
|
||||
S_StartSound(NULL, sfx_buzz1);
|
||||
}
|
||||
|
||||
// If in the center, check to make sure
|
||||
@@ -4711,7 +4711,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
if (mobj->health > 0)
|
||||
mobj->health--;
|
||||
|
||||
S_StartSound(0, (mobj->health) ? sfx_behurt : sfx_bedie2);
|
||||
S_StartSound(NULL, (mobj->health) ? sfx_behurt : sfx_bedie2);
|
||||
|
||||
mobj->reactiontime /= 3;
|
||||
|
||||
@@ -4750,7 +4750,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
INT32 i;
|
||||
mobj->state->nextstate = mobj->info->painstate; // Reset
|
||||
|
||||
S_StartSound(0, sfx_bedeen);
|
||||
S_StartSound(NULL, sfx_bedeen);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
@@ -4774,7 +4774,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
mobj->state->nextstate = mobj->info->spawnstate;
|
||||
|
||||
// Laugh
|
||||
S_StartSound(0, sfx_bewar1 + P_RandomKey(4));
|
||||
S_StartSound(NULL, sfx_bewar1 + P_RandomKey(4));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4794,7 +4794,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
var2 = 2*TICRATE + (80<<16);
|
||||
|
||||
A_LobShot(mobj);
|
||||
S_StartSound(0, sfx_begoop);
|
||||
S_StartSound(NULL, sfx_begoop);
|
||||
}
|
||||
}
|
||||
else if (mobj->state == &states[S_BLACKEGG_SHOOT2])
|
||||
@@ -4818,7 +4818,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
S_StopSound(missile);
|
||||
|
||||
if (leveltime & 1)
|
||||
S_StartSound(0, sfx_beshot);
|
||||
S_StartSound(NULL, sfx_beshot);
|
||||
}
|
||||
else if (mobj->state == &states[S_BLACKEGG_JUMP1] && mobj->tics == 1)
|
||||
{
|
||||
@@ -4951,7 +4951,7 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
fixed_t x,y,z;
|
||||
mobj_t *mo2;
|
||||
|
||||
S_StartSound(0, sfx_befall);
|
||||
S_StartSound(NULL, sfx_befall);
|
||||
|
||||
z = mobj->floorz;
|
||||
for (j = 0; j < 2; j++)
|
||||
@@ -4990,13 +4990,13 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
P_DamageMobj(players[i].mo, mobj, mobj, 1);
|
||||
|
||||
// Laugh
|
||||
S_StartSound(0, sfx_bewar1 + P_RandomKey(4));
|
||||
S_StartSound(NULL, sfx_bewar1 + P_RandomKey(4));
|
||||
}
|
||||
|
||||
P_SetMobjState(mobj, mobj->info->spawnstate);
|
||||
}
|
||||
else if (mobj->state == &states[mobj->info->deathstate] && mobj->tics == mobj->state->tics)
|
||||
S_StartSound(0, sfx_bedie1 + (P_RandomFixed() & 1));
|
||||
S_StartSound(NULL, sfx_bedie1 + (P_RandomFixed() & 1));
|
||||
}
|
||||
|
||||
// Metal Sonic battle boss
|
||||
@@ -10836,7 +10836,7 @@ void P_SpawnPlayer(INT32 playernum)
|
||||
// the dead body mobj retains the skin through the 'spritedef' override).
|
||||
mobj->skin = &skins[p->skin];
|
||||
|
||||
mobj->localskin = (p->localskin ? K_GetPlayerSkin(p) : 0);
|
||||
mobj->localskin = (p->localskin ? K_GetPlayerSkin(p) : NULL);
|
||||
mobj->skinlocal = p->skinlocal;
|
||||
|
||||
mobj->health = p->health;
|
||||
|
||||
+2
-2
@@ -1025,7 +1025,7 @@ void P_WriteThings(lumpnum_t lumpnum)
|
||||
size_t i, length;
|
||||
mapthing_t *mt;
|
||||
UINT8 *data;
|
||||
savebuffer_t save = {0};
|
||||
savebuffer_t save = {};
|
||||
INT16 temp;
|
||||
|
||||
data = W_CacheLumpNum(lumpnum, PU_LEVEL);
|
||||
@@ -1169,7 +1169,7 @@ static void P_LoadLineDefs2(void)
|
||||
for (; i--; ld++)
|
||||
{
|
||||
ld->frontsector = sides[ld->sidenum[0]].sector; //e6y: Can't be -1 here
|
||||
ld->backsector = ld->sidenum[1] != 0xffff ? sides[ld->sidenum[1]].sector : 0;
|
||||
ld->backsector = ld->sidenum[1] != 0xffff ? sides[ld->sidenum[1]].sector : NULL;
|
||||
|
||||
// Repeat count for midtexture
|
||||
if ((ld->flags & ML_EFFECT5) && (ld->sidenum[1] != 0xffff))
|
||||
|
||||
+3
-3
@@ -4579,8 +4579,8 @@ static inline void P_AddFFloorToList(sector_t *sec, ffloor_t *ffloor)
|
||||
if (!sec->ffloors)
|
||||
{
|
||||
sec->ffloors = ffloor;
|
||||
ffloor->next = 0;
|
||||
ffloor->prev = 0;
|
||||
ffloor->next = NULL;
|
||||
ffloor->prev = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4588,7 +4588,7 @@ static inline void P_AddFFloorToList(sector_t *sec, ffloor_t *ffloor)
|
||||
|
||||
rover->next = ffloor;
|
||||
ffloor->prev = rover;
|
||||
ffloor->next = 0;
|
||||
ffloor->next = NULL;
|
||||
}
|
||||
|
||||
/** Adds a 3Dfloor.
|
||||
|
||||
+1
-1
@@ -1084,7 +1084,7 @@ subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
||||
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||
for (i = 0; i < ret->numlines; i++)
|
||||
if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
|
||||
|
||||
if (player->mo)
|
||||
{
|
||||
player->mo->localskin = 0;
|
||||
player->mo->localskin = NULL;
|
||||
player->mo->skinlocal = false;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -532,8 +532,8 @@ void R_ClearSprites(void)
|
||||
visspritecount = numvisiblesprites = clippedvissprites = 0;
|
||||
}
|
||||
|
||||
static INT16 *vissprite_clipbot[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {0};
|
||||
static INT16 *vissprite_cliptop[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {0};
|
||||
static INT16 *vissprite_clipbot[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {};
|
||||
static INT16 *vissprite_cliptop[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {};
|
||||
|
||||
static void R_AllocVisSpriteChunkMemory(UINT32 chunk)
|
||||
{
|
||||
|
||||
+3
-3
@@ -888,7 +888,7 @@ static void S_StopChannel(INT32 cnum)
|
||||
if (cnum != i && c->sfxinfo == channels[i].sfxinfo)
|
||||
break;
|
||||
|
||||
c->sfxinfo = 0;
|
||||
c->sfxinfo = NULL;
|
||||
}
|
||||
|
||||
c->origin = NULL;
|
||||
@@ -1275,7 +1275,7 @@ static musicdef_t *S_AddMusicCredit(void)
|
||||
return &musicdefs[chunk][i];
|
||||
}
|
||||
|
||||
struct cursongcredit cursongcredit = {0}; // Currently displayed song credit info
|
||||
struct cursongcredit cursongcredit = {}; // Currently displayed song credit info
|
||||
|
||||
static boolean ReadMusicDefFields(UINT16 wadnum, int line, char *stoken, musicdef_t **defp)
|
||||
{
|
||||
@@ -1708,7 +1708,7 @@ static void S_UnloadMusic(void)
|
||||
music.flags = 0;
|
||||
music.looping = false;
|
||||
|
||||
music_refade_cv = 0;
|
||||
music_refade_cv = NULL;
|
||||
}
|
||||
|
||||
static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
||||
|
||||
+2
-2
@@ -255,9 +255,9 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||
|
||||
void S_ChangeMusicSpecial (const char *mmusic);
|
||||
|
||||
void S_SetRestoreMusicFadeInCvar (consvar_t *cvar);
|
||||
void S_SetRestoreMusicFadeInCvar(consvar_t *cvar);
|
||||
#define S_ClearRestoreMusicFadeInCvar() \
|
||||
S_SetRestoreMusicFadeInCvar(0)
|
||||
S_SetRestoreMusicFadeInCvar(NULL)
|
||||
int S_GetRestoreMusicFadeIn (void);
|
||||
|
||||
// Stops the music.
|
||||
|
||||
+4
-4
@@ -73,8 +73,8 @@ nongnu_strcasestr (const char *s, const char *q)
|
||||
up = strchr(s, uc);
|
||||
lp = strchr(s, lc);
|
||||
|
||||
if (!( (intptr_t)up|(intptr_t)lp ))
|
||||
return 0;
|
||||
if (up == NULL || lp == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!lp || ( up && up < lp ))
|
||||
{
|
||||
@@ -100,12 +100,12 @@ nongnu_strcasestr (const char *s, const char *q)
|
||||
if (trycmp(ppa, cpa, q, qn) == 0)
|
||||
return (*ppa);
|
||||
|
||||
if (!( (intptr_t)up|(intptr_t)lp ))
|
||||
if (up == NULL || lp == NULL)
|
||||
break;
|
||||
|
||||
if (!(*ppa) || ( (*ppb) && (*ppb) < (*ppa) ))
|
||||
swapp(&ppa, &ppb, &cpa, &cpb);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
+9
-9
@@ -716,12 +716,12 @@ static lumpinfo_t* ResGetLumpsZip(FILE* handle, UINT16* nlmp)
|
||||
strlcpy(fullname, reinterpret_cast<char *>(zentry + 1), SHORT(zentry->namelen) + 1);
|
||||
|
||||
// Strip away file address and extension for the 8char name.
|
||||
if ((trimname = strrchr(fullname, '/')) != 0)
|
||||
if ((trimname = strrchr(fullname, '/')) != NULL)
|
||||
trimname++;
|
||||
else
|
||||
trimname = fullname; // Care taken for root files.
|
||||
|
||||
if ((dotpos = strrchr(trimname, '.')) == 0)
|
||||
if ((dotpos = strrchr(trimname, '.')) == NULL)
|
||||
dotpos = fullname + strlen(fullname); // Watch for files without extension.
|
||||
|
||||
memset(lump_p->name, '\0', 9); // Making sure they're initialized to 0. Is it necessary?
|
||||
@@ -1678,9 +1678,9 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
||||
if (fread(rawData, 1, rawSize, handle) < rawSize)
|
||||
I_Error("wad %d, lump %d: cannot read compressed data", wad, lump);
|
||||
|
||||
strm.zalloc = Z_NULL;
|
||||
strm.zfree = Z_NULL;
|
||||
strm.opaque = Z_NULL;
|
||||
strm.zalloc = NULL;
|
||||
strm.zfree = NULL;
|
||||
strm.opaque = NULL;
|
||||
|
||||
strm.total_in = strm.avail_in = rawSize;
|
||||
strm.total_out = strm.avail_out = decSize;
|
||||
@@ -2252,14 +2252,14 @@ static int W_VerifyPK3(FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
strlcpy(fullname, reinterpret_cast<char *>(zentry + 1), SHORT(zentry->namelen) + 1);
|
||||
|
||||
// Strip away file address and extension for the 8char name.
|
||||
if ((trimname = strrchr(fullname, '/')) != 0)
|
||||
if ((trimname = strrchr(fullname, '/')) != NULL)
|
||||
trimname++;
|
||||
else
|
||||
trimname = fullname; // Care taken for root files.
|
||||
|
||||
if (*trimname) // Ignore directories, well kinda
|
||||
{
|
||||
if ((dotpos = strrchr(trimname, '.')) == 0)
|
||||
if ((dotpos = strrchr(trimname, '.')) == NULL)
|
||||
dotpos = fullname + strlen(fullname); // Watch for files without extension.
|
||||
|
||||
memset(lumpname, '\0', 9); // Making sure they're initialized to 0. Is it necessary?
|
||||
@@ -2497,14 +2497,14 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
strlcpy(fullname, reinterpret_cast<char *>(zentry + 1), SHORT(zentry->namelen) + 1);
|
||||
|
||||
// Strip away file address and extension for the 8char name.
|
||||
if ((trimname = strrchr(fullname, '/')) != 0)
|
||||
if ((trimname = strrchr(fullname, '/')) != NULL)
|
||||
trimname++;
|
||||
else
|
||||
trimname = fullname; // Care taken for root files.
|
||||
|
||||
if (*trimname) // Ignore directories, well kinda
|
||||
{
|
||||
if ((dotpos = strrchr(trimname, '.')) == 0)
|
||||
if ((dotpos = strrchr(trimname, '.')) == NULL)
|
||||
dotpos = fullname + strlen(fullname); // Watch for files without extension.
|
||||
|
||||
memset(lumpname, '\0', 9); // Making sure they're initialized to 0. Is it necessary?
|
||||
|
||||
+4
-4
@@ -104,7 +104,7 @@ typedef struct
|
||||
} y_voteclient;
|
||||
|
||||
// votescreen stuff
|
||||
votescreen_t VoteScreen = {0};
|
||||
votescreen_t VoteScreen = {};
|
||||
|
||||
static y_votelvlinfo levelinfo[5];
|
||||
static y_voteclient voteclient;
|
||||
@@ -1093,7 +1093,7 @@ void Y_VoteDrawer(void)
|
||||
V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, pic);
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, NULL);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
||||
}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ void Y_VoteDrawer(void)
|
||||
V_DrawTinyScaledPatch(BASEVIDWIDTH-60, y, V_SNAPTORIGHT, pic);
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, NULL);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
||||
}
|
||||
|
||||
@@ -1164,7 +1164,7 @@ void Y_VoteDrawer(void)
|
||||
V_DrawTinyScaledPatch(x, y, V_SNAPTOLEFT, pic);
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
|
||||
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, NULL);
|
||||
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, VoteScreen.rubyicon, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user