- Silence all the -Wuninitialized and -Wmaybe-uninitialized warnings relating to HitInfo objects passed through to functions by reference.

This commit is contained in:
Mitchell Richters 2021-12-06 22:24:22 +11:00 committed by Christoph Oelckers
parent c6774d5efd
commit 0c6e55d1b8
19 changed files with 39 additions and 39 deletions

View file

@ -5075,7 +5075,7 @@ int furthestangle(DDukeActor *actor, int angs)
auto s = actor->s;
int j, furthest_angle = 0, angincs;
int d, greatestd;
HitInfo hit;
HitInfo hit{};
greatestd = -(1 << 30);
angincs = 2048 / angs;
@ -5109,7 +5109,7 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, int* dax, int* day
auto s = actor->s;
int j, angincs;
int d, da;//, d, cd, ca,tempx,tempy,cx,cy;
HitInfo hit;
HitInfo hit{};
if ((actor->temp_data[0] & 63)) return -1;

View file

@ -2452,7 +2452,7 @@ int ParseState::parse(void)
insptr++;
if( g_sp->sector()->lotag == 0 )
{
HitInfo hit;
HitInfo hit{};
neartag({ g_sp->x, g_sp->y, g_sp->z - (32 << 8) }, g_sp->sector(), g_sp->ang, hit, 768, 1);
auto sectp = hit.hitSector;
if (sectp)

View file

@ -170,7 +170,7 @@ int hits(DDukeActor* actor)
{
auto sp = actor->s;
int zoff;
HitInfo hit;
HitInfo hit{};
if (sp->picnum == TILE_APLAYER) zoff = isRR() ? PHEIGHT_RR : PHEIGHT_DUKE;
else zoff = 0;
@ -189,7 +189,7 @@ int hitasprite(DDukeActor* actor, DDukeActor** hitsp)
{
auto sp = actor->s;
int zoff;
HitInfo hit;
HitInfo hit{};
if (badguy(actor))
zoff = (42 << 8);
@ -213,7 +213,7 @@ int hitasprite(DDukeActor* actor, DDukeActor** hitsp)
int hitawall(struct player_struct* p, walltype** hitw)
{
HitInfo hit;
HitInfo hit{};
hitscan(p->pos, p->cursector, { p->angle.ang.bcos(), p->angle.ang.bsin(), 0 }, hit, CLIPMASK0);
if (hitw) *hitw = hit.hitWall;
@ -993,7 +993,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
spritetype* const s = actor->s;
auto sectp = s->sector();
int zvel;
HitInfo hit;
HitInfo hit{};
if (p >= 0)
sa += 64 - (krand() & 127);

View file

@ -236,7 +236,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
auto s = actor->s;
auto sectp = s->sector();
int zvel;
HitInfo hit;
HitInfo hit{};
if (p >= 0)
{
@ -323,7 +323,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
auto s = actor->s;
auto sectp = s->sector();
int zvel = 0;
HitInfo hit;
HitInfo hit{};
if (s->extra >= 0) s->shade = -96;
@ -854,7 +854,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
auto sectp = s->sector();
int zvel;
int j;
HitInfo hit;
HitInfo hit{};
if (p >= 0)
zvel = -ps[p].horizon.sum().asq16() >> 11;
@ -925,7 +925,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
auto sect = s->sector();
int zvel;
int k;
HitInfo hit;
HitInfo hit{};
if (p >= 0)
{
@ -2024,7 +2024,7 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
int operateTripbomb(int snum)
{
auto p = &ps[snum];
HitInfo hit;
HitInfo hit{};
hitscan(p->pos, p->cursector, { p->angle.ang.bcos(), p->angle.ang.bsin(), -p->horizon.sum().asq16() >> 11 }, hit, CLIPMASK1);

View file

@ -88,7 +88,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
spritetype* const s = actor->s;
auto sectp = s->sector();
int zvel;
HitInfo hit;
HitInfo hit{};
if (p >= 0)
{
@ -208,7 +208,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
auto s = actor->s;
auto sectp = s->sector();
int zvel = 0;
HitInfo hit;
HitInfo hit{};
if (s->extra >= 0) s->shade = -96;

View file

@ -444,7 +444,7 @@ MOVEEND:
else
{
vec3_t startPos = { x, y, z };
HitInfo hit;
HitInfo hit{};
int dz;
if (bVanilla)
dz = -bsin(pBullet->nPitch, 3);

View file

@ -249,7 +249,7 @@ Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, sectortype* *ppSe
int xVect = bcos(ang);
int yVect = bsin(ang);
HitInfo hit;
HitInfo hit{};
hitscan({ *x, *y, *z }, *ppSector, { xVect, yVect, 0 }, hit, CLIPMASK1);
int ecx = bsin(150, -3);

View file

@ -400,7 +400,7 @@ void AILion::Tick(RunListEvent* ev)
for (int i = 0; i < 5; i++)
{
HitInfo hit;
HitInfo hit{};
hitscan({ x, y, z }, pSprite->sector(), { bcos(nScanAngle), bsin(nScanAngle), 0 }, hit, CLIPMASK1);

View file

@ -130,7 +130,7 @@ void BuildSnake(int nPlayer, int zVal)
int z = (pPlayerSprite->z + zVal) - 2560;
int nAngle = pPlayerSprite->ang;
HitInfo hit;
HitInfo hit{};
hitscan({ x, y, z }, pPlayerSprite->sector(), { bcos(nAngle), bsin(nAngle), 0 }, hit, CLIPMASK1);
uint32_t yDiff = abs(hit.hitpos.y - y);

View file

@ -242,7 +242,7 @@ int CanHitPlayer(DSWActor* actor)
{
USERp u = actor->u();
SPRITEp sp = &actor->s();
HitInfo hit;
HitInfo hit{};
int xvect,yvect,zvect;
int ang;
// if actor can still see the player

View file

@ -904,7 +904,7 @@ void
CircleCamera(int *nx, int *ny, int *nz, sectortype** vsect, binangle *nang, fixed_t q16horiz)
{
SPRITEp sp;
HitInfo hit;
HitInfo hit{};
int i, vx, vy, vz, hx, hy;
int bakcstat, daang;
PLAYERp pp = &Player[screenpeek];

View file

@ -2655,7 +2655,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
if (RectClip)
{
HitInfo hit;
HitInfo hit{};
int vel;
int ret;
@ -3418,7 +3418,7 @@ void DoPlayerClimb(PLAYERp pp)
int DoPlayerWadeSuperJump(PLAYERp pp)
{
HitInfo hit;
HitInfo hit{};
unsigned i;
//short angs[3];
static short angs[3] = {0, 0, 0};

View file

@ -935,7 +935,7 @@ int InitRipperHang(DSWActor* actor)
SPRITEp sp = &actor->s();
int dist;
HitInfo hit;
HitInfo hit{};
bool Found = false;
short dang, tang;

View file

@ -938,7 +938,7 @@ int InitRipper2Hang(DSWActor* actor)
SPRITEp sp = &actor->s();
int dist;
HitInfo hit;
HitInfo hit{};
bool Found = false;
short dang, tang;

View file

@ -282,7 +282,7 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects,
else
zvect = 0;
HitInfo hit;
HitInfo hit{};
hitscan(s, sects, { xvect, yvect, zvect }, hit, CLIPMASK_MISSILE);
if (hit.hitSector == nullptr)

View file

@ -2053,7 +2053,7 @@ bool NearThings(PLAYERp pp)
}
// This only gets called if nothing else worked, check for nearness to a wall
{
HitInfo hit;
HitInfo hit{};
short dang = pp->angle.ang.asbuild();
FAFhitscan(pp->posx, pp->posy, pp->posz - Z(30), pp->cursector, // Start position

View file

@ -1935,7 +1935,7 @@ void SpriteSetup(void)
case SECT_WALL_PAN_SPEED:
{
vec3_t hit_pos = { sp->x, sp->y, sp->z - Z(8) };
HitInfo hit;
HitInfo hit{};
hitscan(hit_pos, sp->sector(), // Start position
{ bcos(sp->ang), bsin(sp->ang), 0 }, hit, CLIPMASK_MISSILE);
@ -1964,7 +1964,7 @@ void SpriteSetup(void)
case WALL_DONT_STICK:
{
vec3_t hit_pos = { sp->x, sp->y, sp->z - Z(8) };
HitInfo hit;
HitInfo hit{};
hitscan(hit_pos, sp->sector(), // Start position
{ bcos(sp->ang), bsin(sp->ang), 0 }, hit, CLIPMASK_MISSILE);

View file

@ -3109,7 +3109,7 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
if (u->ActorActionSet->Jump)
{
int zdiff;
HitInfo hit;
HitInfo hit{};
sp->ang = tpoint->ang;

View file

@ -4478,7 +4478,7 @@ bool WeaponMoveHit(DSWActor* actor)
// clipmove does not correctly return the sprite for WALL sprites
// on walls, so look with hitscan
HitInfo hit;
HitInfo hit{};
hitscan(sp->pos, sp->sector(), { bcos(sp->ang), bsin(sp->ang), sp->zvel }, hit, CLIPMASK_MISSILE);
if (!hit.hitSector)
@ -12526,7 +12526,7 @@ int InitSwordAttack(PLAYERp pp)
// all this is to break glass
{
HitInfo hit;
HitInfo hit{};
short daang;
int daz;
@ -12716,7 +12716,7 @@ int InitFistAttack(PLAYERp pp)
// all this is to break glass
{
HitInfo hit;
HitInfo hit{};
short daang;
int daz;
@ -13492,7 +13492,7 @@ void InitHeartAttack(PLAYERp pp)
int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang, int xvect, int yvect, int zvect)
{
HitInfo hit;
HitInfo hit{};
USERp u = pp->Actor()->u();
FAFhitscan(x, y, z, sect,
@ -13575,7 +13575,7 @@ int InitShotgun(PLAYERp pp)
USERp u = pp->Actor()->u();
auto sp = &pp->Actor()->s();
short daang,ndaang, i;
HitInfo hit;
HitInfo hit{};
int daz, ndaz;
int nx,ny,nz;
int xvect,yvect,zvect;
@ -16129,7 +16129,7 @@ int InitUzi(PLAYERp pp)
SPRITEp wp, hsp;
USERp wu;
short daang;
HitInfo hit;
HitInfo hit{};
int daz, nz;
int xvect,yvect,zvect;
short cstat = 0;
@ -16699,7 +16699,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp)
USERp u = actor->u();
SPRITEp sp = &actor->s();
short daang;
HitInfo hit;
HitInfo hit{};
int daz;
int nx,ny,nz;
short cstat = 0;
@ -17067,7 +17067,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop)
{
SPRITEp hsp;
short daang, i;
HitInfo hit;
HitInfo hit{};
int daz;
int nx,ny,nz;
short cstat = 0;
@ -17233,7 +17233,7 @@ int InitEnemyUzi(DSWActor* actor)
SPRITEp sp = &actor->s(), wp;
USERp wu;
short daang;
HitInfo hit;
HitInfo hit{};
int daz;
int zh;
void InitUziShell(PLAYERp);
@ -18874,7 +18874,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
SPRITEp sp;
short rndnum;
int daz;
HitInfo hit;
HitInfo hit{};
USERp u = actor->u();