Browse Source

xash3d_types: start refactoring engine to use stdint.h types

pull/2/head
Alibek Omarov 5 years ago
parent
commit
8d942bcc86
  1. 10
      common/xash3d_types.h
  2. 4
      engine/common/identification.c
  3. 16
      engine/common/netchan.h
  4. 2
      mainui

10
common/xash3d_types.h

@ -7,6 +7,7 @@
#endif // _WIN32 #endif // _WIN32
#include <sys/types.h> // off_t #include <sys/types.h> // off_t
#include STDINT_H
typedef unsigned char byte; typedef unsigned char byte;
typedef int sound_t; typedef int sound_t;
@ -29,14 +30,7 @@ typedef enum { false, true } qboolean;
typedef int qboolean; typedef int qboolean;
#endif #endif
#if _MSC_VER == 1200 typedef uint64_t longtime_t;
typedef __int64 integer64; //msvc6
#elif defined (XASH_SDL) && !defined(REF_DLL)
typedef Uint64 integer64;
#else
typedef unsigned long long integer64;
#endif
typedef integer64 longtime_t;
#define MAX_STRING 256 // generic string #define MAX_STRING 256 // generic string
#define MAX_INFO_STRING 256 // infostrings are transmitted across network #define MAX_INFO_STRING 256 // infostrings are transmitted across network

4
engine/common/identification.c

@ -29,7 +29,7 @@ should be enough to determine if device exist in identifier
========================================================== ==========================================================
*/ */
typedef integer64 bloomfilter_t; typedef uint64_t bloomfilter_t;
static bloomfilter_t id; static bloomfilter_t id;
@ -48,7 +48,7 @@ bloomfilter_t BloomFilter_Process( const char *buffer, int size )
while( crc32 ) while( crc32 )
{ {
value |= ((integer64)1) << ( crc32 & bf64_mask ); value |= ((uint64_t)1) << ( crc32 & bf64_mask );
crc32 = crc32 >> 6; crc32 = crc32 >> 6;
} }

16
engine/common/netchan.h

@ -113,9 +113,9 @@ GNU General Public License for more details.
typedef struct netsplit_chain_packet_s typedef struct netsplit_chain_packet_s
{ {
// bool vector // bool vector
unsigned int recieved_v[8]; uint32_t recieved_v[8];
// serial number // serial number
unsigned int id; uint32_t id;
byte data[NET_MAX_PAYLOAD]; byte data[NET_MAX_PAYLOAD];
byte received; byte received;
byte count; byte count;
@ -124,10 +124,10 @@ typedef struct netsplit_chain_packet_s
// raw packet format // raw packet format
typedef struct netsplit_packet_s typedef struct netsplit_packet_s
{ {
unsigned int signature; // 0xFFFFFFFE uint32_t signature; // 0xFFFFFFFE
unsigned int length; uint32_t length;
unsigned int part; uint32_t part;
unsigned int id; uint32_t id;
// max 256 parts // max 256 parts
byte count; byte count;
byte index; byte index;
@ -138,8 +138,8 @@ typedef struct netsplit_packet_s
typedef struct netsplit_s typedef struct netsplit_s
{ {
netsplit_chain_packet_t packets[NETSPLIT_BACKUP]; netsplit_chain_packet_t packets[NETSPLIT_BACKUP];
integer64 total_received; uint64_t total_received;
integer64 total_received_uncompressed; uint64_t total_received_uncompressed;
} netsplit_t; } netsplit_t;
// packet splitting // packet splitting

2
mainui

@ -1 +1 @@
Subproject commit 9ef06db97fd612c820674c399db757d00176ada5 Subproject commit f7bde4076321a5e9172a91e789d45dd643c6840e
Loading…
Cancel
Save