From 2e51a9f72fde9cf7b8c28b96e39f92858ae7885c Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 30 Jan 2023 20:21:17 +0000 Subject: [PATCH] silencing static analysis warnings. --- src/client/refresh/files/pcx.c | 2 +- src/client/refresh/soft/sw_poly.c | 2 +- src/common/netchan.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/refresh/files/pcx.c b/src/client/refresh/files/pcx.c index b09602b1..6ce5cb15 100644 --- a/src/client/refresh/files/pcx.c +++ b/src/client/refresh/files/pcx.c @@ -340,7 +340,7 @@ GetPCXPalette (byte **colormap, unsigned *d_8to24table) g = pal[i*3+1]; b = pal[i*3+2]; - v = (255<<24) + (r<<0) + (g<<8) + (b<<16); + v = (255U<<24) + (r<<0) + (g<<8) + (b<<16); d_8to24table[i] = LittleLong(v); } diff --git a/src/client/refresh/soft/sw_poly.c b/src/client/refresh/soft/sw_poly.c index e5b02d58..da130009 100644 --- a/src/client/refresh/soft/sw_poly.c +++ b/src/client/refresh/soft/sw_poly.c @@ -518,9 +518,9 @@ static int R_ClipPolyFace (int nump, clipplane_t *pclipplane) { int i, outcount; - float dists[MAXWORKINGVERTS+3]; float frac, clipdist, *pclipnormal; float *in, *instep, *outstep, *vert2; + float dists[MAXWORKINGVERTS+3] = {0}; clipdist = pclipplane->dist; pclipnormal = pclipplane->normal; diff --git a/src/common/netchan.c b/src/common/netchan.c index ed1c01c3..773f8c0e 100644 --- a/src/common/netchan.c +++ b/src/common/netchan.c @@ -250,10 +250,10 @@ Netchan_Transmit(netchan_t *chan, int length, byte *data) /* write the packet header */ SZ_Init(&send, send_buf, sizeof(send_buf)); - w1 = (chan->outgoing_sequence & ~(1 << 31)) | (send_reliable << 31); + w1 = (chan->outgoing_sequence & ~(1U << 31)) | (send_reliable << 31); w2 = (chan->incoming_sequence & - ~(1 << 31)) | (chan->incoming_reliable_sequence << 31); + ~(1U << 31)) | (chan->incoming_reliable_sequence << 31); chan->outgoing_sequence++; chan->last_sent = curtime; @@ -330,8 +330,8 @@ Netchan_Process(netchan_t *chan, sizebuf_t *msg) reliable_message = sequence >> 31; reliable_ack = sequence_ack >> 31; - sequence &= ~(1 << 31); - sequence_ack &= ~(1 << 31); + sequence &= ~(1U << 31); + sequence_ack &= ~(1U << 31); if (showpackets->value) {