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;