engine: fix some left shifts on signed integers

This commit is contained in:
Alibek Omarov
2021-01-02 05:01:51 +03:00
parent 33ba1f25f3
commit 61fe9fd1fe
4 changed files with 69 additions and 69 deletions

View File

@@ -253,7 +253,7 @@ int contest( int r, int g, int b )
// finds best neuron (min dist-bias) and returns position
// for frequently chosen neurons, freq[i] is high and bias[i] is negative
// bias[i] = gamma * ((1 / netsize) - freq[i])
bestd = ~(1<<31);
bestd = INT_MAX;
bestbiasd = bestd;
bestpos = -1;
bestbiaspos = bestpos;

View File

@@ -223,13 +223,13 @@ typedef struct netchan_s
double cleartime; // if realtime > cleartime, free to send next packet
// Sequencing variables
int incoming_sequence; // increasing count of sequence numbers
int incoming_acknowledged; // # of last outgoing message that has been ack'd.
int incoming_reliable_acknowledged; // toggles T/F as reliable messages are received.
int incoming_reliable_sequence; // single bit, maintained local
int outgoing_sequence; // message we are sending to remote
int reliable_sequence; // whether the message contains reliable payload, single bit
int last_reliable_sequence; // outgoing sequence number of last send that had reliable data
unsigned int incoming_sequence; // increasing count of sequence numbers
unsigned int incoming_acknowledged; // # of last outgoing message that has been ack'd.
unsigned int incoming_reliable_acknowledged; // toggles T/F as reliable messages are received.
unsigned int incoming_reliable_sequence; // single bit, maintained local
unsigned int outgoing_sequence; // message we are sending to remote
unsigned int reliable_sequence; // whether the message contains reliable payload, single bit
unsigned int last_reliable_sequence; // outgoing sequence number of last send that had reliable data
// callback to get actual framgment size
void *client;

View File

@@ -82,14 +82,14 @@ Studio models are position independent, so the cache manager can move them.
#define STUDIO_NF_TWOSIDE 0x1000 // render mesh as twosided
#define STUDIO_NF_HEIGHTMAP 0x2000
#define STUDIO_NF_NODRAW (1<<16) // failed to create shader for this mesh
#define STUDIO_NF_NODLIGHT (1<<17) // failed to create dlight shader for this mesh
#define STUDIO_NF_NOSUNLIGHT (1<<18) // failed to create sun light shader for this mesh
#define STUDIO_NF_NODRAW (1U<<16) // failed to create shader for this mesh
#define STUDIO_NF_NODLIGHT (1U<<17) // failed to create dlight shader for this mesh
#define STUDIO_NF_NOSUNLIGHT (1U<<18) // failed to create sun light shader for this mesh
#define STUDIO_NF_HAS_ALPHA (1<<20) // external texture has alpha-channel
#define STUDIO_NF_HAS_DETAIL (1<<21) // studiomodels has detail textures
#define STUDIO_NF_COLORMAP (1<<30) // internal system flag
#define STUDIO_NF_UV_COORDS (1<<31) // using half-float coords instead of ST
#define STUDIO_NF_HAS_ALPHA (1U<<20) // external texture has alpha-channel
#define STUDIO_NF_HAS_DETAIL (1U<<21) // studiomodels has detail textures
#define STUDIO_NF_COLORMAP (1U<<30) // internal system flag
#define STUDIO_NF_UV_COORDS (1U<<31) // using half-float coords instead of ST
// motion flags
#define STUDIO_X 0x0001