Created
April 29, 2024 04:33
-
-
Save icculus/8482db6c7376e7bbb453f43662a254b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e8744109411830081d1f4a6feaa8bbbfb2471d11 | |
Author: Ryan C. Gordon <[email protected]> | |
Date: Sun Jun 9 00:24:25 2019 -0400 | |
Huge pile of changes from long to int, for 64-bit support. | |
This is a hit-and-miss sort of thing, so there might be more to do, but this | |
(probably) won't make anything worse, as Descent 3 already expected long and | |
int to be the same size. | |
It's also not clear if this fixed anything yet, but better to get this out of | |
the way, as I don't intend to do any 32-bit builds. | |
(Except maybe Emscripten, lol.) | |
diff --git a/Main/MusicTester/stereoaudiotaunts.cpp b/Main/MusicTester/stereoaudiotaunts.cpp | |
index e6f5e34..5e77bda 100644 | |
--- a/Main/MusicTester/stereoaudiotaunts.cpp | |
+++ b/Main/MusicTester/stereoaudiotaunts.cpp | |
@@ -474,11 +474,11 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
cfptr = NULL; | |
char format_type[80]; // ASCII name of format type | |
unsigned short fmttag = 0; // Numerical format type | |
- unsigned long ckid; // Current chunk's ID | |
- unsigned long cksize; // Current chunk's size in bytes | |
- unsigned long filesize; // Size of the sound file | |
- unsigned long nextseek = 0; // Location of the next seek | |
- unsigned long aligned_size; // Sound files are aligned to SOUND_FILE_SAMPLE_ALIGNMENT samples | |
+ unsigned int ckid; // Current chunk's ID | |
+ unsigned int cksize; // Current chunk's size in bytes | |
+ unsigned int filesize; // Size of the sound file | |
+ unsigned int nextseek = 0; // Location of the next seek | |
+ unsigned int aligned_size; // Sound files are aligned to SOUND_FILE_SAMPLE_ALIGNMENT samples | |
// Sound format information | |
int samples_per_second; | |
@@ -486,8 +486,8 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
short number_channels; | |
char error_code = 0; | |
- // Used to read temporary long values | |
- unsigned long temp_long; | |
+ // Used to read temporary int values | |
+ unsigned int temp_int; | |
// Flags for if we previously read data or a format | |
char f_data, f_fmt = 0; | |
@@ -503,8 +503,8 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
} | |
// Make sure that it is a RIFF format | |
- temp_long = (unsigned long) cf_ReadInt(cfptr); | |
- if(temp_long != 0x46464952) | |
+ temp_int = (unsigned int) cf_ReadInt(cfptr); | |
+ if(temp_int != 0x46464952) | |
{ | |
error_code = 2; | |
mprintf((0, "TAUNT: Wav Load: %s is not a RIFF format file\n", filename)); | |
@@ -516,8 +516,8 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
filesize += cftell(cfptr); | |
// Make sure it is a wave file | |
- temp_long = (unsigned long) cf_ReadInt(cfptr); | |
- if(temp_long != 0x45564157) | |
+ temp_int = (unsigned int) cf_ReadInt(cfptr); | |
+ if(temp_int != 0x45564157) | |
{ | |
error_code = 3; | |
mprintf((0, "TAUNT: Wav Load: %s is not a WAVE file\n", filename)); | |
diff --git a/Main/TableCompare/hogbuild.cpp b/Main/TableCompare/hogbuild.cpp | |
index 9c5d056..d65785c 100644 | |
--- a/Main/TableCompare/hogbuild.cpp | |
+++ b/Main/TableCompare/hogbuild.cpp | |
@@ -14,7 +14,7 @@ typedef struct { | |
char name[PSFILENAME_LEN+1]; //just the filename part | |
int offset; //offset into library file | |
int length; //length of this file | |
- ulong timestamp; //time and date of file | |
+ unsigned int timestamp; //time and date of file | |
int flags; //misc flags | |
} library_entry; | |
diff --git a/Main/adecode.c b/Main/adecode.c | |
index 9438151..254214b 100644 | |
--- a/Main/adecode.c | |
+++ b/Main/adecode.c | |
@@ -100,7 +100,7 @@ static unsigned char ByteReaderFill(byte_reader *bytes) | |
typedef struct { | |
byte_reader bytes; | |
- unsigned long data; | |
+ unsigned int data; | |
int bitcnt; | |
} bit_reader; | |
@@ -142,8 +142,8 @@ typedef struct _AudioDecoder { | |
int subbands; // 2^Levels | |
int samples_per_subband; // # of samples in each subband | |
int total_samples; // subbands * samples_per_subband | |
- long *prev_samples; // subbands*1.5 entries, previous samples in each subband | |
- long *samples; // total_samples, samples to be untransformed in place | |
+ int *prev_samples; // subbands*1.5 entries, previous samples in each subband | |
+ int *samples; // total_samples, samples to be untransformed in place | |
int block_samples_per_subband;// number of samples to process at a time per subband >=1 | |
int block_total_samples; // subbands * block_samples_per_subband | |
@@ -151,8 +151,8 @@ typedef struct _AudioDecoder { | |
unsigned channels; | |
unsigned rate; | |
- long file_cnt; | |
- long *samp_ptr; | |
+ int file_cnt; | |
+ int *samp_ptr; | |
int samp_cnt; | |
} AudioDecoder; | |
@@ -191,10 +191,10 @@ static void init_pack_tables(void) | |
#define READBAND_SETUP(ad, subband, scale_min) \ | |
short *scale = AudioDecoder_scale0; \ | |
short *readband_scale = scale + (scale_min); \ | |
- long *readband_dst = ad->samples + subband; \ | |
+ int *readband_dst = ad->samples + subband; \ | |
int readband_step = ad->subbands; \ | |
int readband_cnt = ad->samples_per_subband; \ | |
- long fval; \ | |
+ int fval; \ | |
int val; | |
#define READBAND_STORE_0() \ | |
@@ -580,7 +580,7 @@ static int ReadBands(AudioDecoder *ad) | |
short scale_step; | |
int i, mx; | |
short *s; | |
- long sum; | |
+ int sum; | |
// Initialize scaling table | |
bits_getn(ad->bits, 4, maxbits); // Max # of bits - 1 used to index scale | |
@@ -618,9 +618,9 @@ static int ReadBands(AudioDecoder *ad) | |
// Prv values at level0 can be stored in 16-bits instead of 32-bits, | |
// for a significant savings in space, helping things to stay in the cpu cache. | |
// count will always be a multiple of 2 | |
-static void untransform_subband0(short *prv, long *buf, int step, int count) | |
+static void untransform_subband0(short *prv, int *buf, int step, int count) | |
{ | |
- long l1,h1, l2,h2; | |
+ int l1,h1, l2,h2; | |
int i; | |
int step3; | |
@@ -653,7 +653,7 @@ static void untransform_subband0(short *prv, long *buf, int step, int count) | |
else | |
for (count>>=1, i=step; i; --i, prv+=2, ++buf) | |
{ int c=count; | |
- long *b = buf; | |
+ int *b = buf; | |
if (c&1) | |
{ l2 = prv[0]; | |
h2 = prv[1]; | |
@@ -693,9 +693,9 @@ static void untransform_subband0(short *prv, long *buf, int step, int count) | |
} | |
// count will always be a multiple of 4 | |
-static void untransform_subband(long *prv, long *buf, int step, int count) | |
+static void untransform_subband(int *prv, int *buf, int step, int count) | |
{ | |
- long l1,h1, l2,h2; | |
+ int l1,h1, l2,h2; | |
int step3; | |
int i; | |
@@ -718,7 +718,7 @@ static void untransform_subband(long *prv, long *buf, int step, int count) | |
else | |
for (count>>=2, i=step; i; --i, prv+=2, ++buf) | |
{ int c=count; | |
- long *b = buf; | |
+ int *b = buf; | |
l1 = prv[0]; | |
h1 = prv[1]; | |
@@ -746,7 +746,7 @@ static void untransform_subband(long *prv, long *buf, int step, int count) | |
static void untransform_all(AudioDecoder *ad) | |
{ | |
int rem_samples_per_subband; | |
- long *buf_base; | |
+ int *buf_base; | |
if (!ad->levels) return; | |
@@ -755,11 +755,11 @@ static void untransform_all(AudioDecoder *ad) | |
rem_samples_per_subband>0; | |
rem_samples_per_subband -= ad->block_samples_per_subband, | |
buf_base += ad->block_total_samples) | |
- { long *prv = ad->prev_samples; | |
+ { int *prv = ad->prev_samples; | |
int step = ad->subbands>>1; | |
int count; | |
int i; | |
- long *buf; | |
+ int *buf; | |
count = ad->block_samples_per_subband; | |
if (rem_samples_per_subband < count) | |
@@ -802,7 +802,7 @@ static int AudioDecoder_fill(AudioDecoder *ad) | |
unsigned AudioDecoder_Read(AudioDecoder *ad, void *buf, unsigned qty) | |
{ | |
int levels = ad->levels; | |
- long *samp_ptr = ad->samp_ptr; | |
+ int *samp_ptr = ad->samp_ptr; | |
int samp_cnt = ad->samp_cnt; | |
short *dst = (short *)buf; | |
unsigned i; | |
@@ -844,9 +844,9 @@ void AudioDecoder_Close(AudioDecoder *ad) | |
AudioDecoder *Create_AudioDecoder(ReadFunction *reader, void *data, | |
unsigned *pChannels, unsigned *pSampleRate, | |
- long *pSampleCount) | |
+ int *pSampleCount) | |
{ | |
- unsigned long tmp; | |
+ unsigned int tmp; | |
int prev_samples_length; | |
AudioDecoder *ad = (AudioDecoder *)(*pMalloc)(sizeof(AudioDecoder)); | |
@@ -907,11 +907,11 @@ AudioDecoder *Create_AudioDecoder(ReadFunction *reader, void *data, | |
ad->block_total_samples = ad->subbands * ad->block_samples_per_subband; | |
if (prev_samples_length) | |
- { ad->prev_samples = (long *)(*pMalloc)(prev_samples_length * sizeof(long)); | |
+ { ad->prev_samples = (int *)(*pMalloc)(prev_samples_length * sizeof(int)); | |
if (!ad->prev_samples) goto fail; | |
- memset(ad->prev_samples, 0, prev_samples_length * sizeof(long)); | |
+ memset(ad->prev_samples, 0, prev_samples_length * sizeof(int)); | |
} | |
- ad->samples = (long *)(*pMalloc)(ad->total_samples * sizeof(long)); | |
+ ad->samples = (int *)(*pMalloc)(ad->total_samples * sizeof(int)); | |
if (!ad->samples) goto fail; | |
ad->samp_cnt = 0; | |
if (AudioDecoder_cnt==1) | |
diff --git a/Main/adecode.h b/Main/adecode.h | |
index bfb2ca9..a4dfa3b 100644 | |
--- a/Main/adecode.h | |
+++ b/Main/adecode.h | |
@@ -45,7 +45,7 @@ typedef struct _AudioDecoder AudioDecoder; | |
AudioDecoder * __cdecl Create_AudioDecoder( | |
ReadFunction *reader, void *data, | |
unsigned *pChannels, unsigned *pSampleRate, | |
- long *pSampleCount); | |
+ int *pSampleCount); | |
// Read from audio decoder at most the specified qty of bytes | |
// (each sample takes two bytes). | |
diff --git a/Main/audio_encode/encoder.cpp b/Main/audio_encode/encoder.cpp | |
index eac9e86..88048f3 100755 | |
--- a/Main/audio_encode/encoder.cpp | |
+++ b/Main/audio_encode/encoder.cpp | |
@@ -26,7 +26,7 @@ | |
#include "mono.h" | |
#include "Aencode.h" //Interplay library | |
-long __cdecl aenc_ReadSamp(void *data) | |
+int __cdecl aenc_ReadSamp(void *data) | |
{ | |
FILE *f = (FILE *)data; | |
int a,b; | |
@@ -40,7 +40,7 @@ long __cdecl aenc_ReadSamp(void *data) | |
int aenc_Compress(char *input_filename,char *output_filename,int *input_levels,int *input_samples,int *input_rate,int *input_channels,float *input_factor,float *input_volscale) | |
{ | |
FILE *in, *out; | |
- long result; | |
+ int result; | |
int levels, samples_per_subband; | |
unsigned sample_rate, channels; | |
diff --git a/Main/audiotaunts.cpp b/Main/audiotaunts.cpp | |
index 2ba9cea..241b87b 100644 | |
--- a/Main/audiotaunts.cpp | |
+++ b/Main/audiotaunts.cpp | |
@@ -560,11 +560,11 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
cfptr = NULL; | |
char format_type[80]; // ASCII name of format type | |
unsigned short fmttag = 0; // Numerical format type | |
- unsigned long ckid; // Current chunk's ID | |
- unsigned long cksize; // Current chunk's size in bytes | |
- unsigned long filesize; // Size of the sound file | |
- unsigned long nextseek = 0; // Location of the next seek | |
- unsigned long aligned_size; // Sound files are aligned to SOUND_FILE_SAMPLE_ALIGNMENT samples | |
+ unsigned int ckid; // Current chunk's ID | |
+ unsigned int cksize; // Current chunk's size in bytes | |
+ unsigned int filesize; // Size of the sound file | |
+ unsigned int nextseek = 0; // Location of the next seek | |
+ unsigned int aligned_size; // Sound files are aligned to SOUND_FILE_SAMPLE_ALIGNMENT samples | |
// Sound format information | |
int samples_per_second; | |
@@ -572,8 +572,8 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
short number_channels; | |
char error_code = 0; | |
- // Used to read temporary long values | |
- unsigned long temp_long; | |
+ // Used to read temporary int values | |
+ unsigned int temp_int; | |
// Flags for if we previously read data or a format | |
char f_data, f_fmt = 0; | |
@@ -589,8 +589,8 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
} | |
// Make sure that it is a RIFF format | |
- temp_long = (unsigned long) cf_ReadInt(cfptr); | |
- if(temp_long != 0x46464952) | |
+ temp_int = (unsigned int) cf_ReadInt(cfptr); | |
+ if(temp_int != 0x46464952) | |
{ | |
error_code = 2; | |
mprintf((0, "TAUNT: Wav Load: %s is not a RIFF format file\n", filename)); | |
@@ -602,8 +602,8 @@ char taunt_LoadWaveFile(char *filename,tWaveFile *wave) | |
filesize += cftell(cfptr); | |
// Make sure it is a wave file | |
- temp_long = (unsigned long) cf_ReadInt(cfptr); | |
- if(temp_long != 0x45564157) | |
+ temp_int = (unsigned int) cf_ReadInt(cfptr); | |
+ if(temp_int != 0x45564157) | |
{ | |
error_code = 3; | |
mprintf((0, "TAUNT: Wav Load: %s is not a WAVE file\n", filename)); | |
diff --git a/Main/bitmap/iff.cpp b/Main/bitmap/iff.cpp | |
index 4fa658c..a28343c 100755 | |
--- a/Main/bitmap/iff.cpp | |
+++ b/Main/bitmap/iff.cpp | |
@@ -107,7 +107,7 @@ short iff_has_transparency; // 0=no transparency, 1=iff_transparent_color is val | |
#define MIN(a,b) ((a<b)?a:b) | |
-#define MAKE_SIG(a,b,c,d) (((long)(a)<<24)+((long)(b)<<16)+((c)<<8)+(d)) | |
+#define MAKE_SIG(a,b,c,d) (((int)(a)<<24)+((int)(b)<<16)+((c)<<8)+(d)) | |
#define IFF_SIG_FORM 1 | |
#define IFF_SIG_ILBM 2 | |
@@ -304,7 +304,7 @@ int bm_iff_parse_delta(CFILE *ifile,int len,iff_bitmap_header *bmheader) | |
{ | |
unsigned char *p=bmheader->raw_data; | |
int y; | |
- long chunk_end = cftell(ifile) + len; | |
+ int chunk_end = cftell(ifile) + len; | |
cf_ReadInt(ifile); //longword, seems to be equal to 4. Don't know what it is | |
@@ -589,8 +589,8 @@ int bm_iff_read_animbrush(const char *ifilename,int *bm_list) | |
CFILE *ifile; | |
iff_bitmap_header bm_headers[40]; | |
iff_bitmap_header *temp_bm_head; | |
- long sig,form_len; | |
- long form_type; | |
+ int sig,form_len; | |
+ int form_type; | |
int num_bitmaps=0; | |
int ret,i; | |
diff --git a/Main/cfile/CFILE.cpp b/Main/cfile/CFILE.cpp | |
index ac643a4..f16a9c8 100644 | |
--- a/Main/cfile/CFILE.cpp | |
+++ b/Main/cfile/CFILE.cpp | |
@@ -295,7 +295,7 @@ typedef struct { | |
char name[PSFILENAME_LEN+1]; //just the filename part | |
int offset; //offset into library file | |
int length; //length of this file | |
- ulong timestamp; //time and date of file | |
+ uint timestamp; //time and date of file | |
int flags; //misc flags | |
} library_entry; | |
typedef struct library { | |
diff --git a/Main/d3serial.cpp b/Main/d3serial.cpp | |
index b8b230d..348652e 100644 | |
--- a/Main/d3serial.cpp | |
+++ b/Main/d3serial.cpp | |
@@ -84,7 +84,7 @@ | |
static char name_copy[DESC_ID_LEN]; | |
-unsigned long d3_serialnum = 100000; | |
+unsigned int d3_serialnum = 100000; | |
//checks the exectuable (serialization) | |
int SerialCheck(void) | |
@@ -92,8 +92,8 @@ int SerialCheck(void) | |
char name2[] = DESC_ID_TAG "0000000000000000000000000000000000000000"; | |
char time_str[] = DESC_DEAD_TIME_TAG "00000000"; | |
int i, found; | |
- unsigned long *checksum, test_checksum; | |
- unsigned long *serialnum; | |
+ unsigned int *checksum, test_checksum; | |
+ unsigned int *serialnum; | |
time_t current_time, saved_time; | |
#ifdef DEMO | |
@@ -167,7 +167,7 @@ int SerialCheck(void) | |
char *checksum_ptr = desc_id_checksum_str + DESC_CHKSUM_TAG_LEN; | |
//compare generated checksum with that in the executable | |
- checksum = (unsigned long *)&(checksum_ptr[0]); | |
+ checksum = (unsigned int *)&(checksum_ptr[0]); | |
if (test_checksum != *checksum) | |
{ | |
return SERIAL_BAD_CHECKSUM; | |
@@ -176,7 +176,7 @@ int SerialCheck(void) | |
static char desc_id_serialnum_str[] = DESC_SERIALNUM_TAG "0000"; //4-byte serialnum | |
char *serialnum_ptr = desc_id_serialnum_str + DESC_SERIALNUM_TAG_LEN; | |
- serialnum = (unsigned long *)&(serialnum_ptr[0]); | |
+ serialnum = (unsigned int *)&(serialnum_ptr[0]); | |
d3_serialnum = *serialnum; | |
//this guy is ok, we can exit clean now | |
@@ -220,7 +220,7 @@ void SerialError(int error) | |
} | |
} | |
-unsigned long SerialGetSerialNum(void) | |
+unsigned int SerialGetSerialNum(void) | |
{ | |
return d3_serialnum; | |
} | |
diff --git a/Main/d3serial.h b/Main/d3serial.h | |
index f1625c6..95bc200 100644 | |
--- a/Main/d3serial.h | |
+++ b/Main/d3serial.h | |
@@ -63,7 +63,7 @@ int SerialCheck(void); | |
void SerialError(int error); | |
//returns the serialnumber of the user | |
-unsigned long SerialGetSerialNum(void); | |
+unsigned int SerialGetSerialNum(void); | |
///////////////////////////////////////////////////////////////////////////// | |
// These are the functions used for serialization | |
diff --git a/Main/ddio_lnx/ddio_lnx.h b/Main/ddio_lnx/ddio_lnx.h | |
index 670589a..1cd4b08 100644 | |
--- a/Main/ddio_lnx/ddio_lnx.h | |
+++ b/Main/ddio_lnx/ddio_lnx.h | |
@@ -41,7 +41,7 @@ extern bool DDIO_preemptive; | |
bool ddio_JoyHandler(); | |
void ddio_DebugMessage(unsigned err, char *fmt, ...); | |
-float ddio_TickToSeconds(unsigned long ticks); | |
+float ddio_TickToSeconds(unsigned int ticks); | |
void ddio_KeyHandler(MSG *msg); | |
void ddio_MouseHandler(MSG *msg); | |
diff --git a/Main/ddio_lnx/lnxtimer.cpp b/Main/ddio_lnx/lnxtimer.cpp | |
index 117a746..acced45 100644 | |
--- a/Main/ddio_lnx/lnxtimer.cpp | |
+++ b/Main/ddio_lnx/lnxtimer.cpp | |
@@ -72,7 +72,7 @@ void timer_Close() | |
} | |
-float ddio_TickToSeconds(unsigned long ticks) | |
+float ddio_TickToSeconds(unsigned int ticks) | |
{ | |
//rcg06292000 not used with SDL. | |
// unsigned long time_ms; | |
diff --git a/Main/ddio_win/ddio_win.h b/Main/ddio_win/ddio_win.h | |
index 3a6b3f5..5d48f0f 100644 | |
--- a/Main/ddio_win/ddio_win.h | |
+++ b/Main/ddio_win/ddio_win.h | |
@@ -82,7 +82,7 @@ extern bool DDIO_preemptive; | |
bool ddio_JoyHandler(); | |
-float ddio_TickToSeconds(unsigned long ticks); | |
+float ddio_TickToSeconds(unsigned int ticks); | |
#ifdef _DEBUG | |
void ddio_DebugMessage(unsigned err, char *fmt, ...); | |
diff --git a/Main/dedicated_server.cpp b/Main/dedicated_server.cpp | |
index 7dd2ff6..e32a175 100644 | |
--- a/Main/dedicated_server.cpp | |
+++ b/Main/dedicated_server.cpp | |
@@ -975,10 +975,11 @@ void InitDedicatedSocket(ushort port) | |
return; | |
} | |
//Make the socket non-blocking | |
- unsigned long argp = 1; | |
#if defined(WIN32) | |
+ u_long argp = 1; | |
ioctlsocket(dedicated_listen_socket,FIONBIO,&argp); | |
#elif defined(__LINUX__) | |
+ int argp = 1; | |
ioctl(dedicated_listen_socket,FIONBIO,&argp); | |
#endif | |
@@ -994,16 +995,17 @@ void ListenDedicatedSocket (void) | |
if(INVALID_SOCKET!=incoming_socket) | |
{ | |
//Make the socket non-blocking | |
- unsigned long argp = 1; | |
#if defined(WIN32) | |
+ u_long argp = 1; | |
ioctlsocket(incoming_socket,FIONBIO,&argp); | |
#elif defined(__LINUX__) | |
+ int argp = 1; | |
ioctl(incoming_socket,FIONBIO,&argp); | |
#endif | |
if(!Dedicated_allow_remote) | |
{ | |
//Check to see if this came in from the local address | |
- unsigned long localhost = inet_addr("127.0.0.1"); | |
+ unsigned int localhost = inet_addr("127.0.0.1"); | |
if(memcmp(&localhost,&conn_addr.sin_addr,sizeof(localhost))!=0) | |
{ | |
mprintf((0,"Rejecting connection from remote host!\n")); | |
diff --git a/Main/dmfc/dmfcbase.cpp b/Main/dmfc/dmfcbase.cpp | |
index 9fba24e..5aa5d48 100644 | |
--- a/Main/dmfc/dmfcbase.cpp | |
+++ b/Main/dmfc/dmfcbase.cpp | |
@@ -2925,7 +2925,7 @@ bool DMFCBase::IsAddressBanned(network_address *addr,const char *tracker_id) | |
return false; | |
} | |
- unsigned long address; | |
+ unsigned int address; | |
tHostsNode *curr; | |
memcpy(&address, &addr->address, 4); | |
@@ -4429,8 +4429,8 @@ void ParseHostsFile(const char *filename,tHostsNode **root) | |
char save_buffer[256]; | |
char s_ip[16],s_mask[16]; | |
- unsigned long ip_address; | |
- unsigned long mask; | |
+ unsigned int ip_address; | |
+ unsigned int mask; | |
char *ptr; | |
while(!DLLcfeof(file)){ | |
diff --git a/Main/dmfc/dmfcfunctions.cpp b/Main/dmfc/dmfcfunctions.cpp | |
index b0313eb..75de3cd 100644 | |
--- a/Main/dmfc/dmfcfunctions.cpp | |
+++ b/Main/dmfc/dmfcfunctions.cpp | |
@@ -301,7 +301,7 @@ DMFCFUNCTION void (*DLLInitPlayerNewShip) (int slot,int inven_reset); | |
DMFCFUNCTION void *(*DLLCheckBoxCreate)(void *parent, int id, void *title, int x, int y, int w, int h, int flags); | |
DMFCFUNCTION void (*DLLCheckBoxSetCheck)(void *cb,bool state); | |
DMFCFUNCTION bool (*DLLCheckBoxIsChecked)(void *cb); | |
-DMFCFUNCTION unsigned long (*DLLnw_GetHostAddressFromNumbers) (char *str); | |
+DMFCFUNCTION unsigned int (*DLLnw_GetHostAddressFromNumbers) (char *str); | |
DMFCFUNCTION void (*TableFilesClear)(void); | |
DMFCFUNCTION bool (*TableFileAdd)(char *filename); | |
DMFCFUNCTION void (*DLLDebugBreak_callback_stop)(void); | |
diff --git a/Main/dmfc/encryption.cpp b/Main/dmfc/encryption.cpp | |
index e4ee0f1..5eb1bff 100644 | |
--- a/Main/dmfc/encryption.cpp | |
+++ b/Main/dmfc/encryption.cpp | |
@@ -22,11 +22,11 @@ | |
class IceSubkey | |
{ | |
public: | |
- unsigned long val[3]; | |
+ unsigned int val[3]; | |
}; | |
// the S-boxes | |
-static unsigned long ice_sbox[4][1024]; | |
+static unsigned int ice_sbox[4][1024]; | |
static int ice_sboxes_initialised = 0; | |
// modulo values for the S-boxes | |
@@ -48,7 +48,7 @@ static const int ice_sxor[4][4] = | |
}; | |
// Permutation values for the P-box | |
-static const unsigned long ice_pbox[32] = | |
+static const unsigned int ice_pbox[32] = | |
{ | |
0x00000001, 0x00000080, 0x00000400, 0x00002000, | |
0x00080000, 0x00200000, 0x01000000, 0x40000000, | |
@@ -95,7 +95,7 @@ static uint gf_mult(uint a,uint b,uint m) | |
// Galois Field exponentiation. | |
// Raise the base to the power of 7, modulo m. | |
// | |
-static unsigned long gf_exp7(uint b, uint m) | |
+static unsigned int gf_exp7(uint b, uint m) | |
{ | |
uint x; | |
@@ -112,10 +112,10 @@ static unsigned long gf_exp7(uint b, uint m) | |
// | |
// Carry out the ICE 32-bit P-box permutation. | |
// | |
-static unsigned long ice_perm32 (unsigned long x) | |
+static unsigned int ice_perm32 (unsigned int x) | |
{ | |
- unsigned long res = 0; | |
- const unsigned long *pbox = ice_pbox; | |
+ unsigned int res = 0; | |
+ const unsigned int *pbox = ice_pbox; | |
while(x) | |
{ | |
@@ -140,7 +140,7 @@ static void ice_sboxes_init(void) | |
{ | |
int col=(i>>1)&0xff; | |
int row=(i&0x1)|((i&0x200)>>8); | |
- unsigned long x; | |
+ unsigned int x; | |
x = gf_exp7(col^ice_sxor[0][row],ice_smod[0][row])<<24; | |
ice_sbox[0][i] = ice_perm32 (x); | |
@@ -202,10 +202,10 @@ IceKey::~IceKey () | |
// | |
// The single round ICE f function. | |
// | |
-static unsigned long ice_f(unsigned long p,const IceSubkey *sk) | |
+static unsigned int ice_f(unsigned int p,const IceSubkey *sk) | |
{ | |
- unsigned long tl, tr; /* Expanded 40-bit values */ | |
- unsigned long al, ar; /* Salted expanded 40-bit values */ | |
+ unsigned int tl, tr; /* Expanded 40-bit values */ | |
+ unsigned int al, ar; /* Salted expanded 40-bit values */ | |
// Left half expansion | |
tl = ((p >> 16) & 0x3ff) | (((p >> 14) | (p << 18)) & 0xffc00); | |
@@ -232,15 +232,15 @@ static unsigned long ice_f(unsigned long p,const IceSubkey *sk) | |
void IceKey::encrypt(const ubyte *ptext,ubyte *ctext) const | |
{ | |
int i; | |
- unsigned long l,r; | |
+ unsigned int l,r; | |
- l = (((unsigned long) ptext[0]) << 24) | | |
- (((unsigned long) ptext[1]) << 16) | | |
- (((unsigned long) ptext[2]) << 8) | ptext[3]; | |
+ l = (((unsigned int) ptext[0]) << 24) | | |
+ (((unsigned int) ptext[1]) << 16) | | |
+ (((unsigned int) ptext[2]) << 8) | ptext[3]; | |
- r = (((unsigned long) ptext[4]) << 24) | | |
- (((unsigned long) ptext[5]) << 16) | | |
- (((unsigned long) ptext[6]) << 8) | ptext[7]; | |
+ r = (((unsigned int) ptext[4]) << 24) | | |
+ (((unsigned int) ptext[5]) << 16) | | |
+ (((unsigned int) ptext[6]) << 8) | ptext[7]; | |
for(i=0;i<_rounds;i+=2) | |
{ | |
@@ -264,14 +264,14 @@ void IceKey::encrypt(const ubyte *ptext,ubyte *ctext) const | |
void IceKey::decrypt(const ubyte *ctext,ubyte *ptext) const | |
{ | |
int i; | |
- unsigned long l,r; | |
+ unsigned int l,r; | |
- l = (((unsigned long) ctext[0]) << 24) | | |
- (((unsigned long) ctext[1]) << 16) | | |
- (((unsigned long) ctext[2]) << 8) | ctext[3]; | |
- r = (((unsigned long) ctext[4]) << 24) | | |
- (((unsigned long) ctext[5]) << 16) | | |
- (((unsigned long) ctext[6]) << 8) | ctext[7]; | |
+ l = (((unsigned int) ctext[0]) << 24) | | |
+ (((unsigned int) ctext[1]) << 16) | | |
+ (((unsigned int) ctext[2]) << 8) | ctext[3]; | |
+ r = (((unsigned int) ctext[4]) << 24) | | |
+ (((unsigned int) ctext[5]) << 16) | | |
+ (((unsigned int) ctext[6]) << 8) | ctext[7]; | |
for(i=_rounds-1;i>0;i-=2) | |
{ | |
@@ -308,7 +308,7 @@ void IceKey::scheduleBuild(unsigned short *kb,int n,const int *keyrot) | |
for(j=0;j<15;j++) | |
{ | |
int k; | |
- unsigned long *curr_sk = &isk->val[j%3]; | |
+ unsigned int *curr_sk = &isk->val[j%3]; | |
for(k=0;k<4;k++) | |
{ | |
diff --git a/Main/dp_ipx_client/dp_ipx_client.cpp b/Main/dp_ipx_client/dp_ipx_client.cpp | |
index 3b4cc5e..25d5269 100755 | |
--- a/Main/dp_ipx_client/dp_ipx_client.cpp | |
+++ b/Main/dp_ipx_client/dp_ipx_client.cpp | |
@@ -347,7 +347,7 @@ int MainMultiplayerMenu () | |
void AutoLoginAndJoinGame(void) | |
{ | |
unsigned short port; | |
- unsigned long iaddr; | |
+ unsigned int iaddr; | |
*DLLMultiGameStarting = 0; | |
@@ -369,7 +369,7 @@ void AutoLoginAndJoinGame(void) | |
network_address s_address; | |
iaddr = inet_addr(DLLAuto_login_addr); | |
- memcpy (&s_address.address,&iaddr,sizeof(unsigned long)); | |
+ memcpy (&s_address.address,&iaddr,sizeof(unsigned int)); | |
s_address.port=port; | |
s_address.connection_type = NP_TCP; | |
*DLLGame_is_master_tracker_game = 0; | |
diff --git a/Main/dp_lobby/dp_lobby.cpp b/Main/dp_lobby/dp_lobby.cpp | |
index 7485d6b..91d131d 100755 | |
--- a/Main/dp_lobby/dp_lobby.cpp | |
+++ b/Main/dp_lobby/dp_lobby.cpp | |
@@ -345,7 +345,7 @@ int MainMultiplayerMenu () | |
void AutoLoginAndJoinGame(void) | |
{ | |
unsigned short port; | |
- unsigned long iaddr; | |
+ unsigned int iaddr; | |
*DLLMultiGameStarting = 0; | |
@@ -367,7 +367,7 @@ void AutoLoginAndJoinGame(void) | |
network_address s_address; | |
//iaddr = inet_addr(DLLAuto_login_addr); | |
- memcpy (&s_address.address,&iaddr,sizeof(unsigned long)); | |
+ memcpy (&s_address.address,&iaddr,sizeof(unsigned int)); | |
s_address.port=port; | |
s_address.connection_type = NP_TCP; | |
*DLLGame_is_master_tracker_game = 0; | |
diff --git a/Main/dp_modem/dp_modem.cpp b/Main/dp_modem/dp_modem.cpp | |
index 526daf6..d7b0c68 100755 | |
--- a/Main/dp_modem/dp_modem.cpp | |
+++ b/Main/dp_modem/dp_modem.cpp | |
@@ -260,7 +260,7 @@ int MainMultiplayerMenu () | |
char *szzmodems; | |
- unsigned long modem_len = 0; | |
+ unsigned int modem_len = 0; | |
//Get buffer size | |
if(!DLLdp_GetModemChoices(NULL,&modem_len)) | |
{ | |
diff --git a/Main/editor/DallasMainDlg.cpp b/Main/editor/DallasMainDlg.cpp | |
index 44a1c13..633208a 100644 | |
--- a/Main/editor/DallasMainDlg.cpp | |
+++ b/Main/editor/DallasMainDlg.cpp | |
@@ -9337,7 +9337,7 @@ void CDallasMainDlg::ClearCustomScriptStorage(void) | |
// Scans the file for the custom script block and count how many lines are in it | |
int CDallasMainDlg::CountCustomScriptLines(CFILE *infile) | |
{ | |
- long int start_pos; | |
+ int start_pos; | |
int line_count; | |
char linebuf[2048]; | |
bool done; | |
diff --git a/Main/gamesave.cpp b/Main/gamesave.cpp | |
index 7548634..23a8e46 100644 | |
--- a/Main/gamesave.cpp | |
+++ b/Main/gamesave.cpp | |
@@ -1165,7 +1165,7 @@ START_VERIFY_SAVEFILE(fp); | |
// data universal to all objects that need to be saved. | |
gs_WriteShort(fp, (short)op->id); | |
- gs_WriteInt(fp, (long)op->flags); | |
+ gs_WriteInt(fp, (int)op->flags); | |
gs_WriteByte(fp, (sbyte)op->control_type); | |
gs_WriteByte(fp, (sbyte)op->movement_type); | |
gs_WriteByte(fp, (sbyte)op->render_type); | |
diff --git a/Main/gamespy/gamespy.cpp b/Main/gamespy/gamespy.cpp | |
index 9318bed..e396e61 100644 | |
--- a/Main/gamespy/gamespy.cpp | |
+++ b/Main/gamespy/gamespy.cpp | |
@@ -236,19 +236,15 @@ int gspy_Init(void) | |
return 0; | |
} | |
- int error; | |
- unsigned long arg; | |
- | |
- arg = TRUE; | |
//make the socket non blocking | |
- | |
#ifdef WIN32 | |
- error = ioctlsocket( gspy_socket, FIONBIO, &arg ); | |
+ u_long arg = TRUE; | |
+ int error = ioctlsocket( gspy_socket, FIONBIO, &arg ); | |
#elif defined(__LINUX__) | |
- error = ioctl(gspy_socket,FIONBIO,&arg); | |
+ int arg = TRUE; | |
+ int error = ioctl(gspy_socket,FIONBIO,&arg); | |
#endif | |
- | |
CFILE *cfp = cfopen(cfgpath,"rt"); | |
if(cfp) | |
{ | |
diff --git a/Main/gametrack.h b/Main/gametrack.h | |
index 371ed39..30a5228 100644 | |
--- a/Main/gametrack.h | |
+++ b/Main/gametrack.h | |
@@ -126,7 +126,7 @@ typedef struct _active_games{ | |
typedef struct { | |
unsigned char game_type; | |
char game_name[MAX_GAME_LISTS_PER_PACKET][MAX_GENERIC_GAME_NAME_LEN]; | |
- unsigned long game_server[MAX_GAME_LISTS_PER_PACKET]; | |
+ unsigned int game_server[MAX_GAME_LISTS_PER_PACKET]; | |
}game_list; | |
diff --git a/Main/heatscoring/Heatsdk/include/mpchd_ex.h b/Main/heatscoring/Heatsdk/include/mpchd_ex.h | |
index b3dd4c8..6e05a02 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mpchd_ex.h | |
+++ b/Main/heatscoring/Heatsdk/include/mpchd_ex.h | |
@@ -91,16 +91,16 @@ typedef enum MPSERVER_ATTR_TYPE MPSERVER_ATTR_TYPE; | |
struct MPSERVER_ATTR { | |
MPSERVER_ATTR_TYPE type; | |
union { | |
- u_long shutdown_action; | |
+ u_int shutdown_action; | |
} MPSERVER_ATTR_u; | |
}; | |
typedef struct MPSERVER_ATTR MPSERVER_ATTR; | |
struct MPSERVER_INFO { | |
MPSERVERTYPE server_name; | |
- u_long server_type; | |
- u_long vers; | |
- u_long key; | |
+ u_int server_type; | |
+ u_int vers; | |
+ u_int key; | |
MPADDR mp_addr; | |
MPTLADDR tl_addr; | |
MPSERVERNAME name; | |
diff --git a/Main/heatscoring/Heatsdk/include/mpchdsrv.h b/Main/heatscoring/Heatsdk/include/mpchdsrv.h | |
index df61fb9..3c53bf8 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mpchdsrv.h | |
+++ b/Main/heatscoring/Heatsdk/include/mpchdsrv.h | |
@@ -58,7 +58,7 @@ typedef enum _mpServerMessage { | |
* length - integer parameter that gives the length, in bytes, of pData. | |
* pData - pointer to data structure for this type. See below. | |
*/ | |
-typedef unsigned long (*MPSERVERCBF)(MPSERVER_MESSAGE code, | |
+typedef unsigned int (*MPSERVERCBF)(MPSERVER_MESSAGE code, | |
unsigned int length, | |
void *pData); | |
typedef MPSERVERCBF MPServerCBF; | |
@@ -148,7 +148,7 @@ typedef MPSERVERCBF MPServerCBF; | |
* MPServerInitEx instead, it's more versatile. | |
*/ | |
-extern unsigned long MPServerDefaultCBF(MPSERVER_MESSAGE gm, | |
+extern unsigned int MPServerDefaultCBF(MPSERVER_MESSAGE gm, | |
unsigned int length, | |
void *pData); | |
@@ -198,7 +198,7 @@ extern MPGICS_CSERVER_INFO *MPServerGetServerInfo(void); | |
* Save a new result into a queue, which can be sent to the GICS in one | |
* batch with MPSaveResults | |
*/ | |
-short MPAddResult(MPPLAYERID srcId, MPPLAYERID dstId, u_long key, long value); | |
+short MPAddResult(MPPLAYERID srcId, MPPLAYERID dstId, u_int key, int value); | |
/* | |
* MPSaveResults | |
@@ -227,7 +227,7 @@ short MPServerNotifyPlayerLeave(MPPLAYERID id); | |
* Obtain player ID and other information, based on the player's IP address. | |
* Pointers may be set to NULL if you are not interested in those data. | |
*/ | |
-short MPServerGetPlayerInfoByIpAddr(u_long ipaddr, MPPLAYERID *id, MPUSERNAME *name, MPADDR *addr, u_int *is_spectator); | |
+short MPServerGetPlayerInfoByIpAddr(u_int ipaddr, MPPLAYERID *id, MPUSERNAME *name, MPADDR *addr, u_int *is_spectator); | |
#ifdef __cplusplus | |
} | |
diff --git a/Main/heatscoring/Heatsdk/include/mpdb_ex.h b/Main/heatscoring/Heatsdk/include/mpdb_ex.h | |
index 2b10002..67b17f1 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mpdb_ex.h | |
+++ b/Main/heatscoring/Heatsdk/include/mpdb_ex.h | |
@@ -26,9 +26,9 @@ extern "C" { | |
#include <mpconfig.h> | |
#include <mptypes.h> | |
-typedef u_long MPCUSTID; | |
+typedef u_int MPCUSTID; | |
-typedef u_long MPPLAYERID; | |
+typedef u_int MPPLAYERID; | |
#define MPUSERNAME_MAX 16 | |
typedef char *username; | |
diff --git a/Main/heatscoring/Heatsdk/include/mpgamcfg.h b/Main/heatscoring/Heatsdk/include/mpgamcfg.h | |
index 0804b89..5fb05e2 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mpgamcfg.h | |
+++ b/Main/heatscoring/Heatsdk/include/mpgamcfg.h | |
@@ -242,8 +242,8 @@ int MPOpenOffer( HWND hWndParent, // parent window (you create a child of this, | |
// its existence if it bothers you. | |
// | |
struct initialOfferStr { | |
- unsigned long randomSeed; // each client is guaranteed to get the same seed | |
- unsigned long gameClassID; // Mplayer game class ID | |
+ unsigned int randomSeed; // each client is guaranteed to get the same seed | |
+ unsigned int gameClassID; // Mplayer game class ID | |
unsigned short minPlayers; // from min/max players at room creation | |
unsigned short maxPlayers; // from min/max players at room creation | |
int IAmModerator; // TRUE if you are moderator at this moment (can change dynamically) | |
@@ -260,7 +260,7 @@ struct initialOfferStr { | |
// for example: | |
// | |
// struct currentPlayerInfoStr me; | |
-// unsigned long meSize = sizeof(me); | |
+// unsigned int meSize = sizeof(me); | |
// | |
// if ( 0 == MPLoadBinaryObject(CURRENT_PLAYER_INFO, &me, &meSize) | |
// { | |
@@ -638,8 +638,8 @@ int MPConnectionState( int hGame, | |
// | |
// int itIsMe, // non-zero if this update is about this client | |
// int itIsModerator, // non-zero if this update is about current moderator | |
-// long matchmakerUserID, // matchmaker userID (not to be confused with MPADDR) | |
-// long userState, // state flags for this user | |
+// int matchmakerUserID, // matchmaker userID (not to be confused with MPADDR) | |
+// int userState, // state flags for this user | |
// char *userName // asciz name (or NULL, or empty string) | |
// | |
// Output: | |
@@ -662,8 +662,8 @@ int MPConnectionState( int hGame, | |
int MPUserState( int itIsMe, | |
int itIsModerator, | |
- long matchmakerUserID, | |
- long userState, | |
+ int matchmakerUserID, | |
+ int userState, | |
char *userName | |
); | |
@@ -698,8 +698,8 @@ int MPUserState( int itIsMe, | |
// Input: | |
// | |
// int myROom, // non-zero if this update is about the room I am in, or have selected | |
-// long roomID, // matchmaker roomID | |
-// long roomFLags, // state flags for this room | |
+// int roomID, // matchmaker roomID | |
+// int roomFLags, // state flags for this room | |
// char *roomName // asciz name (or NULL, or empty string) | |
// | |
// Output: | |
@@ -724,8 +724,8 @@ int MPUserState( int itIsMe, | |
#define GED_MM_ROOM_HIDDEN 0x1000 /* room is hidden by moderator */ | |
int MPRoomState( int myRoom, | |
- long roomID, | |
- long roomFlags, | |
+ int roomID, | |
+ int roomFlags, | |
char *roomName | |
); | |
@@ -1034,8 +1034,8 @@ int MPCreateRoom( HWND gameExtWnd, | |
char *pComment, int maxCommentLength, | |
char *pPassword, int maxPasswordLength, | |
char *pURL, int maxURLLength, | |
- unsigned long *minPlayers, | |
- unsigned long *maxPlayers | |
+ unsigned int *minPlayers, | |
+ unsigned int *maxPlayers | |
); | |
@@ -1062,7 +1062,7 @@ int MPCreateRoom( HWND gameExtWnd, | |
// | |
// MPADDR address, // the MPADDR of the packet's sender | |
// void *msg, // a pointer to the body of the packet | |
-// long msg_len // the length of the packet | |
+// int msg_len // the length of the packet | |
// | |
// return code | |
// | |
@@ -1071,7 +1071,7 @@ int MPCreateRoom( HWND gameExtWnd, | |
int MPIncomingPacket( MPADDR address, | |
void *msg, | |
- long msg_len | |
+ int msg_len | |
); | |
//////////////////// | |
@@ -1176,7 +1176,7 @@ int MPEndOfGameObject( HWND gameExtWnd, | |
// 0 no errors | |
// | |
-typedef int (*MPServiceProviderCBF)( unsigned long service, ...); | |
+typedef int (*MPServiceProviderCBF)( unsigned int service, ...); | |
int MPRegisterCallback( MPServiceProviderCBF ); | |
@@ -1426,7 +1426,7 @@ typedef void Done_Callback( u_int status, // result code | |
// | |
// For example: | |
// | |
-// u_long myPlayerIDs[MAX_PLAYER_IDS+1]; // save room for one more than you admit to. | |
+// u_int myPlayerIDs[MAX_PLAYER_IDS+1]; // save room for one more than you admit to. | |
// u_int status; | |
// int err; | |
// | |
@@ -1452,9 +1452,9 @@ typedef void Done_Callback( u_int status, // result code | |
// u_int* pStatus, // where final MCP status is recorded | |
// Done_Callback* DoneCBF, // callback completion function (or NULL for modal call) | |
// void* userContext, // context pointer returned in callback | |
-// u_long* gameClass, // game class ID (only players for this game will be returned) | |
-// u_long* pPlayerIDs, // pointer to buffer to be filled with player IDs | |
-// u_long maxPlayerIDs // Max # of player IDs your buffer can hold (one less than true size) | |
+// u_int* gameClass, // game class ID (only players for this game will be returned) | |
+// u_int* pPlayerIDs, // pointer to buffer to be filled with player IDs | |
+// u_int maxPlayerIDs // Max # of player IDs your buffer can hold (one less than true size) | |
// ); | |
@@ -1470,21 +1470,21 @@ typedef void Done_Callback( u_int status, // result code | |
// recovered, and *type will be set to indicate the type of data which | |
// was received: | |
// | |
-// ATTR_TYPE_INT xdr_u_long | |
+// ATTR_TYPE_INT xdr_u_int | |
// ATTR_TYPE_STRING xdr_string | |
// ATTR_TYPE_BINARY xdr_bytes | |
// ATTR_TYPE_FLOAT n/a -- needs porting to PC. | |
// | |
// | |
// MPServiceProviderCBF( MPSP_GET_PLAYER_ATTR, | |
-// u_long player_id, // from MPSP_LIST_PLAYERS | |
+// u_int player_id, // from MPSP_LIST_PLAYERS | |
// const char* attrName, // asciz name of attribute | |
// u_int* pStatus, // where final MCP status is recorded | |
// Done_Callback* DoneCBF, // callback completion function (or NULL for modal call) | |
// void* userContext, // context pointer returned in callback | |
-// u_long* attrType, // where final attr. type will be stored | |
+// u_int* attrType, // where final attr. type will be stored | |
// void* pAttr, // pointer to buffer to be filler with attribute | |
-// u_long* length // before call: maxLen of pAttr, on return: len of attr | |
+// u_int* length // before call: maxLen of pAttr, on return: len of attr | |
// ); | |
@@ -1676,12 +1676,12 @@ typedef void Done_Callback( u_int status, // result code | |
// This service allows for a game enabler to launch a game. | |
// | |
// MPServiceProviderCBF( MPSP_LAUNCH_GAME, | |
-// unsigned long numPlayers, // | |
-// unsigned long gameStyle, // | |
+// unsigned int numPlayers, // | |
+// unsigned int gameStyle, // | |
// MPTLADDR mpaddr, // | |
-// unsigned long playerID, // | |
-// unsigned long playerIndex, // | |
-// unsigned long instanceID // | |
+// unsigned int playerID, // | |
+// unsigned int playerIndex, // | |
+// unsigned int instanceID // | |
// ); | |
// | |
// Return Values | |
diff --git a/Main/heatscoring/Heatsdk/include/mpgamcfg_v12.h b/Main/heatscoring/Heatsdk/include/mpgamcfg_v12.h | |
index 6a76037..fbb6d37 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mpgamcfg_v12.h | |
+++ b/Main/heatscoring/Heatsdk/include/mpgamcfg_v12.h | |
@@ -242,8 +242,8 @@ int MPOpenOffer( HWND hWndParent, // parent window (you create a child of this, | |
// its existence if it bothers you. | |
// | |
struct initialOfferStr { | |
- unsigned long randomSeed; // each client is guaranteed to get the same seed | |
- unsigned long gameClassID; // Mplayer game class ID | |
+ unsigned int randomSeed; // each client is guaranteed to get the same seed | |
+ unsigned int gameClassID; // Mplayer game class ID | |
unsigned short minPlayers; // from min/max players at room creation | |
unsigned short maxPlayers; // from min/max players at room creation | |
}; | |
@@ -555,7 +555,7 @@ int MPConnectionState( int hGame, | |
// 0 no errors | |
// | |
-typedef int MPServiceProviderCBF( unsigned long service, ...); | |
+typedef int MPServiceProviderCBF( unsigned int service, ...); | |
int MPRegisterCallback( MPServiceProviderCBF ); | |
diff --git a/Main/heatscoring/Heatsdk/include/mplayer.h b/Main/heatscoring/Heatsdk/include/mplayer.h | |
index 254f79e..820bdb1 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mplayer.h | |
+++ b/Main/heatscoring/Heatsdk/include/mplayer.h | |
@@ -73,14 +73,14 @@ typedef struct mplayer_gulp_info_s { | |
uint32_t type; /* GULP Type. */ | |
uint32_t data_len; /* Length of GULP-specific */ | |
/* configuration parameters. */ | |
- long extra[5]; | |
+ int extra[5]; | |
} MPLAYER_GULP_INFO; | |
typedef struct mplayer_client_info_s { | |
MPADDR addr; | |
MPCUSTID id; | |
uint8_t name[MP_CLIENTNAME_MAX + 1]; | |
- long extra[5]; | |
+ int extra[5]; | |
} MPLAYER_CLIENT_INFO; | |
@@ -136,8 +136,8 @@ typedef struct tagGameDefinition | |
HGAME hGame; // handle of this game | |
MPADDR myAddrMP; // my MPath player address | |
MPADDR myAcctMP; // My Mpath account number | |
- long classID; // Class ID number of game | |
- long numPlayers; // Expected Number of players in game | |
+ int classID; // Class ID number of game | |
+ int numPlayers; // Expected Number of players in game | |
MPTLADDR tl_addr; // address of game instance server | |
char playerName[80]; // User's ASCII Name | |
@@ -145,10 +145,10 @@ typedef struct tagGameDefinition | |
char exe[MAX_GAME_INFO_LEN+1]; // path to executable (or full path to DLL) | |
char cmd[MAX_GAME_INFO_LEN+1]; // optional command line arguments | |
short useChunnel; // true if game depends on DOS chunnel | |
- long traceFlags; // diagnostic traceFlags | |
- unsigned long playerIndex; | |
+ int traceFlags; // diagnostic traceFlags | |
+ unsigned int playerIndex; | |
MPTLADDR mcp_tladdr; // MPTLADDR of MCP to which we are currently logged on | |
- long extra[46]; | |
+ int extra[46]; | |
} GAMEDEF; | |
@@ -168,11 +168,11 @@ typedef void* HSESSION; | |
#ifndef HGULP | |
typedef short HGULP; // gulp handle | |
-typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, long msg_len); // user-supplied incoming message handler | |
+typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, int msg_len); // user-supplied incoming message handler | |
#endif | |
-typedef void mpcdecl OpenGULPCompleteCBF( HGULP hGULP, void* context, long status ); // your function, called when OpenGULP completes | |
-typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, long msg_len); | |
+typedef void mpcdecl OpenGULPCompleteCBF( HGULP hGULP, void* context, int status ); // your function, called when OpenGULP completes | |
+typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, int msg_len); | |
#define GULP_OPEN_BY_NAME 0 // GULPName is ASCIZ Gulp Name | |
@@ -180,20 +180,20 @@ typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR addres | |
#define GULP_OPEN_BY_KLUDGE -1 // DIAGNOSTIC: GULPName is hard-wired | |
typedef struct tagMeter { | |
- unsigned long startTick; // GetTickCount() of start of this data period (set by ResetGULPMeter() ) | |
- unsigned long totalPacketsIn; // Total messages Written to GULP by other clients since ResetGULPMeter() | |
- unsigned long totalBytesIn; // Total incoming bytes to GULP since ResetGULPMeter() | |
- unsigned long totalPacketsOut; // Total Messages written to GULP by this client since ResetGULPMeter() | |
- unsigned long totalBytesOut; // Total Bytes written to GULP by this client since ResetGULPMeter() | |
- unsigned long shortestPacket; // shortest msg_len received since ResetGULPMeter() | |
- unsigned long longestPacket; // longest msg_len received since ResetGULPMeter() | |
+ unsigned int startTick; // GetTickCount() of start of this data period (set by ResetGULPMeter() ) | |
+ unsigned int totalPacketsIn; // Total messages Written to GULP by other clients since ResetGULPMeter() | |
+ unsigned int totalBytesIn; // Total incoming bytes to GULP since ResetGULPMeter() | |
+ unsigned int totalPacketsOut; // Total Messages written to GULP by this client since ResetGULPMeter() | |
+ unsigned int totalBytesOut; // Total Bytes written to GULP by this client since ResetGULPMeter() | |
+ unsigned int shortestPacket; // shortest msg_len received since ResetGULPMeter() | |
+ unsigned int longestPacket; // longest msg_len received since ResetGULPMeter() | |
// data below are updated only when calls to MPGetGULPMeter are made | |
- unsigned long dataBytesPerSecondIn; | |
- unsigned long dataBytesPerSecondOut; | |
- unsigned long actualBytesPerSecondIn; | |
- unsigned long actualBytesPerSecondOut; | |
- unsigned long extra[18]; | |
+ unsigned int dataBytesPerSecondIn; | |
+ unsigned int dataBytesPerSecondOut; | |
+ unsigned int actualBytesPerSecondIn; | |
+ unsigned int actualBytesPerSecondOut; | |
+ unsigned int extra[18]; | |
} GULPMETER; | |
@@ -235,8 +235,8 @@ typedef struct tagMeter { | |
#define MISCFLAGS_HERD 1 | |
typedef struct tagMani { | |
- long version; // manifest entry version, not game version | |
- long gameClassID; | |
+ int version; // manifest entry version, not game version | |
+ int gameClassID; | |
char gameTitle[MAX_MANI_STRING_LEN+1]; | |
char gameEXE[MAX_MANI_PATH_LEN+1]; | |
char gamePWD[MAX_MANI_PATH_LEN+1]; | |
@@ -248,7 +248,7 @@ typedef struct tagMani { | |
char gameBMP[MAX_MANI_PATH_LEN+1]; | |
char gameCMDLINE[MAX_MANI_PATH_LEN+1]; | |
short gameMiscFlags; | |
- long reserved[62]; // for future augmentations | |
+ int reserved[62]; // for future augmentations | |
} GAME_MANIFEST_ENTRY; | |
@@ -336,17 +336,17 @@ typedef struct tagMani { | |
typedef void MPMonitorCallbackCBF(short event, | |
// error code, if appropriate | |
- unsigned long code, | |
+ unsigned int code, | |
// game handle, if appropriate | |
- unsigned long hGame, | |
+ unsigned int hGame, | |
// gulp #, if appropriate | |
- unsigned long gulpID, | |
+ unsigned int gulpID, | |
// MPADDR of sender, if appropriate | |
- unsigned long sender, | |
+ unsigned int sender, | |
// MPADDR of target, if appropriate | |
- unsigned long dest, | |
+ unsigned int dest, | |
// length of data object | |
- unsigned long dataLen, | |
+ unsigned int dataLen, | |
// pointer to data block | |
// (valid only during duration of callback) | |
void *data); | |
@@ -737,7 +737,7 @@ short mpcdecl MPGetGameTime(MP_GAME_TIME *time); | |
-----------------------------------------------------------------------------------*/ | |
-int mpcdecl MPAddResult(HGAME hGame,MPPLAYERID srcId,MPPLAYERID dstId,u_long key,long value); | |
+int mpcdecl MPAddResult(HGAME hGame,MPPLAYERID srcId,MPPLAYERID dstId,u_int key,int value); | |
/*----------------------------------------------------------------------------------- | |
@@ -1065,26 +1065,26 @@ short mpcdecl MPCreateGULP(HGAME hGame, /* MPGICS_GULPCREATEREQ* */ void* pGULPr | |
short mpcdecl MPCreateGULP_MC( HGAME hGame, | |
MPADDR mp_addr, | |
char *name, | |
- long no_echo); | |
+ int no_echo); | |
short mpcdecl MPCreateGULP_SI( HGAME hGame, | |
MPADDR mp_addr, | |
char *name, | |
- long no_echo, | |
- long tmo, | |
- long tmo_factor, | |
- long tmo_weight); | |
+ int no_echo, | |
+ int tmo, | |
+ int tmo_factor, | |
+ int tmo_weight); | |
short mpcdecl MPCreateGULP_CS( HGAME hGame, | |
MPADDR mp_addr, | |
char *name, | |
- long no_echo, | |
- long tmo, | |
- long move_type, | |
- long move_max, | |
- long eject_max, | |
- long tmo_factor, | |
- long tmo_weight); | |
+ int no_echo, | |
+ int tmo, | |
+ int move_type, | |
+ int move_max, | |
+ int eject_max, | |
+ int tmo_factor, | |
+ int tmo_weight); | |
// For error return codes, search on MPERR_GENERIC | |
@@ -1322,7 +1322,7 @@ typedef void* HSESSION; | |
#ifndef HGULP | |
typedef short HGULP; // gulp handle | |
-typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, long msg_len); // user-supplied incoming message handler | |
+typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, int msg_len); // user-supplied incoming message handler | |
#endif | |
// | |
@@ -1405,7 +1405,7 @@ typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR addres | |
// void* context // context information you provided during call to MPOpenGULP() | |
// long status // 0 = Gulp opened successfully | |
// | |
-typedef void mpcdecl OpenGULPCompleteCBF( HGULP hGULP, void* context, long status ); // your function, called when OpenGULP completes | |
+typedef void mpcdecl OpenGULPCompleteCBF( HGULP hGULP, void* context, int status ); // your function, called when OpenGULP completes | |
// | |
// pMessageHandler Callback Function | |
@@ -1419,7 +1419,7 @@ typedef void mpcdecl OpenGULPCompleteCBF( HGULP hGULP, void* context, long statu | |
// char* msg // a pointer to the message data | |
// long msg_len // the length of the message data | |
// | |
-typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, long msg_len); | |
+typedef void mpcdecl MessageHandlerCBF(HGULP hGULP, void *context, MPADDR address, char *msg, int msg_len); | |
// | |
// GULPOpenStyles | |
@@ -1521,11 +1521,11 @@ short mpcdecl MPCloseGULP( HGULP hGULP ); | |
// | |
-short mpcdecl MPWriteGULP( HGULP hGULP, char *msg, long msg_len, MPADDR* addr_list); | |
+short mpcdecl MPWriteGULP( HGULP hGULP, char *msg, int msg_len, MPADDR* addr_list); | |
// For error return codes, search on MPERR_GENERIC | |
-long mpcdecl MPIsDataReady(HGULP hGULP); | |
+int mpcdecl MPIsDataReady(HGULP hGULP); | |
///////////////////////////// | |
@@ -1572,10 +1572,10 @@ long mpcdecl MPIsDataReady(HGULP hGULP); | |
// short errorCode // One of the following error codes: | |
// | |
-short mpcdecl MPReadGULP( HGULP hGULP, MPADDR *sender, char *msg, long *msg_len ); | |
+short mpcdecl MPReadGULP( HGULP hGULP, MPADDR *sender, char *msg, int *msg_len ); | |
// For error return codes, search on MPERR_GENERIC | |
-long mpcdecl MPIsDataReady(HGULP hGULP); | |
+int mpcdecl MPIsDataReady(HGULP hGULP); | |
///////////////////////////// | |
@@ -1762,7 +1762,7 @@ GULPMETER * mpcdecl MPGetGULPMeter(HGULP hGULP); // return a pointer to | |
// none | |
// | |
-void mpcdecl MPSpeechHandler(HGULP hGULP, void *context, MPADDR sender, char *msg, long msg_len); | |
+void mpcdecl MPSpeechHandler(HGULP hGULP, void *context, MPADDR sender, char *msg, int msg_len); | |
// For return codes, search on MPERR_GENERIC | |
@@ -2055,7 +2055,7 @@ int mpcdecl MPGetCodecInfo( short *codecType ); | |
// // FALSE = No current Phrase information available (queue empty) | |
// | |
-short mpcdecl MPGetQueueInfo( short *phraseID, MPADDR *playerID, long *chunkCount ); | |
+short mpcdecl MPGetQueueInfo( short *phraseID, MPADDR *playerID, int *chunkCount ); | |
// For error return codes, search on MPERR_GENERIC | |
@@ -2075,7 +2075,7 @@ short mpcdecl MPGetQueueInfo( short *phraseID, MPADDR *playerID, long *chunkCoun | |
// *dataLen is set to actual length of object read. | |
// | |
-int mpcdecl MPLoadBinaryObject(char *objectName, void *pData, unsigned long *dataLen); | |
+int mpcdecl MPLoadBinaryObject(char *objectName, void *pData, unsigned int *dataLen); | |
// | |
// Save a binary object in the registry (such as a gamedef file, for instance), saved in common | |
@@ -2089,7 +2089,7 @@ int mpcdecl MPLoadBinaryObject(char *objectName, void *pData, unsigned long *dat | |
// | |
// 0 no error | |
-int mpcdecl MPSaveBinaryObject(char *objectName, void *pData, unsigned long dataLen); | |
+int mpcdecl MPSaveBinaryObject(char *objectName, void *pData, unsigned int dataLen); | |
//////////////////////////////////////////////////////////// | |
@@ -2101,26 +2101,26 @@ short MPClosePhraseRQ(HSESSION speechSess, short phraseID ); | |
short MPSendPhraseDataRQ(HSESSION speechSess, short phraseID, short codecType, char *samples, short sampleLen); | |
int MPSpeechInit(void); | |
int MPSpeechDestroy(void); | |
-void MPQueueSpeech( char * req_params, long req_params_len ); | |
+void MPQueueSpeech( char * req_params, int req_params_len ); | |
////////////////////////////// | |
// Speech Compression Routines | |
// | |
-unsigned long mpcdecl MPResetCompression(void); | |
+unsigned int mpcdecl MPResetCompression(void); | |
// | |
// Call this to compress a single block of rawsamples into a 32byte compressed data block | |
// | |
-unsigned long mpcdecl MPCompressSpeech(LPBYTE compressedBlock, LPBYTE rawSamples); | |
+unsigned int mpcdecl MPCompressSpeech(LPBYTE compressedBlock, LPBYTE rawSamples); | |
// | |
// Call this to decompress a 32byte compressed data block into the original rawsamples (or something close to it) | |
// | |
-unsigned long mpcdecl MPDecompressSpeech( LPBYTE rawSamples, LPBYTE compressedBlock); | |
+unsigned int mpcdecl MPDecompressSpeech( LPBYTE rawSamples, LPBYTE compressedBlock); | |
// | |
// Get the parameters associated with the specified codec | |
// | |
-long mpcdecl MPGetCodecParameters(short codecType, long *bytesPerSample, long *bytesPerBlock, long *blocksPerPacket, long *sampleFreq, long *bytesPerCompressedBlock ); | |
+int mpcdecl MPGetCodecParameters(short codecType, int *bytesPerSample, int *bytesPerBlock, int *blocksPerPacket, int *sampleFreq, int *bytesPerCompressedBlock ); | |
// For error return codes, search on MPERR_GENERIC | |
/*----------------------------------------------------------------------------------- | |
@@ -2262,7 +2262,7 @@ int mpcdecl MPPostLobbyData(HGAME hGame,u_int objectID,void *pObjectData,u_i | |
-----------------------------------------------------------------------------------*/ | |
-int mpcdecl MPReportGameCompletionResult(HGAME hGame,long result); | |
+int mpcdecl MPReportGameCompletionResult(HGAME hGame,int result); | |
//************************************************************************************* | |
@@ -2291,8 +2291,8 @@ int mpcdecl MPReportGameCompletionResult(HGAME hGame,long result); | |
// flags only enable the dialogbox reporting of their trace messages. | |
-long mpcdecl MPGetTrace(); | |
-void mpcdecl MPSetTrace(long traceMask); | |
+int mpcdecl MPGetTrace(); | |
+void mpcdecl MPSetTrace(int traceMask); | |
#define MPTRACE_ALL 0xFFFFFFFF | |
@@ -2362,7 +2362,7 @@ void mpcdecl MPTraceMsg(char *msg); | |
// which is Mplayer version 1, compatible with sun server 1.03 | |
// | |
-long mpcdecl MPlayerVersion(char *versionString, long maxLen); | |
+int mpcdecl MPlayerVersion(char *versionString, int maxLen); | |
//************************************************************************************** | |
// | |
@@ -2390,7 +2390,7 @@ char * mpcdecl strmcpy(char *dst, char *src, int len); | |
// -2 ping request failed | |
-int mpcdecl MPPingSession(void* hSess, unsigned long *msec); | |
+int mpcdecl MPPingSession(void* hSess, unsigned int *msec); | |
// | |
// Ping the specified GICS, measure the elapsed milliseconds for one round | |
@@ -2404,7 +2404,7 @@ int mpcdecl MPPingSession(void* hSess, unsigned long *msec); | |
// -3 ping request failed | |
-int mpcdecl MPPingGame(HGAME hGame, unsigned long *msec); | |
+int mpcdecl MPPingGame(HGAME hGame, unsigned int *msec); | |
// | |
@@ -2418,7 +2418,7 @@ int mpcdecl MPPingGame(HGAME hGame, unsigned long *msec); | |
// -2 unable to make MPSess connection | |
// -3 ping request failed | |
-int mpcdecl MPPingGULP(HGULP hGULP, unsigned long *msec); | |
+int mpcdecl MPPingGULP(HGULP hGULP, unsigned int *msec); | |
// | |
// Ping the specified MPTLADDR, measure the elapsed milliseconds for one round | |
@@ -2431,7 +2431,7 @@ int mpcdecl MPPingGULP(HGULP hGULP, unsigned long *msec); | |
// -2 unable to make MPSess connection | |
// -3 ping request failed | |
-int mpcdecl MPPingMPTlAddr(MPTLADDR *tl_addr, unsigned long *msec); | |
+int mpcdecl MPPingMPTlAddr(MPTLADDR *tl_addr, unsigned int *msec); | |
///////////////////////////////////////////////////////////////////////////////////////////////// | |
@@ -2692,7 +2692,7 @@ int mpcdecl MPEnableJoinLeaveNotification(HGAME hgame, MPJoinLeaveCBF* callback, | |
int mpcdecl MPDisableJoinLeaveNotification(HGAME hGame, MPJoinLeaveCBF *callback, void* context); | |
-short mpcdecl MPWaitForPlayers(HGAME hgame, const char *namedSync, long numPlayers, long timeout); | |
+short mpcdecl MPWaitForPlayers(HGAME hgame, const char *namedSync, int numPlayers, int timeout); | |
void mpcdecl MPEnableAutoErrorMessageBoxes(int state); | |
@@ -2705,7 +2705,7 @@ int mpcdecl MPGetErrorText(int errId, char *stringBuffer, int lenBuffer); | |
// We will guarantee that you get a null-terminated string | |
// in your stringBuffer. We will never write more than lenBuffer bytes | |
// Returns -1 on failure, 0 for success | |
-int mpcdecl MPMessageHandler(HGULP hGULP, long sender, char *msg, long msg_len); | |
+int mpcdecl MPMessageHandler(HGULP hGULP, int sender, char *msg, int msg_len); | |
void mpcdecl MPIPX_DoPeriodicUpdate (WORD ); | |
@@ -2738,9 +2738,9 @@ typedef short mpcdecl (*MPLeaveGame_TYPE) ( HGAME hGame ); | |
typedef MPADDR mpcdecl (*MPGetMPAddr_TYPE) ( HGAME hGame ); | |
typedef short mpcdecl (*MPEnumGULPs_TYPE) (HGAME hGame, MPADDR *gulpList, int lenList); | |
typedef short mpcdecl (*MPCreateGULP_TYPE) (HGAME hGame, void* pGULPreq); | |
-typedef short mpcdecl (*MPCreateGULP_MC_TYPE) (HGAME hGame, MPADDR mp_addr, char *name,long no_echo); | |
-typedef short mpcdecl (*MPCreateGULP_SI_TYPE) (HGAME hGame, MPADDR mp_addr, char *name, long no_echo,long tmo, long tmo_factor, long tmo_weight); | |
-typedef short mpcdecl (*MPCreateGULP_CS_TYPE) (HGAME hGame, MPADDR mp_addr, char *name, long no_echo,long tmo, long move_type, long move_max, long eject_max, long tmo_factor, long tmo_weight); | |
+typedef short mpcdecl (*MPCreateGULP_MC_TYPE) (HGAME hGame, MPADDR mp_addr, char *name,int no_echo); | |
+typedef short mpcdecl (*MPCreateGULP_SI_TYPE) (HGAME hGame, MPADDR mp_addr, char *name, int no_echo,int tmo, int tmo_factor, int tmo_weight); | |
+typedef short mpcdecl (*MPCreateGULP_CS_TYPE) (HGAME hGame, MPADDR mp_addr, char *name, int no_echo,int tmo, int move_type, int move_max, int eject_max, int tmo_factor, int tmo_weight); | |
typedef int mpcdecl (*MPQueryGULP_TYPE) (HGAME hGame, MPADDR gulpAddr, MPLAYER_GULP_INFO* gulpInfo); | |
typedef int mpcdecl (*MPEnumPlayers_TYPE) (HGAME hGame, MPADDR *playerList, int lenList); | |
typedef int mpcdecl (*MPQueryPlayer_TYPE) (HGAME hGame, MPADDR playerAddr, MPLAYER_CLIENT_INFO* playerInfo); | |
@@ -2753,12 +2753,12 @@ typedef HGULP mpcdecl (*MPOpenSpeechGULP_TYPE)(HGAME hGame, short GULPOpenStyl | |
typedef short mpcdecl (*MPCloseSpeechGULP_TYPE) (HGULP gulp); | |
typedef short mpcdecl (*MPCloseGULPX_TYPE) ( HGULP hGULP ); | |
typedef short mpcdecl (*MPCloseGULP_TYPE) ( HGULP hGULP ); | |
-typedef short mpcdecl (*MPWriteGULP_TYPE) ( HGULP hGULP, char *msg, long msg_len, MPADDR* addr_list); | |
-typedef short mpcdecl (*MPReadGULP_TYPE) ( HGULP hGULP, MPADDR *sender, char *msg, long *msg_len ); | |
-typedef long mpcdecl (*MPIsDataReady_TYPE) (HGULP hGULP); | |
+typedef short mpcdecl (*MPWriteGULP_TYPE) ( HGULP hGULP, char *msg, int msg_len, MPADDR* addr_list); | |
+typedef short mpcdecl (*MPReadGULP_TYPE) ( HGULP hGULP, MPADDR *sender, char *msg, int *msg_len ); | |
+typedef int mpcdecl (*MPIsDataReady_TYPE) (HGULP hGULP); | |
typedef int mpcdecl (*MPResetGULPMeter_TYPE) (HGULP hGULP); | |
typedef GULPMETER * mpcdecl (*MPGetGULPMeter_TYPE) (HGULP hGULP); | |
-typedef void mpcdecl (*MPSpeechHandler_TYPE) (HGULP hGULP, void *context, MPADDR sender, char *msg, long msg_len); | |
+typedef void mpcdecl (*MPSpeechHandler_TYPE) (HGULP hGULP, void *context, MPADDR sender, char *msg, int msg_len); | |
typedef short mpcdecl (*MPOpenPhrase_TYPE) (HGULP hGULP, short phraseID, short codecType, MPADDR* addr_list ); | |
typedef short mpcdecl (*MPSendPhraseData_TYPE)(HGULP hGULP, short phraseID, short codecType, char *samples, short sampleLen, MPADDR* addr_list); | |
typedef short mpcdecl (*MPClosePhrase_TYPE) (HGULP hGULP, short phraseID, MPADDR* addr_list ); | |
@@ -2766,36 +2766,36 @@ typedef int mpcdecl (*MPSpeechInX_TYPE) (char *samples, | |
typedef int mpcdecl (*MPSpeechIn_TYPE) (char *samples, short numObjects, short objectSize, short criticalMass); | |
typedef int mpcdecl (*MPIsReadyToPlay_TYPE) (short criticalMass); | |
typedef int mpcdecl (*MPGetCodecInfo_TYPE) ( short *codecType ); | |
-typedef short mpcdecl (*MPGetQueueInfo_TYPE) ( short *phraseID, MPADDR *playerID, long *chunkCount ); | |
-typedef int mpcdecl (*MPLoadBinaryObject_TYPE) (char *objectName, void *pData, unsigned long *dataLen); | |
-typedef int mpcdecl (*MPSaveBinaryObject_TYPE) (char *objectName, void *pData, unsigned long dataLen); | |
+typedef short mpcdecl (*MPGetQueueInfo_TYPE) ( short *phraseID, MPADDR *playerID, int *chunkCount ); | |
+typedef int mpcdecl (*MPLoadBinaryObject_TYPE) (char *objectName, void *pData, unsigned int *dataLen); | |
+typedef int mpcdecl (*MPSaveBinaryObject_TYPE) (char *objectName, void *pData, unsigned int dataLen); | |
typedef short mpcdecl (*MPOpenPhraseRQ_TYPE) (HSESSION speechSess, short phraseID, short codecType ); | |
typedef short mpcdecl (*MPClosePhraseRQ_TYPE) (HSESSION speechSess, short phraseID ); | |
typedef short mpcdecl (*MPSendPhraseDataRQ_TYPE) (HSESSION speechSess, short phraseID, short codecType, char *samples, short sampleLen); | |
-typedef void mpcdecl (*MPQueueSpeech_TYPE) ( char * req_params, long req_params_len ); | |
-typedef unsigned long mpcdecl (*MPResetCompression_TYPE) (void); | |
-typedef unsigned long mpcdecl (*MPCompressSpeech_TYPE) (LPBYTE compressedBlock, LPBYTE rawSamples); | |
-typedef unsigned long mpcdecl (*MPDecompressSpeech_TYPE) ( LPBYTE rawSamples, LPBYTE compressedBlock); | |
-typedef long mpcdecl (*MPGetCodecParameters_TYPE) (short codecType, long *bytesPerSample, long *bytesPerBlock, long *blocksPerPacket, long *sampleFreq, long *bytesPerCompressedBlock ); | |
-typedef void mpcdecl (*MPSetTrace_TYPE) (long traceMask); | |
-typedef long mpcdecl (*MPGetTrace_TYPE) (); | |
+typedef void mpcdecl (*MPQueueSpeech_TYPE) ( char * req_params, int req_params_len ); | |
+typedef unsigned int mpcdecl (*MPResetCompression_TYPE) (void); | |
+typedef unsigned int mpcdecl (*MPCompressSpeech_TYPE) (LPBYTE compressedBlock, LPBYTE rawSamples); | |
+typedef unsigned int mpcdecl (*MPDecompressSpeech_TYPE) ( LPBYTE rawSamples, LPBYTE compressedBlock); | |
+typedef int mpcdecl (*MPGetCodecParameters_TYPE) (short codecType, int *bytesPerSample, int *bytesPerBlock, int *blocksPerPacket, int *sampleFreq, int *bytesPerCompressedBlock ); | |
+typedef void mpcdecl (*MPSetTrace_TYPE) (int traceMask); | |
+typedef int mpcdecl (*MPGetTrace_TYPE) (); | |
typedef void mpcdecl (*MPAbort_TYPE) (char* format, ...); | |
typedef void mpcdecl (*MPError_TYPE) (char* format, ...); | |
typedef void mpcdecl (*MPWarn_TYPE) (char* format, ...); | |
typedef void mpcdecl (*MPInfo_TYPE) (char* format, ...); | |
typedef void mpcdecl (*MPDebug_TYPE) (char* format, ...); | |
typedef void mpcdecl (*MPTraceMsg_TYPE) (char *msg); | |
-typedef long mpcdecl (*MPlayerVersion_TYPE) (char *versionString, long maxLen); | |
+typedef int mpcdecl (*MPlayerVersion_TYPE) (char *versionString, int maxLen); | |
typedef u_int mpcdecl (*MPStringToTlAddr_TYPE) (char *string, MPTLADDR* tl_addr); | |
typedef void mpcdecl (*MPTLADDRtostr_TYPE) (MPTLADDR* tl_addr, char*string); | |
-typedef int mpcdecl (*MPPingSession_TYPE) (void* hSess, unsigned long *msec); | |
-typedef int mpcdecl (*MPPingGame_TYPE) (HGAME hGame, unsigned long *msec); | |
-typedef int mpcdecl (*MPPingGULP_TYPE) (HGULP hGULP, unsigned long *msec); | |
-typedef int mpcdecl (*MPPingMPTlAddr_TYPE) (MPTLADDR *tl_addr, unsigned long *msec); | |
+typedef int mpcdecl (*MPPingSession_TYPE) (void* hSess, unsigned int *msec); | |
+typedef int mpcdecl (*MPPingGame_TYPE) (HGAME hGame, unsigned int *msec); | |
+typedef int mpcdecl (*MPPingGULP_TYPE) (HGULP hGULP, unsigned int *msec); | |
+typedef int mpcdecl (*MPPingMPTlAddr_TYPE) (MPTLADDR *tl_addr, unsigned int *msec); | |
typedef int mpcdecl (*MPTraceRoute_TYPE) (uint32_t targetIpAddr, uint32_t *routeIpAddrs, uint32_t *numIpAddrs); | |
typedef int mpcdecl (*MPEnableJoinLeaveNotification_TYPE) (HGAME hgame, MPJoinLeaveCBF* callback, void* context); | |
typedef int mpcdecl (*MPDisableJoinLeaveNotification_TYPE) (HGAME hGame, MPJoinLeaveCBF *callback, void* context); | |
-typedef short mpcdecl (*MPWaitForPlayers_TYPE) (HGAME hgame, const char *namedSync, long numPlayers, long timeout); | |
+typedef short mpcdecl (*MPWaitForPlayers_TYPE) (HGAME hgame, const char *namedSync, int numPlayers, int timeout); | |
typedef char * mpcdecl (*strmcpy_TYPE) (char *dst, char *src, int len); | |
typedef void mpcdecl (*MPIPX_DoPeriodicUpdate_TYPE) (WORD ); | |
typedef short mpcdecl (*MPIPX_GetMachineInfo_TYPE) (short, SOCKADDR_IPX *); | |
@@ -2807,10 +2807,10 @@ typedef int mpcdecl (*MPLogReturnVal_TYPE) (const char *functionName | |
typedef int mpcdecl (*MPLogAPICall_TYPE) (const char *functionName, ...); | |
typedef int mpcdecl (*MPGetLastError_TYPE) (); | |
typedef int mpcdecl (*MPGetErrorText_TYPE) (int errId, char *stringBuffer, int lenBuffer); | |
-typedef int mpcdecl (*MPMessageHandler_TYPE) (HGULP hGULP, long sender, char *msg, long msg_len); | |
+typedef int mpcdecl (*MPMessageHandler_TYPE) (HGULP hGULP, int sender, char *msg, int msg_len); | |
typedef void mpcdecl (*MPEnableAutoErrorMessageBoxes_TYPE) (int state); | |
typedef short mpcdecl (*MPGetPlayerIdByAddr_TYPE) (HGAME hGame, MPADDR playerAddr, MPPLAYERID *pId); | |
-typedef int mpcdecl (*MPAddResult_TYPE) (HGAME hGame, MPPLAYERID srcId, MPPLAYERID dstId, u_long key, long value); | |
+typedef int mpcdecl (*MPAddResult_TYPE) (HGAME hGame, MPPLAYERID srcId, MPPLAYERID dstId, u_int key, int value); | |
typedef int mpcdecl (*MPSaveResults_TYPE) (HGAME hGame); | |
typedef short mpcdecl (*MPSynchronizeGameTime_TYPE) (HGAME hGame); | |
typedef short mpcdecl (*MPGetGameTime_TYPE) (MP_GAME_TIME *time); | |
diff --git a/Main/heatscoring/Heatsdk/include/mpnet_ex.h b/Main/heatscoring/Heatsdk/include/mpnet_ex.h | |
index 1bd4be1..68565c5 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mpnet_ex.h | |
+++ b/Main/heatscoring/Heatsdk/include/mpnet_ex.h | |
@@ -73,7 +73,7 @@ extern "C" { | |
Multicast Address: 0x60000000..0x600007ff (11b) */ | |
-typedef u_long MPADDR; | |
+typedef u_int MPADDR; | |
typedef struct mpaddr_0_s { | |
#if defined(BIGENDIAN) | |
union { | |
@@ -616,7 +616,7 @@ MPTlAddrProtoTypeGet(MPTLADDR const* tl_addr); | |
u_int | |
MPSetTlIPAddr(MPTLADDR * tl_addr, | |
- u_long ip_addr); | |
+ u_int ip_addr); | |
/* Function | |
======== | |
@@ -627,7 +627,7 @@ MPSetTlIPAddr(MPTLADDR * tl_addr, | |
u_int | |
MPGetTlIPAddr(MPTLADDR const* tl_addr, | |
- u_long * ip_addr); | |
+ u_int * ip_addr); | |
/* Function | |
======== | |
diff --git a/Main/heatscoring/Heatsdk/include/mptypes.h b/Main/heatscoring/Heatsdk/include/mptypes.h | |
index fd3c8d9..8e21bd3 100644 | |
--- a/Main/heatscoring/Heatsdk/include/mptypes.h | |
+++ b/Main/heatscoring/Heatsdk/include/mptypes.h | |
@@ -60,11 +60,11 @@ typedef char* caddr_t; | |
typedef char int8_t; | |
typedef short int16_t; | |
-typedef long int32_t; | |
+typedef int int32_t; | |
typedef unsigned char uint8_t; | |
typedef unsigned short uint16_t; | |
-typedef unsigned long uint32_t; | |
+typedef unsigned int uint32_t; | |
#if defined(SunOS) | |
/* Need to turn these defines on , so that synch.h of all things, | |
diff --git a/Main/heatscoring/Heatsdk/include/sstypes.h b/Main/heatscoring/Heatsdk/include/sstypes.h | |
index f2762e4..e68456a 100644 | |
--- a/Main/heatscoring/Heatsdk/include/sstypes.h | |
+++ b/Main/heatscoring/Heatsdk/include/sstypes.h | |
@@ -60,12 +60,17 @@ typedef char* caddr_t; | |
#define ARCH_WORDSIZE 16 | |
#elif defined(WIN32) | |
#define ARCH_WORDSIZE 32 | |
+#elif defined(WIN64) | |
+ #define ARCH_WORDSIZE 64 | |
+#elif defined(__LP64__) | |
+ #define ARCH_WORDSIZE 64 | |
#else // UNIX? | |
#define ARCH_WORDSIZE 32 | |
#endif // OS | |
#endif //ARCH_WORDSIZE | |
+ | |
#if (ARCH_WORDSIZE == 16) | |
typedef char int8_t; | |
@@ -82,7 +87,7 @@ typedef short int16_t; | |
typedef long int32_t; | |
typedef unsigned char uint8_t; | |
typedef unsigned short uint16_t; | |
-typedef unsigned long uint32_t; | |
+typedef unsigned int uint32_t; | |
#if defined(SunOS) | |
diff --git a/Main/heatscoring/heatscoring.cpp b/Main/heatscoring/heatscoring.cpp | |
index 6111698..14abf51 100644 | |
--- a/Main/heatscoring/heatscoring.cpp | |
+++ b/Main/heatscoring/heatscoring.cpp | |
@@ -132,7 +132,7 @@ void DLLFUNCCALL DLLMultiCall (int eventnum) | |
DLLmprintf((0,"Pumping...\n")); | |
//DLLDescentDefer(); | |
DLLmprintf((0,"Pumped!\n")); | |
- unsigned long rcode; | |
+ unsigned int rcode; | |
do | |
{ | |
GetExitCodeProcess(si.hProcess,&rcode); | |
@@ -234,7 +234,7 @@ void DLLFUNCCALL DLLMultiScoreEvent(int eventnum, void *ptr) | |
void AutoLoginAndJoinGame(void) | |
{ | |
unsigned short port; | |
- unsigned long iaddr; | |
+ unsigned int iaddr; | |
*DLLMultiGameStarting = 0; | |
@@ -255,7 +255,7 @@ void AutoLoginAndJoinGame(void) | |
network_address s_address; | |
iaddr = inet_addr(DLLAuto_login_addr); | |
- memcpy (&s_address.address,&iaddr,sizeof(unsigned long)); | |
+ memcpy (&s_address.address,&iaddr,sizeof(unsigned int)); | |
s_address.port=port; | |
s_address.connection_type = NP_TCP; | |
*DLLGame_is_master_tracker_game = 0; | |
diff --git a/Main/heatscoring/heatscoring.h b/Main/heatscoring/heatscoring.h | |
index 7600b9e..33a4133 100644 | |
--- a/Main/heatscoring/heatscoring.h | |
+++ b/Main/heatscoring/heatscoring.h | |
@@ -48,7 +48,7 @@ char *DLLHelpText4; | |
char Score_Server[200]; | |
-unsigned long gameID; | |
+unsigned int gameID; | |
//Stuff for the connection DLLs | |
#define MT_EVT_LOGIN 1 | |
diff --git a/Main/heatscoring/mc_common.h b/Main/heatscoring/mc_common.h | |
index ef4202f..5c985dc 100644 | |
--- a/Main/heatscoring/mc_common.h | |
+++ b/Main/heatscoring/mc_common.h | |
@@ -434,7 +434,7 @@ CreateStringTable_fp DLLCreateStringTable; | |
typedef void (*DestroyStringTable_fp)(const char **table,int size); | |
DestroyStringTable_fp DLLDestroyStringTable; | |
-typedef int (*dp_GetModemChoices_fp)(char *buffer,unsigned long *size); | |
+typedef int (*dp_GetModemChoices_fp)(char *buffer,unsigned int *size); | |
dp_GetModemChoices_fp DLLdp_GetModemChoices; | |
typedef void (*DatabaseReadInt_fp)(const char *label, int *val); | |
diff --git a/Main/heatscoring/sstypes.h b/Main/heatscoring/sstypes.h | |
index 53f8291..882e54b 100644 | |
--- a/Main/heatscoring/sstypes.h | |
+++ b/Main/heatscoring/sstypes.h | |
@@ -86,8 +86,12 @@ typedef char* caddr_t; | |
#define ARCH_WORDSIZE 16 | |
#elif defined(WIN32) | |
#define ARCH_WORDSIZE 32 | |
-#else // UNIX? | |
- #define ARCH_WORDSIZE 32 | |
+#elif defined(WIN64) | |
+ #define ARCH_WORDSIZE 64 | |
+#elif defined(__LP64__) | |
+ #define ARCH_WORDSIZE 64 | |
+#else // UNIX? | |
+ #define ARCH_WORDSIZE 32 | |
#endif // OS | |
#endif //ARCH_WORDSIZE | |
@@ -105,10 +109,10 @@ typedef unsigned long uint32_t; | |
typedef char int8_t; | |
typedef short int16_t; | |
-typedef long int32_t; | |
+typedef int int32_t; | |
typedef unsigned char uint8_t; | |
typedef unsigned short uint16_t; | |
-typedef unsigned long uint32_t; | |
+typedef unsigned int uint32_t; | |
#if defined(SunOS) | |
diff --git a/Main/hogedit/HogEditDoc.cpp b/Main/hogedit/HogEditDoc.cpp | |
index 1f04f25..9a08c04 100644 | |
--- a/Main/hogedit/HogEditDoc.cpp | |
+++ b/Main/hogedit/HogEditDoc.cpp | |
@@ -442,7 +442,7 @@ int CHogEditDoc::AddFile(const char *pathname, hog_library_entry *entry) | |
char filename[PSFILENAME_LEN+1]; | |
char ext[_MAX_EXT]; | |
unsigned length; | |
- long timestamp; | |
+ int timestamp; | |
POSITION pos; | |
char path[PSPATHNAME_LEN]; | |
char drive[PSPATHNAME_LEN]; | |
diff --git a/Main/hogedit/HogEditDoc.h b/Main/hogedit/HogEditDoc.h | |
index 1fd03f9..1734e56 100644 | |
--- a/Main/hogedit/HogEditDoc.h | |
+++ b/Main/hogedit/HogEditDoc.h | |
@@ -77,7 +77,7 @@ typedef struct hog_library_entry | |
char path[PSPATHNAME_LEN]; // location of data file (filename not included) | |
char name[PSFILENAME_LEN+1]; // just the filename | |
unsigned length; // length of this file | |
- long timestamp; // time and date of file | |
+ int timestamp; // time and date of file | |
int flags; // misc flags | |
int offset; // file offset in hog (or -1 if in .rib file) | |
} hog_library_entry; | |
diff --git a/Main/hogmaker/hogmaker.c b/Main/hogmaker/hogmaker.c | |
index d5b0c05..de593e1 100644 | |
--- a/Main/hogmaker/hogmaker.c | |
+++ b/Main/hogmaker/hogmaker.c | |
@@ -17,7 +17,7 @@ typedef struct { | |
char name[LIB_FILENAME_LEN]; //just the filename part | |
int offset; //offset into library file | |
int length; //length of this file | |
- long timestamp; //time and date of file | |
+ int timestamp; //time and date of file | |
int flags; //misc flags | |
} library_entry; | |
@@ -250,7 +250,7 @@ void list_files(char *hogname) | |
printf(" %-12s %7d",hogfile->table[i].name,hogfile->table[i].length); | |
if (hogfile->table[i].timestamp) { | |
- long t = hogfile->table[i].timestamp; | |
+ int t = hogfile->table[i].timestamp; | |
char *timestring; | |
//printf(" %2d/%02d/%02d %2d:%02d:%02d",MONTH(t),DAY(t),YEAR(t),HOUR(t),MINUTE(t),SECOND(t)); | |
timestring = ctime(&t); | |
diff --git a/Main/hogmaker/hogmaker.cpp b/Main/hogmaker/hogmaker.cpp | |
index 78ccfa0..769e7c0 100644 | |
--- a/Main/hogmaker/hogmaker.cpp | |
+++ b/Main/hogmaker/hogmaker.cpp | |
@@ -15,7 +15,7 @@ typedef struct { | |
char name[LIB_FILENAME_LEN]; //just the filename part | |
int offset; //offset into library file | |
int length; //length of this file | |
- long timestamp; //time and date of file | |
+ int timestamp; //time and date of file | |
int flags; //misc flags | |
} library_entry; | |
@@ -244,7 +244,7 @@ list_files(char *hogname) | |
printf(" %-12s %7d",hogfile->table[i].name,hogfile->table[i].length); | |
if (hogfile->table[i].timestamp) { | |
- long t = hogfile->table[i].timestamp; | |
+ int t = hogfile->table[i].timestamp; | |
printf(" %2d/%02d/%02d %2d:%02d:%02d",MONTH(t),DAY(t),YEAR(t),HOUR(t),MINUTE(t),SECOND(t)); | |
} | |
else | |
diff --git a/Main/inetfile/Chttpget.cpp b/Main/inetfile/Chttpget.cpp | |
index ab2c297..e6608bb 100644 | |
--- a/Main/inetfile/Chttpget.cpp | |
+++ b/Main/inetfile/Chttpget.cpp | |
@@ -198,12 +198,12 @@ void ChttpGet::PrepSocket(const char *URL) | |
m_State = HTTP_STATE_SOCKET_ERROR; | |
return; | |
} | |
- unsigned long arg; | |
- arg = true; | |
#if defined(WIN32) | |
+ u_long arg = 1; | |
ioctlsocket( m_DataSock, FIONBIO, &arg ); | |
#elif defined(__LINUX__) | |
+ int arg = 1; | |
ioctl( m_DataSock, FIONBIO, &arg ); | |
#endif | |
diff --git a/Main/lanclient/lanclient.cpp b/Main/lanclient/lanclient.cpp | |
index 62938f0..db66ff1 100644 | |
--- a/Main/lanclient/lanclient.cpp | |
+++ b/Main/lanclient/lanclient.cpp | |
@@ -718,7 +718,7 @@ int MainMultiplayerMenu () | |
void AutoLoginAndJoinGame(void) | |
{ | |
unsigned short port; | |
- unsigned long iaddr; | |
+ unsigned int iaddr; | |
*DLLMultiGameStarting = 0; | |
@@ -740,7 +740,7 @@ void AutoLoginAndJoinGame(void) | |
network_address s_address; | |
iaddr = inet_addr(DLLAuto_login_addr); | |
- memcpy (&s_address.address,&iaddr,sizeof(unsigned long)); | |
+ memcpy (&s_address.address,&iaddr,sizeof(unsigned int)); | |
s_address.port=port; | |
s_address.connection_type = NP_TCP; | |
*DLLGame_is_master_tracker_game = 0; | |
diff --git a/Main/lib/Adecode.h b/Main/lib/Adecode.h | |
index 50cf7e7..b1ebcad 100644 | |
--- a/Main/lib/Adecode.h | |
+++ b/Main/lib/Adecode.h | |
@@ -48,7 +48,7 @@ typedef struct _AudioDecoder AudioDecoder; | |
AudioDecoder * __cdecl Create_AudioDecoder( | |
ReadFunction *reader, void *data, | |
unsigned *pChannels, unsigned *pSampleRate, | |
- long *pSampleCount); | |
+ int *pSampleCount); | |
// Read from audio decoder at most the specified qty of bytes | |
// (each sample takes two bytes). | |
diff --git a/Main/lib/Aencode.h b/Main/lib/Aencode.h | |
index 1da1eaf..c34191c 100644 | |
--- a/Main/lib/Aencode.h | |
+++ b/Main/lib/Aencode.h | |
@@ -28,11 +28,11 @@ extern "C" { | |
#define __cdecl | |
#endif | |
-typedef long __cdecl ReadSampleFunction(void *data); | |
+typedef int __cdecl ReadSampleFunction(void *data); | |
#define ReadSampleEof 0x80000000 | |
typedef struct _AudioEncoder AudioEncoder; | |
-unsigned long __cdecl AudioEncode( | |
+unsigned int __cdecl AudioEncode( | |
ReadSampleFunction *read, void *data, | |
unsigned channels, unsigned sample_rate, float volume, | |
FILE *out, | |
diff --git a/Main/lib/appdatabase.h b/Main/lib/appdatabase.h | |
index 464d337..a3e4b73 100644 | |
--- a/Main/lib/appdatabase.h | |
+++ b/Main/lib/appdatabase.h | |
@@ -76,7 +76,7 @@ public: | |
virtual bool write(const char *label, int entry) = 0; | |
// get the current user's name. | |
- virtual void get_user_name(char* buffer, ulong* size) = 0; | |
+ virtual void get_user_name(char* buffer, uint* size) = 0; | |
}; | |
// JCA: moved these from the Win32Database | |
diff --git a/Main/lib/bitmap.h b/Main/lib/bitmap.h | |
index 8facea4..1b76b9d 100644 | |
--- a/Main/lib/bitmap.h | |
+++ b/Main/lib/bitmap.h | |
@@ -53,7 +53,7 @@ typedef struct chunked_bitmap | |
} | |
chunked_bitmap; | |
extern bms_bitmap GameBitmaps[MAX_BITMAPS]; | |
-extern ulong Bitmap_memory_used; | |
+extern uint Bitmap_memory_used; | |
extern ubyte Memory_map[]; | |
// Sets all the bitmaps to unused | |
void bm_InitBitmaps(); | |
diff --git a/Main/lib/byteswap.h b/Main/lib/byteswap.h | |
index 66bad60..286b40f 100644 | |
--- a/Main/lib/byteswap.h | |
+++ b/Main/lib/byteswap.h | |
@@ -70,7 +70,7 @@ | |
#include "psendian.h" | |
#define SWAPSHORT(x) ( ((x) << 8) | (((ushort)(x)) >> 8) ) | |
-#define SWAPINT(x) ( ((x) << 24) | (((ulong)(x)) >> 24) | (((x) & 0x0000ff00) << 8) | (((x) & 0x00ff0000) >> 8) ) | |
+#define SWAPINT(x) ( ((x) << 24) | (((uint)(x)) >> 24) | (((x) & 0x0000ff00) << 8) | (((x) & 0x00ff0000) >> 8) ) | |
//Stupid function to trick the compiler into letting me byteswap a float | |
inline float SWAPFLOAT(float x) | |
@@ -123,7 +123,7 @@ inline float SWAPFLOAT(float x) | |
#endif | |
#define SWAPSHORT(x) (short)(0xFFFF & ( ((x) << 8) | (((ushort)(x)) >> 8) )) | |
- #define SWAPINT(x) (int)( ((x) << 24) | (((ulong)(x)) >> 24) | (((x) & 0x0000ff00) << 8) | (((x) & 0x00ff0000) >> 8) ) | |
+ #define SWAPINT(x) (int)( ((x) << 24) | (((uint)(x)) >> 24) | (((x) & 0x0000ff00) << 8) | (((x) & 0x00ff0000) >> 8) ) | |
//Stupid function to trick the compiler into letting me byteswap a float | |
inline float SWAPFLOAT(float x) | |
diff --git a/Main/lib/con_dll.h b/Main/lib/con_dll.h | |
index dfc4510..5e9bb95 100644 | |
--- a/Main/lib/con_dll.h | |
+++ b/Main/lib/con_dll.h | |
@@ -591,7 +591,7 @@ typedef int (*dp_InitDirectPlay_fp)(char *conn_name, void *parms,int num_element | |
EXTERN_OR_NOT dp_InitDirectPlay_fp DLLdp_InitDirectPlay; | |
-typedef int (*dp_GetModemChoices_fp)(char *buffer,unsigned long *size); | |
+typedef int (*dp_GetModemChoices_fp)(char *buffer,unsigned int *size); | |
EXTERN_OR_NOT dp_GetModemChoices_fp DLLdp_GetModemChoices; | |
#endif | |
@@ -756,8 +756,8 @@ typedef struct vmt_descent3_struct { | |
unsigned int lateral_thrust; | |
unsigned int rotational_thrust; | |
unsigned int sliding_pct; //Percentage of the time you were sliding | |
- unsigned long checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
- unsigned long pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
+ unsigned int checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
+ unsigned int pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
} vmt_descent3_struct; | |
#define DESCENT3_BLOCK_SIZE (sizeof(vmt_descent3_struct)-4) | |
#ifdef WIN32 | |
diff --git a/Main/lib/fix.h b/Main/lib/fix.h | |
index 8976378..49e0a1e 100644 | |
--- a/Main/lib/fix.h | |
+++ b/Main/lib/fix.h | |
@@ -62,7 +62,7 @@ | |
typedef unsigned short angle; | |
//The basic fixed-point type | |
-typedef long fix; | |
+typedef int fix; | |
#define PI 3.141592654 | |
#define PIOVER2 1.570796327 //DAJ | |
@@ -97,7 +97,7 @@ fix FloatToFixFast(float num); | |
//??#define FloatToFix(num) Round((num) * FLOAT_SCALER) | |
#define FloatToFix(num) ((fix)((num)*FLOAT_SCALER)) | |
#define IntToFix(num) ((num) << FIX_SHIFT) | |
-#define ShortToFix(num) (((long) (num)) << FIX_SHIFT) | |
+#define ShortToFix(num) (((int) (num)) << FIX_SHIFT) | |
#define FixToFloat(num) (((float) (num)) / FLOAT_SCALER) | |
#define FixToInt(num) ((num) >> FIX_SHIFT) | |
#define FixToShort(num) ((short) ((num) >> FIX_SHIFT)) | |
diff --git a/Main/lib/forcefeedback.h b/Main/lib/forcefeedback.h | |
index 6097e1f..b29a590 100644 | |
--- a/Main/lib/forcefeedback.h | |
+++ b/Main/lib/forcefeedback.h | |
@@ -154,31 +154,31 @@ typedef enum { | |
kMaxEffectSubTypes | |
}tEffType; | |
typedef struct tEffectConstant{ | |
- long Mag; // +- 10,000 | |
+ int Mag; // +- 10,000 | |
}tEffConstant; | |
typedef struct tEffectRamp{ | |
- long Start; // +- 10,000 | |
- long End; // +- 10,000 | |
+ int Start; // +- 10,000 | |
+ int End; // +- 10,000 | |
}tEffRamp; | |
typedef struct tEffectWave{ | |
- unsigned long Mag; // 0 to 10,000 | |
- long Offset; // +- 10,000 | |
- unsigned long Phase; // 0 to 35,999 | |
- unsigned long Period; | |
+ unsigned int Mag; // 0 to 10,000 | |
+ int Offset; // +- 10,000 | |
+ unsigned int Phase; // 0 to 35,999 | |
+ unsigned int Period; | |
}tEffWave; | |
typedef struct tEffectCondition{ | |
- long Offset; // +- 10,000 | |
- long PositiveCoefficient; // +- 10,000 | |
- long NegativeCoefficient; // +- 10,000 | |
- unsigned long PositiveSaturation; // 0 to 10,000 | |
- unsigned long NegativeSaturation; // 0 to 10,000 | |
- long DeadBand; // 0 to 10,000 | |
+ int Offset; // +- 10,000 | |
+ int PositiveCoefficient; // +- 10,000 | |
+ int NegativeCoefficient; // +- 10,000 | |
+ unsigned int PositiveSaturation; // 0 to 10,000 | |
+ unsigned int NegativeSaturation; // 0 to 10,000 | |
+ int DeadBand; // 0 to 10,000 | |
}tEffCondition; | |
typedef struct tEffectCustom{ | |
int Channels; | |
int Period; | |
int Samples; | |
- long *ForceData; | |
+ int *ForceData; | |
}tEffCustom; | |
typedef union tEffectInfo{ | |
tEffConstant Constant; | |
@@ -188,10 +188,10 @@ typedef union tEffectInfo{ | |
tEffCustom Custom; | |
}tEffInfo; | |
typedef struct tEffectEnvelope{ | |
- unsigned long AttackLevel; | |
- unsigned long AttackTime; | |
- unsigned long FadeLevel; | |
- unsigned long FadeTime; | |
+ unsigned int AttackLevel; | |
+ unsigned int AttackTime; | |
+ unsigned int FadeLevel; | |
+ unsigned int FadeTime; | |
}tEffEnvelope; | |
typedef enum{ | |
kXAxisOnly, | |
@@ -203,13 +203,13 @@ typedef struct tFFB_Effect{ | |
tEffType Type; | |
//tEffInfo TypeInfo[2]; | |
tEffInfo TypeInfo; | |
- unsigned long Duration; | |
- unsigned long Gain; // 0-10000 -- scales all magnitudes and envelope | |
- unsigned long Period; | |
+ unsigned int Duration; | |
+ unsigned int Gain; // 0-10000 -- scales all magnitudes and envelope | |
+ unsigned int Period; | |
tEffAxis Axis; | |
tJoyButtons Trigger; | |
- unsigned long TriggerRepeatTime; | |
- long Direction; // 0 to 360 deg. | |
+ unsigned int TriggerRepeatTime; | |
+ int Direction; // 0 to 360 deg. | |
tEffEnvelope Envelope; | |
}tFFB_Effect; | |
extern bool ddForce_found; //a Force Feedback device was found | |
diff --git a/Main/lib/gamedll_header.h b/Main/lib/gamedll_header.h | |
index aa1c8ef..5e42502 100644 | |
--- a/Main/lib/gamedll_header.h | |
+++ b/Main/lib/gamedll_header.h | |
@@ -945,7 +945,7 @@ DMFCDLLOUT(InitPlayerNewShip_fp DLLInitPlayerNewShip;) | |
// Returns internet address format from string address format...ie "204.243.217.14" | |
// turns into 1414829242 | |
-typedef unsigned long (*nw_GetHostAddressFromNumbers_fp)(char *str); | |
+typedef unsigned int (*nw_GetHostAddressFromNumbers_fp)(char *str); | |
DMFCDLLOUT(nw_GetHostAddressFromNumbers_fp DLLnw_GetHostAddressFromNumbers;) | |
// Removes all addon table files from D3 (really shouldn't be called, automatically done) | |
diff --git a/Main/lib/gameos.h b/Main/lib/gameos.h | |
index 12dce3a..0959a74 100644 | |
--- a/Main/lib/gameos.h | |
+++ b/Main/lib/gameos.h | |
@@ -129,7 +129,7 @@ public: | |
virtual bool write(const char *label, int *entry) = 0; | |
// get the current user's name from the os | |
- virtual void get_user_name(char* buffer, ulong* size) = 0; | |
+ virtual void get_user_name(char* buffer, uint* size) = 0; | |
}; | |
// Data structures | |
typedef struct os_date { | |
diff --git a/Main/lib/linux/lnxdatabase.h b/Main/lib/linux/lnxdatabase.h | |
index 5e9c9e8..3f8d145 100644 | |
--- a/Main/lib/linux/lnxdatabase.h | |
+++ b/Main/lib/linux/lnxdatabase.h | |
@@ -47,7 +47,7 @@ public: | |
virtual bool write(const char *label, int entry); | |
// get the current user's name. | |
- virtual void get_user_name(char* buffer, ulong* size); | |
+ virtual void get_user_name(char* buffer, uint* size); | |
}; | |
//Handy macro to read an int without having to specify the wordsize | |
diff --git a/Main/lib/linux/lnxdsound.h b/Main/lib/linux/lnxdsound.h | |
index a4b1c6a..8f0e8e4 100644 | |
--- a/Main/lib/linux/lnxdsound.h | |
+++ b/Main/lib/linux/lnxdsound.h | |
@@ -65,12 +65,12 @@ typedef struct | |
unsigned int play_cursor; | |
unsigned int write_cursor; | |
unsigned int flags; | |
- unsigned long left_vol,right_vol; | |
+ unsigned int left_vol,right_vol; | |
unsigned char *buffer; | |
- signed long volume; | |
- signed long pan; | |
+ signed int volume; | |
+ signed int pan; | |
WAVEFORMATEX wfx; | |
@@ -112,7 +112,7 @@ int LnxSoundBuffer_Release(LnxSoundBuffer *buff); | |
// 0 : no error | |
// -1 : Cannot set volume | |
// -2 : Invalid parameters | |
-int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed long vol); | |
+int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed int vol); | |
/////////////////////////// | |
// LnxSoundBuffer_SetPan | |
@@ -123,7 +123,7 @@ int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed long vol); | |
// 0 : no error | |
// -1 : Cannot set pan | |
// -2 : Invalid parameters | |
-int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff,signed long pan); | |
+int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff,signed int pan); | |
///////////////////////// | |
// LnxSoundBuffer_Stop | |
diff --git a/Main/lib/linux/oelnx_os.h b/Main/lib/linux/oelnx_os.h | |
index 0f2290a..193917a 100644 | |
--- a/Main/lib/linux/oelnx_os.h | |
+++ b/Main/lib/linux/oelnx_os.h | |
@@ -93,7 +93,7 @@ class osMacDatabase : public osDatabase | |
virtual bool write(const char *label, int *entry); | |
// get the current user's name from the os | |
- virtual void get_user_name(char* buffer, ulong* size); | |
+ virtual void get_user_name(char* buffer, uint* size); | |
protected: | |
// Additional Macintosh Functions, return true if successful | |
diff --git a/Main/lib/mac/oemac_os.h b/Main/lib/mac/oemac_os.h | |
index 90bc96f..920bfd4 100644 | |
--- a/Main/lib/mac/oemac_os.h | |
+++ b/Main/lib/mac/oemac_os.h | |
@@ -91,7 +91,7 @@ class osMacDatabase : public osDatabase | |
virtual bool write(const char *label, int *entry); | |
// get the current user's name from the os | |
- virtual void get_user_name(char* buffer, ulong* size); | |
+ virtual void get_user_name(char* buffer, uint* size); | |
protected: | |
// Additional Macintosh Functions, return true if successful | |
diff --git a/Main/lib/mvelibl.h b/Main/lib/mvelibl.h | |
index 9887434..f3cbaac 100644 | |
--- a/Main/lib/mvelibl.h | |
+++ b/Main/lib/mvelibl.h | |
@@ -58,8 +58,8 @@ void MVE_sndInit(LnxSoundDevice *lpDS); | |
** thru 10,000 (left -100db, right full volume). | |
** The default value for volume and pan is zero. | |
*/ | |
-void MVE_dsbSetVolume(long lVolume); | |
-void MVE_dsbSetPan(long lPan); | |
+void MVE_dsbSetVolume(int lVolume); | |
+void MVE_dsbSetPan(int lPan); | |
/* Only call this function to configure software to work with a Super VGA | |
@@ -93,7 +93,7 @@ void MVE_dsbSetPan(long lPan); | |
*/ | |
void MVE_sfSVGA(unsigned w, unsigned h, unsigned LineWidth, | |
unsigned WriteWin, unsigned char *WriteWinPtr, | |
- unsigned long WinSize, unsigned WinGran, | |
+ unsigned int WinSize, unsigned WinGran, | |
void *SetBank, unsigned hicolor); | |
/* This function alters the display from 640x480 or 640x400 to 640x350 resolution. | |
diff --git a/Main/lib/networking.h b/Main/lib/networking.h | |
index a4ea08c..5463317 100644 | |
--- a/Main/lib/networking.h | |
+++ b/Main/lib/networking.h | |
@@ -429,7 +429,7 @@ void nw_ConnectToServer(SOCKET *socket, network_address *server_addr); | |
// Returns internet address format from string address format...ie "204.243.217.14" | |
// turns into 1414829242 | |
-unsigned long nw_GetHostAddressFromNumbers (char *str); | |
+unsigned int nw_GetHostAddressFromNumbers (char *str); | |
// Fills in the string with the string address from the internet address | |
void nw_GetNumbersFromHostAddress(network_address * address,char *str); | |
@@ -500,7 +500,7 @@ void nw_psnet_buffer_packet(ubyte *data, int length, network_address *from); | |
int nw_psnet_buffer_get_next(ubyte *data, int *length, network_address *from); | |
// get the index of the next packet in order! | |
-int nw_psnet_buffer_get_next_by_dpid(ubyte *data, int *length, unsigned long dpid); | |
+int nw_psnet_buffer_get_next_by_dpid(ubyte *data, int *length, unsigned int dpid); | |
//This is all the reliable UDP stuff... | |
#define MAXNETBUFFERS 150 //Maximum network buffers (For between network and upper level functions, which is | |
diff --git a/Main/lib/pstypes.h b/Main/lib/pstypes.h | |
index b1c04c8..8c324df 100644 | |
--- a/Main/lib/pstypes.h | |
+++ b/Main/lib/pstypes.h | |
@@ -7,7 +7,7 @@ typedef unsigned char ubyte; | |
typedef signed char sbyte; | |
typedef unsigned short ushort; | |
typedef unsigned int uint; | |
-typedef unsigned long ulong; | |
+typedef unsigned int ulong; | |
#ifdef _MSC_VER //only Visual C++ has __int64 | |
typedef __int64 longlong; | |
diff --git a/Main/linux/lnxdata.cpp b/Main/linux/lnxdata.cpp | |
index ac7b129..8fb9b41 100644 | |
--- a/Main/linux/lnxdata.cpp | |
+++ b/Main/linux/lnxdata.cpp | |
@@ -204,7 +204,7 @@ bool oeLnxAppDatabase::write(const char *label, int entry) | |
} | |
// get the current user's name from the os | |
-void oeLnxAppDatabase::get_user_name(char* buffer, ulong* size) | |
+void oeLnxAppDatabase::get_user_name(char* buffer, uint* size) | |
{ | |
struct passwd *pwuid = getpwuid(geteuid()); | |
diff --git a/Main/lnxfuncs.cpp b/Main/lnxfuncs.cpp | |
index 1206a68..db1bf11 100644 | |
--- a/Main/lnxfuncs.cpp | |
+++ b/Main/lnxfuncs.cpp | |
@@ -14,7 +14,7 @@ | |
// (in case you want to pre-allocate a buffer to load them all into memory). | |
typedef unsigned ReadFunction(void *data, void *buf, unsigned qty); | |
typedef struct {bool empty;} AudioDecoder; | |
-AudioDecoder *Create_AudioDecoder(ReadFunction *reader, void *data,unsigned *pChannels, unsigned *pSampleRate,long *pSampleCount) | |
+AudioDecoder *Create_AudioDecoder(ReadFunction *reader, void *data,unsigned *pChannels, unsigned *pSampleRate,int *pSampleCount) | |
{ | |
return malloc(sizeof(AudioDecoder)); | |
} | |
diff --git a/Main/lnxmvelib/lnxdraw.cpp b/Main/lnxmvelib/lnxdraw.cpp | |
index 9ebb15d..42be78c 100644 | |
--- a/Main/lnxmvelib/lnxdraw.cpp | |
+++ b/Main/lnxmvelib/lnxdraw.cpp | |
@@ -753,7 +753,7 @@ inline void BltBuffer32ToPixMap24(unsigned char *pixmap,unsigned char *buffer,in | |
b = (c & 0x000000ff); | |
if(a) | |
- *(unsigned long *)data = ((r << 16) + (g << 8) + b); | |
+ *(unsigned int *)data = ((r << 16) + (g << 8) + b); | |
data += 4; | |
buffer+=4; | |
} | |
@@ -776,7 +776,7 @@ inline void BltBuffer16ToPixMap24(unsigned char *pixmap,unsigned char *buffer,in | |
b = (c&0x001F); | |
if(a) | |
- *(unsigned long *)data = ((r << 19) + (g << 11) + (b<<3)); | |
+ *(unsigned int *)data = ((r << 19) + (g << 11) + (b<<3)); | |
data +=4; | |
buffer+=2; | |
} | |
diff --git a/Main/lnxmvelib/lnxdsound.cpp b/Main/lnxmvelib/lnxdsound.cpp | |
index 3540a63..f307f26 100644 | |
--- a/Main/lnxmvelib/lnxdsound.cpp | |
+++ b/Main/lnxmvelib/lnxdsound.cpp | |
@@ -244,7 +244,7 @@ int LnxSoundBuffer_Release(LnxSoundBuffer *buff) | |
// 0 : no error | |
// -1 : Cannot set volume | |
// -2 : Invalid parameters | |
-int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed long vol) | |
+int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed int vol) | |
{ | |
if(!buff) | |
return -1; | |
@@ -270,9 +270,9 @@ int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed long vol) | |
double vt; | |
vt = (double)(buff->volume-(buff->pan>0?buff->pan:0)); | |
- buff->left_vol = (unsigned long)(pow(2.0,vt/600.0)*32768.0); | |
+ buff->left_vol = (unsigned int)(pow(2.0,vt/600.0)*32768.0); | |
vt = (double)(buff->volume+(buff->pan<0?buff->pan:0)); | |
- buff->right_vol = (unsigned long)(pow(2.0,vt/600.0)*32768.0); | |
+ buff->right_vol = (unsigned int)(pow(2.0,vt/600.0)*32768.0); | |
exit_critical(); | |
@@ -288,7 +288,7 @@ int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff,signed long vol) | |
// 0 : no error | |
// -1 : Cannot set pan | |
// -2 : Invalid parameters | |
-int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff,signed long pan) | |
+int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff,signed int pan) | |
{ | |
if(!buff) | |
return -1; | |
@@ -308,9 +308,9 @@ int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff,signed long pan) | |
double pt; | |
pt = (double)(buff->volume-(buff->pan>0?buff->pan:0)); | |
- buff->left_vol = (unsigned long)(pow(2.0,pt/600.0)*32768.0); | |
+ buff->left_vol = (unsigned int)(pow(2.0,pt/600.0)*32768.0); | |
pt = (double)(buff->volume+(buff->pan<0?buff->pan:0)); | |
- buff->right_vol = (unsigned long)(pow(2.0,pt/600.0)*32768.0); | |
+ buff->right_vol = (unsigned int)(pow(2.0,pt/600.0)*32768.0); | |
exit_critical(); | |
diff --git a/Main/lnxmvelib/mvelibi.h b/Main/lnxmvelib/mvelibi.h | |
index 8555180..44cfb9d 100644 | |
--- a/Main/lnxmvelib/mvelibi.h | |
+++ b/Main/lnxmvelib/mvelibi.h | |
@@ -98,7 +98,7 @@ typedef struct _mcmd_hdr { | |
#define mcmd_syncInit 2 | |
typedef struct _syncInit { | |
- unsigned long period; // period of quanta | |
+ unsigned int period; // period of quanta | |
unsigned short wait_quanta; // # of quanta per frame | |
} marg_syncInit; | |
@@ -119,8 +119,8 @@ typedef struct _sndConfigure { | |
unsigned char stereo:1, bits16:1, comp16:1; | |
unsigned char dummy1; | |
unsigned short frequency; | |
- // Minor opcode 1 extends buflen to be a long | |
- unsigned long buflen; | |
+ // Minor opcode 1 extends buflen to be a int | |
+ unsigned int buflen; | |
} marg_sndConfigure; | |
#define mcmd_sndSync 4 | |
@@ -209,13 +209,13 @@ typedef struct _palLoadPalette { | |
#define mcmd_nfPkInfo 19 | |
#define mcmd_nfHPkInfo 20 | |
typedef struct _nfPkInfo { | |
- unsigned long error; // scaled by 10000 | |
+ unsigned int error; // scaled by 10000 | |
unsigned short usage[64]; | |
} marg_nfPkInfo; | |
#define mcmd_idcode 21 | |
typedef struct _idcode { | |
- unsigned long idcode; // Code identifying version mcomp used to create | |
+ unsigned int idcode; // Code identifying version mcomp used to create | |
} marg_idcode; | |
#if __SC__ | |
diff --git a/Main/lnxmvelib/mvelibl.cpp b/Main/lnxmvelib/mvelibl.cpp | |
index 3dea44b..956e874 100644 | |
--- a/Main/lnxmvelib/mvelibl.cpp | |
+++ b/Main/lnxmvelib/mvelibl.cpp | |
@@ -139,13 +139,13 @@ static int sync_wait_quanta; | |
static bool sync_late = FALSE; | |
static bool sync_FrameDropped = FALSE; | |
-static void syncReset(unsigned long wait_quanta); | |
+static void syncReset(unsigned int wait_quanta); | |
static void syncRelease(void); | |
-static bool syncInit(unsigned long period, unsigned wait_quanta); | |
+static bool syncInit(unsigned int period, unsigned wait_quanta); | |
static bool syncWait(void); | |
static void syncSync(void); | |
-static void syncReset(unsigned long wait_quanta) | |
+static void syncReset(unsigned int wait_quanta) | |
{ | |
sync_time = wait_quanta - timeGetTime()*1000; | |
sync_active = TRUE; | |
@@ -156,9 +156,9 @@ static void syncRelease(void) | |
sync_active = FALSE; | |
} | |
-static bool syncInit(unsigned long period, unsigned wait_quanta) | |
+static bool syncInit(unsigned int period, unsigned wait_quanta) | |
{ | |
- int new_wait_quanta = -(long)(period*wait_quanta+(wait_quanta>>1)); | |
+ int new_wait_quanta = -(int)(period*wait_quanta+(wait_quanta>>1)); | |
// If timer is still running and has same timing | |
// characteristics, assume we are trying to continue smoothly | |
// with another movie and ignore new syncInit() call. | |
@@ -332,8 +332,8 @@ static unsigned snd_stereo; | |
static unsigned snd_comp16; | |
static unsigned snd_bits16; | |
-static long snd_volume = 0; | |
-static long snd_pan = 0; | |
+static int snd_volume = 0; | |
+static int snd_pan = 0; | |
#endif | |
@@ -344,7 +344,7 @@ void MVE_sndInit(LnxSoundDevice *lpDS) | |
#endif | |
} | |
-void MVE_dsbSetVolume(long lVolume) | |
+void MVE_dsbSetVolume(int lVolume) | |
{ | |
#if SOUND_SUPPORT | |
snd_volume = lVolume; | |
@@ -353,7 +353,7 @@ void MVE_dsbSetVolume(long lVolume) | |
#endif | |
} | |
-void MVE_dsbSetPan(long lPan) | |
+void MVE_dsbSetPan(int lPan) | |
{ | |
#if SOUND_SUPPORT | |
snd_pan = lPan; | |
@@ -542,9 +542,9 @@ static unsigned sndAddHelper(unsigned char *dst, unsigned char **pSrc, unsigned | |
{ | |
if (init) | |
{ | |
- state = *(unsigned long *)src; | |
+ state = *(unsigned int *)src; | |
state = INTEL_INT(state); | |
- *(unsigned long *)dst = state; | |
+ *(unsigned int *)dst = state; | |
src += 4; | |
dst += 4; | |
len -= 4; | |
@@ -934,7 +934,7 @@ static unsigned sf_hicolor; // Hicolor mode (0:none,1:normal,2:swapped) | |
// Banked screen parameters, Private, see mveliba.asm | |
void *sf_SetBank; | |
unsigned sf_WinGran; | |
-unsigned long sf_WinSize; | |
+unsigned int sf_WinSize; | |
unsigned sf_WinGranPerSize; | |
//{sf_WriteWinPtr and sf_WriteWinLimit replace sf_WriteWinSeg, see mveliba.asm} | |
unsigned char *sf_WriteWinPtr; | |
@@ -971,7 +971,7 @@ void mve_ShowFrameFieldHi(unsigned char *buf, unsigned bufw, unsigned bufh, | |
// dx: Window position in video memory in units of WinGran. | |
// on return, registers AX and DX are destroyed. | |
void MVE_sfSVGA(unsigned w, unsigned h, unsigned LineWidth,unsigned WriteWin, unsigned char *WriteWinPtr, | |
- unsigned long WinSize, unsigned WinGran,void *SetBank, unsigned hicolor) | |
+ unsigned int WinSize, unsigned WinGran,void *SetBank, unsigned hicolor) | |
{ | |
sf_ScreenWidth = w; | |
sf_ScreenHeight = h; | |
diff --git a/Main/lnxmvelib/mvelibl.h b/Main/lnxmvelib/mvelibl.h | |
index a70d65f..1ba9250 100644 | |
--- a/Main/lnxmvelib/mvelibl.h | |
+++ b/Main/lnxmvelib/mvelibl.h | |
@@ -93,7 +93,7 @@ void MVE_dsbSetPan(long lPan); | |
*/ | |
void MVE_sfSVGA(unsigned w, unsigned h, unsigned LineWidth, | |
unsigned WriteWin, unsigned char *WriteWinPtr, | |
- unsigned long WinSize, unsigned WinGran, | |
+ unsigned int WinSize, unsigned WinGran, | |
void *SetBank, unsigned hicolor); | |
/* This function alters the display from 640x480 or 640x400 to 640x350 resolution. | |
diff --git a/Main/manage/manage.cpp b/Main/manage/manage.cpp | |
index 08f4ab8..40847fc 100644 | |
--- a/Main/manage/manage.cpp | |
+++ b/Main/manage/manage.cpp | |
@@ -570,7 +570,7 @@ void Read256TextureNames (); | |
// Returns 1 on success, zero on error | |
int mng_InitTableFiles() | |
{ | |
- ulong size=TABLE_NAME_LEN; | |
+ uint size=TABLE_NAME_LEN; | |
int answer; | |
Database->get_user_name(TableUser, &size); | |
if (FindArg("-filter")) | |
diff --git a/Main/md5.c b/Main/md5.c | |
index 73ab342..44b5264 100644 | |
--- a/Main/md5.c | |
+++ b/Main/md5.c | |
@@ -94,7 +94,7 @@ main() | |
{ | |
int i; | |
for (i = 1; i <= 64; ++i) { | |
- unsigned long v = (unsigned long)(4294967296.0 * fabs(sin((double)i))); | |
+ unsigned int v = (unsigned int)(4294967296.0 * fabs(sin((double)i))); | |
printf("#define T%d 0x%08lx\n", i, v); | |
} | |
return 0; | |
diff --git a/Main/merc_install/outrage.c b/Main/merc_install/outrage.c | |
index a2e088f..4ff7a96 100644 | |
--- a/Main/merc_install/outrage.c | |
+++ b/Main/merc_install/outrage.c | |
@@ -32,8 +32,8 @@ | |
typedef struct | |
{ | |
- unsigned long dwLowDateTime; | |
- unsigned long dwHighDateTime; | |
+ unsigned int dwLowDateTime; | |
+ unsigned int dwHighDateTime; | |
} opkg_time_stamp; | |
diff --git a/Main/merc_install/pkg_install.cpp b/Main/merc_install/pkg_install.cpp | |
index a460805..622d21d 100644 | |
--- a/Main/merc_install/pkg_install.cpp | |
+++ b/Main/merc_install/pkg_install.cpp | |
@@ -64,8 +64,8 @@ typedef unsigned char ubyte; | |
typedef struct | |
{ | |
- unsigned long dwLowDateTime; | |
- unsigned long dwHighDateTime; | |
+ unsigned int dwLowDateTime; | |
+ unsigned int dwHighDateTime; | |
} FILETIME; | |
#elif (defined WIN32) | |
diff --git a/Main/misc/endian.cpp b/Main/misc/endian.cpp | |
index 79f2a61..be47621 100644 | |
--- a/Main/misc/endian.cpp | |
+++ b/Main/misc/endian.cpp | |
@@ -30,7 +30,7 @@ | |
#include "mono.h" | |
#define SWAPSHORT(x) ((0xffff & ((x) << 8) | (((unsigned short)(x)) >> 8) )) | |
-#define SWAPINT(x) ( ((x) << 24) | (((unsigned long)(x)) >> 24) | (((x) & 0x0000ff00) << 8) | (((x) & 0x00ff0000) >> 8) ) | |
+#define SWAPINT(x) ( ((x) << 24) | (((unsigned int)(x)) >> 24) | (((x) & 0x0000ff00) << 8) | (((x) & 0x00ff0000) >> 8) ) | |
inline float SWAPFLOAT(float x){int i = SWAPINT(*((int *) &(x)));return *((float *) &(i));} | |
#define ENDIAN_BIG_ENDIAN 0 | |
diff --git a/Main/misc/psrand.cpp b/Main/misc/psrand.cpp | |
index f5dffa4..b5237b6 100644 | |
--- a/Main/misc/psrand.cpp | |
+++ b/Main/misc/psrand.cpp | |
@@ -21,13 +21,13 @@ | |
#include "psrand.h" | |
-static long ps_holdrand = 1L; | |
+static int ps_holdrand = 1L; | |
//These are adapted from the C runtime lib. Pretty simple. | |
void ps_srand(unsigned int seed) | |
{ | |
- ps_holdrand = (long)seed; | |
+ ps_holdrand = (int)seed; | |
} | |
int ps_rand(void) | |
diff --git a/Main/module/module.cpp b/Main/module/module.cpp | |
index 4227ecd..fe02255 100644 | |
--- a/Main/module/module.cpp | |
+++ b/Main/module/module.cpp | |
@@ -609,7 +609,7 @@ MODPROCADDRESS mod_GetSymbol(module *handle,const char *symstr,unsigned char par | |
connID = (CFragConnectionID) handle->handle; | |
//DAJ for testing only | |
- long numSym; | |
+ int numSym; | |
Ptr symAddr; | |
err = CountSymbols(connID, &numSym); | |
for(int i = 0; i < numSym; i++) { | |
diff --git a/Main/movie/Blitter.c b/Main/movie/Blitter.c | |
index fa8ac7e..58ff3b0 100644 | |
--- a/Main/movie/Blitter.c | |
+++ b/Main/movie/Blitter.c | |
@@ -13,7 +13,7 @@ | |
#define CENTERTYPE double | |
#define ALIGNMASK 7L | |
#elif CENTERSIZE == 32 | |
-#define CENTERTYPE unsigned long | |
+#define CENTERTYPE unsigned int | |
#define ALIGNMASK 3L | |
#else | |
#error "CENTERTYPES smaller than 32 bits are silly!" | |
@@ -47,7 +47,7 @@ UInt32 repProlog, repCenter, repEpilog; | |
if (w >= sizeof (CENTERTYPE)) | |
{ | |
//Ž Find the number of iterations needed to blit the start, middle, and ending sections of the line | |
- repProlog = (unsigned long) src & ALIGNMASK; | |
+ repProlog = (unsigned int) src & ALIGNMASK; | |
repCenter = (w - repProlog) / sizeof (CENTERTYPE); | |
repEpilog = w - repProlog - (repCenter * sizeof (CENTERTYPE)); | |
@@ -117,7 +117,7 @@ UInt32 repProlog, repCenter, repEpilog; | |
if (w >= sizeof (CENTERTYPE)) | |
{ | |
//Ž Find the number of iterations needed to blit the start, middle, and ending sections of the line | |
- repProlog = (unsigned long) src & ALIGNMASK; | |
+ repProlog = (unsigned int) src & ALIGNMASK; | |
repCenter = (w - repProlog) / sizeof (CENTERTYPE); | |
repEpilog = w - repProlog - (repCenter * sizeof (CENTERTYPE)); | |
@@ -187,7 +187,7 @@ UInt32 repProlog, repCenter, repEpilog; | |
if (w >= sizeof (CENTERTYPE)) | |
{ | |
//Ž Find the number of iterations needed to blit the start, middle, and ending sections of the line | |
- repProlog = (unsigned long) src & ALIGNMASK; | |
+ repProlog = (unsigned int) src & ALIGNMASK; | |
repCenter = (w - repProlog) / sizeof (CENTERTYPE); | |
repEpilog = w - repProlog - (repCenter * sizeof (CENTERTYPE)); | |
@@ -351,11 +351,11 @@ Rect updateRect; | |
dstw = w/3*4; | |
while (h--) { | |
- unsigned long numToBlit = w/3; | |
+ unsigned int numToBlit = w/3; | |
while (numToBlit--) { | |
- //*(unsigned long *)dst = *(unsigned long *)src; | |
- *(unsigned long *)dst = ((*((src)+0)<<24)|(*((src)+0)<<16)|(*((src)+1)<<8)|(*((src)+2))); | |
+ //*(unsigned int *)dst = *(unsigned int *)src; | |
+ *(unsigned int *)dst = ((*((src)+0)<<24)|(*((src)+0)<<16)|(*((src)+1)<<8)|(*((src)+2))); | |
src +=3; | |
dst +=4; | |
} | |
diff --git a/Main/movie/mvelib.h b/Main/movie/mvelib.h | |
index c7fda87..3c1f736 100644 | |
--- a/Main/movie/mvelib.h | |
+++ b/Main/movie/mvelib.h | |
@@ -111,7 +111,7 @@ extern void MVE_sndInit(SndChannelPtr theChannel); | |
//¥ | |
//¥ WriteWin, WriteWinPtr, WinSize, WinGran, SetBank and hicolor are ignored | |
//¥ and are provided only to allow client code compatibility with the DOS/Windows players | |
-extern void MVE_sndVolume(long volume); | |
+extern void MVE_sndVolume(int volume); | |
//¥ This will change the overall volume of the movie player. | |
//¥ 'volume' should be a 32-bit unsigned long where the low 16 bits are used for the | |
//¥ left channel and the high 16 bits are used for the right channel. 0 is silence, | |
diff --git a/Main/mtclient/chat_api.cpp b/Main/mtclient/chat_api.cpp | |
index bc77e66..8cf42e8 100644 | |
--- a/Main/mtclient/chat_api.cpp | |
+++ b/Main/mtclient/chat_api.cpp | |
@@ -116,7 +116,7 @@ int ConnectToChatServer(const char *serveraddr,const char *nickname,const char * | |
short chat_port; | |
char chat_server[50]; | |
const char *p; | |
- unsigned long argp = 1; | |
+ unsigned int argp = 1; | |
char signon_str[100]; | |
//if(Socket_connected && ) return -2; | |
diff --git a/Main/mtclient/mt_net.cpp b/Main/mtclient/mt_net.cpp | |
index 57f5127..9a34d1f 100644 | |
--- a/Main/mtclient/mt_net.cpp | |
+++ b/Main/mtclient/mt_net.cpp | |
@@ -95,8 +95,8 @@ typedef struct vmt_descent3_struct { | |
unsigned int lateral_thrust; | |
unsigned int rotational_thrust; | |
unsigned int sliding_pct; //Percentage of the time you were sliding | |
- unsigned long checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
- unsigned long pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
+ unsigned int checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
+ unsigned int pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
} vmt_descent3_struct; | |
#define DESCENT3_BLOCK_SIZE (sizeof(vmt_descent3_struct)-4) | |
#ifdef WIN32 | |
diff --git a/Main/mtclient/mtclient.cpp b/Main/mtclient/mtclient.cpp | |
index 8f8c855..93f30d3 100644 | |
--- a/Main/mtclient/mtclient.cpp | |
+++ b/Main/mtclient/mtclient.cpp | |
@@ -3324,7 +3324,7 @@ void AutoLoginAndJoinGame(void) | |
int passlen = PASSWORD_LEN; | |
int valret; | |
unsigned short port; | |
- unsigned long iaddr; | |
+ unsigned int iaddr; | |
*DLLMultiGameStarting = 0; | |
DLLCreateSplashScreen(TXT_PXO_CONNECTING,0); | |
@@ -3396,7 +3396,7 @@ void AutoLoginAndJoinGame(void) | |
network_address s_address; | |
iaddr = inet_addr(DLLAuto_login_addr); | |
- memcpy (&s_address.address,&iaddr,sizeof(unsigned long)); | |
+ memcpy (&s_address.address,&iaddr,sizeof(unsigned int)); | |
s_address.port=port; | |
s_address.connection_type = NP_TCP; | |
*DLLGame_is_master_tracker_game = 1; | |
diff --git a/Main/mtclient/mtgametrack.h b/Main/mtclient/mtgametrack.h | |
index 03debf1..5a63052 100644 | |
--- a/Main/mtclient/mtgametrack.h | |
+++ b/Main/mtclient/mtgametrack.h | |
@@ -143,7 +143,7 @@ typedef struct { | |
unsigned char game_type; //1==freespace (GT_FREESPACE), 2==D3, 3==tuberacer, etc. | |
SOCKADDR_IN addr; | |
int type; //Used to specify what to do ie. Add a new net game (GNT_GAMESTARTED), remove a net game (game over), etc. | |
- unsigned long sig; //Unique identifier for client ACKs (The server always fills this in, the client responds) | |
+ unsigned int sig; //Unique identifier for client ACKs (The server always fills this in, the client responds) | |
char data[MAX_GT_GAME_DATA_SIZE]; | |
}game_packet_header; | |
@@ -197,14 +197,14 @@ typedef struct _active_games{ | |
typedef struct { | |
unsigned char game_type; | |
char game_name[MAX_GAME_LISTS_PER_PACKET][MAX_GENERIC_GAME_NAME_LEN]; | |
- unsigned long game_server[MAX_GAME_LISTS_PER_PACKET]; | |
+ unsigned int game_server[MAX_GAME_LISTS_PER_PACKET]; | |
unsigned short game_port[MAX_GAME_LISTS_PER_PACKET]; | |
}game_list; | |
*/ | |
typedef struct { | |
unsigned char game_type; | |
- unsigned long game_server[MAX_GAME_LISTS_PER_PACKET*4]; | |
+ unsigned int game_server[MAX_GAME_LISTS_PER_PACKET*4]; | |
unsigned short game_port[MAX_GAME_LISTS_PER_PACKET*4]; | |
}game_list; | |
diff --git a/Main/mtclient/mtpilottrack.h b/Main/mtclient/mtpilottrack.h | |
index 862aeb5..ba17ff8 100644 | |
--- a/Main/mtclient/mtpilottrack.h | |
+++ b/Main/mtclient/mtpilottrack.h | |
@@ -233,10 +233,10 @@ typedef struct { | |
typedef struct { | |
unsigned char type; //Type of request | |
unsigned short len; //Length of total packet, including this header | |
- unsigned long code; //For control messages | |
+ unsigned int code; //For control messages | |
unsigned short xcode; //For control/NAK messages and for sigs. | |
- unsigned long sig; //To identify unique return ACKs | |
- unsigned long security; // Just a random value, we store the last value used in the user record | |
+ unsigned int sig; //To identify unique return ACKs | |
+ unsigned int security; // Just a random value, we store the last value used in the user record | |
// So we don't process the same request twice. | |
unsigned char data[MAX_UDP_DATA_LENGH]; | |
} udp_packet_header; | |
@@ -248,12 +248,12 @@ typedef struct { | |
typedef struct _net_reg_queue { | |
char login[LOGIN_LEN]; //Login id | |
- unsigned long time_last_sent; //Time in milliseconds since we last sent this packet | |
+ unsigned int time_last_sent; //Time in milliseconds since we last sent this packet | |
int retries; //Number of times this has been sent | |
udp_packet_header packet; //Packet containing the actual data to resend, etc. | |
struct _net_reg_queue *next; //Pointer to next item in the list | |
SOCKADDR netaddr; | |
- unsigned long sig; //Signature to be used by the client to ACK our response. | |
+ unsigned int sig; //Signature to be used by the client to ACK our response. | |
} net_reg_queue; | |
#endif | |
@@ -278,8 +278,8 @@ typedef struct vmt_descent3_struct { | |
unsigned int lateral_thrust; | |
unsigned int rotational_thrust; | |
unsigned int sliding_pct; //Percentage of the time you were sliding | |
- unsigned long checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
- unsigned long pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
+ unsigned int checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
+ unsigned int pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
} vmt_descent3_struct; | |
*/ | |
@@ -298,7 +298,7 @@ void PollPTrackNet(); | |
void ValidIdle(); | |
//int ValidateUser(validate_id_request *valid_id); | |
int ValidateUser(validate_id_request *valid_id, char *trackerid); | |
-void xorcode(void *data,unsigned int len,unsigned long hash); | |
+void xorcode(void *data,unsigned int len,unsigned int hash); | |
extern int MTAVersionCheck(unsigned int oldver, char *URL); | |
void VersionIdle(); | |
void HandlePilotData(ubyte *data,int len, network_address *from); | |
diff --git a/Main/mtclient/mtpilottracker.cpp b/Main/mtclient/mtpilottracker.cpp | |
index 4386cfa..bde325d 100644 | |
--- a/Main/mtclient/mtpilottracker.cpp | |
+++ b/Main/mtclient/mtpilottracker.cpp | |
@@ -145,8 +145,8 @@ typedef struct vmt_descent3_struct { | |
unsigned int lateral_thrust; | |
unsigned int rotational_thrust; | |
unsigned int sliding_pct; //Percentage of the time you were sliding | |
- unsigned long checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
- unsigned long pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
+ unsigned int checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
+ unsigned int pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
} vmt_descent3_struct; | |
#define DESCENT3_BLOCK_SIZE (sizeof(vmt_descent3_struct)-4) | |
#ifdef WIN32 | |
@@ -728,17 +728,17 @@ void ValidIdle() | |
} | |
} | |
//This code will modify 4 bytes at a time, so make sure to pad it!!! | |
-void xorcode(void *data,unsigned int len,unsigned long hash) | |
+void xorcode(void *data,unsigned int len,unsigned int hash) | |
{ | |
return; | |
unsigned int i=0; | |
- unsigned long *src = (unsigned long *)&data; | |
+ unsigned int *src = (unsigned int *)&data; | |
while(i<len) | |
{ | |
*src = *src ^ hash; | |
src++; | |
- i += sizeof(unsigned long); | |
+ i += sizeof(unsigned int); | |
} | |
} | |
diff --git a/Main/multi.h b/Main/multi.h | |
index 61f9bdd..a79ce1b 100644 | |
--- a/Main/multi.h | |
+++ b/Main/multi.h | |
@@ -811,8 +811,8 @@ typedef struct vmt_descent3_struct { | |
unsigned int lateral_thrust; | |
unsigned int rotational_thrust; | |
unsigned int sliding_pct; //Percentage of the time you were sliding | |
- unsigned long checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
- unsigned long pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
+ unsigned int checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
+ unsigned int pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
} vmt_descent3_struct; | |
#define DESCENT3_BLOCK_SIZE (sizeof(vmt_descent3_struct)-4) | |
#if defined(WIN32) | |
diff --git a/Main/multi_external.h b/Main/multi_external.h | |
index fc13b41..773fea5 100644 | |
--- a/Main/multi_external.h | |
+++ b/Main/multi_external.h | |
@@ -194,7 +194,7 @@ typedef struct | |
ubyte sequence; // where we are in the sequence chain | |
ubyte pps; | |
HANDLE hPlayerEvent; // player event to use for directplay | |
- unsigned long dpidPlayer; // directplay ID of player created | |
+ unsigned int dpidPlayer; // directplay ID of player created | |
float ping_time; | |
float last_ping_time; | |
ushort pilot_pic_id; | |
diff --git a/Main/nettest/nettest.cpp b/Main/nettest/nettest.cpp | |
index d410c0b..bf498c1 100644 | |
--- a/Main/nettest/nettest.cpp | |
+++ b/Main/nettest/nettest.cpp | |
@@ -406,7 +406,7 @@ int Sock_Init() | |
TCP_unreliable_socket = INVALID_SOCKET; | |
} | |
// Make the socket non-blocking | |
- unsigned long arg; | |
+ unsigned int arg; | |
arg = TRUE; | |
if(!Daemon_mode) | |
ioctlsocket( TCP_unreliable_socket, FIONBIO, &arg ); | |
@@ -531,7 +531,7 @@ unsigned int psnet_ras_status() | |
int PingGamePorts(char *host) | |
{ | |
HOSTENT *he; | |
- unsigned long uladdr = inet_addr(host); | |
+ unsigned int uladdr = inet_addr(host); | |
if(INADDR_NONE!=uladdr) | |
{ | |
memcpy(&pingaddr.sin_addr,&uladdr,sizeof(unsigned int)); | |
diff --git a/Main/nettest/nettest.h b/Main/nettest/nettest.h | |
index 049538a..25d5f84 100644 | |
--- a/Main/nettest/nettest.h | |
+++ b/Main/nettest/nettest.h | |
@@ -69,7 +69,7 @@ SOCKADDR_IPX IPX_unrel_addr; | |
UUID uuid; | |
#endif | |
-unsigned long Bindip = INADDR_ANY; | |
+unsigned int Bindip = INADDR_ANY; | |
//rcg06192000 win32-specifics put in #ifdef. | |
#ifdef WIN32 | |
diff --git a/Main/networking/networking.cpp b/Main/networking/networking.cpp | |
index 35255b1..7056463 100644 | |
--- a/Main/networking/networking.cpp | |
+++ b/Main/networking/networking.cpp | |
@@ -358,7 +358,7 @@ network_protocol NetworkProtocol=NP_NONE; | |
int Sockets_initted = 0; | |
int Network_initted =0; | |
-unsigned long Net_fixed_ip = INADDR_NONE; | |
+unsigned int Net_fixed_ip = INADDR_NONE; | |
// sockets for IPX and TCP | |
SOCKET IPX_socket; | |
@@ -716,15 +716,12 @@ void nw_SetSocketOptions( SOCKET sock ) | |
setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (LPSTR)&broadcast, sizeof(broadcast) ); | |
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (LPSTR)&broadcast, sizeof(broadcast) ); | |
- | |
- int error; | |
- unsigned long arg; | |
- | |
- arg = TRUE; | |
#ifdef WIN32 | |
- error = ioctlsocket( sock, FIONBIO, &arg ); | |
+ u_long arg = TRUE | |
+ int error = ioctlsocket( sock, FIONBIO, &arg ); | |
#elif defined(__LINUX__) | |
- error = ioctl(sock,FIONBIO,&arg); | |
+ int arg = TRUE; | |
+ int error = ioctl(sock,FIONBIO,&arg); | |
#endif | |
if ( error == SOCKET_ERROR ) | |
{ | |
@@ -1012,7 +1009,7 @@ void nw_GetMyAddress (network_address *addr) | |
// Returns internet address format from string address format...ie "204.243.217.14" | |
// turns into 1414829242 | |
-unsigned long nw_GetHostAddressFromNumbers (char *str) | |
+unsigned int nw_GetHostAddressFromNumbers (char *str) | |
{ | |
//ASSERT (NetworkProtocol==NP_TCP); | |
@@ -1097,7 +1094,7 @@ unsigned int nw_GetThisIP() | |
// Resolve host name for local address | |
hostent = gethostbyname((LPSTR)local); | |
if ( hostent ) | |
- local_address.sin_addr.s_addr = *((u_long FAR *)(hostent->h_addr)); | |
+ local_address.sin_addr.s_addr = *((u_int FAR *)(hostent->h_addr)); | |
} | |
*/ | |
local_address.sin_addr.s_addr = INADDR_ANY; | |
@@ -2376,7 +2373,7 @@ void nw_psnet_buffer_packet(ubyte *data, int length, network_address *from) | |
// get the index of the next packet in order! | |
-int nw_psnet_buffer_get_next_by_dpid(ubyte *data, int *length, unsigned long dpid) | |
+int nw_psnet_buffer_get_next_by_dpid(ubyte *data, int *length, unsigned int dpid) | |
{ | |
int idx; | |
int found_buf = 0; | |
@@ -2390,8 +2387,8 @@ int nw_psnet_buffer_get_next_by_dpid(ubyte *data, int *length, unsigned long dpi | |
// search until we find the lowest packet index id# | |
for(idx=0;idx<MAX_PACKET_BUFFERS;idx++) | |
{ | |
- unsigned long *thisid; | |
- thisid = (unsigned long *) &Psnet_buffers[idx].from_addr.address; | |
+ unsigned int *thisid; | |
+ thisid = (unsigned int *) &Psnet_buffers[idx].from_addr.address; | |
// if we found the buffer | |
if((Psnet_buffers[idx].sequence_number == Psnet_lowest_id)&&(dpid==*thisid)) | |
{ | |
@@ -2462,10 +2459,10 @@ int nw_psnet_buffer_get_next(ubyte *data, int *length, network_address *from) | |
unsigned int psnet_ras_status() | |
{ | |
int rval; | |
- unsigned long size, num_connections, i; | |
+ unsigned int size, num_connections, i; | |
RASCONN rasbuffer[25]; | |
HINSTANCE ras_handle; | |
- unsigned long rasip=0; | |
+ unsigned int rasip=0; | |
RASPPPIP projection; | |
int Ras_connected; | |
@@ -2514,7 +2511,7 @@ unsigned int psnet_ras_status() | |
for (i = 0; i < num_connections; i++ ) { | |
RASCONNSTATUS status; | |
- unsigned long size; | |
+ unsigned int size; | |
mprintf((0, "Connection %d:\n", i)); | |
mprintf((0, "Entry Name: %s\n", rasbuffer[i].szEntryName)); | |
diff --git a/Main/object_external_struct.h b/Main/object_external_struct.h | |
index 43082d0..feaa7b1 100644 | |
--- a/Main/object_external_struct.h | |
+++ b/Main/object_external_struct.h | |
@@ -413,7 +413,7 @@ typedef struct object { | |
ubyte type; // what type of object this is... robot, weapon, hostage, powerup, fireball | |
ubyte dummy_type; // stored type of an OBJ_DUMMY | |
ushort id; // which form of object...which powerup, robot, etc. | |
- ulong flags; | |
+ uint flags; | |
char *name; // the name of this object, or NULL | |
diff --git a/Main/pilottrack.h b/Main/pilottrack.h | |
index 3563f89..ffcfab2 100644 | |
--- a/Main/pilottrack.h | |
+++ b/Main/pilottrack.h | |
@@ -201,10 +201,10 @@ typedef struct { | |
typedef struct { | |
unsigned char type; //Type of request | |
unsigned short len; //Length of total packet, including this header | |
- unsigned long code; //For control messages | |
+ unsigned int code; //For control messages | |
unsigned short xcode; //For control/NAK messages and for sigs. | |
- unsigned long sig; //To identify unique return ACKs | |
- unsigned long security; // Just a random value, we store the last value used in the user record | |
+ unsigned int sig; //To identify unique return ACKs | |
+ unsigned int security; // Just a random value, we store the last value used in the user record | |
// So we don't process the same request twice. | |
unsigned char data[MAX_UDP_DATA_LENGH]; | |
} udp_packet_header; | |
@@ -216,12 +216,12 @@ typedef struct { | |
typedef struct _net_reg_queue { | |
char login[LOGIN_LEN]; //Login id | |
- unsigned long time_last_sent; //Time in milliseconds since we last sent this packet | |
+ unsigned int time_last_sent; //Time in milliseconds since we last sent this packet | |
int retries; //Number of times this has been sent | |
udp_packet_header packet; //Packet containing the actual data to resend, etc. | |
struct _net_reg_queue *next; //Pointer to next item in the list | |
SOCKADDR netaddr; | |
- unsigned long sig; //Signature to be used by the client to ACK our response. | |
+ unsigned int sig; //Signature to be used by the client to ACK our response. | |
} net_reg_queue; | |
#endif | |
@@ -246,8 +246,8 @@ typedef struct vmt_descent3_struct { | |
unsigned int lateral_thrust; | |
unsigned int rotational_thrust; | |
unsigned int sliding_pct; //Percentage of the time you were sliding | |
- unsigned long checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
- unsigned long pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
+ unsigned int checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded | |
+ unsigned int pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now | |
} vmt_descent3_struct; | |
#define DESCENT3_BLOCK_SIZE (sizeof(vmt_descent3_struct)-4) | |
@@ -266,7 +266,7 @@ void PollPTrackNet(); | |
void ValidIdle(); | |
//int ValidateUser(validate_id_request *valid_id); | |
int ValidateUser(validate_id_request *valid_id, char *trackerid); | |
-void xorcode(void *data,unsigned int len,unsigned long hash); | |
+void xorcode(void *data,unsigned int len,unsigned int hash); | |
#endif | |
diff --git a/Main/pilottracker.cpp b/Main/pilottracker.cpp | |
index 3bd27d0..e0d00ea 100644 | |
--- a/Main/pilottracker.cpp | |
+++ b/Main/pilottracker.cpp | |
@@ -546,15 +546,15 @@ void ValidIdle() | |
} | |
} | |
//This code will modify 4 bytes at a time, so make sure to pad it!!! | |
-void xorcode(void *data,unsigned int len,unsigned long hash) | |
+void xorcode(void *data,unsigned int len,unsigned int hash) | |
{ | |
unsigned int i=0; | |
- unsigned long *src = (unsigned long *)&data; | |
+ unsigned int *src = (unsigned int *)&data; | |
while(i<len) | |
{ | |
*src = *src ^ hash; | |
src++; | |
- i += sizeof(unsigned long); | |
+ i += sizeof(unsigned int); | |
} | |
} | |
\ No newline at end of file | |
diff --git a/Main/renderer/MACOPENGL.CPP b/Main/renderer/MACOPENGL.CPP | |
index ab397c1..b86e6b6 100644 | |
--- a/Main/renderer/MACOPENGL.CPP | |
+++ b/Main/renderer/MACOPENGL.CPP | |
@@ -617,7 +617,7 @@ void opengl_Close () | |
for (int i=1;i<Cur_texture_object_num;i++) | |
delete_list[i]=i; | |
if (Cur_texture_object_num>1) | |
- glDeleteTextures ((long)Cur_texture_object_num,(const ulong *)delete_list); | |
+ glDeleteTextures ((GLint)Cur_texture_object_num,(const ulong *)delete_list); | |
mem_free (delete_list); | |
opengl_Shutdown(); | |
@@ -1880,7 +1880,7 @@ void opengl_SetGammaValue (float val) | |
return; | |
OpenGL_preferred_state.gamma=val; | |
mprintf ((0,"Setting gamma to %f\n",val)); | |
- long rampvals[3*256]; | |
+ int rampvals[3*256]; | |
for (int i=0;i<256;i++) | |
{ | |
float norm=(float)i*recp255; | |
diff --git a/Main/renderer/opengl.cpp b/Main/renderer/opengl.cpp | |
index 6fe21d8..90f83a2 100644 | |
--- a/Main/renderer/opengl.cpp | |
+++ b/Main/renderer/opengl.cpp | |
@@ -1107,7 +1107,7 @@ bool opengl_GetXConfig(Display *dpy,XVisualInfo *vis,int attrib,int *value) | |
#ifdef __CHECK_FOR_TOO_SLOW_RENDERING__ | |
-static long minimumAcceptableRender = -1; | |
+static int minimumAcceptableRender = -1; | |
static Uint32 lastSwapTicks = 0; | |
static int tooSlowCount = 0; | |
static int tooSlowChecksLeft = 0; | |
diff --git a/Main/scripts/osiris_common.h b/Main/scripts/osiris_common.h | |
index 09dd8bb..10d8023 100644 | |
--- a/Main/scripts/osiris_common.h | |
+++ b/Main/scripts/osiris_common.h | |
@@ -931,7 +931,7 @@ typedef unsigned char ubyte; | |
typedef signed char sbyte; | |
typedef unsigned short ushort; | |
typedef unsigned int uint; | |
-typedef unsigned long ulong; | |
+typedef unsigned int ulong; // this was unsigned long, but int is 32-bits (as intended!) everywhere we currently care about. --ryan, 2019. | |
typedef unsigned int ddgr_color; | |
#ifndef NULL | |
diff --git a/Main/scripts/osiris_vector.h b/Main/scripts/osiris_vector.h | |
index 3b126a1..5a61880 100644 | |
--- a/Main/scripts/osiris_vector.h | |
+++ b/Main/scripts/osiris_vector.h | |
@@ -15,7 +15,7 @@ const vector Zero_vector = {0.0f, 0.0f, 0.0f}; | |
typedef unsigned short angle; | |
//The basic fixed-point type | |
-typedef long fix; | |
+typedef int fix; | |
#define PI 3.141592654 | |
@@ -49,7 +49,7 @@ fix FloatToFixFast(float num); | |
//??#define FloatToFix(num) Round((num) * FLOAT_SCALER) | |
#define FloatToFix(num) ((fix)((num)*FLOAT_SCALER)) | |
#define IntToFix(num) ((num) << FIX_SHIFT) | |
-#define ShortToFix(num) (((long) (num)) << FIX_SHIFT) | |
+#define ShortToFix(num) (((int) (num)) << FIX_SHIFT) | |
#define FixToFloat(num) (((float) (num)) / FLOAT_SCALER) | |
#define FixToInt(num) ((num) >> FIX_SHIFT) | |
#define FixToShort(num) ((short) ((num) >> FIX_SHIFT)) | |
diff --git a/Main/streamaudio/streamaudio.cpp b/Main/streamaudio/streamaudio.cpp | |
index 73aeb2f..c13511d 100644 | |
--- a/Main/streamaudio/streamaudio.cpp | |
+++ b/Main/streamaudio/streamaudio.cpp | |
@@ -471,7 +471,7 @@ bool AudioStream::ReopenDigitalStream(ubyte fbufidx, int nbufs) | |
{ | |
const tOSFDigiHdr *digihdr = (const tOSFDigiHdr *)m_archive.StreamHeader(); | |
int bytesize, granularity; | |
- long sample_count; | |
+ int sample_count; | |
unsigned channels; | |
m_bytesleft = m_archive.StreamLength(); | |
@@ -510,8 +510,8 @@ bool AudioStream::ReopenDigitalStream(ubyte fbufidx, int nbufs) | |
LOGFILE((_logfp, "STRM[%d]: Illegal OSF (no channels?): %d.\n",m_curid, channels)); | |
return false; | |
} | |
- long bytes_per_buf = (SAMPLES_PER_STREAM_BUF*granularity); | |
- long filelen = (sample_count/channels)*granularity; | |
+ int bytes_per_buf = (SAMPLES_PER_STREAM_BUF*granularity); | |
+ int filelen = (sample_count/channels)*granularity; | |
int nbuffers = filelen/bytes_per_buf; | |
if (nbuffers >= 0 && nbuffers <=1) { | |
if (filelen > 0) { | |
@@ -770,7 +770,7 @@ void AudioStream::Reset() | |
if (m_decoder) { | |
unsigned channels; | |
unsigned sample_rate; | |
- long sample_count; | |
+ int sample_count; | |
AudioDecoder_Close(m_decoder); | |
m_decoder = Create_AudioDecoder(ADecodeFileRead,this,&channels,&sample_rate,&sample_count); | |
} | |
diff --git a/Main/terrain.cpp b/Main/terrain.cpp | |
index f4cd1d4..ba2202c 100644 | |
--- a/Main/terrain.cpp | |
+++ b/Main/terrain.cpp | |
@@ -20,7 +20,7 @@ | |
#include "dedicated_server.h" | |
#include "psrand.h" | |
#ifdef EDITOR | |
- #include "editor\d3edit.h" | |
+ #include "editor/d3edit.h" | |
#endif | |
#define SKY_RADIUS 2500.0 | |
diff --git a/Main/terrain.h b/Main/terrain.h | |
index e6e6f87..8fc6cdd 100644 | |
--- a/Main/terrain.h | |
+++ b/Main/terrain.h | |
@@ -207,8 +207,8 @@ extern ubyte Terrain_from_mine; | |
extern float Last_terrain_render_time; | |
-extern terrain_segment Terrain_seg[TERRAIN_WIDTH*TERRAIN_DEPTH]; | |
-extern terrain_tex_segment Terrain_tex_seg[TERRAIN_TEX_WIDTH*TERRAIN_TEX_DEPTH]; | |
+extern terrain_segment Terrain_seg[TERRAIN_WIDTH*TERRAIN_DEPTH*2]; | |
+extern terrain_tex_segment Terrain_tex_seg[TERRAIN_TEX_WIDTH*TERRAIN_TEX_DEPTH*2]; | |
// first object to render after cell has been rendered (only used for SW renderer) | |
extern short Terrain_seg_render_objs[]; | |
diff --git a/Main/texmap/texture.cpp b/Main/texmap/texture.cpp | |
index 0ecab01..cb0c296 100644 | |
--- a/Main/texmap/texture.cpp | |
+++ b/Main/texmap/texture.cpp | |
@@ -232,9 +232,9 @@ static int Lighting8; | |
static int Mips_on=1; | |
ubyte TexShadeTable8[MAX_TEXTURE_SHADES][256]; | |
-ulong TexShadeTable16[MAX_TEXTURE_SHADES][256]; | |
+uint TexShadeTable16[MAX_TEXTURE_SHADES][256]; | |
ubyte TexRevShadeTable8[MAX_TEXTURE_SHADES][256]; | |
-ulong TexRevShadeTable16[MAX_TEXTURE_SHADES][256]; | |
+uint TexRevShadeTable16[MAX_TEXTURE_SHADES][256]; | |
ushort Translate4444To1555[65536]; | |
fix Fix_recip_table[RECIP_TABLE_SIZE]; | |
diff --git a/Main/win32/winmono.cpp b/Main/win32/winmono.cpp | |
index d651425..72fa407 100644 | |
--- a/Main/win32/winmono.cpp | |
+++ b/Main/win32/winmono.cpp | |
@@ -120,7 +120,7 @@ char tcp_log_buffer[MAX_TCPLOG_LEN]; | |
void nw_InitTCPLogging(char *ip,unsigned short port) | |
{ | |
- unsigned long argp = 1; | |
+ u_long argp = 1; | |
int addrlen = sizeof(SOCKADDR_IN); | |
tcp_log_sock = socket(AF_INET,SOCK_STREAM,0); | |
if(INVALID_SOCKET == tcp_log_sock) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment