diff --git a/Descent3/AIGoal.cpp b/Descent3/AIGoal.cpp index f163c139..437c05ed 100644 --- a/Descent3/AIGoal.cpp +++ b/Descent3/AIGoal.cpp @@ -943,7 +943,7 @@ int GoalAllocSlot(object *obj, int level, float influence) { } // Adds a goal to the object -int GoalAddGoal(object *obj, unsigned int goal_type, void *arg_struct, int level, float influence, int f_goal, int guid, +int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, float influence, int f_goal, int guid, char subtype) { ai_frame *ai_info = obj->ai_info; int goal_index = AI_INVALID_INDEX; diff --git a/Descent3/AIGoal.h b/Descent3/AIGoal.h index a624deee..62d3598f 100644 --- a/Descent3/AIGoal.h +++ b/Descent3/AIGoal.h @@ -110,7 +110,7 @@ void GoalClearAll(object *obj); // Adds a new goal -int GoalAddGoal(object *obj, unsigned int goal_type, void *args, int level = 0, float influence = 1.0f, int f_goal = 0, +int GoalAddGoal(object *obj, uint32_t goal_type, void *args, int level = 0, float influence = 1.0f, int f_goal = 0, int guid = -1, char subtype = 0); // Adds a ending condition to a goal diff --git a/Descent3/BOA.cpp b/Descent3/BOA.cpp index 5463aed0..6d18502e 100644 --- a/Descent3/BOA.cpp +++ b/Descent3/BOA.cpp @@ -1362,7 +1362,7 @@ void ValidateRoomPathPoint(int room, char *message, int len) { char new_message[300]; snprintf(new_message, sizeof(new_message), "Room %d has a bad center point\n", room); - if (strlen(message) + strlen(new_message) < (unsigned int)len) { + if (strlen(message) + strlen(new_message) < (uint32_t)len) { strcat(message, new_message); } } diff --git a/Descent3/D3ForceFeedback.cpp b/Descent3/D3ForceFeedback.cpp index 6e22ee61..1d86719b 100644 --- a/Descent3/D3ForceFeedback.cpp +++ b/Descent3/D3ForceFeedback.cpp @@ -370,11 +370,11 @@ void ForceEffectsPlay(int id, float *scale, int *direction) { return; if (scale || direction) { - unsigned int *ns = NULL; - unsigned int new_gain; + uint32_t *ns = NULL; + uint32_t new_gain; if (scale) { - new_gain = (unsigned int)(10000.0f * (*scale)); + new_gain = (uint32_t)(10000.0f * (*scale)); ns = &new_gain; } @@ -410,14 +410,14 @@ void ForceEffectsPlay(int id, float *scale, vector *direction) { if (scale || direction) { int *d = NULL; - unsigned int *ns = NULL; - unsigned int new_gain; + uint32_t *ns = NULL; + uint32_t new_gain; if (direction) d = &new_dir; if (scale) { - new_gain = (unsigned int)(10000.0f * (*scale)); + new_gain = (uint32_t)(10000.0f * (*scale)); ns = &new_gain; } diff --git a/Descent3/Game2DLL.cpp b/Descent3/Game2DLL.cpp index 060490a5..fff2a14b 100644 --- a/Descent3/Game2DLL.cpp +++ b/Descent3/Game2DLL.cpp @@ -797,7 +797,7 @@ int GetDLLRequirements(const char *name, char *requirements, int buflen) { } strncpy(requirements, opt.requirements, buflen - 1); requirements[buflen - 1] = '\0'; - unsigned int opt_req_len = strlen(opt.requirements); + uint32_t opt_req_len = strlen(opt.requirements); if (opt_req_len > strlen(requirements)) { // too small of a buffer! mprintf((0, "Too small of a buffer to fill in all requirements!...need %d\n", opt_req_len + 1)); diff --git a/Descent3/GameLoop.cpp b/Descent3/GameLoop.cpp index b7239118..0588f230 100644 --- a/Descent3/GameLoop.cpp +++ b/Descent3/GameLoop.cpp @@ -2748,7 +2748,7 @@ void StartTime() { float Min_frametime = 500; float Max_frametime = 0; float Avg_frametime = 0; -unsigned int Frames_counted = 0; +uint32_t Frames_counted = 0; // Compute how long last frame took void CalcFrameTime(void) { @@ -3109,10 +3109,10 @@ void GameFrame(void) { // Slow down the game if the user asked us to int64_t current_timer; - unsigned int sleeptime; + uint32_t sleeptime; current_timer = timer_GetMSTime(); if ((current_timer - last_timer) < Min_allowed_frametime) { - sleeptime = (unsigned int)Min_allowed_frametime - (current_timer - last_timer); + sleeptime = (uint32_t)Min_allowed_frametime - (current_timer - last_timer); // mprintf((0,"Sleeping for %d ms\n",sleeptime)); Sleep(sleeptime); } diff --git a/Descent3/LoadLevel.h b/Descent3/LoadLevel.h index 5512e424..d0d3ab6b 100644 --- a/Descent3/LoadLevel.h +++ b/Descent3/LoadLevel.h @@ -681,7 +681,7 @@ inline void AppendToLevelChecksum(int val) { Level_md5->update(val); } -inline void AppendToLevelChecksum(unsigned int val) { +inline void AppendToLevelChecksum(uint32_t val) { if (!Level_md5) { return; } diff --git a/Descent3/ObjInit.cpp b/Descent3/ObjInit.cpp index 01aa81a2..d1612ea3 100644 --- a/Descent3/ObjInit.cpp +++ b/Descent3/ObjInit.cpp @@ -814,7 +814,7 @@ int ObjInitGeneric(object *objp, bool reinit) { poly_model *pm = &Poly_models[objp->rtype.pobj_info.model_num]; int num_wbs = pm->num_wbs; - if ((objp->dynamic_wb != NULL) && ((unsigned int)num_wbs != mem_size(objp->dynamic_wb) / sizeof(dynamic_wb_info))) + if ((objp->dynamic_wb != NULL) && ((uint32_t)num_wbs != mem_size(objp->dynamic_wb) / sizeof(dynamic_wb_info))) { mem_free(objp->dynamic_wb); objp->dynamic_wb = NULL; diff --git a/Descent3/OsirisLoadandBind.cpp b/Descent3/OsirisLoadandBind.cpp index 96656e4a..60d244f4 100644 --- a/Descent3/OsirisLoadandBind.cpp +++ b/Descent3/OsirisLoadandBind.cpp @@ -3336,8 +3336,8 @@ char OMMS_GetInfo(OMMSHANDLE handle,uint *mem_size,uint *uid,ushort *reference_c typedef struct tOMMSNode { unsigned short id; - unsigned int size_of_memory; - unsigned int unique_id; + uint32_t size_of_memory; + uint32_t unique_id; unsigned short reference_count; unsigned char free_called; void *memory_ptr; @@ -3363,9 +3363,9 @@ tOMMSHashNode *Osiris_OMMS_FindHashNode(char *script_name, bool autocreate); tOMMSHashNode *Osiris_OMMS_DeleteHashNode(tOMMSHashNode *node); // finds an OMMS node, given the hash node to start at. If it isn't // found than one is created. NULL if out of memory. -tOMMSNode *Osiris_OMMS_FindNode(tOMMSHashNode *root, unsigned int uid, bool autocreate); +tOMMSNode *Osiris_OMMS_FindNode(tOMMSHashNode *root, uint32_t uid, bool autocreate); // Removes the OMMS node for the given HashNode (completly remove) -void Osiris_OMMS_RemoveNode(tOMMSHashNode *root, unsigned int uid); +void Osiris_OMMS_RemoveNode(tOMMSHashNode *root, uint32_t uid); // Reduces the reference count for an OMMSNode by 1 void Osiris_OMMS_ReduceRefCount(tOMMSHashNode *root, tOMMSNode *node); // Calls free on a node @@ -3626,7 +3626,7 @@ tOMMSHashNode *Osiris_OMMS_DeleteHashNode(tOMMSHashNode *node) { // finds an OMMS node, given the hash node to start at. If it isn't // found than one is created. NULL if out of memory. -tOMMSNode *Osiris_OMMS_FindNode(tOMMSHashNode *root, unsigned int uid, bool autocreate) { +tOMMSNode *Osiris_OMMS_FindNode(tOMMSHashNode *root, uint32_t uid, bool autocreate) { tOMMSNode *curr = root->root; if (!root->root) { @@ -3672,7 +3672,7 @@ tOMMSNode *Osiris_OMMS_FindNode(tOMMSHashNode *root, unsigned int uid, bool auto } // Removes the OMMS node for the given HashNode (completly remove) -void Osiris_OMMS_RemoveNode(tOMMSHashNode *root, unsigned int uid) { +void Osiris_OMMS_RemoveNode(tOMMSHashNode *root, uint32_t uid) { tOMMSNode *curr = root->root; tOMMSNode *node_to_free = NULL; diff --git a/Descent3/aistruct.h b/Descent3/aistruct.h index 15774a05..8f7d8f44 100644 --- a/Descent3/aistruct.h +++ b/Descent3/aistruct.h @@ -622,7 +622,7 @@ typedef struct goal_info { // Goal structure typedef struct goal { - unsigned int type; + uint32_t type; char subtype; ubyte activation_level; float creation_time; diff --git a/Descent3/audiotaunts.cpp b/Descent3/audiotaunts.cpp index 99db4d0d..afcc34a2 100644 --- a/Descent3/audiotaunts.cpp +++ b/Descent3/audiotaunts.cpp @@ -501,11 +501,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 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 + uint32_t ckid; // Current chunk's ID + uint32_t cksize; // Current chunk's size in bytes + uint32_t filesize; // Size of the sound file + uint32_t nextseek = 0; // Location of the next seek + uint32_t aligned_size; // Sound files are aligned to SOUND_FILE_SAMPLE_ALIGNMENT samples // Sound format information int samples_per_second; @@ -514,7 +514,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { char error_code = 0; // Used to read temporary long values - unsigned int temp_long; + uint32_t temp_long; // Flags for if we previously read data or a format char f_data, f_fmt = 0; @@ -530,7 +530,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { } // Make sure that it is a RIFF format - temp_long = (unsigned int)cf_ReadInt(cfptr); + temp_long = (uint32_t)cf_ReadInt(cfptr); if (temp_long != 0x46464952) { error_code = 2; mprintf((0, "TAUNT: Wav Load: %s is not a RIFF format file\n", filename)); @@ -542,7 +542,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { filesize += cftell(cfptr); // Make sure it is a wave file - temp_long = (unsigned int)cf_ReadInt(cfptr); + temp_long = (uint32_t)cf_ReadInt(cfptr); if (temp_long != 0x45564157) { error_code = 3; mprintf((0, "TAUNT: Wav Load: %s is not a WAVE file\n", filename)); diff --git a/Descent3/d3serial.cpp b/Descent3/d3serial.cpp index de5fbc19..257d9a96 100644 --- a/Descent3/d3serial.cpp +++ b/Descent3/d3serial.cpp @@ -95,15 +95,15 @@ static char name_copy[DESC_ID_LEN]; -static unsigned int d3_serialnum = 100000; +static uint32_t d3_serialnum = 100000; // checks the exectuable (serialization) int SerialCheck(void) { char name2[] = DESC_ID_TAG "0000000000000000000000000000000000000000"; char time_str[] = DESC_DEAD_TIME_TAG "00000000"; int i, found; - unsigned int *checksum, test_checksum; - unsigned int *serialnum; + uint32_t *checksum, test_checksum; + uint32_t *serialnum; time_t current_time, saved_time; #ifdef DEMO @@ -179,7 +179,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 int *)&(checksum_ptr[0]); + checksum = (uint32_t *)&(checksum_ptr[0]); if (test_checksum != *checksum) { return SERIAL_BAD_CHECKSUM; } @@ -187,7 +187,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 int *)&(serialnum_ptr[0]); + serialnum = (uint32_t *)&(serialnum_ptr[0]); d3_serialnum = *serialnum; // this guy is ok, we can exit clean now @@ -224,4 +224,4 @@ void SerialError(int error) { } } -unsigned int SerialGetSerialNum(void) { return d3_serialnum; } +uint32_t SerialGetSerialNum(void) { return d3_serialnum; } diff --git a/Descent3/d3serial.h b/Descent3/d3serial.h index cbf004e4..2f839d35 100644 --- a/Descent3/d3serial.h +++ b/Descent3/d3serial.h @@ -68,7 +68,7 @@ int SerialCheck(void); void SerialError(int error); // returns the serialnumber of the user -unsigned int SerialGetSerialNum(void); +uint32_t SerialGetSerialNum(void); ///////////////////////////////////////////////////////////////////////////// // These are the functions used for serialization diff --git a/Descent3/dedicated_server.cpp b/Descent3/dedicated_server.cpp index 40017984..add1f4ef 100644 --- a/Descent3/dedicated_server.cpp +++ b/Descent3/dedicated_server.cpp @@ -835,7 +835,7 @@ void InitDedicatedSocket(ushort port) { memset(&sock_addr, 0, sizeof(SOCKADDR_IN)); sock_addr.sin_family = AF_INET; - unsigned int my_ip; + uint32_t my_ip; my_ip = nw_GetThisIP(); memcpy(&sock_addr.sin_addr.s_addr, &my_ip, sizeof(uint)); sock_addr.sin_port = htons(port); diff --git a/Descent3/demofile.cpp b/Descent3/demofile.cpp index 5d033911..6c182390 100644 --- a/Descent3/demofile.cpp +++ b/Descent3/demofile.cpp @@ -308,7 +308,7 @@ static float Demo_frame_time = 0; static float Demo_last_pinfo; float Demo_frame_ofs; static int Demo_auto_idx = 0; -unsigned int Demo_flags = 0; +uint32_t Demo_flags = 0; unsigned short Demo_obj_map[MAX_OBJECTS]; static bool Demo_turretchanged[MAX_OBJECTS]; bool Demo_looping = false; @@ -328,7 +328,7 @@ extern gs_tables *gs_Xlates; extern float Min_frametime; extern float Max_frametime; extern float Avg_frametime; -extern unsigned int Frames_counted; +extern uint32_t Frames_counted; extern bool Game_paused; static bool Demo_play_fast = false; @@ -487,7 +487,7 @@ void DemoWriteWeaponFire(unsigned short objectnum, vector *pos, vector *dir, uns } } -void DemoWriteHudMessage(unsigned int color, bool blink, char *msg) { +void DemoWriteHudMessage(uint32_t color, bool blink, char *msg) { if (Demo_flags == DF_RECORDING) { cf_WriteByte(Demo_cfp, DT_HUD_MESSAGE); cf_WriteInt(Demo_cfp, color); @@ -1727,7 +1727,7 @@ void DemoReadPersistantHUDMessage() { int sound_index; char *fmt; - color = (unsigned int)cf_ReadInt(Demo_cfp); + color = (uint32_t)cf_ReadInt(Demo_cfp); x = cf_ReadInt(Demo_cfp); y = cf_ReadInt(Demo_cfp); time = cf_ReadFloat(Demo_cfp); diff --git a/Descent3/hotspotmap.cpp b/Descent3/hotspotmap.cpp index 944c1a1d..8cf3f231 100644 --- a/Descent3/hotspotmap.cpp +++ b/Descent3/hotspotmap.cpp @@ -512,7 +512,7 @@ int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) { ubyte image_id_len, color_map_type, image_type, pixsize, descriptor; ubyte upside_down = 0; ushort width, height; - unsigned int pixel; + uint32_t pixel; int i, t, n; char alphavalue; CFILE *infile; diff --git a/Descent3/levelgoal.h b/Descent3/levelgoal.h index 2ad0a97e..41eb26cb 100644 --- a/Descent3/levelgoal.h +++ b/Descent3/levelgoal.h @@ -55,7 +55,7 @@ private: // been completed, else we *possibly* can complete the goal more than // once. int m_priority; - unsigned int m_flags; + uint32_t m_flags; void GoalComplete(int handle, bool announce); void SendMultiUpdate(int handle); diff --git a/Descent3/lnxmain.cpp b/Descent3/lnxmain.cpp index 342a6d12..58f8e67c 100644 --- a/Descent3/lnxmain.cpp +++ b/Descent3/lnxmain.cpp @@ -505,10 +505,10 @@ int main(int argc, char *argv[]) { if (FindArg("-game_checksum")) { extern tOSIRISModuleInit Osiris_module_init; extern void Osiris_CreateModuleInitStruct(tOSIRISModuleInit * st); - extern unsigned int Osiris_CreateGameChecksum(void); + extern uint32_t Osiris_CreateGameChecksum(void); Osiris_CreateModuleInitStruct(&Osiris_module_init); - unsigned int checksum = Osiris_CreateGameChecksum(); + uint32_t checksum = Osiris_CreateGameChecksum(); printf("Descent 3\n"); printf("Game Checksum: %u\n", checksum); return (0); diff --git a/Descent3/mission_download.cpp b/Descent3/mission_download.cpp index f6746b0d..f8b59682 100644 --- a/Descent3/mission_download.cpp +++ b/Descent3/mission_download.cpp @@ -788,7 +788,7 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { } } else { // check the CRC - unsigned int crc = cf_GetfileCRC(output_filename); + uint32_t crc = cf_GetfileCRC(output_filename); if (crc == ze->crc32) { console.puts(GR_GREEN, "CRC OK"); diff --git a/Descent3/multi.cpp b/Descent3/multi.cpp index 09347b3f..e039205a 100644 --- a/Descent3/multi.cpp +++ b/Descent3/multi.cpp @@ -1722,7 +1722,7 @@ player_pos_suppress Player_pos_fix[MAX_PLAYERS]; // If this is true, PXO games won't save the kills, deaths, etc. bool Multi_no_stats_saved = false; -unsigned int Netgame_curr_handle = 1; +uint32_t Netgame_curr_handle = 1; ushort Local_object_list[MAX_OBJECTS]; ushort Server_object_list[MAX_OBJECTS]; @@ -2099,7 +2099,7 @@ void MultiDoRobotFire(ubyte *data) { unsigned short obj_num; vector weapon_pos; vector weapon_dir; - unsigned int weapon_num; + uint32_t weapon_num; uint uniqueid; if (Netgame.local_role == LR_SERVER) { @@ -2340,7 +2340,7 @@ void MultiDoMyInfo(ubyte *data) { Players[slot].time_in_game = timer_GetTime(); if (Game_is_master_tracker_game) { - unsigned int mt_sig; + uint32_t mt_sig; Players[slot].kills = 0; Players[slot].deaths = 0; @@ -4072,7 +4072,7 @@ void MultiDoGameInfo(ubyte *data, network_address *from_addr) { ping_time = MultiGetFloat(data, &count); - unsigned int flags = MultiGetInt(data, &count); + uint32_t flags = MultiGetInt(data, &count); bool dedicated = MultiGetByte(data, &count) ? true : false; int diff = MultiGetByte(data, &count); @@ -7201,7 +7201,7 @@ void MultiDoClientInventoryUseItem(int slot, ubyte *data) { int count = 0; int type; int id; - unsigned int hash; + uint32_t hash; // Only the server receives this MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); @@ -7273,7 +7273,7 @@ void MultiDoClientInventoryRemoveItem(int slot, ubyte *data) { int count = 0; int type; int id; - unsigned int hash; + uint32_t hash; int pnum; // Only the server receives this @@ -7494,7 +7494,7 @@ void MultiSendBytesSent(int slot) { void MultiDoBytesSent(ubyte *data) { int count = 0; - unsigned int server_sent; + uint32_t server_sent; float drop_ratio; SKIP_HEADER(data, &count); server_sent = MultiGetUint(data, &count); @@ -7564,7 +7564,7 @@ void MultiDoPPSSet(ubyte *data, int slot) { mprintf((0, "%s changed his PPS to %d\n", Players[slot].callsign, NetPlayers[slot].pps)); } -void MultiSendGreetings(unsigned int id) { +void MultiSendGreetings(uint32_t id) { int size = 0; ubyte data[MAX_GAME_DATA_SIZE]; int count = 0; @@ -7580,7 +7580,7 @@ void MultiSendGreetings(unsigned int id) { void MultiDoGreetings(ubyte *data, network_address *addr) { int count = 0; SKIP_HEADER(data, &count); - unsigned int id = MultiGetUint(data, &count); + uint32_t id = MultiGetUint(data, &count); int i; // mprintf((0,"Got a greeting packet with an id of %d\n")); for (i = 0; i < MAX_NET_PLAYERS; i++) { @@ -7760,8 +7760,8 @@ void MultiDoFileDenied(ubyte *data) { void MultiDoFileData(ubyte *data) { // File data. We asked for it, now the server is sending it to us. - unsigned int total_len; // Length of the entire file - unsigned int curr_len; // Length of file sent so far + uint32_t total_len; // Length of the entire file + uint32_t curr_len; // Length of file sent so far ushort file_id; // Defines which file this is ushort playernum; // Who is sending us the file ushort data_len; // between 1-450 bytes @@ -7867,7 +7867,7 @@ void SendDataChunk(int playernum) { // mprintf((0,"Sending a data chunk to %d.\n",playernum)); // Read the next chunk of the file and send it! if ((DATA_CHUNK_SIZE + NetPlayers[playernum].file_xfer_pos) > - (unsigned int)NetPlayers[playernum].file_xfer_cfile->size) { + (uint32_t)NetPlayers[playernum].file_xfer_cfile->size) { dataread = NetPlayers[playernum].file_xfer_cfile->size - NetPlayers[playernum].file_xfer_pos; // This is the end of the file mprintf((0, "End of file detected!\n")); diff --git a/Descent3/multi.h b/Descent3/multi.h index 6ba88c8a..80b0ca36 100644 --- a/Descent3/multi.h +++ b/Descent3/multi.h @@ -809,13 +809,13 @@ typedef struct vmt_descent3_struct { int suicides; int online_time; int games_played; - unsigned int security; + uint32_t security; unsigned char virgin_pilot; // This pilot was just created if TRUE - unsigned int lateral_thrust; - unsigned int rotational_thrust; - unsigned int sliding_pct; // Percentage of the time you were sliding - 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 + uint32_t lateral_thrust; + uint32_t rotational_thrust; + uint32_t sliding_pct; // Percentage of the time you were sliding + uint32_t checksum; // This value needs to be equal to whatever the checksum is once the packet is decoded + uint32_t 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) @@ -1083,7 +1083,7 @@ void MultiSendPPSSet(int pps); void MultiDoPPSSet(ubyte *data, int slot); -void MultiSendGreetings(unsigned int id); +void MultiSendGreetings(uint32_t id); void MultiDoGreetings(ubyte *data, network_address *addr); diff --git a/Descent3/multi_connect.cpp b/Descent3/multi_connect.cpp index 376f4f07..f15f0a8c 100644 --- a/Descent3/multi_connect.cpp +++ b/Descent3/multi_connect.cpp @@ -476,7 +476,7 @@ void MultiDoConnectionAccepted(ubyte *data) { mprintf((0, "Server is sending %d packets per second\n", Netgame.packets_per_second)); // Get the secret code we will use to identify ourselves to the server - unsigned int secret_code = MultiGetUint(data, &count); + uint32_t secret_code = MultiGetUint(data, &count); // Get the peer-peer flag int flags = MultiGetInt(data, &count); @@ -902,7 +902,7 @@ void MultiCloseGame() { #define GET_GAME_INFO_TIME 2 // Fills in the passed in buffers with the info of the games that are on this subnet -int SearchForLocalGamesTCP(unsigned int ask, ushort port) { +int SearchForLocalGamesTCP(uint32_t ask, ushort port) { int count = 0; int size; int tries = 0; @@ -931,7 +931,7 @@ int SearchForLocalGamesTCP(unsigned int ask, ushort port) { } // Fills in the passed in buffers with the info of the games that are on this subnet -int SearchForGamesPXO(unsigned int ask, ushort port) { +int SearchForGamesPXO(uint32_t ask, ushort port) { int count = 0; int size; int tries = 0; diff --git a/Descent3/multi_dll_mgr.cpp b/Descent3/multi_dll_mgr.cpp index 4ec102c4..1c4e0ec2 100644 --- a/Descent3/multi_dll_mgr.cpp +++ b/Descent3/multi_dll_mgr.cpp @@ -319,8 +319,8 @@ void *callback = NULL; module MultiDLLHandle = {NULL}; -int SearchForLocalGamesTCP(unsigned int ask, ushort port); -int SearchForGamesPXO(unsigned int ask, ushort port); +int SearchForLocalGamesTCP(uint32_t ask, ushort port); +int SearchForGamesPXO(uint32_t ask, ushort port); extern ubyte NewUIWindow_alpha; extern void DoScreenshot(); extern void UpdateAndPackGameList(void); @@ -698,7 +698,7 @@ void CallMultiDLL(int eventnum) { if (MultiDLLHandle.handle && DLLMultiCall) DLLMultiCall(eventnum); } -void SetUITextItemText(UITextItem *uit, char *newtext, unsigned int color) { +void SetUITextItemText(UITextItem *uit, char *newtext, uint32_t color) { // This function is currently broken! strcpy(uit->m_Text, newtext); uit->set_color(color); @@ -822,7 +822,7 @@ int PollUI(void) { } return result; } -void *CreateNewUITextItem(const char *newtext, unsigned int color, int font) { +void *CreateNewUITextItem(const char *newtext, uint32_t color, int font) { UITextItem *new_text_item; if (font == -1) { new_text_item = new UITextItem(newtext); diff --git a/Descent3/multi_dll_mgr.h b/Descent3/multi_dll_mgr.h index f9148d9a..e7362ec6 100644 --- a/Descent3/multi_dll_mgr.h +++ b/Descent3/multi_dll_mgr.h @@ -116,7 +116,7 @@ void FreeMultiDLL(); int LoadMultiDLL(const char *name); void CallMultiDLL(int eventnum); -void SetUITextItemText(UITextItem *uit, char *newtext, unsigned int color); +void SetUITextItemText(UITextItem *uit, char *newtext, uint32_t color); void *NewUIWindowCreate(int x, int y, int w, int h, int flags); void NewUIWindowDestroy(NewUIWindow *deswin); void NewUIWindowOpen(NewUIWindow *deswin); @@ -147,7 +147,7 @@ void *HotSpotCreate(UIWindow *parentwin, int id, int key, UIItem *txtitemoff, UI void HotSpotSetStates(UIHotspot *hs, UIItem *texton, UIItem *textoff); int PollUI(void); void RemoveUITextItem(void *item); -void *CreateNewUITextItem(const char *newtext, unsigned int color, int font = -1); +void *CreateNewUITextItem(const char *newtext, uint32_t color, int font = -1); void RemoveUIBmpItem(void *item); void *CreateNewUIBmpItem(int handle, ubyte alpha); void CloseSplashScreen(void); diff --git a/Descent3/multi_external.h b/Descent3/multi_external.h index 76633a7e..b73f807a 100644 --- a/Descent3/multi_external.h +++ b/Descent3/multi_external.h @@ -176,14 +176,14 @@ typedef struct { SOCKET reliable_socket; float last_packet_time; float packet_time; // for making sure we don't get position packets out of order - unsigned int total_bytes_sent; - unsigned int total_bytes_rcvd; - unsigned int secret_net_id; // We use this to determine who we are getting packets from + uint32_t total_bytes_sent; + uint32_t total_bytes_rcvd; + uint32_t secret_net_id; // We use this to determine who we are getting packets from int file_xfer_flags; // Are we sending,receiving, or neither - unsigned int file_xfer_total_len; // Total length of the file we are receiving - unsigned int file_xfer_pos; // Position for sending and/or receiving - unsigned int file_xfer_id; // File id that we are sending - unsigned int file_xfer_who; // Who the file is for + uint32_t file_xfer_total_len; // Total length of the file we are receiving + uint32_t file_xfer_pos; // Position for sending and/or receiving + uint32_t file_xfer_id; // File id that we are sending + uint32_t file_xfer_who; // Who the file is for CFILE *file_xfer_cfile; // File handle for src/target file ushort position_counter; // for making sure we don't get position packets out of order char ship_logo[_MAX_PATH]; @@ -215,11 +215,11 @@ typedef struct { ushort curr_num_players; ushort max_num_players; float server_response_time; - unsigned int flags; + uint32_t flags; float last_update; bool dedicated_server; ubyte difficulty; // Game difficulty level - unsigned int handle; + uint32_t handle; } network_game; // netgame flags diff --git a/Descent3/multi_server.cpp b/Descent3/multi_server.cpp index 1a9e4c51..00dda7d9 100644 --- a/Descent3/multi_server.cpp +++ b/Descent3/multi_server.cpp @@ -705,7 +705,7 @@ int Player_count = 0; // The total number of players playing the game extern int Use_file_xfer; -unsigned int Secret_net_id = 0; +uint32_t Secret_net_id = 0; // Stars a multiplayer server. If playing is non-zero, then the server is a player in the // game // Server only diff --git a/Descent3/multi_server.h b/Descent3/multi_server.h index a05227e6..7520fc81 100644 --- a/Descent3/multi_server.h +++ b/Descent3/multi_server.h @@ -38,7 +38,7 @@ extern unsigned short Num_changed_wb_anim[MAX_NET_PLAYERS]; extern int Changed_turret[MAX_CHANGED_OBJECTS][MAX_NET_PLAYERS]; extern unsigned short Num_changed_turret[MAX_NET_PLAYERS]; -extern unsigned int Secret_net_id; +extern uint32_t Secret_net_id; #define JOIN_ANSWER_OK 0 #define JOIN_ANSWER_NOT_SERVER 1 #define JOIN_ANSWER_REJECTED 2 diff --git a/Descent3/multi_ui.cpp b/Descent3/multi_ui.cpp index 4f6a03e1..a09084a1 100644 --- a/Descent3/multi_ui.cpp +++ b/Descent3/multi_ui.cpp @@ -389,7 +389,7 @@ int MainMultiplayerMenu() { char sznetgame[MAX_NET_DLL_LEN] = ""; int netgamelen = MAX_NET_DLL_LEN; int i; - unsigned int j; + uint32_t j; for (i = 0; i < MAX_OBJECT_IDS; i++) { if (Object_info[i].type == OBJ_POWERUP) { @@ -516,7 +516,7 @@ int MainMultiplayerMenu() { dllcount++; } - unsigned int len; + uint32_t len; while ((ddio_FindNextFile(buffer)) && (dllcount < MAX_DLLS)) { ddio_SplitPath(buffer, fdir, fname, fext); len = strlen(fname); @@ -573,7 +573,7 @@ int MainMultiplayerMenu() { case UID_OK: { menu_wnd.Close(); lists->GetCurrentItem(seldll, _MAX_PATH); - unsigned int len = strlen(seldll); + uint32_t len = strlen(seldll); for (j = 0; j < len; j++) { if (seldll[j] == '/') { @@ -595,7 +595,7 @@ int MainMultiplayerMenu() { // Help { lists->GetCurrentItem(seldll, _MAX_PATH); - unsigned int len = strlen(seldll); + uint32_t len = strlen(seldll); for (j = 0; j < len; j++) { if (seldll[j] == '/') { seldll[j] = '~'; @@ -1698,7 +1698,7 @@ int MultiLevelSelection(void) { return Current_mission.cur_level; } -bool DoPlayerMouselookCheck(unsigned int flags) { +bool DoPlayerMouselookCheck(uint32_t flags) { if (Current_pilot.mouselook_control) { if (flags & NF_ALLOW_MLOOK) { return true; diff --git a/Descent3/multi_ui.h b/Descent3/multi_ui.h index e1a327ff..fcc75f7f 100644 --- a/Descent3/multi_ui.h +++ b/Descent3/multi_ui.h @@ -35,5 +35,5 @@ void MultiDoConfigSave(void); void MultiGameOptionsMenu(int alloptions); int ReturnMultiplayerGameMenu(void); int MultiLevelSelection(void); -bool DoPlayerMouselookCheck(unsigned int flags); +bool DoPlayerMouselookCheck(uint32_t flags); #endif diff --git a/Descent3/multisafe.cpp b/Descent3/multisafe.cpp index af640d2b..b03eb151 100644 --- a/Descent3/multisafe.cpp +++ b/Descent3/multisafe.cpp @@ -2263,7 +2263,7 @@ void msafe_CallFunction(ubyte type, msafe_struct *mstruct) { if (Game_mode & GM_MULTI && Netgame.local_role == LR_CLIENT) { ASSERT(objp->flags & OF_SERVER_OBJECT); } - if (objp->flags != (unsigned int)mstruct->flags) { + if (objp->flags != (uint32_t)mstruct->flags) { objp->flags = mstruct->flags; } else { send_it = false; @@ -2294,7 +2294,7 @@ void msafe_CallFunction(ubyte type, msafe_struct *mstruct) { case MSAFE_OBJECT_PHYSICS_FLAGS: { object *objp = ObjGet(mstruct->objhandle); if (objp) { - if (objp->mtype.phys_info.flags != (unsigned int)mstruct->physics_flags) { + if (objp->mtype.phys_info.flags != (uint32_t)mstruct->physics_flags) { objp->mtype.phys_info.flags = mstruct->physics_flags; objp->change_flags |= OCF_PHYS_FLAGS; } else { diff --git a/Descent3/pilot.cpp b/Descent3/pilot.cpp index d63f615e..263a791f 100644 --- a/Descent3/pilot.cpp +++ b/Descent3/pilot.cpp @@ -2166,7 +2166,7 @@ void StripCRCFileName(const char *src, char *dest) { char hexstring[9]; strncpy(hexstring, &src[eon + 1], 8); hexstring[8] = '\0'; - unsigned int crc; + uint32_t crc; crc = axtoi(hexstring); if (crc == 0) { @@ -2195,7 +2195,7 @@ bool CreateCRCFileName(const char *src, char *dest) { if (cfexist(src) != CFES_ON_DISK) return false; - unsigned int crc_value = cf_GetfileCRC((char *)src); + uint32_t crc_value = cf_GetfileCRC((char *)src); if (crc_value == 0) { mprintf((0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n")); } @@ -2226,7 +2226,7 @@ bool CreateCRCFileName(const char *src, char *base, char *newfilename) { if (cfexist(src) != CFES_ON_DISK) return false; - unsigned int crc_value = cf_GetfileCRC((char *)src); + uint32_t crc_value = cf_GetfileCRC((char *)src); if (crc_value == 0) { mprintf((0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n")); } diff --git a/Descent3/vclip.cpp b/Descent3/vclip.cpp index 8004068e..9e32d7ab 100644 --- a/Descent3/vclip.cpp +++ b/Descent3/vclip.cpp @@ -460,7 +460,7 @@ int AllocLoadVClip(const char *filename, int texture_size, int mipped, int pagea int AllocLoadIFLVClip(const char *filename, int texture_size, int mipped, int format) { CFILE *infile; char name[PAGENAME_LEN]; - unsigned int i, done = 0; + uint32_t i, done = 0; ASSERT(filename != NULL); diff --git a/Descent3/winmain.cpp b/Descent3/winmain.cpp index f18d646e..81878278 100644 --- a/Descent3/winmain.cpp +++ b/Descent3/winmain.cpp @@ -489,7 +489,7 @@ int PASCAL HandledWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR szCmdLine, if (Dedicated_server) { d3 = new oeD3Win32App(OEAPP_CONSOLE, (HInstance)hInst); } else { - unsigned int flags = OEAPP_FULLSCREEN; + uint32_t flags = OEAPP_FULLSCREEN; #ifndef RELEASE // TODO: remove #ifndef when window mode is ready for primetime if (FindArg("-windowed")) { // switch to windowed mode instead diff --git a/bitmap/bitmain.cpp b/bitmap/bitmain.cpp index dae85de8..af808470 100644 --- a/bitmap/bitmain.cpp +++ b/bitmap/bitmain.cpp @@ -374,7 +374,7 @@ bm_hashTableIndex bm_hash(bm_T data) { * hash function applied to data * ***********************************/ char *p = data->name; - unsigned int hval = strlen(p); + uint32_t hval = strlen(p); while (*p) { hval += tolower(*p); @@ -631,7 +631,7 @@ void bm_FreeBitmapMain(int handle) { } // Returns -1 if this name is not already in use, else index of bitmap that is using name int bm_TestName(const char *src) { - unsigned int i, limit; + uint32_t i, limit; char namedest[256]; char path[256], ext[256], filename[256]; @@ -652,7 +652,7 @@ int bm_TestName(const char *src) { } // gets the filename from a path, plus appends our .ogf extension void bm_ChangeEndName(const char *src, char *dest) { - unsigned int i, limit; + uint32_t i, limit; int last = -1; int curnum = -1; char namedest[256+16]; diff --git a/bitmap/tga.cpp b/bitmap/tga.cpp index b1d2e8fc..4e9df86e 100644 --- a/bitmap/tga.cpp +++ b/bitmap/tga.cpp @@ -327,7 +327,7 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { ubyte image_id_len, color_map_type, image_type, pixsize, descriptor; ubyte upside_down = 0; ushort width, height; - unsigned int pixel; + uint32_t pixel; int i, t, n, data8bit = 0, savepos; int mipped = 0; int num_mips = 1; diff --git a/cfile/cfile.cpp b/cfile/cfile.cpp index f0f8468c..da593052 100644 --- a/cfile/cfile.cpp +++ b/cfile/cfile.cpp @@ -1130,15 +1130,15 @@ void cf_Rewind(CFILE *fp) { #define CRC32_POLYNOMIAL 0xEDB88320L #define CRC_BUFFER_SIZE 5000 -unsigned int cf_CalculateFileCRC(CFILE *infile) { +uint32_t cf_CalculateFileCRC(CFILE *infile) { int i, j; ubyte crcbuf[CRC_BUFFER_SIZE]; static bool Cfile_crc_calculated = false; - static unsigned int CRCTable[256]; - unsigned int crc; - unsigned int temp1; - unsigned int temp2; - unsigned int readlen; + static uint32_t CRCTable[256]; + uint32_t crc; + uint32_t temp1; + uint32_t temp2; + uint32_t readlen; // Only make the lookup table once if (!Cfile_crc_calculated) { @@ -1167,7 +1167,7 @@ unsigned int cf_CalculateFileCRC(CFILE *infile) { Int3(); return 0xFFFFFFFF; } - for (unsigned int a = 0; a < readlen; a++) { + for (uint32_t a = 0; a < readlen; a++) { temp1 = (crc >> 8) & 0x00FFFFFFL; temp2 = CRCTable[((int)crc ^ crcbuf[a]) & 0xff]; crc = temp1 ^ temp2; @@ -1177,14 +1177,14 @@ unsigned int cf_CalculateFileCRC(CFILE *infile) { return crc ^ 0xffffffffl; } -unsigned int cf_GetfileCRC(char *src) { +uint32_t cf_GetfileCRC(char *src) { CFILE *infile; infile = (CFILE *)cfopen(src, "rb"); if (!infile) return 0xFFFFFFFF; - unsigned int crc = cf_CalculateFileCRC(infile); + uint32_t crc = cf_CalculateFileCRC(infile); cfclose(infile); return crc; diff --git a/cfile/cfile.h b/cfile/cfile.h index 89a3e95e..c9b2d3b7 100644 --- a/cfile/cfile.h +++ b/cfile/cfile.h @@ -318,8 +318,8 @@ void cf_ChangeFileAttributes(const char *name, int attr); void cf_Rewind(CFILE *fp); // Calculates a 32 bit CRC -unsigned int cf_GetfileCRC(char *src); -unsigned int cf_CalculateFileCRC(CFILE *fp); // same as cf_GetfileCRC, except works with CFILE pointers +uint32_t cf_GetfileCRC(char *src); +uint32_t cf_CalculateFileCRC(CFILE *fp); // same as cf_GetfileCRC, except works with CFILE pointers // the following cf_LibraryFind function are similar to the ddio_Find functions as they look // for files that match the wildcard passed in, however, this is to be used for hog files. diff --git a/czip/HuffmanBasic.cpp b/czip/HuffmanBasic.cpp index b6bb8f27..14da291a 100644 --- a/czip/HuffmanBasic.cpp +++ b/czip/HuffmanBasic.cpp @@ -156,7 +156,7 @@ void CZip::hb_input_counts(BITFILE *input, tH0Node *nodes) { if ((c = VFgetc(input->file)) == EOF) { // fatal_error( "Error reading byte counts\n" ); } else - nodes[i].count = (unsigned int)c; + nodes[i].count = (uint32_t)c; if ((first = VFgetc(input->file)) == EOF) { // fatal_error( "Error reading byte counts\n" ); } diff --git a/ddebug/lnxmono.cpp b/ddebug/lnxmono.cpp index 25fbceb2..db66c136 100644 --- a/ddebug/lnxmono.cpp +++ b/ddebug/lnxmono.cpp @@ -106,7 +106,7 @@ static uint64_t Timer_sys_start_time = 0; static uint64_t Timer_accum = 0, Timer_high_mark = 0; static float nw_TCPLoggingTimer(void) { - unsigned int time_ms; + uint32_t time_ms; uint64_t ret; struct timeval t; @@ -207,7 +207,7 @@ bool nw_InitTCPLogging(char *ip, unsigned short port) { dpthread_self = (pthread_self_fp)dlsym(lib, "pthread_self"); #endif - unsigned int argp = 1; + uint32_t argp = 1; int addrlen = sizeof(SOCKADDR_IN); tcp_log_sock = socket(AF_INET, SOCK_STREAM, 0); if (INVALID_SOCKET == tcp_log_sock) { diff --git a/ddio_lnx/lnxcdrom.cpp b/ddio_lnx/lnxcdrom.cpp index a2066df0..edd30d5b 100644 --- a/ddio_lnx/lnxcdrom.cpp +++ b/ddio_lnx/lnxcdrom.cpp @@ -503,7 +503,7 @@ bool system_cdroms::Mount(void) { /* don't do this. // Not mounted? Do it ourselves. // so we now have our directory, try to mount - unsigned int int rwflag = MS_MGC_VAL|MS_RDONLY; + uint32_t int rwflag = MS_MGC_VAL|MS_RDONLY; int ret = mount(name,m_MountedDir,"iso9660",rwflag,NULL); if(ret!=0) { diff --git a/ddio_lnx/lnxforcefeedback.cpp b/ddio_lnx/lnxforcefeedback.cpp index 0cd59192..56277b14 100644 --- a/ddio_lnx/lnxforcefeedback.cpp +++ b/ddio_lnx/lnxforcefeedback.cpp @@ -254,14 +254,14 @@ void ddio_ffb_effectUnload(short) {} // Modifies a single effect, only if the given parameters are // different from what's currently loaded. // ------------------------------------------------------------------- -void ddio_ffb_effectModify(short, int *, unsigned int *, unsigned int *, unsigned int *, tEffInfo *, tEffEnvelope *) {} +void ddio_ffb_effectModify(short, int *, uint32_t *, uint32_t *, uint32_t *, tEffInfo *, tEffEnvelope *) {} // ------------------------------------------------------------------- // ddio_ffb_GetEffectData // Purpose: // Retrieves affect data for the given parameters, pass NULL for those you don't want // ------------------------------------------------------------------- -void ddio_ffb_GetEffectData(short, int *, unsigned int *, unsigned int *, unsigned int *, tEffInfo *, tEffEnvelope *) {} +void ddio_ffb_GetEffectData(short, int *, uint32_t *, uint32_t *, uint32_t *, tEffInfo *, tEffEnvelope *) {} // ------------------------------------------------------------------- // ddio_ffjoy_EnableAutoCenter diff --git a/ddio_lnx/lnxkey_sdl.cpp b/ddio_lnx/lnxkey_sdl.cpp index 3e36cdf1..d209b9b2 100644 --- a/ddio_lnx/lnxkey_sdl.cpp +++ b/ddio_lnx/lnxkey_sdl.cpp @@ -94,7 +94,7 @@ int sdlkey_to_ddiocode[27] = {0, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, K KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z}; -static inline ubyte sdlkeycode_to_keycode(unsigned int sdlkeycode) { +static inline ubyte sdlkeycode_to_keycode(uint32_t sdlkeycode) { // unceremoniously taken from Heretic source code with a few modifications. // (by Outrage. Not Loki. We know better. :) --ryan.) int rc = sdlkeycode; diff --git a/ddio_lnx/sdljoy.cpp b/ddio_lnx/sdljoy.cpp index aade8eff..2835e262 100644 --- a/ddio_lnx/sdljoy.cpp +++ b/ddio_lnx/sdljoy.cpp @@ -242,8 +242,8 @@ void joy_GetRawPos(tJoystick joy, tJoyPos *pos) { pos->v = (pos->v + 32767); } -static inline unsigned int map_hat(Uint8 value) { - unsigned int mapped = 0; +static inline uint32_t map_hat(Uint8 value) { + uint32_t mapped = 0; switch (value) { case SDL_HAT_CENTERED: @@ -287,7 +287,7 @@ void joy_GetPos(tJoystick joy, tJoyPos *pos) { // retrieve joystick info from the net, or locally. stick = Joysticks[joy].handle; if (stick) { - unsigned int mask; + uint32_t mask; mask = Joysticks[joy].caps.axes_mask; pos->x = SDL_JoystickGetAxis(stick, 0); diff --git a/ddio_win/winforcefeedback.cpp b/ddio_win/winforcefeedback.cpp index 62795d21..fd193ee1 100644 --- a/ddio_win/winforcefeedback.cpp +++ b/ddio_win/winforcefeedback.cpp @@ -546,7 +546,7 @@ BOOL CALLBACK FFEnumCallback(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef) // ------------------------------------------------------------------- int ddio_ffjoy_Query(int dev, int* but_flags, int* axis_flags) { - unsigned int i,bit; + uint32_t i,bit; DIDEVCAPS DICaps; DIDEVICEOBJECTINSTANCE DIObjInst; DWORD DIAxisOFS[6] = { DIJOFS_X, @@ -1036,9 +1036,9 @@ void ddio_ffb_effectUnload(short eID) // Modifies a single effect, only if the given parameters are // different from what's currently loaded. // ------------------------------------------------------------------- -void ddio_ffb_effectModify(short eID, int* Direction, unsigned int* Duration, unsigned int* Gain, unsigned int* Period, tEffInfo* TypeInfo, tEffEnvelope* Envelope) +void ddio_ffb_effectModify(short eID, int* Direction, uint32_t* Duration, uint32_t* Gain, uint32_t* Period, tEffInfo* TypeInfo, tEffEnvelope* Envelope) { - unsigned int flags = 0; + uint32_t flags = 0; //return; @@ -1101,7 +1101,7 @@ void ddio_ffb_effectModify(short eID, int* Direction, unsigned int* Duration, un // Purpose: // Retrieves affect data for the given parameters, pass NULL for those you don't want // ------------------------------------------------------------------- -void ddio_ffb_GetEffectData(short eID, int* Direction, unsigned int* Duration, unsigned int* Gain, unsigned int* Period, tEffInfo* TypeInfo, tEffEnvelope* Envelope) +void ddio_ffb_GetEffectData(short eID, int* Direction, uint32_t* Duration, uint32_t* Gain, uint32_t* Period, tEffInfo* TypeInfo, tEffEnvelope* Envelope) { if (Direction){ *Direction = ddEffect[eID].direction[0]; @@ -1500,7 +1500,7 @@ void ddio_ffb_DestroyAll(void) {} void ddio_ffb_effectPlay(short eID) {} -void ddio_ffb_effectModify(short eID, int *Direction, unsigned int *Duration, unsigned int *Gain, unsigned int *Period, +void ddio_ffb_effectModify(short eID, int *Direction, uint32_t *Duration, uint32_t *Gain, uint32_t *Period, tEffInfo *TypeInfo, tEffEnvelope *Envelope) {} int ddio_ffb_effectCreate(tDevice dev, tFFB_Effect *eff) { return -1; } diff --git a/ddio_win/winmouse.cpp b/ddio_win/winmouse.cpp index a21224b9..3fd1e859 100644 --- a/ddio_win/winmouse.cpp +++ b/ddio_win/winmouse.cpp @@ -234,7 +234,7 @@ void ddio_InternalMouseFrame() { void MouseError() { MessageBoxA(nullptr, "Failed to init raw input for mouse", "Error", MB_ICONERROR); } int RawInputHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - unsigned int buttons; + uint32_t buttons; t_mse_event ev; float curtime = timer_GetTime(); diff --git a/legacy/D3Launch/OS_Config.cpp b/legacy/D3Launch/OS_Config.cpp index 5deb9988..b5fe8d7e 100644 --- a/legacy/D3Launch/OS_Config.cpp +++ b/legacy/D3Launch/OS_Config.cpp @@ -233,7 +233,7 @@ Cleanup: RegCloseKey(hKey); } -// Writes an unsigned int to the INI file. +// Writes an uint32_t to the INI file. void os_config_write_uint( char *section, char *name, uint value ) { HKEY hKey = NULL; diff --git a/legacy/D3Launch/SiteSelectDlg.cpp b/legacy/D3Launch/SiteSelectDlg.cpp index 60fe820a..4943db63 100644 --- a/legacy/D3Launch/SiteSelectDlg.cpp +++ b/legacy/D3Launch/SiteSelectDlg.cpp @@ -150,14 +150,14 @@ BOOL CSiteSelectDlg::OnInitDialog() // Calculates column widths and sets them void CSiteSelectDlg::SetColumnWidths(void) { - unsigned int w0, w1, w2; + uint32_t w0, w1, w2; RECT rect; m_SiteList.GetClientRect(&rect); - w0=unsigned int(rect.right*SITE_NAME_COLUMN_WIDTH); - w1=unsigned int(rect.right*SITE_ADDRESS_COLUMN_WIDTH); - w2=unsigned int(rect.right*SITE_LOCATION_COLUMN_WIDTH); + w0=uint32_t(rect.right*SITE_NAME_COLUMN_WIDTH); + w1=uint32_t(rect.right*SITE_ADDRESS_COLUMN_WIDTH); + w2=uint32_t(rect.right*SITE_LOCATION_COLUMN_WIDTH); m_SiteList.SetColumnWidth(SITE_NAME_COLUMN,w0); m_SiteList.SetColumnWidth(SITE_ADDRESS_COLUMN,w1); diff --git a/legacy/D3Launch/UpdateDlg.cpp b/legacy/D3Launch/UpdateDlg.cpp index 246453d3..a3e3ff67 100644 --- a/legacy/D3Launch/UpdateDlg.cpp +++ b/legacy/D3Launch/UpdateDlg.cpp @@ -213,7 +213,7 @@ WSADATA wsa_data; // Declare the function pointer to get the Patch apply function from the DLL extern "C" { - unsigned int (pascal *RTPatchApply32)( LPSTR cmdline, LPVOID (CALLBACK *lpfCallback)(UINT id, LPVOID lpParm), BOOL WaitFlag); + uint32_t (pascal *RTPatchApply32)( LPSTR cmdline, LPVOID (CALLBACK *lpfCallback)(UINT id, LPVOID lpParm), BOOL WaitFlag); } ///////////////////////////////////////////////////////////////////////////// @@ -790,7 +790,7 @@ BOOL CUpdateDlg::OnInitDialog() char *CleanString(char *src) { CString temp; - unsigned int j; + uint32_t j; // Allocate a temporary string workspace temp=""; @@ -968,7 +968,7 @@ BOOL CUpdateDlg::ApplyPatch() patching=TRUE; sprintf(patch_cmd_line,"-undo %s",PATCH_LOC_FNAME); - RTPatchApply32 = (unsigned int (__stdcall *)(char *,void *(__stdcall *)(unsigned int,void *),int))GetProcAddress(patchlib, "RTPatchApply32@12"); + RTPatchApply32 = (uint32_t (__stdcall *)(char *,void *(__stdcall *)(uint32_t,void *),int))GetProcAddress(patchlib, "RTPatchApply32@12"); if (RTPatchApply32) { m_progress.SetRange(0,short(0x8000)); m_progress.SetPos(0); @@ -1061,7 +1061,7 @@ int CUpdateDlg::UpdateTheLauncher() // Downloads a given remote file and saves it as a local file int CUpdateDlg::GetHTTPFile(char *remote, char *local) { - unsigned int LastPrintbytes = time(NULL); + uint32_t LastPrintbytes = time(NULL); InetGetFile *inetfile; WORD ver=MAKEWORD(1,1); char URL[PSPATHNAME_LEN+1]; diff --git a/legacy/editor/DallasMainDlg.cpp b/legacy/editor/DallasMainDlg.cpp index 7573c2e2..ce2c3a93 100644 --- a/legacy/editor/DallasMainDlg.cpp +++ b/legacy/editor/DallasMainDlg.cpp @@ -874,7 +874,7 @@ void CDallasMainDlg::OnDblclkMessageList() // Check if the message name is valid char *msgname=dlg.m_PromptData.GetBuffer(0); if(strlen(msgname)==0) return; - for(unsigned int j=0;jAppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)category_submenu.Detach(), m_FunctionCategories[j]); + action_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)category_submenu.Detach(), m_FunctionCategories[j]); else - action_menu->AppendMenu(MF_POPUP, (unsigned int)category_submenu.Detach(), m_FunctionCategories[j]); + action_menu->AppendMenu(MF_POPUP, (uint32_t)category_submenu.Detach(), m_FunctionCategories[j]); } } @@ -7265,9 +7265,9 @@ void CDallasMainDlg::FillQueryMenu(CMenu *query_menu, int command_offset, int va // Detach and add this submenu to the action menu ColumnizePopupMenu(&category_submenu); if(queries_added==0) - query_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)category_submenu.Detach(), m_FunctionCategories[j]); + query_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)category_submenu.Detach(), m_FunctionCategories[j]); else - query_menu->AppendMenu(MF_POPUP, (unsigned int)category_submenu.Detach(), m_FunctionCategories[j]); + query_menu->AppendMenu(MF_POPUP, (uint32_t)category_submenu.Detach(), m_FunctionCategories[j]); } } @@ -12107,44 +12107,44 @@ void CDallasMainDlg::FillObjectMenu(CMenu *object_menu, int command_offset, bool // Add the powerup submenu ColumnizePopupMenu(&powerup_submenu); if(powerups_added==0) - object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)powerup_submenu.Detach(), "Powerup"); + object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)powerup_submenu.Detach(), "Powerup"); else - object_menu->AppendMenu(MF_POPUP, (unsigned int)powerup_submenu.Detach(), "Powerup"); + object_menu->AppendMenu(MF_POPUP, (uint32_t)powerup_submenu.Detach(), "Powerup"); // Add the robot submenu ColumnizePopupMenu(&robot_submenu); if(robots_added==0) - object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)robot_submenu.Detach(), "Robot"); + object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)robot_submenu.Detach(), "Robot"); else - object_menu->AppendMenu(MF_POPUP, (unsigned int)robot_submenu.Detach(), "Robot"); + object_menu->AppendMenu(MF_POPUP, (uint32_t)robot_submenu.Detach(), "Robot"); // Add the clutter submenu ColumnizePopupMenu(&clutter_submenu); if(clutter_added==0) - object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)clutter_submenu.Detach(), "Clutter"); + object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)clutter_submenu.Detach(), "Clutter"); else - object_menu->AppendMenu(MF_POPUP, (unsigned int)clutter_submenu.Detach(), "Clutter"); + object_menu->AppendMenu(MF_POPUP, (uint32_t)clutter_submenu.Detach(), "Clutter"); // Add the building submenu ColumnizePopupMenu(&building_submenu); if(buildings_added==0) - object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)building_submenu.Detach(), "Building"); + object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)building_submenu.Detach(), "Building"); else - object_menu->AppendMenu(MF_POPUP, (unsigned int)building_submenu.Detach(), "Building"); + object_menu->AppendMenu(MF_POPUP, (uint32_t)building_submenu.Detach(), "Building"); // Add the door submenu ColumnizePopupMenu(&door_submenu); if(doors_added==0) - object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)door_submenu.Detach(), "Door"); + object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)door_submenu.Detach(), "Door"); else - object_menu->AppendMenu(MF_POPUP, (unsigned int)door_submenu.Detach(), "Door"); + object_menu->AppendMenu(MF_POPUP, (uint32_t)door_submenu.Detach(), "Door"); // Add the other submenu ColumnizePopupMenu(&other_submenu); if(!show_other || others_added==0) - object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)other_submenu.Detach(), "Other"); + object_menu->AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)other_submenu.Detach(), "Other"); else - object_menu->AppendMenu(MF_POPUP, (unsigned int)other_submenu.Detach(), "Other"); + object_menu->AppendMenu(MF_POPUP, (uint32_t)other_submenu.Detach(), "Other"); } @@ -12385,16 +12385,16 @@ int CDallasMainDlg::FillLiteralMenu(CMenu *literal_menu, int command_offset, int if(j==ENUM_PARAMETER_TYPE) { ColumnizePopupMenu(&enum_submenu); if(types_added>0) - literal_menu->AppendMenu(MF_POPUP, (unsigned int)enum_submenu.Detach(), param_menu_item[j].name); + literal_menu->AppendMenu(MF_POPUP, (uint32_t)enum_submenu.Detach(), param_menu_item[j].name); else - literal_menu->AppendMenu(MF_GRAYED | MF_POPUP, (unsigned int)enum_submenu.Detach(), param_menu_item[j].name); + literal_menu->AppendMenu(MF_GRAYED | MF_POPUP, (uint32_t)enum_submenu.Detach(), param_menu_item[j].name); } else if(j==FLAG_PARAMETER_TYPE) { ColumnizePopupMenu(&flag_submenu); if(flag_types_added>0) - literal_menu->AppendMenu(MF_POPUP, (unsigned int)flag_submenu.Detach(), param_menu_item[j].name); + literal_menu->AppendMenu(MF_POPUP, (uint32_t)flag_submenu.Detach(), param_menu_item[j].name); else - literal_menu->AppendMenu(MF_GRAYED | MF_POPUP, (unsigned int)flag_submenu.Detach(), param_menu_item[j].name); + literal_menu->AppendMenu(MF_GRAYED | MF_POPUP, (uint32_t)flag_submenu.Detach(), param_menu_item[j].name); } else literal_menu->AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, command_offset+param_menu_item[j].type, param_menu_item[j].name); @@ -12438,9 +12438,9 @@ void CDallasMainDlg::FillConditionMenu(CMenu *condition_menu, int command_offset condition_menu->AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&qbin_submenu); - condition_menu->AppendMenu(MF_POPUP, (unsigned int)qbin_submenu.Detach(), "Binary Statement with Query"); + condition_menu->AppendMenu(MF_POPUP, (uint32_t)qbin_submenu.Detach(), "Binary Statement with Query"); ColumnizePopupMenu(&qcomp_submenu); - condition_menu->AppendMenu(MF_POPUP, (unsigned int)qcomp_submenu.Detach(), "Comparison Statement with Query"); + condition_menu->AppendMenu(MF_POPUP, (uint32_t)qcomp_submenu.Detach(), "Comparison Statement with Query"); } @@ -12471,15 +12471,15 @@ void CDallasMainDlg::DisplayScriptOwnerNodeMenu(POINT *point) object_submenu.CreatePopupMenu(); FillObjectMenu(&object_submenu,ASSIGN_OBJECT_ID_RANGE_START,TRUE); ColumnizePopupMenu(&object_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)object_submenu.Detach(), "Object"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)object_submenu.Detach(), "Object"); trigger_submenu.CreatePopupMenu(); triggers_added=FillTriggerMenu(&trigger_submenu,ASSIGN_TRIGGER_ID_RANGE_START); ColumnizePopupMenu(&trigger_submenu); if(triggers_added==0) - main_menu.AppendMenu(MF_POPUP|MF_GRAYED, (unsigned int)trigger_submenu.Detach(), "Trigger"); + main_menu.AppendMenu(MF_POPUP|MF_GRAYED, (uint32_t)trigger_submenu.Detach(), "Trigger"); else - main_menu.AppendMenu(MF_POPUP, (unsigned int)trigger_submenu.Detach(), "Trigger"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)trigger_submenu.Detach(), "Trigger"); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, ASSIGN_LEVEL_ID, "Level"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); @@ -12545,17 +12545,17 @@ void CDallasMainDlg::DisplayLogicalOperatorNodeMenu(POINT *point) main_menu.CreatePopupMenu(); ColumnizePopupMenu(&insert_logop_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)insert_logop_submenu.Detach(), "Insert Logical Operator"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)insert_logop_submenu.Detach(), "Insert Logical Operator"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&condition_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)condition_submenu.Detach(), "Add a New Condition"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)condition_submenu.Detach(), "Add a New Condition"); ColumnizePopupMenu(&add_logop_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)add_logop_submenu.Detach(), "Add Logical Operator"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)add_logop_submenu.Detach(), "Add Logical Operator"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&replace_condition_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_condition_submenu.Detach(), "Replace with a Condition"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_condition_submenu.Detach(), "Replace with a Condition"); ColumnizePopupMenu(&replace_logop_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_logop_submenu.Detach(), "Replace with a New Logical Operator"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_logop_submenu.Detach(), "Replace with a New Logical Operator"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, DELETE_ALL_ID, "Delete this Operator"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); @@ -12585,12 +12585,12 @@ void CDallasMainDlg::DisplayConditionalStatementNodeMenu(POINT *point) main_menu.CreatePopupMenu(); ColumnizePopupMenu(&log_op_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)log_op_submenu.Detach(), "Insert Logical Operator"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)log_op_submenu.Detach(), "Insert Logical Operator"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&replace_condition_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_condition_submenu.Detach(), "Replace with a New Condition"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_condition_submenu.Detach(), "Replace with a New Condition"); ColumnizePopupMenu(&replace_logop_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_logop_submenu.Detach(), "Replace with a Logical Operator"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_logop_submenu.Detach(), "Replace with a Logical Operator"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, DELETE_ALL_ID, "Delete this Condition"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); @@ -12615,9 +12615,9 @@ void CDallasMainDlg::DisplayExpressionNodeMenu(POINT *point, int valid_return_ty main_menu.CreatePopupMenu(); ColumnizePopupMenu(&replace_with_query_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_with_query_submenu.Detach(), "Replace with Query"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_with_query_submenu.Detach(), "Replace with Query"); ColumnizePopupMenu(&replace_with_literal_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_with_literal_submenu.Detach(), "Replace with Literal"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_with_literal_submenu.Detach(), "Replace with Literal"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, CANCEL_COMMAND_ID, "Cancel"); @@ -12663,12 +12663,12 @@ void CDallasMainDlg::DisplayActionStatementNodeMenu(POINT *point) main_menu.CreatePopupMenu(); ColumnizePopupMenu(&insert_actions_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)insert_actions_submenu.Detach(), "Insert a New Action"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)insert_actions_submenu.Detach(), "Insert a New Action"); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, ADD_IF_THEN_CLAUSE_ID, "Insert a Nested IF-THEN Clause"); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, ADD_IF_THEN_ELSE_CLAUSE_ID, "Insert a Nested IF-THEN-ELSE Clause"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&replace_actions_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_actions_submenu.Detach(), "Replace with a Different Action"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_actions_submenu.Detach(), "Replace with a Different Action"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, DELETE_ALL_ID, "Delete"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); @@ -12706,17 +12706,17 @@ void CDallasMainDlg::DisplayActionHeaderNodeMenu(POINT *point, int level_type, i main_menu.CreatePopupMenu(); ColumnizePopupMenu(&select_extimes_submenu); if(level_type==TOP_LEVEL) - main_menu.AppendMenu(MF_POPUP, (unsigned int)select_extimes_submenu.Detach(), "Select Max Times to Execute"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)select_extimes_submenu.Detach(), "Select Max Times to Execute"); else - main_menu.AppendMenu(MF_GRAYED|MF_POPUP, (unsigned int)select_extimes_submenu.Detach(), "Select Max Times to Execute"); + main_menu.AppendMenu(MF_GRAYED|MF_POPUP, (uint32_t)select_extimes_submenu.Detach(), "Select Max Times to Execute"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); if(level_type==TOP_LEVEL) - main_menu.AppendMenu(MF_POPUP, (unsigned int)select_chain_submenu.Detach(), "Select Script Chaining Option"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)select_chain_submenu.Detach(), "Select Script Chaining Option"); else - main_menu.AppendMenu(MF_GRAYED|MF_POPUP, (unsigned int)select_chain_submenu.Detach(), "Select Script Chaining Option"); + main_menu.AppendMenu(MF_GRAYED|MF_POPUP, (uint32_t)select_chain_submenu.Detach(), "Select Script Chaining Option"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&add_actions_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)add_actions_submenu.Detach(), "Add a New Action"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)add_actions_submenu.Detach(), "Add a New Action"); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, ADD_IF_THEN_CLAUSE_ID, "Add a Nested IF-THEN Clause"); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, ADD_IF_THEN_ELSE_CLAUSE_ID, "Add a Nested IF-THEN-ELSE Clause"); if(can_add_else) @@ -12930,9 +12930,9 @@ void CDallasMainDlg::DisplayParameterNodeMenu(POINT *point, int param_type, char main_menu.AppendMenu(MF_SEPARATOR, 0, ""); ColumnizePopupMenu(&replace_with_query_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_with_query_submenu.Detach(), "Replace with Query"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_with_query_submenu.Detach(), "Replace with Query"); ColumnizePopupMenu(&replace_with_literal_submenu); - main_menu.AppendMenu(MF_POPUP, (unsigned int)replace_with_literal_submenu.Detach(), "Replace with Literal"); + main_menu.AppendMenu(MF_POPUP, (uint32_t)replace_with_literal_submenu.Detach(), "Replace with Literal"); main_menu.AppendMenu(MF_SEPARATOR, 0, ""); main_menu.AppendMenu(MF_ENABLED | MF_UNCHECKED | MF_STRING, CANCEL_COMMAND_ID, "Cancel"); @@ -12995,7 +12995,7 @@ void CDallasMainDlg::ColumnizePopupMenu(CMenu *menu) submenu=menu->GetSubMenu(pos); if(submenu!=NULL) { - id=(unsigned int)submenu->Detach(); + id=(uint32_t)submenu->Detach(); flags |= MF_POPUP; } } @@ -13345,7 +13345,7 @@ void CDallasMainDlg::AssignSpecificValue(void) // Check if the message name is valid char *newname=dlg.m_PromptData.GetBuffer(0); if(strlen(newname)==0) return; - for(unsigned int j=0;jip,0,sizeof(unsigned int)); + memset(&newaslu->ip,0,sizeof(uint32_t)); newaslu->host = hostname; newaslu->done = false; newaslu->error = false; @@ -823,7 +823,7 @@ int http_Asyncgethostbyname(unsigned int *ip,int command, char *hostname) { //free(http_lastaslu); http_lastaslu = NULL; - memcpy(ip,&httpaslu.ip,sizeof(unsigned int)); + memcpy(ip,&httpaslu.ip,sizeof(uint32_t)); return 1; } else if(httpaslu.error) @@ -861,7 +861,7 @@ void *http_gethostbynameworker(void *parm) } else if(!lookup->abort) { - memcpy(&lookup->ip,he->h_addr_list[0],sizeof(unsigned int)); + memcpy(&lookup->ip,he->h_addr_list[0],sizeof(uint32_t)); lookup->done = true; memcpy(&httpaslu,lookup,sizeof(async_dns_lookup)); } diff --git a/legacy/inetfile/lnxinetfile.cpp b/legacy/inetfile/lnxinetfile.cpp index fdb60cac..951ad26e 100644 --- a/legacy/inetfile/lnxinetfile.cpp +++ b/legacy/inetfile/lnxinetfile.cpp @@ -75,27 +75,27 @@ void InetGetFile::AbortGet() CFtpGet::CFtpGet(char *URL,char *localfile,char *Username,char *Password){} CFtpGet::~CFtpGet(){} int CFtpGet::GetStatus(){return 0;} -unsigned int CFtpGet::GetBytesIn(){return 0;} -unsigned int CFtpGet::GetTotalBytes(){return 0;} +uint32_t CFtpGet::GetBytesIn(){return 0;} +uint32_t CFtpGet::GetTotalBytes(){return 0;} void CFtpGet::AbortGet(){} void CFtpGet::WorkerThread(){} int CFtpGet::ConnectControlSocket(){return 0;} int CFtpGet::LoginHost(){return 0;} -unsigned int CFtpGet::SendFTPCommand(char *command){return 0;} -unsigned int CFtpGet::ReadFTPServerReply(){return 0;} -unsigned int CFtpGet::GetFile(){return 0;} -unsigned int CFtpGet::IssuePort(){return 0;} -unsigned int CFtpGet::ReadDataChannel(){return 0;} +uint32_t CFtpGet::SendFTPCommand(char *command){return 0;} +uint32_t CFtpGet::ReadFTPServerReply(){return 0;} +uint32_t CFtpGet::GetFile(){return 0;} +uint32_t CFtpGet::IssuePort(){return 0;} +uint32_t CFtpGet::ReadDataChannel(){return 0;} void CFtpGet::FlushControlChannel(){} ///////////////////////////////////////////////////////////////////// ChttpGet::ChttpGet(char *URL,char *localfile){} ChttpGet::~ChttpGet(){} int ChttpGet::GetStatus(){return 0;} -unsigned int ChttpGet::GetBytesIn(){return 0;} -unsigned int GetTotalBytes(){return 0;} +uint32_t ChttpGet::GetBytesIn(){return 0;} +uint32_t GetTotalBytes(){return 0;} void AbortGet(){} void WorkerThread(){} int ConnectSocket(){return 0;} char *GetHTTPLine(){return "ERR";} -unsigned int ReadDataChannel(){return 0;} +uint32_t ReadDataChannel(){return 0;} diff --git a/legacy/mtclient/chat_api.cpp b/legacy/mtclient/chat_api.cpp index 7aefc7e0..e0d23282 100644 --- a/legacy/mtclient/chat_api.cpp +++ b/legacy/mtclient/chat_api.cpp @@ -47,7 +47,7 @@ extern mem_malloc_fp DLLmem_malloc; typedef void (*mem_free_fp) (void *memblock); extern mem_free_fp DLLmem_free; -typedef int (*nw_Asyncgethostbyname_fp) (unsigned int *ip,int command, char *hostname); +typedef int (*nw_Asyncgethostbyname_fp) (uint32_t *ip,int command, char *hostname); extern nw_Asyncgethostbyname_fp DLLnw_Asyncgethostbyname; typedef int (*PollUI_fp) (void); @@ -142,7 +142,7 @@ int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid) if(!Socket_connecting) { strcpy(Nick_name,nickname); - for(unsigned int l=0;lTRACKER_UPDATE_INTERVAL)) { diff --git a/legacy/mtclient/mtgametrack.h b/legacy/mtclient/mtgametrack.h index 84f1a524..9b8bfc2e 100644 --- a/legacy/mtclient/mtgametrack.h +++ b/legacy/mtclient/mtgametrack.h @@ -151,7 +151,7 @@ #define GAME_HEADER_ONLY_SIZE (sizeof(game_packet_header)-MAX_GT_GAME_DATA_SIZE) typedef struct { - unsigned int len; //Length of entire packet; + uint32_t len; //Length of entire packet; 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. @@ -201,7 +201,7 @@ typedef struct { typedef struct _active_games{ int game_type; //ie. GT_FREESPACE GT_DESCENT3, etc. SOCKADDR addr; - unsigned int last_update; //Time we last got an update from this game + uint32_t last_update; //Time we last got an update from this game char data[MAX_GT_GAME_DATA_SIZE]; //memory to hold the game specific data _active_games *next; }active_games; diff --git a/legacy/mtclient/mtpilottrack.h b/legacy/mtclient/mtpilottrack.h index 6e2a5600..cd619a2f 100644 --- a/legacy/mtclient/mtpilottrack.h +++ b/legacy/mtclient/mtpilottrack.h @@ -281,11 +281,11 @@ typedef struct vmt_descent3_struct { int suicides; int online_time; int games_played; - unsigned int security; + uint32_t security; unsigned char virgin_pilot; //This pilot was just created if TRUE - unsigned int lateral_thrust; - unsigned int rotational_thrust; - unsigned int sliding_pct; //Percentage of the time you were sliding + uint32_t lateral_thrust; + uint32_t rotational_thrust; + uint32_t sliding_pct; //Percentage of the time you were sliding uint32_t checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded uint32_t 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 @@ typedef struct vmt_descent3_struct { int GetD3MOTD(char *szmotd,int maxlen); //Function prototypes int InitPilotTrackerClient(); -void AckServer(unsigned int sig); +void AckServer(uint32_t sig); int SendD3PilotData(vmt_descent3_struct *d3_pilot); int GetD3PilotData(vmt_descent3_struct *d3_pilot,char *pilot_name,char *tracker_id); @@ -306,8 +306,8 @@ 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,uint32_t hash); -extern int MTAVersionCheck(unsigned int oldver, char *URL); +void xorcode(void *data,uint32_t len,uint32_t hash); +extern int MTAVersionCheck(uint32_t oldver, char *URL); void VersionIdle(); void HandlePilotData(ubyte *data,int len, network_address *from); diff --git a/legacy/mtclient/mtpilottracker.cpp b/legacy/mtclient/mtpilottracker.cpp index 0dd3c087..2d66de01 100644 --- a/legacy/mtclient/mtpilottracker.cpp +++ b/legacy/mtclient/mtpilottracker.cpp @@ -145,11 +145,11 @@ typedef struct vmt_descent3_struct { int suicides; int online_time; int games_played; - unsigned int security; + uint32_t security; unsigned char virgin_pilot; //This pilot was just created if TRUE - unsigned int lateral_thrust; - unsigned int rotational_thrust; - unsigned int sliding_pct; //Percentage of the time you were sliding + uint32_t lateral_thrust; + uint32_t rotational_thrust; + uint32_t sliding_pct; //Percentage of the time you were sliding uint32_t checksum; //This value needs to be equal to whatever the checksum is once the packet is decoded uint32_t pad; //just to provide room for out 4 byte encryption boundry only needed on the client side for now } vmt_descent3_struct; @@ -220,7 +220,7 @@ float MOTDFirstSent; float MOTDLastSent; char *Motdptr; -unsigned int Motd_maxlen; +uint32_t Motd_maxlen; int ValidState; @@ -234,7 +234,7 @@ float VersionLastSent; char *VersionURL; -unsigned int ValidSecurity; +uint32_t ValidSecurity; char *Psztracker_id; @@ -255,7 +255,7 @@ int InitPilotTrackerClient() VersionState = VERSION_STATE_IDLE; srand(DLLtimer_GetTime()); - ValidSecurity = (unsigned int)rand(); + ValidSecurity = (uint32_t)rand(); //Build the request packet PacketHeader.type = UNT_LOGIN_AUTH_REQUEST;//UNT_VALIDAT_ID_REQUEST; PacketHeader.len = INTEL_SHORT(PACKED_HEADER_ONLY_SIZE+sizeof(validate_id_request)); @@ -459,7 +459,7 @@ int GetD3PilotData(vmt_descent3_struct *d3_pilot,char *pilot_name,char *tracker_ //Send an ACK to the server -void AckServer(unsigned int sig) +void AckServer(uint32_t sig) { udp_packet_header ack_pack; @@ -687,7 +687,7 @@ int ValidateUser(validate_id_request *valid_id, char *trackerid) { /* //First, flush the input buffer for the socket - unsigned int bytesin; + uint32_t bytesin; udp_packet_header inpacket; do { @@ -695,7 +695,7 @@ int ValidateUser(validate_id_request *valid_id, char *trackerid) }while(bytesin && (bytesin!=-1)); */ Psztracker_id = trackerid; - ValidSecurity = (unsigned int)rand(); + ValidSecurity = (uint32_t)rand(); PacketHeader.security = ValidSecurity; //strcpy(ValidIDReq->tracker_id,valid_id->tracker_id); strcpy(ValidIDReq->login,valid_id->login); @@ -733,10 +733,10 @@ void ValidIdle() } } //This code will modify 4 bytes at a time, so make sure to pad it!!! -void xorcode(void *data,unsigned int len,uint32_t hash) +void xorcode(void *data,uint32_t len,uint32_t hash) { return; - unsigned int i=0; + uint32_t i=0; uint32_t *src = (uint32_t *)&data; while(i // helper macros for working with SOCKADDR_IN to make it look nicer between windows and Linux -static inline void INADDR_SET_SUN_SADDR(struct in_addr *st, unsigned int value) { st->S_un.S_addr = value; } -static inline void INADDR_GET_SUN_SADDR(struct in_addr *st, unsigned int *value) { *value = st->S_un.S_addr; } +static inline void INADDR_SET_SUN_SADDR(struct in_addr *st, uint32_t value) { st->S_un.S_addr = value; } +static inline void INADDR_GET_SUN_SADDR(struct in_addr *st, uint32_t *value) { *value = st->S_un.S_addr; } static inline void INADDR_SET_SUN_SUNW(struct in_addr *st, unsigned short s_w1, unsigned short s_w2) { st->S_un.S_un_w.s_w1 = s_w1; st->S_un.S_un_w.s_w2 = s_w2; @@ -241,8 +241,8 @@ static inline int WSAGetLastError() { return errno; } extern bool Use_DirectPlay; // helper macros for working with SOCKADDR_IN to make it look nicer between windows and Linux -static inline void INADDR_SET_SUN_SADDR(struct in_addr *st, unsigned int value) { st->s_addr = value; } -static inline void INADDR_GET_SUN_SADDR(struct in_addr *st, unsigned int *value) { *value = st->s_addr; } +static inline void INADDR_SET_SUN_SADDR(struct in_addr *st, uint32_t value) { st->s_addr = value; } +static inline void INADDR_GET_SUN_SADDR(struct in_addr *st, uint32_t *value) { *value = st->s_addr; } static inline void INADDR_SET_SUN_SUNW(struct in_addr *st, unsigned short s_w1, unsigned short s_w2) { union { struct { @@ -251,7 +251,7 @@ static inline void INADDR_SET_SUN_SUNW(struct in_addr *st, unsigned short s_w1, struct { unsigned short s_w1, s_w2; } S_un_w; - unsigned int S_addr; + uint32_t S_addr; } S_un; S_un.S_un_w.s_w1 = s_w1; @@ -266,7 +266,7 @@ static inline void INADDR_GET_SUN_SUNW(struct in_addr *st, unsigned short *s_w1, struct { unsigned short s_w1, s_w2; } S_un_w; - unsigned int S_addr; + uint32_t S_addr; } S_un; S_un.S_addr = st->s_addr; @@ -282,7 +282,7 @@ static inline void INADDR_SET_SUN_SUNB(struct in_addr *st, unsigned char s_b1, u struct { unsigned short s_w1, s_w2; } S_un_w; - unsigned int S_addr; + uint32_t S_addr; } S_un; S_un.S_un_b.s_b1 = s_b1; @@ -300,7 +300,7 @@ static inline void INADDR_GET_SUN_SUNB(struct in_addr *st, unsigned char *s_b1, struct { unsigned short s_w1, s_w2; } S_un_w; - unsigned int S_addr; + uint32_t S_addr; } S_un; S_un.S_addr = st->s_addr; @@ -344,7 +344,7 @@ extern BOOL DP_active; extern BOOL TCP_active; extern BOOL IPX_active; // Get the info from RAS -unsigned int psnet_ras_status(); +uint32_t psnet_ras_status(); // function to shutdown and close the given socket. It takes a couple of things into consideration // when closing, such as possibly reiniting reliable sockets if they are closed here. @@ -374,7 +374,7 @@ uint32_t nw_GetHostAddressFromNumbers(char *str); void nw_GetNumbersFromHostAddress(network_address *address, char *str); // returns the ip address of this computer -unsigned int nw_GetThisIP(); +uint32_t nw_GetThisIP(); // function which checks the Listen_socket for possibly incoming requests to be connected. // returns 0 on error or nothing waiting. 1 if we should try to accept @@ -399,7 +399,7 @@ void nw_FreePacket(int id); int nw_Receive(void *data, network_address *from_addr); // nw_SendReliable sends the given data through the given reliable socket. -int nw_SendReliable(unsigned int socketid, ubyte *data, int length, bool urgent = false); +int nw_SendReliable(uint32_t socketid, ubyte *data, int length, bool urgent = false); // function which reads data off of a reliable socket. recv() should read the totaly amount of data // available I believe. (i.e. we shouldn't read only part of a message with one call....I may be wrong @@ -466,7 +466,7 @@ int nw_psnet_buffer_get_next_by_packet_id(ubyte *data, int *length, uint32_t pac #define RNF_CONNECTING 4 // We received the connecting message, but haven't told the game yet. #define RNF_LIMBO 5 // between connecting and connected -void nw_SendReliableAck(SOCKADDR *raddr, unsigned int sig, network_protocol link_type, float time_sent); +void nw_SendReliableAck(SOCKADDR *raddr, uint32_t sig, network_protocol link_type, float time_sent); void nw_WorkReliable(ubyte *data, int len, network_address *naddr); int nw_Compress(void *srcdata, void *destdata, int count); int nw_Uncompress(void *compdata, void *uncompdata, int count); @@ -476,7 +476,7 @@ int nw_Uncompress(void *compdata, void *uncompdata, int count); #define NW_AGHBN_READ 3 typedef struct _async_dns_lookup { - unsigned int ip; // resolved host. Write only to worker thread. + uint32_t ip; // resolved host. Write only to worker thread. char *host; // host name to resolve. read only to worker thread bool done; // write only to the worker thread. Signals that the operation is complete bool error; // write only to worker thread. Thread sets this if the name doesn't resolve @@ -500,7 +500,7 @@ int CDECLCALL gethostbynameworker(void *parm); void CDECLCALL gethostbynameworker(void *parm); #endif -int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname); +int nw_Asyncgethostbyname(uint32_t *ip, int command, char *hostname); int nw_ReccomendPPS(); void nw_DoNetworkIdle(void); diff --git a/lib/pstypes.h b/lib/pstypes.h index 97bf0211..84a3f347 100644 --- a/lib/pstypes.h +++ b/lib/pstypes.h @@ -25,7 +25,7 @@ typedef unsigned char ubyte; typedef signed char sbyte; typedef unsigned short ushort; -typedef unsigned int uint; +typedef uint32_t uint; typedef unsigned long ulong; #ifdef _MSC_VER // only Visual C++ has __int64 diff --git a/lib/uires.h b/lib/uires.h index 9c79f001..863ea681 100644 --- a/lib/uires.h +++ b/lib/uires.h @@ -120,7 +120,7 @@ public: // text. allows for alpha, color and different fonts. class UITextItem : public UIItem { - friend void SetUITextItemText(UITextItem *uit, char *newtext, unsigned int color); + friend void SetUITextItemText(UITextItem *uit, char *newtext, uint32_t color); ubyte m_Alpha; // alpha value of text. ddgr_color m_Color; // color of text. diff --git a/lib/win/wincontroller.h b/lib/win/wincontroller.h index 712c79f1..42b6cf46 100644 --- a/lib/win/wincontroller.h +++ b/lib/win/wincontroller.h @@ -273,7 +273,7 @@ private: struct t_msestate { int m_deltaX, m_deltaY, m_deltaZ; int m_absX, m_absY; - unsigned int m_buttonMask; + uint32_t m_buttonMask; } m_MseState; struct t_extctlstate { diff --git a/libacm/adecode.cpp b/libacm/adecode.cpp index 0502b462..fa344fa7 100644 --- a/libacm/adecode.cpp +++ b/libacm/adecode.cpp @@ -50,7 +50,7 @@ public: int AcmReadFunc(void *ptr, int size, int n, void *datasrc) { InternalAudioDecoder *iad = reinterpret_cast(datasrc); int ret = - iad->m_readerFunction(iad->m_pReaderData, ptr, (unsigned int)size * n); + iad->m_readerFunction(iad->m_pReaderData, ptr, (uint32_t)size * n); // ret < 0: error, ret == 0: EOF, ret > 0: read ret bytes of data // apparently acm_io_callbacks::read() expects pretty much the same behavior, // except that for > 0 it's not number of bytes but number of items (like in diff --git a/libacm/aencode.cpp b/libacm/aencode.cpp index 326e0385..ed7972f5 100644 --- a/libacm/aencode.cpp +++ b/libacm/aencode.cpp @@ -23,7 +23,7 @@ #include #include "Aencode.h" -typedef unsigned int uint32; +typedef uint32_t uint32; typedef signed int sint32; typedef unsigned short uint16; typedef signed short sint16; @@ -877,7 +877,7 @@ sint32 calc_bits(Encoder &enc, sint32 val) { eax = ~minValue; } - if (maxValue > 0 && ((unsigned int)(eax) < (unsigned int)(maxValue))) { + if (maxValue > 0 && ((uint32_t)(eax) < (uint32_t)(maxValue))) { eax = maxValue; } diff --git a/libacm/decode.c b/libacm/decode.c index ff663137..635947a0 100644 --- a/libacm/decode.c +++ b/libacm/decode.c @@ -195,7 +195,7 @@ static int f_bad(ACMStream *acm, unsigned ind, unsigned col) static int f_linear(ACMStream *acm, unsigned ind, unsigned col) { - unsigned int i; + uint32_t i; int b, middle = 1 << (ind - 1); for (i = 0; i < acm->info.acm_rows; i++) { @@ -507,9 +507,9 @@ static int fill_block(ACMStream *acm) static void juggle(int *wrap_p, int *block_p, unsigned sub_len, unsigned sub_count) { - unsigned int i, j; + uint32_t i, j; int *p; - unsigned int r0, r1, r2, r3; + uint32_t r0, r1, r2, r3; for (i = 0; i < sub_len; i++) { p = block_p; r0 = wrap_p[0]; @@ -711,7 +711,7 @@ static int read_wavc_header(ACMStream *acm) static int read_header(ACMStream *acm) { - unsigned int tmp; + uint32_t tmp; /* read header */ diff --git a/libmve/SystemInterfaces.h b/libmve/SystemInterfaces.h index a97e981d..4b4b2eef 100644 --- a/libmve/SystemInterfaces.h +++ b/libmve/SystemInterfaces.h @@ -45,8 +45,8 @@ struct SoundWAVEFormatEx { unsigned short wFormatTag; unsigned short nChannels; - unsigned int nSamplesPerSec; - unsigned int nAvgBytesPerSec; + uint32_t nSamplesPerSec; + uint32_t nAvgBytesPerSec; unsigned short nBlockAlign; unsigned short wBitsPerSample; unsigned short cbSize; @@ -54,15 +54,15 @@ struct SoundWAVEFormatEx { #define SOUND_WAVE_FORMAT_PCM 0x01 struct SysSoundCaps { - unsigned int dwFlags; - unsigned int dwBufferBytes; + uint32_t dwFlags; + uint32_t dwBufferBytes; }; class SysSoundBufferDesc { public: SoundWAVEFormatEx *lpwfxFormat; - unsigned int dwBufferBytes; - unsigned int dwFlags; + uint32_t dwBufferBytes; + uint32_t dwFlags; }; class ISysSoundBuffer { @@ -119,7 +119,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - virtual int Play(unsigned int flags) = 0; + virtual int Play(uint32_t flags) = 0; //////////////////////////// // GetCaps @@ -139,7 +139,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - virtual int GetStatus(unsigned int *status) = 0; + virtual int GetStatus(uint32_t *status) = 0; /////////////////////////////////////// // GetCurrentPosition @@ -149,7 +149,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - virtual int GetCurrentPosition(unsigned int *ppos, unsigned int *wpos) = 0; + virtual int GetCurrentPosition(uint32_t *ppos, uint32_t *wpos) = 0; /////////////////////////////////////// // SetCurrentPosition @@ -159,7 +159,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - virtual int SetCurrentPosition(unsigned int pos) = 0; + virtual int SetCurrentPosition(uint32_t pos) = 0; ///////////////////////// // Lock @@ -170,8 +170,8 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - virtual int Lock(unsigned int pos, unsigned int numbytes, void **ptr1, unsigned int *numbytes1, void **ptr2, - unsigned int *numbytes2, unsigned int flags) = 0; + virtual int Lock(uint32_t pos, uint32_t numbytes, void **ptr1, uint32_t *numbytes1, void **ptr2, + uint32_t *numbytes2, uint32_t flags) = 0; /////////////////////////// // Unlock @@ -181,7 +181,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - virtual int Unlock(void *ptr1, unsigned int num1, void *ptr2, unsigned int num2) = 0; + virtual int Unlock(void *ptr1, uint32_t num1, void *ptr2, uint32_t num2) = 0; }; class ISoundDevice { diff --git a/libmve/lnxdsound.cpp b/libmve/lnxdsound.cpp index debe6806..c55502f0 100644 --- a/libmve/lnxdsound.cpp +++ b/libmve/lnxdsound.cpp @@ -48,9 +48,9 @@ static LnxSoundDevice LinuxSoundDevice; static bool StartupSoundSystem(LnxSoundDevice *dev); static void ShutdownSoundSystem(void); -static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len); -static unsigned int LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len); -static unsigned int LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len); +static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len); +static uint32_t LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len); +static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len); static void LinuxSoundMixBuffersIntoMain(int len); static void LinuxSoundThreadHandler(void *unused, Uint8 *stream, int len); @@ -260,9 +260,9 @@ int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff, signed int vol) { double vt; vt = (double)(buff->volume - (buff->pan > 0 ? buff->pan : 0)); - buff->left_vol = (unsigned int)(pow(2.0, vt / 600.0) * 32768.0); + buff->left_vol = (uint32_t)(pow(2.0, vt / 600.0) * 32768.0); vt = (double)(buff->volume + (buff->pan < 0 ? buff->pan : 0)); - buff->right_vol = (unsigned int)(pow(2.0, vt / 600.0) * 32768.0); + buff->right_vol = (uint32_t)(pow(2.0, vt / 600.0) * 32768.0); exit_critical(); @@ -295,9 +295,9 @@ int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff, signed int pan) { double pt; pt = (double)(buff->volume - (buff->pan > 0 ? buff->pan : 0)); - buff->left_vol = (unsigned int)(pow(2.0, pt / 600.0) * 32768.0); + buff->left_vol = (uint32_t)(pow(2.0, pt / 600.0) * 32768.0); pt = (double)(buff->volume + (buff->pan < 0 ? buff->pan : 0)); - buff->right_vol = (unsigned int)(pow(2.0, pt / 600.0) * 32768.0); + buff->right_vol = (uint32_t)(pow(2.0, pt / 600.0) * 32768.0); exit_critical(); @@ -331,7 +331,7 @@ int LnxSoundBuffer_Stop(LnxSoundBuffer *buff) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Play(LnxSoundBuffer *buff, unsigned int flags) { +int LnxSoundBuffer_Play(LnxSoundBuffer *buff, uint32_t flags) { if (!buff) return -1; @@ -369,7 +369,7 @@ int LnxSoundBuffer_GetCaps(LnxSoundBuffer *buff, LinuxSoundCaps *caps) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status) { +int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, uint32_t *status) { if (!status || !buff) return -1; @@ -390,7 +390,7 @@ int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, unsigned int *wpos) { +int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, uint32_t *ppos, uint32_t *wpos) { if (!buff) return -1; @@ -410,7 +410,7 @@ int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos) { +int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, uint32_t pos) { if (!buff) return -1; @@ -429,8 +429,8 @@ int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int numbytes, void **ptr1, - unsigned int *numbytes1, void **ptr2, unsigned int *numbytes2, unsigned int flags) { +int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, uint32_t pos, uint32_t numbytes, void **ptr1, + uint32_t *numbytes1, void **ptr2, uint32_t *numbytes2, uint32_t flags) { if (!buff) return -1; @@ -470,7 +470,7 @@ int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int num // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, unsigned int num1, void *ptr2, unsigned int num2) { +int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, uint32_t num1, void *ptr2, uint32_t num2) { if (!buff) return -1; @@ -521,7 +521,7 @@ static bool StartupSoundSystem(LnxSoundDevice *dev) { // Shutsdown the sound processing thread static void ShutdownSoundSystem(void) { SDL_CloseAudio(); } -static inline void GetValues(const LnxSoundBuffer *dsb, unsigned char *buf, unsigned int *fl, unsigned int *fr) { +static inline void GetValues(const LnxSoundBuffer *dsb, unsigned char *buf, uint32_t *fl, uint32_t *fr) { signed short *bufs = (signed short *)buf; // 8 bit stereo @@ -554,7 +554,7 @@ static inline void GetValues(const LnxSoundBuffer *dsb, unsigned char *buf, unsi return; } -static inline void SetValues(unsigned char *buf, unsigned int fl, unsigned int fr) { +static inline void SetValues(unsigned char *buf, uint32_t fl, uint32_t fr) { signed short *bufs = (signed short *)buf; // 8 bit stereo @@ -585,8 +585,8 @@ static inline void SetValues(unsigned char *buf, unsigned int fl, unsigned int f return; } -static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len) { - unsigned int i, inc = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); +static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len) { + uint32_t i, inc = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); unsigned char *bpc = buf; signed short *bps = (signed short *)buf; @@ -595,7 +595,7 @@ static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uns return; for (i = 0; i < len; i += inc) { - unsigned int val; + uint32_t val; switch (inc) { case 1: { val = *bpc - 128; @@ -613,11 +613,11 @@ static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uns } } -static unsigned int LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len) { - unsigned int i, size, ipos, ilen, fieldL = 0, fieldR = 0; +static uint32_t LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len) { + uint32_t i, size, ipos, ilen, fieldL = 0, fieldR = 0; unsigned char *ibp, *obp; - unsigned int iAdvance = dsb->wfx.nBlockAlign; - unsigned int oAdvance = LnxBuffers[0]->wfx.nBlockAlign; + uint32_t iAdvance = dsb->wfx.nBlockAlign; + uint32_t oAdvance = LnxBuffers[0]->wfx.nBlockAlign; ibp = dsb->buffer + dsb->play_cursor; obp = buf; @@ -676,8 +676,8 @@ int DoMulDiv(int nNumber, int nNumerator, int nDenominator) { static void *TempSoundBuffer = NULL; static int TempSoundBufferLen = 0; -static unsigned int LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) { - unsigned int i, ilen, advance = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); +static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) { + uint32_t i, ilen, advance = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); unsigned char *buf, *ibuf, *obuf; signed int temp, field; signed short *ibufs, *obufs; diff --git a/libmve/lnxdsound.h b/libmve/lnxdsound.h index 7adc5bc8..4b8a60be 100644 --- a/libmve/lnxdsound.h +++ b/libmve/lnxdsound.h @@ -22,10 +22,10 @@ #include "SystemInterfaces.h" typedef struct { int sound_device; // file device handle for sound - unsigned int bps; // (bytes per second) channels*freq*bit_depth/8 - unsigned int freq; // frequency (22050, etc.) - unsigned int bit_depth; // 8 or 16 - unsigned int channels; // 1 or 2 (mono or stereo) + uint32_t bps; // (bytes per second) channels*freq*bit_depth/8 + uint32_t freq; // frequency (22050, etc.) + uint32_t bit_depth; // 8 or 16 + uint32_t channels; // 1 or 2 (mono or stereo) } LnxSoundDevice; #define WAVEFORMATEX SoundWAVEFormatEx @@ -39,11 +39,11 @@ typedef struct { typedef struct { int freq_adjustment; int bps; - unsigned int buffer_len; - unsigned int play_cursor; - unsigned int write_cursor; - unsigned int flags; - unsigned int left_vol, right_vol; + uint32_t buffer_len; + uint32_t play_cursor; + uint32_t write_cursor; + uint32_t flags; + uint32_t left_vol, right_vol; unsigned char *buffer; @@ -122,7 +122,7 @@ int LnxSoundBuffer_Stop(LnxSoundBuffer *buff); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Play(LnxSoundBuffer *buff, unsigned int flags); +int LnxSoundBuffer_Play(LnxSoundBuffer *buff, uint32_t flags); //////////////////////////// // LnxSoundBuffer_GetCaps @@ -143,7 +143,7 @@ int LnxSoundBuffer_GetCaps(LnxSoundBuffer *buff, LinuxSoundCaps *caps); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status); +int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, uint32_t *status); /////////////////////////////////////// // LnxSoundBuffer_GetCurrentPosition @@ -153,7 +153,7 @@ int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, unsigned int *wpos); +int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, uint32_t *ppos, uint32_t *wpos); /////////////////////////////////////// // LnxSoundBuffer_SetCurrentPosition @@ -163,7 +163,7 @@ int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos); +int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, uint32_t pos); ///////////////////////// // LnxSoundBuffer_Lock @@ -174,8 +174,8 @@ int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int numbytes, void **ptr1, - unsigned int *numbytes1, void **ptr2, unsigned int *numbytes2, unsigned int flags); +int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, uint32_t pos, uint32_t numbytes, void **ptr1, + uint32_t *numbytes1, void **ptr2, uint32_t *numbytes2, uint32_t flags); /////////////////////////// // LnxSoundBuffer_Unlock @@ -185,6 +185,6 @@ int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int num // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, unsigned int num1, void *ptr2, unsigned int num2); +int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, uint32_t num1, void *ptr2, uint32_t num2); #endif diff --git a/libmve/mveasm.cpp b/libmve/mveasm.cpp index 62b53f12..e0da7c8d 100644 --- a/libmve/mveasm.cpp +++ b/libmve/mveasm.cpp @@ -48,8 +48,8 @@ unsigned sndDecompM16(unsigned short *dst, const unsigned char *src, unsigned le unsigned sndDecompS16(unsigned short *dst, const unsigned char *src, unsigned len, unsigned prev); void Trans16Blk(unsigned char *edi, const unsigned char *idx); -void DOnf_xycshift(const bool hiColor, const unsigned int eax, unsigned char *&edi, const int nfpk_back_right); -void DOnf_xypshift(const bool hiColor, const unsigned int eax, unsigned char *&edi, const int nfpk_back_right, +void DOnf_xycshift(const bool hiColor, const uint32_t eax, unsigned char *&edi, const int nfpk_back_right); +void DOnf_xypshift(const bool hiColor, const uint32_t eax, unsigned char *&edi, const int nfpk_back_right, const int DiffBufPtrs); void DOnf_shift(const bool hiColor, int eax, unsigned char *&edi, const int nfpk_back_right); @@ -62,7 +62,7 @@ void DOnf_shift(const bool hiColor, int eax, unsigned char *&edi, const int nfpk // prev is the previous decompression state or zero. // Returns new decompression state. unsigned sndDecompM16(unsigned short *dst, const unsigned char *src, unsigned len, unsigned prev) { - unsigned int i, eax, ebx; + uint32_t i, eax, ebx; if (len == 0) return prev; eax = prev; @@ -88,7 +88,7 @@ unsigned sndDecompM16(unsigned short *dst, const unsigned char *src, unsigned le // Returns new decompression state. unsigned sndDecompS16(unsigned short *dst, const unsigned char *src, unsigned len, unsigned prev) { unsigned re = 0; - unsigned int eax, edx, ebx, i; + uint32_t eax, edx, ebx, i; if (len == 0) { return prev; @@ -552,7 +552,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned nf.y = y; NF_DECOMP_INIT((hiColor) ? 1 : 0, &nf); - const unsigned int kSWidthScaled = (hiColor) ? SWIDTH * 2 : SWIDTH; + const uint32_t kSWidthScaled = (hiColor) ? SWIDTH * 2 : SWIDTH; int nfpk_back_right = nf_back_right - kSWidthScaled; @@ -561,7 +561,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned const unsigned char *bcomp = NULL; if (hiColor) { - unsigned int bcompOffset = IntelSwapper(*((const unsigned short *)esi)); + uint32_t bcompOffset = IntelSwapper(*((const unsigned short *)esi)); bcomp = esi + bcompOffset; esi += 2; } @@ -616,10 +616,10 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } } else { // Here we paint with the palette index we want - const unsigned int kPaletteIndex = 0; + const uint32_t kPaletteIndex = 0; - unsigned int *pDst = reinterpret_cast(edi); - const unsigned int kPalIndexDWord = + uint32_t *pDst = reinterpret_cast(edi); + const uint32_t kPalIndexDWord = (kPaletteIndex << 24) | (kPaletteIndex << 16) | (kPaletteIndex << 8) | kPaletteIndex; for (int r = 0; r < 8; ++r) { pDst[0] = kPalIndexDWord; @@ -642,7 +642,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } break; case 2: { // Near shift from older part of current buffer - unsigned int offset; + uint32_t offset; if (hiColor) { offset = *bcomp++; } else { @@ -653,7 +653,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned case 3: { // Near shift from newer part of current buffer union { - unsigned int eax; + uint32_t eax; reg_word word; reg_byte byte; } myeax; @@ -673,7 +673,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned case 4: { // Near shift from previous buffer union { - unsigned int eax; + uint32_t eax; reg_word word; reg_byte byte; } myeax; @@ -689,21 +689,21 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } break; case 5: { // Far shift from previous buffer - unsigned int eax = IntelSwapper(*(unsigned short *)(esi)); + uint32_t eax = IntelSwapper(*(unsigned short *)(esi)); esi += 2; DOnf_xypshift(hiColor, eax, edi, nfpk_back_right, nf.DiffBufPtrs); } break; case 6: { if (hiColor) { // Far shift from current buffer - unsigned int val1 = IntelSwapper(*(unsigned short *)esi); + uint32_t val1 = IntelSwapper(*(unsigned short *)esi); esi += 2; DOnf_xycshift(hiColor, val1, edi, nfpk_back_right); } else { // Run of no changes (must only appear in first nibble opcodes) // Next nibble k specifies 2k+4 squares with no changes skipNextOpCode = true; // Next nibble is not an opcode - unsigned int cnt = ((opcode >> 4) & 0xF) + 2; // (minimum of 4 squares) + uint32_t cnt = ((opcode >> 4) & 0xF) + 2; // (minimum of 4 squares) while (true) { edi += SWIDTH * 2; // Advance over two squares @@ -734,19 +734,19 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned if (!donf23) { // 8x8x1 (12/10 bytes) - unsigned int colors[4]; + uint32_t colors[4]; if (hiColor) { - unsigned int ecx = (Trans16(esi + 2) << 16) | Trans16(esi); - unsigned int edx = (ecx >> 16) | (ecx << 16); - unsigned int ebx = (edx & 0xFFFF0000) | (ecx & 0xFFFF); - unsigned int ebp = (ecx & 0xFFFF0000) | (edx & 0xFFFF); + uint32_t ecx = (Trans16(esi + 2) << 16) | Trans16(esi); + uint32_t edx = (ecx >> 16) | (ecx << 16); + uint32_t ebx = (edx & 0xFFFF0000) | (ecx & 0xFFFF); + uint32_t ebp = (ecx & 0xFFFF0000) | (edx & 0xFFFF); colors[0] = ebx; colors[1] = edx; colors[2] = ecx; colors[3] = ebp; } else { - unsigned int tcLo = esi[0]; - unsigned int tcHi = esi[1]; + uint32_t tcLo = esi[0]; + uint32_t tcHi = esi[1]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -759,21 +759,21 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int rep_count = 0; rep_count < max_repcount; ++rep_count) { const unsigned char *color_idx = lookupTable + (esi[rep_count + kOffset] * 4); #ifdef OUTRAGE_BIG_ENDIAN - unsigned int w1 = colors[color_idx[3]]; - unsigned int w2 = colors[color_idx[2]]; - unsigned int w3 = colors[color_idx[1]]; - unsigned int w4 = colors[color_idx[0]]; + uint32_t w1 = colors[color_idx[3]]; + uint32_t w2 = colors[color_idx[2]]; + uint32_t w3 = colors[color_idx[1]]; + uint32_t w4 = colors[color_idx[0]]; #else - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; #endif if (hiColor) { - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; } else { *(unsigned short *)(edi + 0) = w1; *(unsigned short *)(edi + 2) = w2; @@ -788,15 +788,15 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned edi -= nfpk_back_right; } else { // low 4x4x1 (6/4 bytes) - unsigned int colors[2]; + uint32_t colors[2]; if (hiColor) { - unsigned int temp = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; + uint32_t temp = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; colors[0] = (temp << 16) | temp; temp = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; colors[1] = (temp << 16) | temp; } else { - unsigned int tcLo = esi[0]; - unsigned int tcHi = esi[1]; + uint32_t tcLo = esi[0]; + uint32_t tcHi = esi[1]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcHi << 8); } @@ -823,26 +823,26 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned const unsigned char *color_idx = lookupTable + (idx * 4); #ifdef OUTRAGE_BIG_ENDIAN - unsigned int w1 = colors[color_idx[3]]; - unsigned int w2 = colors[color_idx[2]]; - unsigned int w3 = colors[color_idx[1]]; - unsigned int w4 = colors[color_idx[0]]; + uint32_t w1 = colors[color_idx[3]]; + uint32_t w2 = colors[color_idx[2]]; + uint32_t w3 = colors[color_idx[1]]; + uint32_t w4 = colors[color_idx[0]]; #else - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; #endif if (hiColor) { - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; - *(unsigned int *)(edi + nf_width + 0) = w1; - *(unsigned int *)(edi + nf_width + 4) = w2; - *(unsigned int *)(edi + nf_width + 8) = w3; - *(unsigned int *)(edi + nf_width + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; + *(uint32_t *)(edi + nf_width + 0) = w1; + *(uint32_t *)(edi + nf_width + 4) = w2; + *(uint32_t *)(edi + nf_width + 8) = w3; + *(uint32_t *)(edi + nf_width + 12) = w4; } else { *(unsigned short *)(edi + 0) = w1; *(unsigned short *)(edi + 2) = w2; @@ -887,11 +887,11 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } if (!donf24 && !donf40) { - unsigned int colors[4]; + uint32_t colors[4]; int max_repcount = 8; if (hiColor) { - unsigned int tempcolor; + uint32_t tempcolor; tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]); colors[2] = tempcolor; @@ -900,8 +900,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[1] = tempcolor; colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { - unsigned int tcLo = esi[0]; - unsigned int tcHi = esi[1]; + uint32_t tcLo = esi[0]; + uint32_t tcHi = esi[1]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -925,23 +925,23 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned int idx = repLookup[rep_count]; const unsigned char *color_idx = lookupTable + (esi[idx] * 4); #ifdef OUTRAGE_BIG_ENDIAN - unsigned int w1 = colors[color_idx[3]]; - unsigned int w2 = colors[color_idx[2]]; - unsigned int w3 = colors[color_idx[1]]; - unsigned int w4 = colors[color_idx[0]]; + uint32_t w1 = colors[color_idx[3]]; + uint32_t w2 = colors[color_idx[2]]; + uint32_t w3 = colors[color_idx[1]]; + uint32_t w4 = colors[color_idx[0]]; #else - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; #endif if (hiColor) { - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; edi += nf_width; - *(unsigned int *)(edi + 0) = w3; - *(unsigned int *)(edi + 4) = w4; + *(uint32_t *)(edi + 0) = w3; + *(uint32_t *)(edi + 4) = w4; edi += nf_width; } else { *(unsigned short *)(edi + 0) = w1; @@ -954,7 +954,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned if (rep_count == 1) { if (hiColor) { - unsigned int tempcolor = nf_trans16_lo[*(esi + 8)] | nf_trans16_hi[*(esi + 9)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 8)] | nf_trans16_hi[*(esi + 9)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 6)] | nf_trans16_hi[*(esi + 7)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -962,8 +962,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[1] = tempcolor; colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { - unsigned int tcLo = esi[4]; - unsigned int tcHi = esi[5]; + uint32_t tcLo = esi[4]; + uint32_t tcHi = esi[5]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -972,7 +972,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } else if (rep_count == 3) { if (hiColor) { edi -= nf_width * 8 - 8; - unsigned int tempcolor = nf_trans16_lo[*(esi + 14)] | nf_trans16_hi[*(esi + 15)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 14)] | nf_trans16_hi[*(esi + 15)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 12)] | nf_trans16_hi[*(esi + 13)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -981,8 +981,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { edi -= nf_width * 8 - 4; - unsigned int tcLo = esi[8]; - unsigned int tcHi = esi[9]; + uint32_t tcLo = esi[8]; + uint32_t tcHi = esi[9]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -990,7 +990,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } } else if (rep_count == 5) { if (hiColor) { - unsigned int tempcolor = nf_trans16_lo[*(esi + 20)] | nf_trans16_hi[*(esi + 21)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 20)] | nf_trans16_hi[*(esi + 21)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 18)] | nf_trans16_hi[*(esi + 19)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -998,8 +998,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[1] = tempcolor; colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { - unsigned int tcLo = esi[12]; - unsigned int tcHi = esi[13]; + uint32_t tcLo = esi[12]; + uint32_t tcHi = esi[13]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -1014,10 +1014,10 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } if (donf24) { - unsigned int colors[4]; + uint32_t colors[4]; if (hiColor) { - unsigned int tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -1025,8 +1025,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[1] = tempcolor; colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { - unsigned int tcLo = esi[0]; - unsigned int tcHi = esi[1]; + uint32_t tcLo = esi[0]; + uint32_t tcHi = esi[1]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -1051,17 +1051,17 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int rep_count = 0; rep_count < max_repcount; rep_count++) { int idx = repLookupTable[rep_count]; const unsigned char *color_idx = lookupTable + (esi[idx] * 4); - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; if (hiColor) { - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; edi += nf_width; - *(unsigned int *)(edi + 0) = w3; - *(unsigned int *)(edi + 4) = w4; + *(uint32_t *)(edi + 0) = w3; + *(uint32_t *)(edi + 4) = w4; edi += nf_width; } else { *(unsigned short *)(edi + 0) = w1; @@ -1076,7 +1076,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned if (hiColor) { edi -= nf_width * 8 - 8; - unsigned int tempcolor = nf_trans16_lo[*(esi + 10)] | nf_trans16_hi[*(esi + 11)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 10)] | nf_trans16_hi[*(esi + 11)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 8)] | nf_trans16_hi[*(esi + 9)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -1086,8 +1086,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } else { edi -= nf_width * 8 - 4; - unsigned int tcLo = esi[6]; - unsigned int tcHi = esi[7]; + uint32_t tcLo = esi[6]; + uint32_t tcHi = esi[7]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -1101,10 +1101,10 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } if (donf40) { - unsigned int colors[4]; + uint32_t colors[4]; if (hiColor) { - unsigned int tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -1112,8 +1112,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[1] = tempcolor; colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { - unsigned int tcLo = esi[0]; - unsigned int tcHi = esi[1]; + uint32_t tcLo = esi[0]; + uint32_t tcHi = esi[1]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -1138,21 +1138,21 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned int idx = repLookupTable[rep_count]; const unsigned char *color_idx = lookupTable + (esi[idx] * 4); #ifdef OUTRAGE_BIG_ENDIAN - unsigned int w1 = colors[color_idx[3]]; - unsigned int w2 = colors[color_idx[2]]; - unsigned int w3 = colors[color_idx[1]]; - unsigned int w4 = colors[color_idx[0]]; + uint32_t w1 = colors[color_idx[3]]; + uint32_t w2 = colors[color_idx[2]]; + uint32_t w3 = colors[color_idx[1]]; + uint32_t w4 = colors[color_idx[0]]; #else - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; #endif if (hiColor) { - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; } else { *(unsigned short *)(edi + 0) = w1; *(unsigned short *)(edi + 2) = w2; @@ -1163,7 +1163,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned if (rep_count == 3) { if (hiColor) { - unsigned int tempcolor = nf_trans16_lo[*(esi + 10)] | nf_trans16_hi[*(esi + 11)]; + uint32_t tempcolor = nf_trans16_lo[*(esi + 10)] | nf_trans16_hi[*(esi + 11)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 8)] | nf_trans16_hi[*(esi + 9)]); colors[2] = tempcolor; tempcolor = ((tempcolor & 0xFFFF0000) >> 16) | ((tempcolor & 0xFFFF) << 16); @@ -1171,8 +1171,8 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned colors[1] = tempcolor; colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); } else { - unsigned int tcLo = esi[6]; - unsigned int tcHi = esi[7]; + uint32_t tcLo = esi[6]; + uint32_t tcHi = esi[7]; colors[0] = tcLo | (tcLo << 8); colors[1] = tcHi | (tcLo << 8); colors[2] = tcLo | (tcHi << 8); @@ -1238,19 +1238,19 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned int idx = rep_count + ((hiColor) ? 8 : 4); const unsigned char *color_idx = lookupTable + (esi[idx] * 4); - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; if (rep_count & 1) { #ifdef OUTRAGE_BIG_ENDIAN if (hiColor) { - *(unsigned int *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); } else { *(unsigned char *)(edi + 4) = w4; *(unsigned char *)(edi + 5) = w3; @@ -1264,11 +1264,11 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } #else if (hiColor) { - *(unsigned int *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); } else { *(unsigned char *)(edi + 4) = w1; *(unsigned char *)(edi + 5) = w2; @@ -1285,22 +1285,22 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } else { if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 0) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 4) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 4) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); #else - *(unsigned int *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); #endif } else { - const unsigned int value = IntelSwapper((unsigned int)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); - *(unsigned int *)(edi) = value; - *(unsigned int *)(edi + nf_width) = value; + const uint32_t value = IntelSwapper((uint32_t)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); + *(uint32_t *)(edi) = value; + *(uint32_t *)(edi + nf_width) = value; } } } @@ -1310,7 +1310,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned edi += nf_width; edi -= nfpk_back_right; } else if (donf41) { - unsigned int colors[4]; + uint32_t colors[4]; if (hiColor) { colors[0] = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; colors[0] = ((colors[0]) << 16) | colors[0]; @@ -1332,16 +1332,16 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int rep_count = 0; rep_count < max_repcount; ++rep_count) { int idx = rep_count + ((hiColor) ? 8 : 4); const unsigned char *color_idx = lookupTable + (esi[idx] * 4); - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; #ifdef OUTRAGE_BIG_ENDIAN if (hiColor) { - *(unsigned int *)(edi + 0) = w4; - *(unsigned int *)(edi + 4) = w3; - *(unsigned int *)(edi + 8) = w2; - *(unsigned int *)(edi + 12) = w1; + *(uint32_t *)(edi + 0) = w4; + *(uint32_t *)(edi + 4) = w3; + *(uint32_t *)(edi + 8) = w2; + *(uint32_t *)(edi + 12) = w1; } else { *(unsigned char *)(edi + 0) = w4; *(unsigned char *)(edi + 1) = w4; @@ -1354,10 +1354,10 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned } #else if (hiColor) { - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; } else { *(unsigned char *)(edi + 0) = w1; *(unsigned char *)(edi + 1) = w1; @@ -1377,7 +1377,7 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned edi -= nf_width; edi -= nfpk_back_right; } else if (donf25) { - unsigned int colors[4]; + uint32_t colors[4]; if (hiColor) { colors[0] = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; colors[0] = ((colors[0]) << 16) | colors[0]; @@ -1399,38 +1399,38 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int rep_count = 0; rep_count < max_repcount; ++rep_count) { int idx = rep_count + (hiColor ? 8 : 4); const unsigned char *color_idx = lookupTable + (esi[idx] * 4); - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 0) = w4; - *(unsigned int *)(edi + nf_width) = w4; - *(unsigned int *)(edi + 4) = w3; - *(unsigned int *)(edi + nf_width + 4) = w3; - *(unsigned int *)(edi + 8) = w2; - *(unsigned int *)(edi + nf_width + 8) = w2; - *(unsigned int *)(edi + 12) = w1; - *(unsigned int *)(edi + nf_width + 12) = w1; + *(uint32_t *)(edi + 0) = w4; + *(uint32_t *)(edi + nf_width) = w4; + *(uint32_t *)(edi + 4) = w3; + *(uint32_t *)(edi + nf_width + 4) = w3; + *(uint32_t *)(edi + 8) = w2; + *(uint32_t *)(edi + nf_width + 8) = w2; + *(uint32_t *)(edi + 12) = w1; + *(uint32_t *)(edi + nf_width + 12) = w1; #else - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + nf_width) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + nf_width + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + nf_width + 8) = w3; - *(unsigned int *)(edi + 12) = w4; - *(unsigned int *)(edi + nf_width + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + nf_width) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + nf_width + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + nf_width + 8) = w3; + *(uint32_t *)(edi + 12) = w4; + *(uint32_t *)(edi + nf_width + 12) = w4; #endif } else { - unsigned int c0 = IntelSwapper((unsigned int)(w2 << 24) | (w2 << 16) | (w1 << 8) | w1); - unsigned int c1 = IntelSwapper((unsigned int)(w4 << 24) | (w4 << 16) | (w3 << 8) | w3); - *(unsigned int *)(edi + 0) = c0; - *(unsigned int *)(edi + nf_width) = c0; - *(unsigned int *)(edi + 4) = c1; - *(unsigned int *)(edi + nf_width + 4) = c1; + uint32_t c0 = IntelSwapper((uint32_t)(w2 << 24) | (w2 << 16) | (w1 << 8) | w1); + uint32_t c1 = IntelSwapper((uint32_t)(w4 << 24) | (w4 << 16) | (w3 << 8) | w3); + *(uint32_t *)(edi + 0) = c0; + *(uint32_t *)(edi + nf_width) = c0; + *(uint32_t *)(edi + 4) = c1; + *(uint32_t *)(edi + nf_width + 4) = c1; } edi += nf_width * 2; @@ -1460,36 +1460,36 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned int idx = rep_count + ((hiColor) ? 8 : 4); const unsigned char *color_idx = lookupTable + (esi[idx] * 4); - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; if (rep_count & 1) { if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 8) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); #else - *(unsigned int *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); #endif } else { - *(unsigned int *)(edi + 4) = IntelSwapper((unsigned int)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); + *(uint32_t *)(edi + 4) = IntelSwapper((uint32_t)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); } edi += nf_width; } else { if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 0) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16); #else - *(unsigned int *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); #endif } else { - *(unsigned int *)(edi + 0) = IntelSwapper((unsigned int)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); + *(uint32_t *)(edi + 0) = IntelSwapper((uint32_t)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); } } } @@ -1564,22 +1564,22 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int rep_count = 0; rep_count < 16; ++rep_count) { int idx = repLookup[rep_count]; const unsigned char *color_idx = lookupTable + (esi[idx] * 4); - unsigned int w1 = colors[color_idx[0]]; - unsigned int w2 = colors[color_idx[1]]; - unsigned int w3 = colors[color_idx[2]]; - unsigned int w4 = colors[color_idx[3]]; + uint32_t w1 = colors[color_idx[0]]; + uint32_t w2 = colors[color_idx[1]]; + uint32_t w3 = colors[color_idx[2]]; + uint32_t w4 = colors[color_idx[3]]; if (!do42) { if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 0) = ((unsigned int)(w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16)); - *(unsigned int *)(edi + 4) = ((unsigned int)(w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 0) = ((uint32_t)(w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 4) = ((uint32_t)(w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16)); #else - *(unsigned int *)(edi + 0) = ((unsigned int)(w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16)); - *(unsigned int *)(edi + 4) = ((unsigned int)(w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 0) = ((uint32_t)(w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 4) = ((uint32_t)(w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16)); #endif } else { - *(unsigned int *)(edi + 0) = IntelSwapper((unsigned int)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); + *(uint32_t *)(edi + 0) = IntelSwapper((uint32_t)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); } edi += nf_width; } else { @@ -1587,28 +1587,28 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned if (rep_count & 1) { if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 8) = ((unsigned int)(w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16)); - *(unsigned int *)(edi + 12) = ((unsigned int)(w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 8) = ((uint32_t)(w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 12) = ((uint32_t)(w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16)); #else - *(unsigned int *)(edi + 8) = ((unsigned int)(w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16)); - *(unsigned int *)(edi + 12) = ((unsigned int)(w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 8) = ((uint32_t)(w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 12) = ((uint32_t)(w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16)); #endif } else { - *(unsigned int *)(edi + 4) = IntelSwapper((unsigned int)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); + *(uint32_t *)(edi + 4) = IntelSwapper((uint32_t)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); } edi += nf_width; } else { if (hiColor) { #ifdef OUTRAGE_BIG_ENDIAN - *(unsigned int *)(edi + 0) = ((unsigned int)(w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16)); - *(unsigned int *)(edi + 4) = ((unsigned int)(w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 0) = ((uint32_t)(w4 & 0xFFFF) | ((w3 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 4) = ((uint32_t)(w2 & 0xFFFF) | ((w1 & 0xFFFF) << 16)); #else - *(unsigned int *)(edi + 0) = ((unsigned int)(w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16)); - *(unsigned int *)(edi + 4) = ((unsigned int)(w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 0) = ((uint32_t)(w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16)); + *(uint32_t *)(edi + 4) = ((uint32_t)(w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16)); #endif } else { - *(unsigned int *)(edi + 0) = IntelSwapper((unsigned int)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); + *(uint32_t *)(edi + 0) = IntelSwapper((uint32_t)(w4 << 24) | (w3 << 16) | (w2 << 8) | w1); } } } @@ -1725,9 +1725,9 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned esi += 128; } else { // 8x8x8 (64 bytes) - unsigned int *ediW = (unsigned int *)edi; - unsigned int *esiW = (unsigned int *)esi; - const unsigned int width = nf_width >> 2; + uint32_t *ediW = (uint32_t *)edi; + uint32_t *esiW = (uint32_t *)esi; + const uint32_t width = nf_width >> 2; ediW[0] = (esiW[0]); ediW[1] = (esiW[1]); ediW += width; @@ -1760,52 +1760,52 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int i = 0; i < 4; ++i) { if (hiColor) { // low 4x4x16 (32 bytes) - unsigned int eax, ebx; + uint32_t eax, ebx; eax = *(unsigned char *)(esi + i * 8 + 0); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 1); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 0) = eax; - *(unsigned int *)(edi + nf_width) = eax; + *(uint32_t *)(edi + 0) = eax; + *(uint32_t *)(edi + nf_width) = eax; eax = *(unsigned char *)(esi + i * 8 + 2); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 3); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 4) = eax; - *(unsigned int *)(edi + nf_width + 4) = eax; + *(uint32_t *)(edi + 4) = eax; + *(uint32_t *)(edi + nf_width + 4) = eax; eax = *(unsigned char *)(esi + i * 8 + 4); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 5); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 8) = eax; - *(unsigned int *)(edi + nf_width + 8) = eax; + *(uint32_t *)(edi + 8) = eax; + *(uint32_t *)(edi + nf_width + 8) = eax; eax = *(unsigned char *)(esi + i * 8 + 6); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 7); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 12) = eax; - *(unsigned int *)(edi + nf_width + 12) = eax; + *(uint32_t *)(edi + 12) = eax; + *(uint32_t *)(edi + nf_width + 12) = eax; } else { // low 4x4x8 (16 bytes) - unsigned int eax, ebx; + uint32_t eax, ebx; - eax = IntelSwapper(((unsigned int *)esi)[i]); + eax = IntelSwapper(((uint32_t *)esi)[i]); ebx = ((eax & 0xFF00) << 16) | ((eax & 0xFF00) << 8) | ((eax & 0xFF) << 8) | (eax & 0xFF); - ((unsigned int *)edi)[0] = ebx; - ((unsigned int *)(edi + nf_width))[0] = ebx; + ((uint32_t *)edi)[0] = ebx; + ((uint32_t *)(edi + nf_width))[0] = ebx; eax = eax >> 16; ebx = ((eax & 0xFF00) << 16) | ((eax & 0xFF00) << 8) | ((eax & 0xFF) << 8) | (eax & 0xFF); - ((unsigned int *)edi)[1] = ebx; - ((unsigned int *)(edi + nf_width))[1] = ebx; + ((uint32_t *)edi)[1] = ebx; + ((uint32_t *)(edi + nf_width))[1] = ebx; } edi += nf_width * 2; @@ -1822,53 +1822,53 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned for (int i = 0; i < 2; ++i) { const unsigned char *loopEsi = esi + (i * 4); - unsigned int temp = nf_trans16_lo[loopEsi[0]] | nf_trans16_hi[loopEsi[1]]; - unsigned int ebx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); + uint32_t temp = nf_trans16_lo[loopEsi[0]] | nf_trans16_hi[loopEsi[1]]; + uint32_t ebx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); temp = nf_trans16_lo[loopEsi[2]] | nf_trans16_hi[loopEsi[3]]; - unsigned int ecx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); + uint32_t ecx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ecx; - *(unsigned int *)(edi + 12) = ecx; - *(unsigned int *)(edi + nf_width) = ebx; - *(unsigned int *)(edi + nf_width + 4) = ebx; - *(unsigned int *)(edi + nf_width + 8) = ecx; - *(unsigned int *)(edi + nf_width + 12) = ecx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ecx; + *(uint32_t *)(edi + 12) = ecx; + *(uint32_t *)(edi + nf_width) = ebx; + *(uint32_t *)(edi + nf_width + 4) = ebx; + *(uint32_t *)(edi + nf_width + 8) = ecx; + *(uint32_t *)(edi + nf_width + 12) = ecx; edi += nf_width * 2; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ecx; - *(unsigned int *)(edi + 12) = ecx; - *(unsigned int *)(edi + nf_width) = ebx; - *(unsigned int *)(edi + nf_width + 4) = ebx; - *(unsigned int *)(edi + nf_width + 8) = ecx; - *(unsigned int *)(edi + nf_width + 12) = ecx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ecx; + *(uint32_t *)(edi + 12) = ecx; + *(uint32_t *)(edi + nf_width) = ebx; + *(uint32_t *)(edi + nf_width + 4) = ebx; + *(uint32_t *)(edi + nf_width + 8) = ecx; + *(uint32_t *)(edi + nf_width + 12) = ecx; edi += nf_width * 2; } } else { // 2x2 4x4x0 (4 bytes) for (int i = 0; i < 2; ++i) { - unsigned int c1 = esi[(i << 1) + 0]; - unsigned int eax = (c1 << 24) | (c1 << 16) | (c1 << 8) | c1; + uint32_t c1 = esi[(i << 1) + 0]; + uint32_t eax = (c1 << 24) | (c1 << 16) | (c1 << 8) | c1; - unsigned int c2 = esi[(i << 1) + 1]; - unsigned int ebx = (c2 << 24) | (c2 << 16) | (c2 << 8) | c2; + uint32_t c2 = esi[(i << 1) + 1]; + uint32_t ebx = (c2 << 24) | (c2 << 16) | (c2 << 8) | c2; - *(unsigned int *)(edi + 0) = eax; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 0 + nf_width) = eax; - *(unsigned int *)(edi + 4 + nf_width) = ebx; + *(uint32_t *)(edi + 0) = eax; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 0 + nf_width) = eax; + *(uint32_t *)(edi + 4 + nf_width) = ebx; edi += nf_width * 2; - *(unsigned int *)(edi + 0) = eax; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 0 + nf_width) = eax; - *(unsigned int *)(edi + 4 + nf_width) = ebx; + *(uint32_t *)(edi + 0) = eax; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 0 + nf_width) = eax; + *(uint32_t *)(edi + 4 + nf_width) = ebx; edi += nf_width * 2; } } @@ -1881,15 +1881,15 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned case 14: { if (hiColor) { // 8x8x0 (2 bytes) - unsigned int ecx = nf_trans16_lo[esi[0]] | nf_trans16_hi[esi[1]]; - unsigned int ebx = ((ecx & 0xFFFF) << 16) | (ecx & 0xFFFF); + uint32_t ecx = nf_trans16_lo[esi[0]] | nf_trans16_hi[esi[1]]; + uint32_t ebx = ((ecx & 0xFFFF) << 16) | (ecx & 0xFFFF); esi += 2; for (int i = 0; i < 8; ++i) { - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; } @@ -1897,12 +1897,12 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned edi -= nfpk_back_right; } else { // 8x8x0 (1 byte) - unsigned int c = *esi++; // Copy color into 8 positions - unsigned int col = (c << 24) | (c << 16) | (c << 8) | c; + uint32_t c = *esi++; // Copy color into 8 positions + uint32_t col = (c << 24) | (c << 16) | (c << 8) | c; for (int i = 0; i < 8; ++i) { - *(unsigned int *)(edi + 0) = col; - *(unsigned int *)(edi + 4) = col; + *(uint32_t *)(edi + 0) = col; + *(uint32_t *)(edi + 4) = col; edi += nf_width; } edi -= nf_width; @@ -1912,18 +1912,18 @@ void PkDecompWorker(const bool hiColor, const unsigned char *ops, const unsigned case 15: { if (!hiColor) { // mix 8x8x0 (2 bytes) - unsigned int ebx = IntelSwapper(*(unsigned short *)(esi)); // Copy 2 colors into 8 positions + uint32_t ebx = IntelSwapper(*(unsigned short *)(esi)); // Copy 2 colors into 8 positions esi += 2; // in a checkerboard - unsigned int eax = (ebx << 16) | ebx; + uint32_t eax = (ebx << 16) | ebx; ebx = (eax << 8) | ((eax >> 24) & 0xFF); for (int i = 0; i < 4; ++i) { - *(unsigned int *)(edi + 0) = eax; - *(unsigned int *)(edi + 4) = eax; + *(uint32_t *)(edi + 0) = eax; + *(uint32_t *)(edi + 4) = eax; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; edi += nf_width; } edi -= nf_width; @@ -1951,8 +1951,8 @@ void Trans16Blk(unsigned char *edi, const unsigned char *idx) { *((unsigned short *)(edi + 14)) = nf_trans16_lo[*(idx + 14)] | nf_trans16_hi[*(idx + 15)]; } -void DOnf_xycshift(const bool hiColor, const unsigned int eax, unsigned char *&edi, const int nfpk_back_right) { - unsigned int ebx = (eax >> 8) & 0xFF; +void DOnf_xycshift(const bool hiColor, const uint32_t eax, unsigned char *&edi, const int nfpk_back_right) { + uint32_t ebx = (eax >> 8) & 0xFF; // get the lower byte of the offset, but sign extend it int offset = eax & 0xFF; @@ -1971,9 +1971,9 @@ void DOnf_xycshift(const bool hiColor, const unsigned int eax, unsigned char *&e DOnf_shift(hiColor, offset, edi, nfpk_back_right); } -void DOnf_xypshift(const bool hiColor, const unsigned int eax, unsigned char *&edi, const int nfpk_back_right, +void DOnf_xypshift(const bool hiColor, const uint32_t eax, unsigned char *&edi, const int nfpk_back_right, const int DiffBufPtrs) { - unsigned int ebx = (eax >> 8) & 0xFF; + uint32_t ebx = (eax >> 8) & 0xFF; // get the lower byte of the offset, but sign extend it int offset = eax & 0xFF; @@ -1995,7 +1995,7 @@ void DOnf_xypshift(const bool hiColor, const unsigned int eax, unsigned char *&e // Copy the 128/64 bytes from an offset of edi to edi is. void DOnf_shift(const bool hiColor, const int offset, unsigned char *&edi, const int nfpk_back_right) { union ptr { - unsigned int *pAsInt; + uint32_t *pAsInt; unsigned char *pAsChar; }; ptr dstBuffer; @@ -2056,9 +2056,9 @@ void MVE_gfxWaitRetrace(int state); void MVE_gfxSetSplit(unsigned line); -void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x, unsigned int _y, unsigned int _w, - unsigned int _h) { - unsigned int HI_COLOR_SCALE = (HI_COLOR_FLAG) ? 2 : 1; +void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, uint32_t _x, uint32_t _y, uint32_t _w, + uint32_t _h) { + uint32_t HI_COLOR_SCALE = (HI_COLOR_FLAG) ? 2 : 1; tNextFrame nf; nf.w = _w; @@ -2067,7 +2067,7 @@ void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x nf.y = _y; NF_DECOMP_INIT(HI_COLOR_FLAG ? 1 : 0, &nf); - unsigned int parms_sz = (nf.w * nf.h * nf_fqty) << 1; + uint32_t parms_sz = (nf.w * nf.h * nf_fqty) << 1; const unsigned char *compData = comp + parms_sz; // New Data @@ -2078,8 +2078,8 @@ void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x const unsigned short *compAsWord = (const unsigned short *)comp; for (unsigned char fqIt = nf_fqty; fqIt != 0; --fqIt, curr_tbuf += nf_width) { unsigned char *this_tbuf = curr_tbuf; - for (unsigned int ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { - for (unsigned int cl = nf.w; cl != 0; --cl) { + for (uint32_t ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { + for (uint32_t cl = nf.w; cl != 0; --cl) { int flags = (int)IntelSwapper(*compAsWord++); if (flags != 0) { this_tbuf += SWIDTH * HI_COLOR_SCALE; @@ -2090,9 +2090,9 @@ void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x // Enter with esi(compData) pointing to source data, edi(this_tbuf) to screen section. // Assumes SWIDTH=8 (16-bit data) and SHEIGHT=8 for (int currH = 0; currH < 8; ++currH) { - size_t amt = sizeof(unsigned int) * 2 * HI_COLOR_SCALE; + size_t amt = sizeof(uint32_t) * 2 * HI_COLOR_SCALE; // memcpy( this_tbuf, compData, amt ); - for (unsigned int ii = 0; ii < (amt / 2); ii++) { + for (uint32_t ii = 0; ii < (amt / 2); ii++) { unsigned short *destword = (unsigned short *)this_tbuf[ii]; unsigned short *srcword = (unsigned short *)compData[ii]; *destword = IntelSwapper(*srcword); @@ -2118,8 +2118,8 @@ void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x curr_tbuf = nf.tbuf; for (unsigned char fqIt = nf_fqty; fqIt != 0; --fqIt, curr_tbuf += nf_width) { unsigned char *this_tbuf = curr_tbuf; - for (unsigned int ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { - for (unsigned int cl = nf.w; cl != 0; --cl) { + for (uint32_t ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { + for (uint32_t cl = nf.w; cl != 0; --cl) { int flags = (int)IntelSwapper(*compAsWord++); if (flags == 0) { this_tbuf += SWIDTH * HI_COLOR_SCALE; @@ -2137,9 +2137,9 @@ void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x } for (int i = 0; i < 8; ++i) { - size_t amt = sizeof(unsigned int) * 2 * HI_COLOR_SCALE; + size_t amt = sizeof(uint32_t) * 2 * HI_COLOR_SCALE; // memcpy( this_tbuf, src, amt ); - for (unsigned int ii = 0; ii < (amt / 2); ii++) { + for (uint32_t ii = 0; ii < (amt / 2); ii++) { unsigned short *destword = (unsigned short *)this_tbuf[ii]; unsigned short *srcword = (unsigned short *)src[ii]; *destword = IntelSwapper(*srcword); @@ -2156,8 +2156,8 @@ void DECOMP_BODY(bool HI_COLOR_FLAG, const unsigned char *&comp, unsigned int _x } void DECOMP_CHG_BODY(bool HI_COLOR_FLAG, const unsigned short *&chgs, const unsigned short *&parms, - const unsigned char *&comp, unsigned int _x, unsigned int _y, unsigned int _w, unsigned int _h) { - unsigned int HI_COLOR_SCALE = (HI_COLOR_FLAG) ? 2 : 1; + const unsigned char *&comp, uint32_t _x, uint32_t _y, uint32_t _w, uint32_t _h) { + uint32_t HI_COLOR_SCALE = (HI_COLOR_FLAG) ? 2 : 1; tNextFrame nf; nf.w = _w; @@ -2168,14 +2168,14 @@ void DECOMP_CHG_BODY(bool HI_COLOR_FLAG, const unsigned short *&chgs, const unsi // Iterate over params and copy new hires data to appropriate sections. const unsigned short *pChgs = chgs; - unsigned int eax = 0; + uint32_t eax = 0; const unsigned char *compData = comp; unsigned char *curr_tbuf = nf.tbuf; const unsigned short *curr_parms = parms; for (unsigned char fqIt = nf_fqty; fqIt != 0; --fqIt, curr_tbuf += nf_width) { unsigned char *this_tbuf = curr_tbuf; - for (unsigned int ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { - for (unsigned int cl = nf.w; cl != 0; --cl) { + for (uint32_t ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { + for (uint32_t cl = nf.w; cl != 0; --cl) { eax *= 2; while (eax == 0) { eax = IntelSwapper(*pChgs++); @@ -2197,10 +2197,10 @@ void DECOMP_CHG_BODY(bool HI_COLOR_FLAG, const unsigned short *&chgs, const unsi // Enter with ds:si pointing to source data, es:di to screen section. // Assumes SWIDTH=8 (16-bit data) and SHEIGHT=8 for (int i = 0; i < 8; ++i) { - size_t amt = sizeof(unsigned int) * 2 * HI_COLOR_SCALE; + size_t amt = sizeof(uint32_t) * 2 * HI_COLOR_SCALE; // TODO: Do these bytes need swapping? Is this data shorts? // memcpy( this_tbuf, compData, amt ); - for (unsigned int ii = 0; ii < (amt / 2); ii++) { + for (uint32_t ii = 0; ii < (amt / 2); ii++) { unsigned short *dest = (unsigned short *)this_tbuf[ii]; unsigned short *src = (unsigned short *)compData[ii]; *dest = IntelSwapper(*src); @@ -2226,8 +2226,8 @@ void DECOMP_CHG_BODY(bool HI_COLOR_FLAG, const unsigned short *&chgs, const unsi for (unsigned char fqIt = nf_fqty; fqIt != 0; --fqIt, curr_tbuf += nf_width) { unsigned char *this_tbuf = curr_tbuf; - for (unsigned int ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { - for (unsigned int cl = nf.w; cl != 0; --cl) { + for (uint32_t ch = nf.h; ch != 0; --ch, this_tbuf += nf.new_row) { + for (uint32_t cl = nf.w; cl != 0; --cl) { eax *= 2; while (eax == 0) { eax = IntelSwapper(*pChgs++); @@ -2255,9 +2255,9 @@ void DECOMP_CHG_BODY(bool HI_COLOR_FLAG, const unsigned short *&chgs, const unsi } for (int i = 0; i < 8; ++i) { - size_t amt = sizeof(unsigned int) * 2 * HI_COLOR_SCALE; + size_t amt = sizeof(uint32_t) * 2 * HI_COLOR_SCALE; // memcpy( this_tbuf, src, amt ); - for (unsigned int ii = 0; ii < (amt / 2); ii++) { + for (uint32_t ii = 0; ii < (amt / 2); ii++) { unsigned short *destword = (unsigned short *)this_tbuf[ii]; unsigned short *srcword = (unsigned short *)src[ii]; *destword = IntelSwapper(*srcword); @@ -2273,7 +2273,7 @@ void DECOMP_CHG_BODY(bool HI_COLOR_FLAG, const unsigned short *&chgs, const unsi } // Decompress into subsection of current buffer specified by x,y,w,h in units of SWIDTHxSHEIGHT (8x8). -void nfHiColorDecomp(const unsigned char *comp, unsigned int x, unsigned int y, unsigned int w, unsigned int h) { +void nfHiColorDecomp(const unsigned char *comp, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { DECOMP_BODY(true, comp, x, y, w, h); } diff --git a/libmve/mvelibi.h b/libmve/mvelibi.h index bc8de448..9eaef1ac 100644 --- a/libmve/mvelibi.h +++ b/libmve/mvelibi.h @@ -56,7 +56,7 @@ inline unsigned short IntelSwapper(unsigned short a) { return INTEL_SHORT(a); } inline short IntelSwapper(short a) { return INTEL_SHORT(a); } -inline unsigned int IntelSwapper(unsigned int a) { return INTEL_INT(a); } +inline uint32_t IntelSwapper(uint32_t a) { return INTEL_INT(a); } inline int IntelSwapper(int a) { return INTEL_INT(a); } diff --git a/libmve/mvelibl.cpp b/libmve/mvelibl.cpp index f35f2d69..83dbd6fd 100644 --- a/libmve/mvelibl.cpp +++ b/libmve/mvelibl.cpp @@ -128,20 +128,20 @@ static int sync_wait_quanta = 0; static bool sync_late = false; static bool sync_FrameDropped = false; -static void syncReset(unsigned int wait_quanta); +static void syncReset(uint32_t wait_quanta); static void syncRelease(void); -static bool syncInit(unsigned int period, unsigned wait_quanta); +static bool syncInit(uint32_t period, unsigned wait_quanta); static bool syncWait(void); static void syncSync(void); -static void syncReset(unsigned int wait_quanta) { +static void syncReset(uint32_t wait_quanta) { sync_time = wait_quanta - platform_timeGetTime() * 1000; sync_active = true; } static void syncRelease(void) { sync_active = false; } -static bool syncInit(unsigned int period, unsigned wait_quanta) { +static bool syncInit(uint32_t period, unsigned wait_quanta) { int new_wait_quanta = -(int32_t)(period * wait_quanta + (wait_quanta >> 1)); // If timer is still running and has same timing @@ -279,7 +279,7 @@ static void ioRelease(void) { MemFree(&io_mem_buf); } static ISoundDevice *snd_ds = NULL; static ISysSoundBuffer *snd_buffer = NULL; static SysSoundCaps snd_buffer_caps; -static unsigned int snd_write_cursor = 0; +static uint32_t snd_write_cursor = 0; enum { snd_queue_max = 60 }; @@ -385,9 +385,9 @@ static void sndSync(void) { if (!snd_ds || !snd_buffer) return; - unsigned int dsbstatus; - unsigned int target; - unsigned int play_cursor, write_cursor; + uint32_t dsbstatus; + uint32_t target; + uint32_t play_cursor, write_cursor; #define set_target(t) \ (target = (snd_queue[snd_empty].ptr + (t) + snd_buffer_caps.dwBufferBytes) % snd_buffer_caps.dwBufferBytes) #define target_pending() \ @@ -489,8 +489,8 @@ static unsigned sndAddHelper(unsigned char *dst, const unsigned char **pSrc, uns src += len >> 1; } else { if (init) { - state = IntelSwapper(*(unsigned int *)src); - *(unsigned int *)dst = state; + state = IntelSwapper(*(uint32_t *)src); + *(uint32_t *)dst = state; src += 4; dst += 4; len -= 4; @@ -514,8 +514,8 @@ static unsigned sndAddHelper(unsigned char *dst, const unsigned char **pSrc, uns static void sndAdd(const unsigned char *buf, unsigned len) { #if SOUND_SUPPORT int dsrval; - unsigned int play_cursor, write_cursor; - unsigned int len1, len2; + uint32_t play_cursor, write_cursor; + uint32_t len1, len2; unsigned state = 0; bool init = true; @@ -677,9 +677,9 @@ static bool nfConfig(int wqty, int hqty, int fqty, int hicolor) { { if (hicolor) { - const unsigned int pal_rmask = 0x001F; - const unsigned int pal_bmask = 0xF800; - const unsigned int pal_gmask = 0x07E0; + const uint32_t pal_rmask = 0x001F; + const uint32_t pal_bmask = 0xF800; + const uint32_t pal_gmask = 0x07E0; const int pal_rshift = ffs(pal_rmask) - 4; const int pal_gshift = ffs(pal_gmask) - 4; @@ -830,7 +830,7 @@ static unsigned sf_hicolor = 0; // Hicolor mode (0:none,1:normal,2:swapped) // Banked screen parameters, Private, see mveliba.asm void *sf_SetBank = NULL; unsigned sf_WinGran = 0; -unsigned int sf_WinSize = 0; +uint32_t sf_WinSize = 0; unsigned sf_WinGranPerSize = 0; //{sf_WriteWinPtr and sf_WriteWinLimit replace sf_WriteWinSeg, see mveliba.asm} unsigned char *sf_WriteWinPtr = NULL; @@ -863,7 +863,7 @@ void mve_ShowFrameFieldHi(unsigned char *buf, unsigned bufw, unsigned bufh, unsi // 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 int WinSize, unsigned WinGran, void *SetBank, unsigned hicolor) { + uint32_t WinSize, unsigned WinGran, void *SetBank, unsigned hicolor) { sf_ScreenWidth = w; sf_ScreenHeight = h; sf_ResolutionWidth = w; @@ -1618,8 +1618,8 @@ MVE_frStream MVE_frOpen(unsigned (*fn_read)(int handle, void *buf, unsigned coun return frs; } -int MVE_frGet(MVE_frStream frs, unsigned char **pBuf, unsigned int *width, unsigned int *height, - unsigned int *hicolor) { +int MVE_frGet(MVE_frStream frs, unsigned char **pBuf, uint32_t *width, uint32_t *height, + uint32_t *hicolor) { MVE_frStreamRec save; unsigned char *p; unsigned len; diff --git a/libmve/mvelibl.h b/libmve/mvelibl.h index aa999222..4af79f38 100644 --- a/libmve/mvelibl.h +++ b/libmve/mvelibl.h @@ -82,7 +82,7 @@ void MVE_dsbSetPan(int32_t lPan); // is just used for window centering and for determining // how and when to do palette callbacks. void MVE_sfSVGA(unsigned w, unsigned h, unsigned LineWidth, unsigned WriteWin, unsigned char *WriteWinPtr, - unsigned int WinSize, unsigned WinGran, void *SetBank, unsigned hicolor); + uint32_t WinSize, unsigned WinGran, void *SetBank, unsigned hicolor); // This function alters the display from 640x480 or 640x400 to 640x350 resolution. void MVE_ForceVres350(void); @@ -99,9 +99,9 @@ void MVE_ForceVresHalf(void); // or modify which portions of the screen are updated. // This function replaces calls to the default MVE_ShowFrame function // with calls to your function, which can itself call MVE_ShowFrame. -typedef void (*mve_cb_ShowFrame)(unsigned char *buf, unsigned int bufw, unsigned int bufh, unsigned int sx, - unsigned int sy, unsigned int w, unsigned int h, unsigned int dstx, unsigned int dsty, - unsigned int hicolor); +typedef void (*mve_cb_ShowFrame)(unsigned char *buf, uint32_t bufw, uint32_t bufh, uint32_t sx, + uint32_t sy, uint32_t w, uint32_t h, uint32_t dstx, uint32_t dsty, + uint32_t hicolor); void MVE_sfCallbacks(mve_cb_ShowFrame fn_ShowFrame); typedef void mve_cb_SetPalette(unsigned char *p, unsigned start, unsigned count); @@ -222,7 +222,7 @@ MVE_frStream MVE_frOpen(unsigned (*fn_read)(int handle, void *buf, unsigned coun // If successful, MVE_frGet(frs, &buf, &w, &h) returns a pointer // to a surface containing the frame in pBuf, // and its width and height in w and h. -int MVE_frGet(MVE_frStream frs, unsigned char **pBuf, unsigned int *width, unsigned int *height, unsigned int *hicolor); +int MVE_frGet(MVE_frStream frs, unsigned char **pBuf, uint32_t *width, uint32_t *height, uint32_t *hicolor); // MVE_frPal // After each successful call to MVE_frGet(), this call may be used to diff --git a/libmve/platform.cpp b/libmve/platform.cpp index d2b04ffc..aa0a8840 100644 --- a/libmve/platform.cpp +++ b/libmve/platform.cpp @@ -20,13 +20,13 @@ #include #include -unsigned int platform_timeGetTime(void) { return timeGetTime(); } +uint32_t platform_timeGetTime(void) { return timeGetTime(); } #else #include #include -unsigned int platform_timeGetTime(void) { +uint32_t platform_timeGetTime(void) { struct timeval t; gettimeofday(&t, NULL); diff --git a/libmve/platform.h b/libmve/platform.h index be48390a..1a3fd66a 100644 --- a/libmve/platform.h +++ b/libmve/platform.h @@ -19,6 +19,6 @@ #ifndef MVEPLATFORM_H_ #define MVEPLATFORM_H_ -unsigned int platform_timeGetTime(void); +uint32_t platform_timeGetTime(void); #endif diff --git a/linux/lnxapp.cpp b/linux/lnxapp.cpp index b2ee52db..7c3f25ea 100644 --- a/linux/lnxapp.cpp +++ b/linux/lnxapp.cpp @@ -118,7 +118,7 @@ char *strupr(char *string) { return string; } -static unsigned int LinuxAppFlags = 0; +static uint32_t LinuxAppFlags = 0; // static Display *LinuxAppDisplay=NULL; static bool LinuxAppSetAtExit = false; static bool LinuxAppDontCallShutdown = false; diff --git a/linux/lnxdata.cpp b/linux/lnxdata.cpp index 27866e05..443d88ae 100644 --- a/linux/lnxdata.cpp +++ b/linux/lnxdata.cpp @@ -166,7 +166,7 @@ bool oeLnxAppDatabase::read(const char *label, void *entry, int wordsize) { *((unsigned short *)entry) = (unsigned short)data; break; case 4: - *((unsigned int *)entry) = (unsigned int)data; + *((uint32_t *)entry) = (uint32_t)data; break; default: mprintf((0, "Unable to read key %s, unsupported size", label)); diff --git a/lnxmvelib/asmstub.c b/lnxmvelib/asmstub.c index 12a8be94..3ad12a36 100644 --- a/lnxmvelib/asmstub.c +++ b/lnxmvelib/asmstub.c @@ -23,22 +23,22 @@ /* For _asm_sndDecompM16 */ unsigned short *sndDecompM16_dst; unsigned char *sndDecompM16_src; -unsigned int sndDecompM16_len; -unsigned int sndDecompM16_prev; -unsigned int sndDecompM16_return; +uint32_t sndDecompM16_len; +uint32_t sndDecompM16_prev; +uint32_t sndDecompM16_return; /* For _asm_sndDecompM16 */ unsigned short *sndDecompS16_dst; unsigned char *sndDecompS16_src; -unsigned int sndDecompS16_len; -unsigned int sndDecompS16_prev; -unsigned int sndDecompS16_return; +uint32_t sndDecompS16_len; +uint32_t sndDecompS16_prev; +uint32_t sndDecompS16_return; /* For _asm_nfHPkDecomp */ unsigned char *nfHPkDecomp_ops; unsigned char *nfHPkDecomp_comp; -unsigned int nfHPkDecomp_x; -unsigned int nfHPkDecomp_y; -unsigned int nfHPkDecomp_w; -unsigned int nfHPkDecomp_h; +uint32_t nfHPkDecomp_x; +uint32_t nfHPkDecomp_y; +uint32_t nfHPkDecomp_w; +uint32_t nfHPkDecomp_h; #ifdef __cplusplus /* Avoid C++ name mangling - AH */ extern "C" { @@ -57,7 +57,7 @@ int global_unlock_memory_pointers[MAX_MEM_UNLOCK_POINTS]; // _asm_selfModify() s int allow_self_modification(void) { int i; - unsigned int page_start; + uint32_t page_start; for (i = 0; i < MAX_MEM_UNLOCK_POINTS; i++) global_unlock_memory_pointers[i] = 0; @@ -95,8 +95,8 @@ void nfPkConfig(void) { return; } -void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned int x, unsigned int y, unsigned int w, - unsigned int h) { +void nfHPkDecomp(unsigned char *ops, unsigned char *comp, uint32_t x, uint32_t y, uint32_t w, + uint32_t h) { nfHPkDecomp_ops = ops; nfHPkDecomp_comp = comp; nfHPkDecomp_x = x; diff --git a/lnxmvelib/lnxdraw.cpp b/lnxmvelib/lnxdraw.cpp index 55023e49..8ae7bdd5 100644 --- a/lnxmvelib/lnxdraw.cpp +++ b/lnxmvelib/lnxdraw.cpp @@ -28,7 +28,7 @@ // static Display *lpDisplay = NULL; static int nDefaultScreen = -1; -static unsigned int dwOriginalWidth, dwOriginalHeight; +static uint32_t dwOriginalWidth, dwOriginalHeight; static LnxWindow **WindowList; static int NumWindows = 0; // static int GetXSharedMemory(int size); @@ -104,7 +104,7 @@ int LnxDraw_CreateWindow(LnxWindowDesc *ldesc, LnxWindow **lphandle) { // return -2; // determine what we have to work with (currently) - // unsigned int display_width,display_height; + // uint32_t display_width,display_height; // display_width = DisplayWidth(lpDisplay,nDefaultScreen); // display_height = DisplayHeight(lpDisplay,nDefaultScreen); @@ -214,7 +214,7 @@ int LnxDraw_CreateWindow(LnxWindowDesc *ldesc, LnxWindow **lphandle) { wnd->lpXvisual = wnd->viVisualInfo.visual; wnd->cmColorMap = DefaultColormapOfScreen(DefaultScreenOfDisplay(lpDisplay)); - unsigned int attrib_mask; + uint32_t attrib_mask; XSetWindowAttributes attrib; // setup some attribute and hints for actual window creation @@ -522,7 +522,7 @@ void LnxDraw_UnlockSurface(LnxWindow *wnd, unsigned char *ptr) { SDL_UpdateRect(wnd->surface, 0, 0, wnd->dwWidth, wnd->dwHeight); #ifdef __DUMP_MVE_TO_DISK - static unsigned int framenum = 0; + static uint32_t framenum = 0; char filename[100]; snprintf(filename, sizeof(filename), "./mve/frame%lu.bmp", framenum); SDL_SaveBMP(wnd->surface, filename); @@ -540,7 +540,7 @@ void LnxDraw_UnlockSurface(LnxWindow *wnd, unsigned char *ptr) { // 0 : no error // -1 : invalid parameter // -2 : unknown error -int LnxDraw_Blit(LnxWindow *wnd, unsigned char *ptr, unsigned int x, unsigned int y, unsigned int w, unsigned int h) { +int LnxDraw_Blit(LnxWindow *wnd, unsigned char *ptr, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { return 0; /* if(!wnd || !ptr) @@ -608,7 +608,7 @@ int LnxDraw_Blit(LnxWindow *wnd, unsigned char *ptr, unsigned int x, unsigned in // Returns: // 0 : no error // -1 : invalid parameters -int LnxDraw_GetRGBMasks(LnxWindow *wnd, unsigned int *r, unsigned int *g, unsigned int *b) { +int LnxDraw_GetRGBMasks(LnxWindow *wnd, uint32_t *r, uint32_t *g, uint32_t *b) { return -1; if (!wnd || !r || !g || !b) return -1; @@ -715,18 +715,18 @@ inline void BltBuffer32ToPixMap16(unsigned char *pixmap, unsigned char *buffer, unsigned char *data; unsigned short int l; int r, g, b, a; - unsigned int c; + uint32_t c; data = (unsigned char *)pixmap; for (l = height * width; l > 0; l--) { - c = *(unsigned int *)buffer; + c = *(uint32_t *)buffer; a = ((c & 0xff000000) >> 24); r = ((c & 0x00ff0000) >> 16); g = ((c & 0x0000ff00) >> 8); b = (c & 0x000000ff); if (a) - *(unsigned int *)data = (((r >> 3) << 10) + ((g >> 3) << 5) + (b >> 3)); + *(uint32_t *)data = (((r >> 3) << 10) + ((g >> 3) << 5) + (b >> 3)); data += 2; buffer += 4; } @@ -742,18 +742,18 @@ inline void BltBuffer32ToPixMap24(unsigned char *pixmap, unsigned char *buffer, unsigned char *data; unsigned short int l; int r, g, b, a; - unsigned int c; + uint32_t c; data = (unsigned char *)pixmap; for (l = height * width; l > 0; l--) { - c = *(unsigned int *)buffer; + c = *(uint32_t *)buffer; a = ((c & 0xff000000) >> 24); r = ((c & 0x00ff0000) >> 16); g = ((c & 0x0000ff00) >> 8); b = (c & 0x000000ff); if (a) - *(unsigned int *)data = ((r << 16) + (g << 8) + b); + *(uint32_t *)data = ((r << 16) + (g << 8) + b); data += 4; buffer += 4; } @@ -774,7 +774,7 @@ inline void BltBuffer16ToPixMap24(unsigned char *pixmap, unsigned char *buffer, b = (c & 0x001F); if (a) - *(unsigned int *)data = ((r << 19) + (g << 11) + (b << 3)); + *(uint32_t *)data = ((r << 19) + (g << 11) + (b << 3)); data += 4; buffer += 2; } diff --git a/lnxmvelib/lnxdsound.cpp b/lnxmvelib/lnxdsound.cpp index 739e7077..da2c1624 100644 --- a/lnxmvelib/lnxdsound.cpp +++ b/lnxmvelib/lnxdsound.cpp @@ -48,9 +48,9 @@ static LnxSoundDevice LinuxSoundDevice; static bool StartupSoundSystem(LnxSoundDevice *dev); static void ShutdownSoundSystem(void); -static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len); -static unsigned int LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len); -static unsigned int LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len); +static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len); +static uint32_t LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len); +static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len); static void LinuxSoundMixBuffersIntoMain(int len); static void LinuxSoundThreadHandler(void *unused, Uint8 *stream, int len); @@ -260,9 +260,9 @@ int LnxSoundBuffer_SetVolume(LnxSoundBuffer *buff, signed int vol) { double vt; vt = (double)(buff->volume - (buff->pan > 0 ? buff->pan : 0)); - buff->left_vol = (unsigned int)(pow(2.0, vt / 600.0) * 32768.0); + buff->left_vol = (uint32_t)(pow(2.0, vt / 600.0) * 32768.0); vt = (double)(buff->volume + (buff->pan < 0 ? buff->pan : 0)); - buff->right_vol = (unsigned int)(pow(2.0, vt / 600.0) * 32768.0); + buff->right_vol = (uint32_t)(pow(2.0, vt / 600.0) * 32768.0); exit_critical(); @@ -295,9 +295,9 @@ int LnxSoundBuffer_SetPan(LnxSoundBuffer *buff, signed int pan) { double pt; pt = (double)(buff->volume - (buff->pan > 0 ? buff->pan : 0)); - buff->left_vol = (unsigned int)(pow(2.0, pt / 600.0) * 32768.0); + buff->left_vol = (uint32_t)(pow(2.0, pt / 600.0) * 32768.0); pt = (double)(buff->volume + (buff->pan < 0 ? buff->pan : 0)); - buff->right_vol = (unsigned int)(pow(2.0, pt / 600.0) * 32768.0); + buff->right_vol = (uint32_t)(pow(2.0, pt / 600.0) * 32768.0); exit_critical(); @@ -331,7 +331,7 @@ int LnxSoundBuffer_Stop(LnxSoundBuffer *buff) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Play(LnxSoundBuffer *buff, unsigned int flags) { +int LnxSoundBuffer_Play(LnxSoundBuffer *buff, uint32_t flags) { if (!buff) return -1; @@ -369,7 +369,7 @@ int LnxSoundBuffer_GetCaps(LnxSoundBuffer *buff, LinuxSoundCaps *caps) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status) { +int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, uint32_t *status) { if (!status || !buff) return -1; @@ -390,7 +390,7 @@ int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, unsigned int *wpos) { +int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, uint32_t *ppos, uint32_t *wpos) { if (!buff) return -1; @@ -410,7 +410,7 @@ int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos) { +int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, uint32_t pos) { if (!buff) return -1; @@ -429,8 +429,8 @@ int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos) { // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int numbytes, void **ptr1, - unsigned int *numbytes1, void **ptr2, unsigned int *numbytes2, unsigned int flags) { +int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, uint32_t pos, uint32_t numbytes, void **ptr1, + uint32_t *numbytes1, void **ptr2, uint32_t *numbytes2, uint32_t flags) { if (!buff) return -1; @@ -470,7 +470,7 @@ int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int num // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, unsigned int num1, void *ptr2, unsigned int num2) { +int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, uint32_t num1, void *ptr2, uint32_t num2) { if (!buff) return -1; @@ -505,7 +505,7 @@ static bool StartupSoundSystem(LnxSoundDevice *dev) { // Shutsdown the sound processing thread static void ShutdownSoundSystem(void) { SDL_CloseAudio(); } -static inline void GetValues(const LnxSoundBuffer *dsb, unsigned char *buf, unsigned int *fl, unsigned int *fr) { +static inline void GetValues(const LnxSoundBuffer *dsb, unsigned char *buf, uint32_t *fl, uint32_t *fr) { signed short *bufs = (signed short *)buf; // 8 bit stereo @@ -538,7 +538,7 @@ static inline void GetValues(const LnxSoundBuffer *dsb, unsigned char *buf, unsi return; } -static inline void SetValues(unsigned char *buf, unsigned int fl, unsigned int fr) { +static inline void SetValues(unsigned char *buf, uint32_t fl, uint32_t fr) { signed short *bufs = (signed short *)buf; // 8 bit stereo @@ -569,8 +569,8 @@ static inline void SetValues(unsigned char *buf, unsigned int fl, unsigned int f return; } -static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len) { - unsigned int i, inc = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); +static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len) { + uint32_t i, inc = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); unsigned char *bpc = buf; signed short *bps = (signed short *)buf; @@ -579,7 +579,7 @@ static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uns return; for (i = 0; i < len; i += inc) { - unsigned int val; + uint32_t val; switch (inc) { case 1: { val = *bpc - 128; @@ -597,11 +597,11 @@ static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, unsigned char *buf, uns } } -static unsigned int LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, unsigned int len) { - unsigned int i, size, ipos, ilen, fieldL, fieldR; +static uint32_t LinuxSoundMixNormalize(LnxSoundBuffer *dsb, unsigned char *buf, uint32_t len) { + uint32_t i, size, ipos, ilen, fieldL, fieldR; unsigned char *ibp, *obp; - unsigned int iAdvance = dsb->wfx.nBlockAlign; - unsigned int oAdvance = LnxBuffers[0]->wfx.nBlockAlign; + uint32_t iAdvance = dsb->wfx.nBlockAlign; + uint32_t oAdvance = LnxBuffers[0]->wfx.nBlockAlign; ibp = dsb->buffer + dsb->play_cursor; obp = buf; @@ -660,8 +660,8 @@ int DoMulDiv(int nNumber, int nNumerator, int nDenominator) { static void *TempSoundBuffer = NULL; static int TempSoundBufferLen = 0; -static unsigned int LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) { - unsigned int i, ilen, advance = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); +static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) { + uint32_t i, ilen, advance = (LnxBuffers[0]->wfx.wBitsPerSample >> 3); unsigned char *buf, *ibuf, *obuf; signed int temp, field; signed short *ibufs, *obufs; diff --git a/lnxmvelib/lnxdsound.h b/lnxmvelib/lnxdsound.h index c5612066..966017ab 100644 --- a/lnxmvelib/lnxdsound.h +++ b/lnxmvelib/lnxdsound.h @@ -43,17 +43,17 @@ typedef struct { int sound_device; // file device handle for sound - unsigned int bps; // (bytes per second) channels*freq*bit_depth/8 - unsigned int freq; // frequency (22050, etc.) - unsigned int bit_depth; // 8 or 16 - unsigned int channels; // 1 or 2 (mono or stereo) + uint32_t bps; // (bytes per second) channels*freq*bit_depth/8 + uint32_t freq; // frequency (22050, etc.) + uint32_t bit_depth; // 8 or 16 + uint32_t channels; // 1 or 2 (mono or stereo) } LnxSoundDevice; typedef struct { unsigned short wFormatTag; unsigned short nChannels; - unsigned int nSamplesPerSec; - unsigned int nAvgBytesPerSec; + uint32_t nSamplesPerSec; + uint32_t nAvgBytesPerSec; unsigned short nBlockAlign; unsigned short wBitsPerSample; unsigned short cbSize; @@ -61,24 +61,24 @@ typedef struct { #define WAVE_FORMAT_PCM 0x01 typedef struct { - unsigned int dwFlags; - unsigned int dwBufferBytes; + uint32_t dwFlags; + uint32_t dwBufferBytes; } LinuxSoundCaps; typedef struct { WAVEFORMATEX *lpwfxFormat; - unsigned int dwBufferBytes; - unsigned int dwFlags; + uint32_t dwBufferBytes; + uint32_t dwFlags; } LnxBufferDesc; typedef struct { int freq_adjustment; int bps; - unsigned int buffer_len; - unsigned int play_cursor; - unsigned int write_cursor; - unsigned int flags; - unsigned int left_vol, right_vol; + uint32_t buffer_len; + uint32_t play_cursor; + uint32_t write_cursor; + uint32_t flags; + uint32_t left_vol, right_vol; unsigned char *buffer; @@ -157,7 +157,7 @@ int LnxSoundBuffer_Stop(LnxSoundBuffer *buff); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Play(LnxSoundBuffer *buff, unsigned int flags); +int LnxSoundBuffer_Play(LnxSoundBuffer *buff, uint32_t flags); //////////////////////////// // LnxSoundBuffer_GetCaps @@ -178,7 +178,7 @@ int LnxSoundBuffer_GetCaps(LnxSoundBuffer *buff, LinuxSoundCaps *caps); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status); +int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, uint32_t *status); /////////////////////////////////////// // LnxSoundBuffer_GetCurrentPosition @@ -188,7 +188,7 @@ int LnxSoundBuffer_GetStatus(LnxSoundBuffer *buff, unsigned int *status); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, unsigned int *wpos); +int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, uint32_t *ppos, uint32_t *wpos); /////////////////////////////////////// // LnxSoundBuffer_SetCurrentPosition @@ -198,7 +198,7 @@ int LnxSoundBuffer_GetCurrentPosition(LnxSoundBuffer *buff, unsigned int *ppos, // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos); +int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, uint32_t pos); ///////////////////////// // LnxSoundBuffer_Lock @@ -209,8 +209,8 @@ int LnxSoundBuffer_SetCurrentPosition(LnxSoundBuffer *buff, unsigned int pos); // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int numbytes, void **ptr1, - unsigned int *numbytes1, void **ptr2, unsigned int *numbytes2, unsigned int flags); +int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, uint32_t pos, uint32_t numbytes, void **ptr1, + uint32_t *numbytes1, void **ptr2, uint32_t *numbytes2, uint32_t flags); /////////////////////////// // LnxSoundBuffer_Unlock @@ -220,6 +220,6 @@ int LnxSoundBuffer_Lock(LnxSoundBuffer *buff, unsigned int pos, unsigned int num // Returns: // 0 : no error // -1 : invalid parameters -int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, unsigned int num1, void *ptr2, unsigned int num2); +int LnxSoundBuffer_Unlock(LnxSoundBuffer *buff, void *ptr1, uint32_t num1, void *ptr2, uint32_t num2); #endif diff --git a/lnxmvelib/mveasm.cpp b/lnxmvelib/mveasm.cpp index 79b79f5f..b3777a6d 100644 --- a/lnxmvelib/mveasm.cpp +++ b/lnxmvelib/mveasm.cpp @@ -45,10 +45,10 @@ unsigned sndDecompM16(unsigned short *dst, const unsigned char *src, unsigned le unsigned sndDecompS16(unsigned short *dst, const unsigned char *src, unsigned len, unsigned prev); void Trans16Blk(unsigned char *edi, unsigned char *idx); -void call_hnfxycshift(unsigned int eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right); -void call_hnfxypshift(unsigned int eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right, +void call_hnfxycshift(uint32_t eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right); +void call_hnfxypshift(uint32_t eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right, int DiffBufPtrs); -void call_hnfshift(unsigned int meax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right); +void call_hnfshift(uint32_t meax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right); //-------------------------------------------------------------------- // Sound Management @@ -59,7 +59,7 @@ void call_hnfshift(unsigned int meax, unsigned char **medi, unsigned char **mesi // prev is the previous decompression state or zero. // Returns new decompression state. unsigned sndDecompM16(unsigned short *dst, const unsigned char *src, unsigned len, unsigned prev) { - unsigned int i, eax, ebx; + uint32_t i, eax, ebx; if (len == 0) return prev; eax = prev; @@ -85,7 +85,7 @@ unsigned sndDecompM16(unsigned short *dst, const unsigned char *src, unsigned le // Returns new decompression state. unsigned sndDecompS16(unsigned short *dst, const unsigned char *src, unsigned len, unsigned prev) { unsigned re = 0; - unsigned int eax, edx, ebx, i; + uint32_t eax, edx, ebx, i; if (len == 0) { return prev; @@ -375,7 +375,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y edi += SWIDTH * 2; } break; case 2: { - unsigned int eax; + uint32_t eax; eax = *bcomp; bcomp++; eax = nfpk_ShiftP2[eax]; @@ -401,7 +401,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } reg_byte; #endif union { - unsigned int eax; + uint32_t eax; reg_word word; reg_byte byte; } myeax; @@ -434,7 +434,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } reg_byte; #endif union { - unsigned int eax; + uint32_t eax; reg_word word; reg_byte byte; } myeax; @@ -449,13 +449,13 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } break; case 5: { unsigned short swapper = *(unsigned short *)(esi); - unsigned int eax = INTEL_SHORT(swapper); + uint32_t eax = INTEL_SHORT(swapper); esi += 2; call_hnfxypshift(eax, &edi, &esi, nfpk_back_right, nf.DiffBufPtrs); } break; case 6: { // Far shift from current buffer - unsigned int val1, val2; + uint32_t val1, val2; unsigned short swapper = *(unsigned short *)(esi); val1 = INTEL_SHORT(swapper); @@ -488,10 +488,10 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } if (!donf23) { - unsigned int colors[4]; + uint32_t colors[4]; max_repcount = 8; - unsigned int temp_color; + uint32_t temp_color; temp_color = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; temp_color = (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]) | (temp_color << 16); @@ -502,21 +502,21 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; idx = rep_count + 4; - color_idx = *(unsigned int *)(nfhpk_mov8 + ((*(esi + idx)) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov8 + ((*(esi + idx)) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; if (rep_count != (max_repcount - 1)) edi += nf_width; } @@ -524,18 +524,18 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y esi += 12; edi -= nfpk_back_right; } else { - unsigned int colors[2]; + uint32_t colors[2]; max_repcount = 4; - unsigned int temp; + uint32_t temp; temp = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; colors[0] = (temp << 16) | temp; temp = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; colors[1] = (temp << 16) | temp; for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; // 4l,4h,5l,5h (nibbles) @@ -554,20 +554,20 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y break; } - color_idx = *(unsigned int *)(nfhpk_mov4l + (idx * 4)); + color_idx = *(uint32_t *)(nfhpk_mov4l + (idx * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + nf_width) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + nf_width + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + nf_width + 8) = w3; - *(unsigned int *)(edi + 12) = w4; - *(unsigned int *)(edi + nf_width + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + nf_width) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + nf_width + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + nf_width + 8) = w3; + *(uint32_t *)(edi + 12) = w4; + *(uint32_t *)(edi + nf_width + 12) = w4; if (rep_count != (max_repcount - 1)) edi = edi + nf_width * 2; } @@ -595,10 +595,10 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } if (!donf24 && !donf40) { - unsigned int colors[4]; + uint32_t colors[4]; max_repcount = 8; - unsigned int tempcolor; + uint32_t tempcolor; tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]); colors[2] = tempcolor; @@ -608,8 +608,8 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; switch (rep_count) { @@ -639,17 +639,17 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y break; } - color_idx = *(unsigned int *)(nfhpk_mov8 + (*(esi + idx) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov8 + (*(esi + idx) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; edi += nf_width; - *(unsigned int *)(edi + 0) = w3; - *(unsigned int *)(edi + 4) = w4; + *(uint32_t *)(edi + 0) = w3; + *(uint32_t *)(edi + 4) = w4; if (rep_count != (max_repcount - 1)) edi += nf_width; @@ -691,10 +691,10 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } if (donf24) { - unsigned int colors[4]; + uint32_t colors[4]; max_repcount = 8; - unsigned int tempcolor; + uint32_t tempcolor; tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]); colors[2] = tempcolor; @@ -704,8 +704,8 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; switch (rep_count) { @@ -735,17 +735,17 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y break; } - color_idx = *(unsigned int *)(nfhpk_mov8 + (*(esi + idx) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov8 + (*(esi + idx) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; edi += nf_width; - *(unsigned int *)(edi + 0) = w3; - *(unsigned int *)(edi + 4) = w4; + *(uint32_t *)(edi + 0) = w3; + *(uint32_t *)(edi + 4) = w4; if (rep_count != (max_repcount - 1)) edi += nf_width; @@ -767,10 +767,10 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } if (donf40) { - unsigned int colors[4]; + uint32_t colors[4]; max_repcount = 8; - unsigned int tempcolor; + uint32_t tempcolor; tempcolor = nf_trans16_lo[*(esi + 2)] | nf_trans16_hi[*(esi + 3)]; tempcolor = (tempcolor << 16) | (nf_trans16_lo[*(esi + 0)] | nf_trans16_hi[*(esi + 1)]); colors[2] = tempcolor; @@ -780,8 +780,8 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = (colors[2] & 0xFFFF0000) | (colors[1] & 0xFFFF); for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; switch (rep_count) { @@ -811,16 +811,16 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y break; } - color_idx = *(unsigned int *)(nfhpk_mov8 + (*(esi + idx) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov8 + (*(esi + idx) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; if (rep_count != (max_repcount - 1)) edi += nf_width; @@ -875,32 +875,32 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = nf_trans16_lo[*(esi + 6)] | nf_trans16_hi[*(esi + 7)]; for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; idx = rep_count + 8; - color_idx = *(unsigned int *)(nfhpk_mov4 + ((*(esi + idx)) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov4 + ((*(esi + idx)) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; if (rep_count % 2) { - *(unsigned int *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); if (rep_count != (max_repcount - 1)) edi = edi + nf_width * 2; } else { - *(unsigned int *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); - *(unsigned int *)(edi + nf_width + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + nf_width + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); } } @@ -910,7 +910,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } if (donf41) { - unsigned int colors[4]; + uint32_t colors[4]; max_repcount = 8; colors[0] = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; @@ -923,21 +923,21 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = ((colors[3]) << 16) | colors[3]; for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; idx = rep_count + 8; - color_idx = *(unsigned int *)(nfhpk_mov8 + (*(esi + idx) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov8 + (*(esi + idx) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + 12) = w4; if (rep_count != (max_repcount - 1)) edi += nf_width; @@ -948,7 +948,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } if (donf25) { - unsigned int colors[4]; + uint32_t colors[4]; max_repcount = 4; colors[0] = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; @@ -961,26 +961,26 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = ((colors[3]) << 16) | colors[3]; for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; idx = rep_count + 8; - color_idx = *(unsigned int *)(nfhpk_mov4 + ((*(esi + idx)) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov4 + ((*(esi + idx)) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; - *(unsigned int *)(edi + 0) = w1; - *(unsigned int *)(edi + nf_width) = w1; - *(unsigned int *)(edi + 4) = w2; - *(unsigned int *)(edi + nf_width + 4) = w2; - *(unsigned int *)(edi + 8) = w3; - *(unsigned int *)(edi + nf_width + 8) = w3; - *(unsigned int *)(edi + 12) = w4; - *(unsigned int *)(edi + nf_width + 12) = w4; + *(uint32_t *)(edi + 0) = w1; + *(uint32_t *)(edi + nf_width) = w1; + *(uint32_t *)(edi + 4) = w2; + *(uint32_t *)(edi + nf_width + 4) = w2; + *(uint32_t *)(edi + 8) = w3; + *(uint32_t *)(edi + nf_width + 8) = w3; + *(uint32_t *)(edi + 12) = w4; + *(uint32_t *)(edi + nf_width + 12) = w4; if (rep_count != (max_repcount - 1)) edi = edi + nf_width * 2; @@ -1001,27 +1001,27 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = nf_trans16_lo[*(esi + 6)] | nf_trans16_hi[*(esi + 7)]; for (rep_count = 0; rep_count < max_repcount; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; idx = rep_count + 8; - color_idx = *(unsigned int *)(nfhpk_mov4 + ((*(esi + idx)) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov4 + ((*(esi + idx)) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; if (rep_count % 2) { - *(unsigned int *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); if (rep_count != (max_repcount - 1)) edi += nf_width; } else { - *(unsigned int *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); } } @@ -1056,8 +1056,8 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y colors[3] = nf_trans16_lo[*(esi + 6)] | nf_trans16_hi[*(esi + 7)]; for (rep_count = 0; rep_count < 16; rep_count++) { - unsigned int w1, w2, w3, w4; - unsigned int color_idx; + uint32_t w1, w2, w3, w4; + uint32_t color_idx; int idx; if (!do26 && !do42) { @@ -1163,28 +1163,28 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y break; } } - color_idx = *(unsigned int *)(nfhpk_mov4 + (*(esi + idx) * 4)); + color_idx = *(uint32_t *)(nfhpk_mov4 + (*(esi + idx) * 4)); w1 = colors[color_idx & 0x000000FF]; w2 = colors[(color_idx & 0x0000FF00) >> 8]; w3 = colors[(color_idx & 0x00FF0000) >> 16]; w4 = colors[(color_idx & 0xFF000000) >> 24]; if (!do42) { - *(unsigned int *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); if (rep_count != 15) edi += nf_width; } else { if (rep_count % 2) { - *(unsigned int *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 8) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 12) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); if (rep_count != 15) edi += nf_width; } else { - *(unsigned int *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); - *(unsigned int *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); + *(uint32_t *)(edi + 0) = (w1 & 0xFFFF) | ((w2 & 0xFFFF) << 16); + *(uint32_t *)(edi + 4) = (w3 & 0xFFFF) | ((w4 & 0xFFFF) << 16); } } @@ -1279,7 +1279,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y case 12: { // low 4x4x16 (32 bytes) int i; - unsigned int eax, ebx; + uint32_t eax, ebx; for (i = 0; i < 4; i++) { eax = *(unsigned char *)(esi + i * 8 + 0); @@ -1287,32 +1287,32 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y eax = *(unsigned char *)(esi + i * 8 + 1); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 0) = eax; - *(unsigned int *)(edi + nf_width) = eax; + *(uint32_t *)(edi + 0) = eax; + *(uint32_t *)(edi + nf_width) = eax; eax = *(unsigned char *)(esi + i * 8 + 2); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 3); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 4) = eax; - *(unsigned int *)(edi + nf_width + 4) = eax; + *(uint32_t *)(edi + 4) = eax; + *(uint32_t *)(edi + nf_width + 4) = eax; eax = *(unsigned char *)(esi + i * 8 + 4); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 5); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 8) = eax; - *(unsigned int *)(edi + nf_width + 8) = eax; + *(uint32_t *)(edi + 8) = eax; + *(uint32_t *)(edi + nf_width + 8) = eax; eax = *(unsigned char *)(esi + i * 8 + 6); ebx = nf_trans16_lo[eax]; eax = *(unsigned char *)(esi + i * 8 + 7); ebx |= nf_trans16_hi[eax]; eax = ((ebx & 0xFFFF) << 16) | (ebx & 0xFFFF); - *(unsigned int *)(edi + 12) = eax; - *(unsigned int *)(edi + nf_width + 12) = eax; + *(uint32_t *)(edi + 12) = eax; + *(uint32_t *)(edi + nf_width + 12) = eax; if (i != 3) edi = edi + nf_width * 2; @@ -1324,7 +1324,7 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } break; case 13: { // 2x2 4x4x0 (8 bytes) - unsigned int temp, ebx, ecx; + uint32_t temp, ebx, ecx; temp = nf_trans16_lo[(*esi)] | nf_trans16_hi[(*(esi + 1))]; ebx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); @@ -1332,25 +1332,25 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y temp = nf_trans16_lo[(*(esi + 2))] | nf_trans16_hi[(*(esi + 3))]; ecx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ecx; - *(unsigned int *)(edi + 12) = ecx; - *(unsigned int *)(edi + nf_width) = ebx; - *(unsigned int *)(edi + nf_width + 4) = ebx; - *(unsigned int *)(edi + nf_width + 8) = ecx; - *(unsigned int *)(edi + nf_width + 12) = ecx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ecx; + *(uint32_t *)(edi + 12) = ecx; + *(uint32_t *)(edi + nf_width) = ebx; + *(uint32_t *)(edi + nf_width + 4) = ebx; + *(uint32_t *)(edi + nf_width + 8) = ecx; + *(uint32_t *)(edi + nf_width + 12) = ecx; edi = edi + nf_width * 2; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ecx; - *(unsigned int *)(edi + 12) = ecx; - *(unsigned int *)(edi + nf_width) = ebx; - *(unsigned int *)(edi + nf_width + 4) = ebx; - *(unsigned int *)(edi + nf_width + 8) = ecx; - *(unsigned int *)(edi + nf_width + 12) = ecx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ecx; + *(uint32_t *)(edi + 12) = ecx; + *(uint32_t *)(edi + nf_width) = ebx; + *(uint32_t *)(edi + nf_width + 4) = ebx; + *(uint32_t *)(edi + nf_width + 8) = ecx; + *(uint32_t *)(edi + nf_width + 12) = ecx; edi = edi + nf_width * 2; @@ -1360,25 +1360,25 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y temp = nf_trans16_lo[(*(esi + 6))] | nf_trans16_hi[(*(esi + 7))]; ecx = ((temp & 0xFFFF) << 16) | (temp & 0xFFFF); - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ecx; - *(unsigned int *)(edi + 12) = ecx; - *(unsigned int *)(edi + nf_width) = ebx; - *(unsigned int *)(edi + nf_width + 4) = ebx; - *(unsigned int *)(edi + nf_width + 8) = ecx; - *(unsigned int *)(edi + nf_width + 12) = ecx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ecx; + *(uint32_t *)(edi + 12) = ecx; + *(uint32_t *)(edi + nf_width) = ebx; + *(uint32_t *)(edi + nf_width + 4) = ebx; + *(uint32_t *)(edi + nf_width + 8) = ecx; + *(uint32_t *)(edi + nf_width + 12) = ecx; edi = edi + nf_width * 2; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ecx; - *(unsigned int *)(edi + 12) = ecx; - *(unsigned int *)(edi + nf_width) = ebx; - *(unsigned int *)(edi + nf_width + 4) = ebx; - *(unsigned int *)(edi + nf_width + 8) = ecx; - *(unsigned int *)(edi + nf_width + 12) = ecx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ecx; + *(uint32_t *)(edi + 12) = ecx; + *(uint32_t *)(edi + nf_width) = ebx; + *(uint32_t *)(edi + nf_width + 4) = ebx; + *(uint32_t *)(edi + nf_width + 8) = ecx; + *(uint32_t *)(edi + nf_width + 12) = ecx; edi += nf_width; edi -= nfpk_back_right; @@ -1386,57 +1386,57 @@ void nfHPkDecomp(unsigned char *ops, unsigned char *comp, unsigned x, unsigned y } break; case 14: { // 8x8x0 (2 bytes) - unsigned int ecx, ebx; + uint32_t ecx, ebx; ecx = nf_trans16_lo[*(esi)] | nf_trans16_hi[*(esi + 1)]; esi += 2; ebx = ((ecx & 0xFFFF) << 16) | (ecx & 0xFFFF); - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi += nf_width; - *(unsigned int *)(edi + 0) = ebx; - *(unsigned int *)(edi + 4) = ebx; - *(unsigned int *)(edi + 8) = ebx; - *(unsigned int *)(edi + 12) = ebx; + *(uint32_t *)(edi + 0) = ebx; + *(uint32_t *)(edi + 4) = ebx; + *(uint32_t *)(edi + 8) = ebx; + *(uint32_t *)(edi + 12) = ebx; edi -= nfpk_back_right; } break; @@ -1473,8 +1473,8 @@ void Trans16Blk(unsigned char *edi, unsigned char *idx) { *((unsigned short *)(edi + 14)) = nf_trans16_lo[*(idx + 14)] | nf_trans16_hi[*(idx + 15)]; } -void call_hnfxycshift(unsigned int eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right) { - unsigned int ebx; +void call_hnfxycshift(uint32_t eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right) { + uint32_t ebx; ebx = ((eax & 0xFF00) >> 8); if (eax & 0x80) { @@ -1489,9 +1489,9 @@ void call_hnfxycshift(unsigned int eax, unsigned char **medi, unsigned char **me call_hnfshift(eax, medi, mesi, nfpk_back_right); } -void call_hnfxypshift(unsigned int eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right, +void call_hnfxypshift(uint32_t eax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right, int DiffBufPtrs) { - unsigned int ebx; + uint32_t ebx; ebx = ((eax & 0xFF00) >> 8); if (eax & 0x80) { @@ -1507,7 +1507,7 @@ void call_hnfxypshift(unsigned int eax, unsigned char **medi, unsigned char **me call_hnfshift(eax, medi, mesi, nfpk_back_right); } -void call_hnfshift(unsigned int meax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right) { +void call_hnfshift(uint32_t meax, unsigned char **medi, unsigned char **mesi, int nfpk_back_right) { unsigned char *esi, *edi, *saved_esi; int i; @@ -1516,7 +1516,7 @@ void call_hnfshift(unsigned int meax, unsigned char **medi, unsigned char **mesi esi = edi + meax; for (i = 0; i < 8; i++) { -#define HNFSHIFT_WRITEOUT(x) *(unsigned int *)(edi + x) = *(unsigned int *)(esi + x); +#define HNFSHIFT_WRITEOUT(x) *(uint32_t *)(edi + x) = *(uint32_t *)(esi + x); HNFSHIFT_WRITEOUT(0); HNFSHIFT_WRITEOUT(4); diff --git a/lnxmvelib/mvelibi.h b/lnxmvelib/mvelibi.h index 75256829..11242b47 100644 --- a/lnxmvelib/mvelibi.h +++ b/lnxmvelib/mvelibi.h @@ -116,7 +116,7 @@ typedef struct _mcmd_hdr { #define mcmd_syncInit 2 typedef struct _syncInit { - unsigned int period; // period of quanta + uint32_t period; // period of quanta unsigned short wait_quanta; // # of quanta per frame } marg_syncInit; @@ -138,7 +138,7 @@ typedef struct _sndConfigure { unsigned char dummy1; unsigned short frequency; // Minor opcode 1 extends buflen to be a long - unsigned int buflen; + uint32_t buflen; } marg_sndConfigure; #define mcmd_sndSync 4 @@ -227,13 +227,13 @@ typedef struct _palLoadPalette { #define mcmd_nfPkInfo 19 #define mcmd_nfHPkInfo 20 typedef struct _nfPkInfo { - unsigned int error; // scaled by 10000 + uint32_t error; // scaled by 10000 unsigned short usage[64]; } marg_nfPkInfo; #define mcmd_idcode 21 typedef struct _idcode { - unsigned int idcode; // Code identifying version mcomp used to create + uint32_t idcode; // Code identifying version mcomp used to create } marg_idcode; #if __SC__ diff --git a/lnxmvelib/mvelibl.cpp b/lnxmvelib/mvelibl.cpp index 25fd57ad..dbf6f2e1 100644 --- a/lnxmvelib/mvelibl.cpp +++ b/lnxmvelib/mvelibl.cpp @@ -56,7 +56,7 @@ unsigned sndDecompS16(unsigned short *dst, const unsigned char *src, unsigned le static LnxWindow *mve_lpWin = NULL; -unsigned int timeGetTime(void) { +uint32_t timeGetTime(void) { struct timeval t; gettimeofday(&t, NULL); @@ -130,20 +130,20 @@ static int sync_wait_quanta; static bool sync_late = FALSE; static bool sync_FrameDropped = FALSE; -static void syncReset(unsigned int wait_quanta); +static void syncReset(uint32_t wait_quanta); static void syncRelease(void); -static bool syncInit(unsigned int period, unsigned wait_quanta); +static bool syncInit(uint32_t period, unsigned wait_quanta); static bool syncWait(void); static void syncSync(void); -static void syncReset(unsigned int wait_quanta) { +static void syncReset(uint32_t wait_quanta) { sync_time = wait_quanta - timeGetTime() * 1000; sync_active = TRUE; } static void syncRelease(void) { sync_active = FALSE; } -static bool syncInit(unsigned int period, unsigned wait_quanta) { +static bool syncInit(uint32_t period, unsigned wait_quanta) { int new_wait_quanta = -(int32_t)(period * wait_quanta + (wait_quanta >> 1)); // If timer is still running and has same timing // characteristics, assume we are trying to continue smoothly @@ -279,7 +279,7 @@ static void ioRelease(void) { MemFree(&io_mem_buf); } static LnxSoundDevice *snd_ds = NULL; static LnxSoundBuffer *snd_buffer = NULL; static LinuxSoundCaps snd_buffer_caps; -static unsigned int snd_write_cursor; +static uint32_t snd_write_cursor; enum { snd_queue_max = 60 }; @@ -386,8 +386,8 @@ static void sndSync(void) { #if SOUND_SUPPORT int dsrval; - unsigned int dsbstatus; - unsigned int play_cursor, write_cursor, target; + uint32_t dsbstatus; + uint32_t play_cursor, write_cursor, target; bool need_resync; #endif @@ -496,9 +496,9 @@ static unsigned sndAddHelper(unsigned char *dst, unsigned char **pSrc, unsigned src += len >> 1; } else { if (init) { - state = *(unsigned int *)src; + state = *(uint32_t *)src; state = INTEL_INT(state); - *(unsigned int *)dst = state; + *(uint32_t *)dst = state; src += 4; dst += 4; len -= 4; @@ -521,8 +521,8 @@ static void sndAdd(const unsigned char *buf, unsigned len) { #if SOUND_SUPPORT int dsrval; - unsigned int play_cursor, write_cursor; - unsigned int len1, len2; + uint32_t play_cursor, write_cursor; + uint32_t len1, len2; unsigned state = 0; bool init = TRUE; @@ -774,7 +774,7 @@ static void nfAdvance(void) { y = (sf_ScreenHeight>>1) - (nf_height>>1); if(y<0) y = 0; - ret = LnxDraw_Blit(mve_lpWin,nf_dds_cur,(unsigned int)x,(unsigned int)y,mw,nf_height); + ret = LnxDraw_Blit(mve_lpWin,nf_dds_cur,(uint32_t)x,(uint32_t)y,mw,nf_height); */ unsigned char *tmp; tmp = nf_dds_prv; @@ -876,7 +876,7 @@ 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 int sf_WinSize; +uint32_t sf_WinSize; unsigned sf_WinGranPerSize; //{sf_WriteWinPtr and sf_WriteWinLimit replace sf_WriteWinSeg, see mveliba.asm} unsigned char *sf_WriteWinPtr; @@ -909,7 +909,7 @@ void mve_ShowFrameFieldHi(unsigned char *buf, unsigned bufw, unsigned bufh, unsi // 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 int WinSize, unsigned WinGran, void *SetBank, unsigned hicolor) { + uint32_t WinSize, unsigned WinGran, void *SetBank, unsigned hicolor) { sf_ScreenWidth = w; sf_ScreenHeight = h; sf_ResolutionWidth = w; diff --git a/lnxmvelib/mvelibl.h b/lnxmvelib/mvelibl.h index 71770bee..24d05a0e 100644 --- a/lnxmvelib/mvelibl.h +++ b/lnxmvelib/mvelibl.h @@ -90,7 +90,7 @@ void MVE_dsbSetPan(int32_t lPan); ** how and when to do palette callbacks. */ void MVE_sfSVGA(unsigned w, unsigned h, unsigned LineWidth, unsigned WriteWin, unsigned char *WriteWinPtr, - unsigned int WinSize, unsigned WinGran, void *SetBank, unsigned hicolor); + uint32_t WinSize, unsigned WinGran, void *SetBank, unsigned hicolor); /* This function alters the display from 640x480 or 640x400 to 640x350 resolution. */ diff --git a/md5/md5.cpp b/md5/md5.cpp index 7b5d617d..9ba1f1cc 100644 --- a/md5/md5.cpp +++ b/md5/md5.cpp @@ -22,7 +22,7 @@ namespace { -const unsigned int md5_round_shifts[] = {7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21}; +const uint32_t md5_round_shifts[] = {7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21}; const std::uint32_t md5_round_constants[] = { 0xD76AA478UL, 0xE8C7B756UL, 0x242070DBUL, 0xC1BDCEEEUL, 0xF57C0FAFUL, 0x4787C62AUL, 0xA8304613UL, 0xFD469501UL, @@ -50,9 +50,9 @@ void MD5::round(std::array &sums, const unsigned char *block) std::uint32_t a = sums[0], b = sums[1], c = sums[2], d = sums[3]; // 64 rounds... - for (unsigned int r = 0; r < 64; ++r) { + for (uint32_t r = 0; r < 64; ++r) { std::uint32_t f, g; - unsigned int s = md5_round_shifts[((r >> 2) & ~3) | (r & 3)]; + uint32_t s = md5_round_shifts[((r >> 2) & ~3) | (r & 3)]; switch (r >> 4) { case 0: f = (b & c) | (~b & d), g = r; @@ -175,10 +175,10 @@ void MD5::update(short valin) noexcept { update(p, sizeof(short)); } -void MD5::update(unsigned int valin) noexcept { - unsigned int val = INTEL_INT(valin); +void MD5::update(uint32_t valin) noexcept { + uint32_t val = INTEL_INT(valin); unsigned char *p = (unsigned char *)&val; - update(p, sizeof(unsigned int)); + update(p, sizeof(uint32_t)); } void MD5::update(unsigned char val) noexcept { diff --git a/md5/md5.h b/md5/md5.h index 5d968a3a..fd64a5e5 100644 --- a/md5/md5.h +++ b/md5/md5.h @@ -37,7 +37,7 @@ public: void update(const unsigned char *data, std::size_t n) noexcept; void update(float val) noexcept; void update(int val) noexcept; - void update(unsigned int val) noexcept; + void update(uint32_t val) noexcept; void update(unsigned char val) noexcept; void update(short val) noexcept; std::array digest() const noexcept; diff --git a/md5/tests/md5_tests.cpp b/md5/tests/md5_tests.cpp index 2bd22772..1fe15916 100644 --- a/md5/tests/md5_tests.cpp +++ b/md5/tests/md5_tests.cpp @@ -31,7 +31,7 @@ std::string hexdigest_after_n_rounds_of_fuzz(int n) { md5.update((float)1.0f); md5.update((int)2); md5.update((short)3); - md5.update((unsigned int)4U); + md5.update((uint32_t)4U); md5.update((unsigned char)5); } @@ -40,7 +40,7 @@ std::string hexdigest_after_n_rounds_of_fuzz(int n) { auto digest = md5.digest(); for (int i = 0; i < 16; ++i) - hexdigest << std::setw(2) << std::setfill('0') << std::nouppercase << static_cast(digest[i]); + hexdigest << std::setw(2) << std::setfill('0') << std::nouppercase << static_cast(digest[i]); return hexdigest.str(); } diff --git a/mem/mem.cpp b/mem/mem.cpp index e48d5a7a..8151aaa3 100644 --- a/mem/mem.cpp +++ b/mem/mem.cpp @@ -338,15 +338,15 @@ FILE *mem_out = NULL; int Mem_mallocs_since_last_sort = 0; /* #undef new -void *operator new(unsigned int size, char *file, int line) +void *operator new(uint32_t size, char *file, int line) { return mem_malloc_sub(size, file, line); } -void *operator new [](unsigned int size, char *file, int line) +void *operator new [](uint32_t size, char *file, int line) { return mem_malloc_sub(size, file, line); } -void *operator new(unsigned int size) +void *operator new(uint32_t size) { return mem_malloc_sub(size,"unknown",0); } @@ -864,7 +864,7 @@ hashTableIndex hash(T data) { /*********************************** * hash function applied to data * ***********************************/ - unsigned int hval = (unsigned int)data->ptr; + uint32_t hval = (uint32_t)data->ptr; return (hval % MEM_MAX_MALLOCS); } Node *insertNode(T data) { diff --git a/movie/d3movie.cpp b/movie/d3movie.cpp index d0201b88..b748cfc0 100644 --- a/movie/d3movie.cpp +++ b/movie/d3movie.cpp @@ -125,7 +125,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int Play(unsigned int flags) { + int Play(uint32_t flags) { DWORD dsFlags = (flags & LNXSND_LOOPING) ? DSBPLAY_LOOPING : 0; return m_pBuffer->Play(0, 0, dsFlags); } @@ -158,7 +158,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int GetStatus(unsigned int *status) { return m_pBuffer->GetStatus(reinterpret_cast(status)); } + int GetStatus(uint32_t *status) { return m_pBuffer->GetStatus(reinterpret_cast(status)); } /////////////////////////////////////// // GetCurrentPosition @@ -168,7 +168,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int GetCurrentPosition(unsigned int *ppos, unsigned int *wpos) { + int GetCurrentPosition(uint32_t *ppos, uint32_t *wpos) { return m_pBuffer->GetCurrentPosition(reinterpret_cast(ppos), reinterpret_cast(wpos)); } @@ -180,7 +180,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int SetCurrentPosition(unsigned int pos) { return m_pBuffer->SetCurrentPosition(pos); } + int SetCurrentPosition(uint32_t pos) { return m_pBuffer->SetCurrentPosition(pos); } ///////////////////////// // Lock @@ -191,8 +191,8 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int Lock(unsigned int pos, unsigned int numbytes, void **ptr1, unsigned int *numbytes1, void **ptr2, - unsigned int *numbytes2, unsigned int flags) { + int Lock(uint32_t pos, uint32_t numbytes, void **ptr1, uint32_t *numbytes1, void **ptr2, + uint32_t *numbytes2, uint32_t flags) { return m_pBuffer->Lock(pos, numbytes, ptr1, reinterpret_cast(numbytes1), ptr2, reinterpret_cast(numbytes2), flags); } @@ -205,7 +205,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int Unlock(void *ptr1, unsigned int num1, void *ptr2, unsigned int num2) { + int Unlock(void *ptr1, uint32_t num1, void *ptr2, uint32_t num2) { return m_pBuffer->Unlock(ptr1, num1, ptr2, num2); } }; @@ -320,8 +320,8 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int Play(unsigned int flags) { - unsigned int dsFlags = (flags & LNXSND_LOOPING) ? LNXSND_LOOPING : 0; + int Play(uint32_t flags) { + uint32_t dsFlags = (flags & LNXSND_LOOPING) ? LNXSND_LOOPING : 0; return LnxSoundBuffer_Play(m_pBuffer, dsFlags); } @@ -343,7 +343,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int GetStatus(unsigned int *status) { return LnxSoundBuffer_GetStatus(m_pBuffer, status); } + int GetStatus(uint32_t *status) { return LnxSoundBuffer_GetStatus(m_pBuffer, status); } /////////////////////////////////////// // GetCurrentPosition @@ -353,7 +353,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int GetCurrentPosition(unsigned int *ppos, unsigned int *wpos) { + int GetCurrentPosition(uint32_t *ppos, uint32_t *wpos) { return LnxSoundBuffer_GetCurrentPosition(m_pBuffer, ppos, wpos); } @@ -366,7 +366,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int SetCurrentPosition(unsigned int pos) { return LnxSoundBuffer_SetCurrentPosition(m_pBuffer, pos); } + int SetCurrentPosition(uint32_t pos) { return LnxSoundBuffer_SetCurrentPosition(m_pBuffer, pos); } ///////////////////////// // Lock @@ -377,8 +377,8 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int Lock(unsigned int pos, unsigned int numbytes, void **ptr1, unsigned int *numbytes1, void **ptr2, - unsigned int *numbytes2, unsigned int flags) { + int Lock(uint32_t pos, uint32_t numbytes, void **ptr1, uint32_t *numbytes1, void **ptr2, + uint32_t *numbytes2, uint32_t flags) { return LnxSoundBuffer_Lock(m_pBuffer, pos, numbytes, ptr1, numbytes1, ptr2, numbytes2, flags); } @@ -390,7 +390,7 @@ public: // Returns: // 0 : no error // -1 : invalid parameters - int Unlock(void *ptr1, unsigned int num1, void *ptr2, unsigned int num2) { + int Unlock(void *ptr1, uint32_t num1, void *ptr2, uint32_t num2) { return LnxSoundBuffer_Unlock(m_pBuffer, ptr1, num1, ptr2, num2); } }; @@ -432,14 +432,14 @@ public: #endif } // namespace -static void *CallbackAlloc(unsigned int size); +static void *CallbackAlloc(uint32_t size); static void CallbackFree(void *p); -static unsigned int CallbackFileRead(int hFile, void *pBuffer, unsigned int bufferCount); +static uint32_t CallbackFileRead(int hFile, void *pBuffer, uint32_t bufferCount); static void InitializePalette(); -static void CallbackSetPalette(unsigned char *pBuffer, unsigned int start, unsigned int count); -static void CallbackShowFrame(unsigned char *buf, unsigned int bufw, unsigned int bufh, unsigned int sx, - unsigned int sy, unsigned int w, unsigned int h, unsigned int dstx, unsigned int dsty, - unsigned int hicolor); +static void CallbackSetPalette(unsigned char *pBuffer, uint32_t start, uint32_t count); +static void CallbackShowFrame(unsigned char *buf, uint32_t bufw, uint32_t bufh, uint32_t sx, + uint32_t sy, uint32_t w, uint32_t h, uint32_t dstx, uint32_t dsty, + uint32_t hicolor); #ifndef NO_MOVIES static bool mve_InitSound(oeApplication *app, MovieSoundDevice &device); @@ -590,12 +590,12 @@ int mve_PlayMovie(const char *pMovieName, oeApplication *pApp) { #endif } -void *CallbackAlloc(unsigned int size) { return mem_malloc(size); } +void *CallbackAlloc(uint32_t size) { return mem_malloc(size); } void CallbackFree(void *p) { mem_free(p); } -unsigned int CallbackFileRead(int hFile, void *pBuffer, unsigned int bufferCount) { - unsigned int numRead = read(hFile, pBuffer, bufferCount); +uint32_t CallbackFileRead(int hFile, void *pBuffer, uint32_t bufferCount) { + uint32_t numRead = read(hFile, pBuffer, bufferCount); return (numRead == bufferCount) ? 1 : 0; } @@ -605,14 +605,14 @@ void InitializePalette() { } } -void CallbackSetPalette(unsigned char *pBuffer, unsigned int start, unsigned int count) { +void CallbackSetPalette(unsigned char *pBuffer, uint32_t start, uint32_t count) { #ifndef NO_MOVIES pBuffer += start * 3; - for (unsigned int i = 0; i < count; ++i) { - unsigned int r = pBuffer[0] << 2; - unsigned int g = pBuffer[1] << 2; - unsigned int b = pBuffer[2] << 2; + for (uint32_t i = 0; i < count; ++i) { + uint32_t r = pBuffer[0] << 2; + uint32_t g = pBuffer[1] << 2; + uint32_t b = pBuffer[2] << 2; pBuffer += 3; CurrentPalette[start + i] = OPAQUE_FLAG | GR_RGB16(r, g, b); @@ -632,7 +632,7 @@ int NextPow2(int n) { } #ifndef NO_MOVIES -void BlitToMovieBitmap(unsigned char *buf, unsigned int bufw, unsigned int bufh, unsigned int hicolor, +void BlitToMovieBitmap(unsigned char *buf, uint32_t bufw, uint32_t bufh, uint32_t hicolor, bool usePow2Texture, int &texW, int &texH) { // get some sizes int drawWidth = hicolor ? (bufw >> 1) : bufw; @@ -661,9 +661,9 @@ void BlitToMovieBitmap(unsigned char *buf, unsigned int bufw, unsigned int bufh, for (int y = 0; y < drawHeight; ++y) { for (int x = 0; x < drawWidth; ++x) { unsigned short col16 = *wBuf++; - unsigned int b = ((col16 >> 11) & 0x1F) << 3; - unsigned int g = ((col16 >> 5) & 0x3F) << 2; - unsigned int r = ((col16 >> 0) & 0x1F) << 3; + uint32_t b = ((col16 >> 11) & 0x1F) << 3; + uint32_t g = ((col16 >> 5) & 0x3F) << 2; + uint32_t r = ((col16 >> 0) & 0x1F) << 3; pPixelData[x] = OPAQUE_FLAG | GR_RGB16(r, g, b); } @@ -681,8 +681,8 @@ void BlitToMovieBitmap(unsigned char *buf, unsigned int bufw, unsigned int bufh, } } -void CallbackShowFrame(unsigned char *buf, unsigned int bufw, unsigned int bufh, unsigned int sx, unsigned int sy, - unsigned int w, unsigned int h, unsigned int dstx, unsigned int dsty, unsigned int hicolor) { +void CallbackShowFrame(unsigned char *buf, uint32_t bufw, uint32_t bufh, uint32_t sx, uint32_t sy, + uint32_t w, uint32_t h, uint32_t dstx, uint32_t dsty, uint32_t hicolor) { // prepare our bitmap int texW, texH; BlitToMovieBitmap(buf, bufw, bufh, hicolor, true, texW, texH); @@ -781,8 +781,8 @@ reread_frame: // refresh our palette { - unsigned int palstart = 0; - unsigned int palcount = 0; + uint32_t palstart = 0; + uint32_t palcount = 0; unsigned char *pal = NULL; MVE_frPal((MVE_frStream)handle, &pal, &palstart, &palcount); CallbackSetPalette(pal, palstart, palcount); diff --git a/netcon/includes/CFtp.h b/netcon/includes/CFtp.h index 16f31c70..22bd3b92 100644 --- a/netcon/includes/CFtp.h +++ b/netcon/includes/CFtp.h @@ -91,8 +91,8 @@ public: CFtpGet(char *URL, char *localfile, char *Username = NULL, char *Password = NULL); ~CFtpGet(); int GetStatus(); - unsigned int GetBytesIn(); - unsigned int GetTotalBytes(); + uint32_t GetBytesIn(); + uint32_t GetTotalBytes(); void AbortGet(); void WorkerThread(); @@ -100,16 +100,16 @@ public: protected: int ConnectControlSocket(); int LoginHost(); - unsigned int SendFTPCommand(char *command); - unsigned int ReadFTPServerReply(); - unsigned int GetFile(); - unsigned int IssuePort(); - unsigned int ReadDataChannel(); + uint32_t SendFTPCommand(char *command); + uint32_t ReadFTPServerReply(); + uint32_t GetFile(); + uint32_t IssuePort(); + uint32_t ReadDataChannel(); void FlushControlChannel(); - unsigned int m_iBytesIn; - unsigned int m_iBytesTotal; - unsigned int m_State; + uint32_t m_iBytesIn; + uint32_t m_iBytesTotal; + uint32_t m_State; bool m_Aborting; bool m_Aborted; diff --git a/netcon/includes/Chttpget.h b/netcon/includes/Chttpget.h index 57575adb..896b874b 100644 --- a/netcon/includes/Chttpget.h +++ b/netcon/includes/Chttpget.h @@ -89,8 +89,8 @@ public: ~ChttpGet(); void GetFile(char *URL, char *localfile); int GetStatus(); - unsigned int GetBytesIn(); - unsigned int GetTotalBytes(); + uint32_t GetBytesIn(); + uint32_t GetTotalBytes(); void AbortGet(); void WorkerThread(); bool m_Aborted; @@ -98,10 +98,10 @@ public: protected: int ConnectSocket(); char *GetHTTPLine(); - unsigned int ReadDataChannel(); - unsigned int m_iBytesIn; - unsigned int m_iBytesTotal; - unsigned int m_State; + uint32_t ReadDataChannel(); + uint32_t m_iBytesIn; + uint32_t m_iBytesTotal; + uint32_t m_State; bool m_ProxyEnabled; char *m_ProxyIP; char m_URL[MAX_URL_LEN]; diff --git a/netcon/includes/con_dll.h b/netcon/includes/con_dll.h index 2f37f046..4ff97423 100644 --- a/netcon/includes/con_dll.h +++ b/netcon/includes/con_dll.h @@ -330,7 +330,7 @@ typedef struct { typedef void (*GetMultiAPI_fp)(multi_api *api); GetMultiAPI_fp DLLGetMultiAPI; -typedef void (*SetUITextItemText_fp)(void *uit, char *newtext, unsigned int color); +typedef void (*SetUITextItemText_fp)(void *uit, char *newtext, uint32_t color); SetUITextItemText_fp DLLSetUITextItemText; typedef void *(*NewUIWindowCreate_fp)(int x, int y, int w, int h, int flags); @@ -465,7 +465,7 @@ static inline void DLLMultiStartServer(int playing, char *scriptname, int dedica typedef void (*ShowProgressScreen_fp)(char *, char *); ShowProgressScreen_fp DLLShowProgressScreen; -typedef int (*SearchForLocalGamesTCP_fp)(unsigned int, ushort); +typedef int (*SearchForLocalGamesTCP_fp)(uint32_t, ushort); SearchForLocalGamesTCP_fp DLLSearchForLocalGamesTCP; typedef int (*nw_GetHostAddressFromNumbers_fp)(char *str); @@ -487,9 +487,9 @@ GetMissionName_fp DLLGetMissionName; typedef void (*RemoveUITextItem_fp)(void *item); RemoveUITextItem_fp DLLRemoveUITextItem; -typedef void *(*CreateNewUITextItem_fp)(const char *newtext, unsigned int color, int font); +typedef void *(*CreateNewUITextItem_fp)(const char *newtext, uint32_t color, int font); CreateNewUITextItem_fp DLLCreateNewUITextItemFP; -static inline void *DLLCreateNewUITextItem(const char *newtext, unsigned int color, int font = -1) { +static inline void *DLLCreateNewUITextItem(const char *newtext, uint32_t color, int font = -1) { return DLLCreateNewUITextItemFP(newtext, color, font); } @@ -548,7 +548,7 @@ OldEditGetText_fp DLLOldEditGetText; typedef void (*ToggleUICallback_fp)(int state); ToggleUICallback_fp DLLToggleUICallback; -typedef int (*SearchForGamesPXO_fp)(unsigned int ask, ushort port); +typedef int (*SearchForGamesPXO_fp)(uint32_t ask, ushort port); SearchForGamesPXO_fp DLLSearchForGamesPXO; typedef void (*SetOldEditBufferLen_fp)(void *item, int len); @@ -579,7 +579,7 @@ dp_ListDirectPlayGames_fp DLLdp_ListDirectPlayGames; typedef int (*dp_InitDirectPlay_fp)(char *conn_name, void *parms, int num_elements); dp_InitDirectPlay_fp DLLdp_InitDirectPlay; -typedef int (*dp_GetModemChoices_fp)(char *buffer, unsigned int *size); +typedef int (*dp_GetModemChoices_fp)(char *buffer, uint32_t *size); dp_GetModemChoices_fp DLLdp_GetModemChoices; #endif @@ -620,7 +620,7 @@ typedef void (*dp_EndGame_fp)(); dp_EndGame_fp DLLdp_EndGame; #endif -typedef int (*nw_Asyncgethostbyname_fp)(unsigned int *ip, int command, char *hostname); +typedef int (*nw_Asyncgethostbyname_fp)(uint32_t *ip, int command, char *hostname); nw_Asyncgethostbyname_fp DLLnw_Asyncgethostbyname; typedef int (*nw_ReccomendPPS_fp)(); @@ -691,7 +691,7 @@ UpdateAndPackGameList_fp DLLUpdateAndPackGameList; typedef int (*MultiLevelSelection_fp)(void); MultiLevelSelection_fp DLLMultiLevelSelection; -typedef bool (*DoPlayerMouselookCheck_fp)(unsigned int flags); +typedef bool (*DoPlayerMouselookCheck_fp)(uint32_t flags); DoPlayerMouselookCheck_fp DLLDoPlayerMouselookCheck; typedef int (*CheckMissionForScript_fp)(char *mission, char *script, int dedicated_server_num_teams); @@ -711,7 +711,7 @@ int DLLUIClass_CurrID = 0xD0; #define JEFF_GREEN GR_RGB(40, 255, 40) #define NETPOLLINTERVAL 10.0 -extern int MTAVersionCheck(unsigned int oldver, char *URL); +extern int MTAVersionCheck(uint32_t oldver, char *URL); #define LOGIN_LEN 33 #define REAL_NAME_LEN 66 @@ -734,13 +734,13 @@ typedef struct vmt_descent3_struct { int suicides; int online_time; int games_played; - unsigned int security; + uint32_t security; unsigned char virgin_pilot; // This pilot was just created if TRUE - unsigned int lateral_thrust; - unsigned int rotational_thrust; - unsigned int sliding_pct; // Percentage of the time you were sliding - 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 + uint32_t lateral_thrust; + uint32_t rotational_thrust; + uint32_t sliding_pct; // Percentage of the time you were sliding + uint32_t checksum; // This value needs to be equal to whatever the checksum is once the packet is decoded + uint32_t 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 @@ -757,7 +757,7 @@ typedef struct vmt_descent3_struct { #define DLLmprintf(args) #endif -unsigned int MTClientVer = 100; +uint32_t MTClientVer = 100; char MTUpdateURL[300] = ""; diff --git a/netcon/includes/inetgetfile.h b/netcon/includes/inetgetfile.h index 0d285b06..376255e2 100644 --- a/netcon/includes/inetgetfile.h +++ b/netcon/includes/inetgetfile.h @@ -200,7 +200,7 @@ protected: int main(int argc,char **argv) { - unsigned int LastPrintbytes = time(NULL); + uint32_t LastPrintbytes = time(NULL); InetGetFile *inetfile; WSADATA ws_data; WORD ver=MAKEWORD(1,1); diff --git a/netcon/inetfile/CFtp.cpp b/netcon/inetfile/CFtp.cpp index 7a8e774f..6d9fdddf 100644 --- a/netcon/inetfile/CFtp.cpp +++ b/netcon/inetfile/CFtp.cpp @@ -258,9 +258,9 @@ CFtpGet::~CFtpGet() { // Returns a value to specify the status (ie. connecting/connected/transferring/done) int CFtpGet::GetStatus() { return m_State; } -unsigned int CFtpGet::GetBytesIn() { return m_iBytesIn; } +uint32_t CFtpGet::GetBytesIn() { return m_iBytesIn; } -unsigned int CFtpGet::GetTotalBytes() { return m_iBytesTotal; } +uint32_t CFtpGet::GetTotalBytes() { return m_iBytesTotal; } // This function does all the work -- connects on a blocking socket // then sends the appropriate user and password commands @@ -280,7 +280,7 @@ void CFtpGet::WorkerThread() { m_Aborted = true; } -unsigned int CFtpGet::GetFile() { +uint32_t CFtpGet::GetFile() { // Start off by changing into the proper dir. char szCommandString[256]; @@ -351,13 +351,13 @@ unsigned int CFtpGet::GetFile() { return 1; } -unsigned int CFtpGet::IssuePort() { +uint32_t CFtpGet::IssuePort() { char szCommandString[200]; SOCKADDR_IN listenaddr; // Socket address structure socklen_t iLength; // Length of the address structure - unsigned int nLocalPort; // Local port for listening - unsigned int nReplyCode; // FTP server reply code + uint32_t nLocalPort; // Local port for listening + uint32_t nReplyCode; // FTP server reply code // Get the address for the hListenSocket iLength = sizeof(listenaddr); @@ -391,10 +391,10 @@ unsigned int CFtpGet::IssuePort() { struct { unsigned short s_w1, s_w2; } S_un_w; - unsigned int S_addr; + uint32_t S_addr; } S_un; - S_un.S_addr = (unsigned int)listenaddr.sin_addr.s_addr; + S_un.S_addr = (uint32_t)listenaddr.sin_addr.s_addr; // Format the PORT command with the correct numbers. snprintf(szCommandString, sizeof(szCommandString), "PORT %d,%d,%d,%d,%d,%d\r\n", S_un.S_un_b.s_b1, S_un.S_un_b.s_b2, S_un.S_un_b.s_b3, S_un.S_un_b.s_b4, nLocalPort & 0xFF, nLocalPort >> 8); @@ -473,7 +473,7 @@ int CFtpGet::LoginHost() { return 1; } -unsigned int CFtpGet::SendFTPCommand(char *command) { +uint32_t CFtpGet::SendFTPCommand(char *command) { FlushControlChannel(); // Send the FTP command @@ -487,12 +487,12 @@ unsigned int CFtpGet::SendFTPCommand(char *command) { return (ReadFTPServerReply()); } -unsigned int CFtpGet::ReadFTPServerReply() { - unsigned int rcode; - unsigned int iBytesRead; +uint32_t CFtpGet::ReadFTPServerReply() { + uint32_t rcode; + uint32_t iBytesRead; char chunk[2]; char szcode[5]; - unsigned int igotcrlf = 0; + uint32_t igotcrlf = 0; memset(recv_buffer, 0, 1000); do { chunk[0] = '\0'; @@ -535,7 +535,7 @@ unsigned int CFtpGet::ReadFTPServerReply() { return (rcode); } -unsigned int CFtpGet::ReadDataChannel() { +uint32_t CFtpGet::ReadDataChannel() { char sDataBuffer[4096]; // Data-storage buffer for the data channel int nBytesRecv; // Bytes received from the data channel m_State = FTP_STATE_RECEIVING; diff --git a/netcon/inetfile/Chttpget.cpp b/netcon/inetfile/Chttpget.cpp index afce6283..d402c12b 100644 --- a/netcon/inetfile/Chttpget.cpp +++ b/netcon/inetfile/Chttpget.cpp @@ -162,7 +162,7 @@ static int HTTPObjThread(void *obj); static int http_gethostbynameworker(void *parm); #endif -static int http_Asyncgethostbyname(unsigned int *ip, int command, char *hostname); +static int http_Asyncgethostbyname(uint32_t *ip, int command, char *hostname); #ifndef __LINUX__ void HTTPObjThread(void *obj) @@ -210,7 +210,7 @@ void ChttpGet::PrepSocket(char *URL) { m_State = HTTP_STATE_SOCKET_ERROR; return; } - unsigned int arg = 1; + uint32_t arg = 1; #ifdef WIN32 u_long argWin = static_cast(arg); @@ -314,9 +314,9 @@ ChttpGet::~ChttpGet() { int ChttpGet::GetStatus() { return m_State; } -unsigned int ChttpGet::GetBytesIn() { return m_iBytesIn; } +uint32_t ChttpGet::GetBytesIn() { return m_iBytesIn; } -unsigned int ChttpGet::GetTotalBytes() { return m_iBytesTotal; } +uint32_t ChttpGet::GetTotalBytes() { return m_iBytesTotal; } void ChttpGet::WorkerThread() { char szCommand[1000]; @@ -432,7 +432,7 @@ void ChttpGet::WorkerThread() { int ChttpGet::ConnectSocket() { // HOSTENT *he; - unsigned int ip; + uint32_t ip; SERVENT *se; SOCKADDR_IN hostaddr; @@ -541,9 +541,9 @@ int ChttpGet::ConnectSocket() { } char *ChttpGet::GetHTTPLine() { - unsigned int iBytesRead; + uint32_t iBytesRead; char chunk[2]; - unsigned int igotcrlf = 0; + uint32_t igotcrlf = 0; memset(recv_buffer, 0, 1000); do { chunk[0] = '\0'; @@ -601,7 +601,7 @@ char *ChttpGet::GetHTTPLine() { return recv_buffer; } -unsigned int ChttpGet::ReadDataChannel() { +uint32_t ChttpGet::ReadDataChannel() { char sDataBuffer[4096]; // Data-storage buffer for the data channel int nBytesRecv = 0; // Bytes received from the data channel @@ -670,7 +670,7 @@ unsigned int ChttpGet::ReadDataChannel() { } typedef struct _async_dns_lookup { - unsigned int ip; // resolved host. Write only to worker thread. + uint32_t ip; // resolved host. Write only to worker thread. char *host; // host name to resolve. read only to worker thread bool done; // write only to the worker thread. Signals that the operation is complete bool error; // write only to worker thread. Thread sets this if the name doesn't resolve @@ -684,7 +684,7 @@ typedef struct _async_dns_lookup { static async_dns_lookup httpaslu; static async_dns_lookup *http_lastaslu = NULL; -int http_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { +int http_Asyncgethostbyname(uint32_t *ip, int command, char *hostname) { if (command == NW_AGHBN_LOOKUP) { if (http_lastaslu) @@ -692,7 +692,7 @@ int http_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { async_dns_lookup *newaslu; newaslu = (async_dns_lookup *)mem_malloc(sizeof(async_dns_lookup)); - memset(&newaslu->ip, 0, sizeof(unsigned int)); + memset(&newaslu->ip, 0, sizeof(uint32_t)); newaslu->host = hostname; newaslu->done = false; newaslu->error = false; @@ -731,7 +731,7 @@ int http_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { #endif http_lastaslu = NULL; - memcpy(ip, &httpaslu.ip, sizeof(unsigned int)); + memcpy(ip, &httpaslu.ip, sizeof(uint32_t)); return 1; } else if (httpaslu.error) { #ifdef __LINUX__ @@ -767,7 +767,7 @@ int http_gethostbynameworker(void *parm) return; #endif } else if (!lookup->abort) { - memcpy(&lookup->ip, he->h_addr_list[0], sizeof(unsigned int)); + memcpy(&lookup->ip, he->h_addr_list[0], sizeof(uint32_t)); lookup->done = true; memcpy(&httpaslu, lookup, sizeof(async_dns_lookup)); } diff --git a/netcon/inetfile/lnxinetfile.cpp b/netcon/inetfile/lnxinetfile.cpp index 1f8b4562..452595de 100644 --- a/netcon/inetfile/lnxinetfile.cpp +++ b/netcon/inetfile/lnxinetfile.cpp @@ -47,26 +47,26 @@ void InetGetFile::AbortGet() {} CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) {} CFtpGet::~CFtpGet() {} int CFtpGet::GetStatus() { return 0; } -unsigned int CFtpGet::GetBytesIn() { return 0; } -unsigned int CFtpGet::GetTotalBytes() { return 0; } +uint32_t CFtpGet::GetBytesIn() { return 0; } +uint32_t CFtpGet::GetTotalBytes() { return 0; } void CFtpGet::AbortGet() {} void CFtpGet::WorkerThread() {} int CFtpGet::ConnectControlSocket() { return 0; } int CFtpGet::LoginHost() { return 0; } -unsigned int CFtpGet::SendFTPCommand(char *command) { return 0; } -unsigned int CFtpGet::ReadFTPServerReply() { return 0; } -unsigned int CFtpGet::GetFile() { return 0; } -unsigned int CFtpGet::IssuePort() { return 0; } -unsigned int CFtpGet::ReadDataChannel() { return 0; } +uint32_t CFtpGet::SendFTPCommand(char *command) { return 0; } +uint32_t CFtpGet::ReadFTPServerReply() { return 0; } +uint32_t CFtpGet::GetFile() { return 0; } +uint32_t CFtpGet::IssuePort() { return 0; } +uint32_t CFtpGet::ReadDataChannel() { return 0; } void CFtpGet::FlushControlChannel() {} ///////////////////////////////////////////////////////////////////// ChttpGet::ChttpGet(char *URL, char *localfile) {} ChttpGet::~ChttpGet() {} int ChttpGet::GetStatus() { return 0; } -unsigned int ChttpGet::GetBytesIn() { return 0; } -unsigned int GetTotalBytes() { return 0; } +uint32_t ChttpGet::GetBytesIn() { return 0; } +uint32_t GetTotalBytes() { return 0; } void AbortGet() {} void WorkerThread() {} int ConnectSocket() { return 0; } char *GetHTTPLine() { return "ERR"; } -unsigned int ReadDataChannel() { return 0; } +uint32_t ReadDataChannel() { return 0; } diff --git a/netcon/lanclient/lanclient.cpp b/netcon/lanclient/lanclient.cpp index f8d0aa95..8f798181 100644 --- a/netcon/lanclient/lanclient.cpp +++ b/netcon/lanclient/lanclient.cpp @@ -321,7 +321,7 @@ using namespace lanclient; #define JEFF_GREEN GR_RGB(40, 255, 40) #define NETPOLLINTERVAL 10.0 -extern int MTAVersionCheck(unsigned int oldver, char *URL); +extern int MTAVersionCheck(uint32_t oldver, char *URL); ///////////////////////////// // Defines @@ -619,7 +619,7 @@ int MainMultiplayerMenu() { // Scan a specific IP unsigned short iport = DEFAULT_GAME_PORT; looklocal = 0; - unsigned int iaddr; + uint32_t iaddr; lastgamesfound = 0; DLLEditGetText(edit_box, szdip, 25); // Make this IP the default @@ -693,7 +693,7 @@ int MainMultiplayerMenu() { // MTS: only used in this file void AutoLoginAndJoinGame(void) { unsigned short port; - unsigned int iaddr; + uint32_t iaddr; *DLLMultiGameStarting = 0; @@ -711,7 +711,7 @@ void AutoLoginAndJoinGame(void) { network_address s_address; iaddr = inet_addr(DLLAuto_login_addr); - memcpy(&s_address.address, &iaddr, sizeof(unsigned int)); + memcpy(&s_address.address, &iaddr, sizeof(uint32_t)); s_address.port = port; s_address.connection_type = NP_TCP; *DLLGame_is_master_tracker_game = 0; diff --git a/netgames/dmfc/dmfcbase.cpp b/netgames/dmfc/dmfcbase.cpp index 7f5c73f0..751d7a8d 100644 --- a/netgames/dmfc/dmfcbase.cpp +++ b/netgames/dmfc/dmfcbase.cpp @@ -2828,7 +2828,7 @@ bool DMFCBase::IsAddressBanned(network_address *addr, const char *tracker_id) { return false; } - unsigned int address; + uint32_t address; tHostsNode *curr; memcpy(&address, &addr->address, 4); @@ -4279,8 +4279,8 @@ void ParseHostsFile(char *filename, tHostsNode **root) { char save_buffer[256]; char s_ip[16], s_mask[16]; - unsigned int ip_address; - unsigned int mask; + uint32_t ip_address; + uint32_t mask; char *ptr; while (!DLLcfeof(file)) { diff --git a/netgames/dmfc/dmfcfunctions.cpp b/netgames/dmfc/dmfcfunctions.cpp index 59973143..c8ad19e7 100644 --- a/netgames/dmfc/dmfcfunctions.cpp +++ b/netgames/dmfc/dmfcfunctions.cpp @@ -236,7 +236,7 @@ DMFCFUNCTION int (*DLLFindTextureName)(const char *name); DMFCFUNCTION bool (*DLLApplyDamageToPlayer)(object *playerobj, object *killer, int damage_type, float damage_amount, int server_says, int weapon_id, bool playsound); DMFCFUNCTION int (*DLLMultiMatchGeneric)(uint unique_id); -DMFCFUNCTION void (*DLLSetUITextItemText)(void *uit, char *newtext, unsigned int color); +DMFCFUNCTION void (*DLLSetUITextItemText)(void *uit, char *newtext, uint32_t color); DMFCFUNCTION void *(*DLLNewUIWindowCreate)(int x, int y, int w, int h, int flags); DMFCFUNCTION void (*DLLNewUIWindowDestroy)(void *deswin); DMFCFUNCTION void (*DLLNewUIWindowOpen)(void *deswin); @@ -266,7 +266,7 @@ DMFCFUNCTION void *(*DLLHotSpotCreate)(void *parentwin, int id, int key, void *t int y, int w, int h, int flags); DMFCFUNCTION int (*DLLPollUI)(void); DMFCFUNCTION void (*DLLRemoveUITextItem)(void *item); -DMFCFUNCTION void *(*DLLCreateNewUITextItem)(const char *newtext, unsigned int color, int font); +DMFCFUNCTION void *(*DLLCreateNewUITextItem)(const char *newtext, uint32_t color, int font); DMFCFUNCTION void (*DLLRemoveUIBmpItem)(void *item); DMFCFUNCTION void *(*DLLCreateNewUIBmpItem)(int handle, ubyte alpha); DMFCFUNCTION void *(*DLLUIConsoleGadgetCreate)(void *parentid, int id, int x, int y, int font, int cols, int rows, @@ -329,7 +329,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 int (*DLLnw_GetHostAddressFromNumbers)(char *str); +DMFCFUNCTION uint32_t (*DLLnw_GetHostAddressFromNumbers)(char *str); DMFCFUNCTION void (*TableFilesClear)(void); DMFCFUNCTION bool (*TableFileAdd)(char *filename); DMFCFUNCTION void (*DLLDebugBreak_callback_stop)(void); diff --git a/netgames/dmfc/dmfcinternal.h b/netgames/dmfc/dmfcinternal.h index 92fb78f3..3db19741 100644 --- a/netgames/dmfc/dmfcinternal.h +++ b/netgames/dmfc/dmfcinternal.h @@ -569,8 +569,8 @@ protected: }; typedef struct tHostsNode { - unsigned int ip; - unsigned int mask; + uint32_t ip; + uint32_t mask; tHostsNode *next; } tHostsNode; // Allow/Deny IP address nodes diff --git a/netgames/dmfc/dmfcremote.cpp b/netgames/dmfc/dmfcremote.cpp index 4b09d862..9adafa9d 100644 --- a/netgames/dmfc/dmfcremote.cpp +++ b/netgames/dmfc/dmfcremote.cpp @@ -105,7 +105,7 @@ int FilterNonRemoteCommands(char *command); // Initializes the remote administration system void Remote_Initialize(void) { // initialize encryption keys - srand((unsigned int)time(0)); + srand((uint32_t)time(0)); int i, j; for (i = 0; i < MAX_PLAYER_RECORDS; i++) { diff --git a/netgames/dmfc/encryption.cpp b/netgames/dmfc/encryption.cpp index 73ca2065..2188efcf 100644 --- a/netgames/dmfc/encryption.cpp +++ b/netgames/dmfc/encryption.cpp @@ -39,11 +39,11 @@ class IceSubkey { public: - unsigned int val[3]; + uint32_t val[3]; }; // the S-boxes -static unsigned int ice_sbox[4][1024]; +static uint32_t ice_sbox[4][1024]; static int ice_sboxes_initialised = 0; // modulo values for the S-boxes @@ -55,7 +55,7 @@ static const int ice_sxor[4][4] = { {0x83, 0x85, 0x9b, 0xcd}, {0xcc, 0xa7, 0xad, 0x41}, {0x4b, 0x2e, 0xd4, 0x33}, {0xea, 0xcb, 0x2e, 0x04}}; // Permutation values for the P-box -static const unsigned int ice_pbox[32] = { +static const uint32_t ice_pbox[32] = { 0x00000001, 0x00000080, 0x00000400, 0x00002000, 0x00080000, 0x00200000, 0x01000000, 0x40000000, 0x00000008, 0x00000020, 0x00000100, 0x00004000, 0x00010000, 0x00800000, 0x04000000, 0x20000000, 0x00000004, 0x00000010, 0x00000200, 0x00008000, 0x00020000, 0x00400000, 0x08000000, 0x10000000, @@ -90,7 +90,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 int gf_exp7(uint b, uint m) { +static uint32_t gf_exp7(uint b, uint m) { uint x; if (b == 0) @@ -106,9 +106,9 @@ static unsigned int gf_exp7(uint b, uint m) { // // Carry out the ICE 32-bit P-box permutation. // -static unsigned int ice_perm32(unsigned int x) { - unsigned int res = 0; - const unsigned int *pbox = ice_pbox; +static uint32_t ice_perm32(uint32_t x) { + uint32_t res = 0; + const uint32_t *pbox = ice_pbox; while (x) { if (x & 1) @@ -130,7 +130,7 @@ static void ice_sboxes_init(void) { for (i = 0; i < 1024; i++) { int col = (i >> 1) & 0xff; int row = (i & 0x1) | ((i & 0x200) >> 8); - unsigned int x; + uint32_t x; x = gf_exp7(col ^ ice_sxor[0][row], ice_smod[0][row]) << 24; ice_sbox[0][i] = ice_perm32(x); @@ -186,9 +186,9 @@ IceKey::~IceKey() { // // The single round ICE f function. // -static unsigned int ice_f(unsigned int p, const IceSubkey *sk) { - unsigned int tl, tr; /* Expanded 40-bit values */ - unsigned int al, ar; /* Salted expanded 40-bit values */ +static uint32_t ice_f(uint32_t p, const IceSubkey *sk) { + uint32_t tl, tr; /* Expanded 40-bit values */ + uint32_t al, ar; /* Salted expanded 40-bit values */ // Left half expansion tl = ((p >> 16) & 0x3ff) | (((p >> 14) | (p << 18)) & 0xffc00); @@ -213,12 +213,12 @@ static unsigned int ice_f(unsigned int p, const IceSubkey *sk) { // void IceKey::encrypt(const ubyte *ptext, ubyte *ctext) const { int i; - unsigned int l, r; + uint32_t l, r; - l = (((unsigned int)ptext[0]) << 24) | (((unsigned int)ptext[1]) << 16) | (((unsigned int)ptext[2]) << 8) | + l = (((uint32_t)ptext[0]) << 24) | (((uint32_t)ptext[1]) << 16) | (((uint32_t)ptext[2]) << 8) | ptext[3]; - r = (((unsigned int)ptext[4]) << 24) | (((unsigned int)ptext[5]) << 16) | (((unsigned int)ptext[6]) << 8) | + r = (((uint32_t)ptext[4]) << 24) | (((uint32_t)ptext[5]) << 16) | (((uint32_t)ptext[6]) << 8) | ptext[7]; for (i = 0; i < _rounds; i += 2) { @@ -240,11 +240,11 @@ void IceKey::encrypt(const ubyte *ptext, ubyte *ctext) const { // void IceKey::decrypt(const ubyte *ctext, ubyte *ptext) const { int i; - unsigned int l, r; + uint32_t l, r; - l = (((unsigned int)ctext[0]) << 24) | (((unsigned int)ctext[1]) << 16) | (((unsigned int)ctext[2]) << 8) | + l = (((uint32_t)ctext[0]) << 24) | (((uint32_t)ctext[1]) << 16) | (((uint32_t)ctext[2]) << 8) | ctext[3]; - r = (((unsigned int)ctext[4]) << 24) | (((unsigned int)ctext[5]) << 16) | (((unsigned int)ctext[6]) << 8) | + r = (((uint32_t)ctext[4]) << 24) | (((uint32_t)ctext[5]) << 16) | (((uint32_t)ctext[6]) << 8) | ctext[7]; for (i = _rounds - 1; i > 0; i -= 2) { @@ -277,7 +277,7 @@ void IceKey::scheduleBuild(unsigned short *kb, int n, const int *keyrot) { for (j = 0; j < 15; j++) { int k; - unsigned int *curr_sk = &isk->val[j % 3]; + uint32_t *curr_sk = &isk->val[j % 3]; for (k = 0; k < 4; k++) { ushort *curr_kb = &kb[(kr + k) & 3]; diff --git a/netgames/includes/gamedll_header.h b/netgames/includes/gamedll_header.h index 5d2e81bc..313e8182 100644 --- a/netgames/includes/gamedll_header.h +++ b/netgames/includes/gamedll_header.h @@ -614,7 +614,7 @@ DMFCDLLOUT(ApplyDamageToPlayer_fp DLLApplyDamageToPlayer;) typedef int (*MultiMatchGeneric_fp)(uint unique_id); DMFCDLLOUT(MultiMatchGeneric_fp DLLMultiMatchGeneric;) -typedef void (*SetUITextItemText_fp)(void *uit, char *newtext, unsigned int color); +typedef void (*SetUITextItemText_fp)(void *uit, char *newtext, uint32_t color); DMFCDLLOUT(SetUITextItemText_fp DLLSetUITextItemText;) typedef void *(*NewUIWindowCreate_fp)(int x, int y, int w, int h, int flags); @@ -724,8 +724,8 @@ DMFCDLLOUT(PollUI_fp DLLPollUI;) typedef void (*RemoveUITextItem_fp)(void *item); DMFCDLLOUT(RemoveUITextItem_fp DLLRemoveUITextItem;) -// typedef void *(*CreateNewUITextItem_fp)(const char *newtext,unsigned int color,int font=-1); -typedef void *(*CreateNewUITextItem_fp)(const char *newtext, unsigned int color, int font); +// typedef void *(*CreateNewUITextItem_fp)(const char *newtext,uint32_t color,int font=-1); +typedef void *(*CreateNewUITextItem_fp)(const char *newtext, uint32_t color, int font); DMFCDLLOUT(CreateNewUITextItem_fp DLLCreateNewUITextItem;) typedef void (*RemoveUIBmpItem_fp)(void *item); @@ -926,7 +926,7 @@ DMFCDLLOUT(InitPlayerNewShip_fp DLLInitPlayerNewShip;) // Returns internet address format from string address format...ie "204.243.217.14" // turns into 1414829242 -typedef unsigned int (*nw_GetHostAddressFromNumbers_fp)(char *str); +typedef uint32_t (*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/networking/networking.cpp b/networking/networking.cpp index baed973a..06407a13 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -480,7 +480,7 @@ static SOCKET Reliable_UDP_socket = INVALID_SOCKET; static float first_sent_iamhere = 0; static float last_sent_iamhere = 0; -static unsigned int serverconn = 0xFFFFFFFF; +static uint32_t serverconn = 0xFFFFFFFF; #ifdef WIN32 #pragma pack(pop, r_udp) @@ -496,7 +496,7 @@ typedef struct { float last_packet_received; // For a given connection, this is the last packet we received float last_packet_sent; float pings[MAX_PING_HISTORY]; - unsigned int num_ping_samples; + uint32_t num_ping_samples; float mean_ping; float last_sent; // The last time we sent a packet (used for NAGLE emulation) int waiting_packet_number; // Which packet has data in it that is waiting for the interval to send @@ -754,7 +754,7 @@ void nw_InitSockets(ushort port) { memset(&sock_addr, 0, sizeof(SOCKADDR_IN)); sock_addr.sin_family = AF_INET; - unsigned int my_ip; + uint32_t my_ip; my_ip = nw_GetThisIP(); @@ -774,10 +774,10 @@ void nw_InitSockets(ushort port) { tcp_done: int ret; - unsigned int isocktrue = 1; + uint32_t isocktrue = 1; setsockopt(TCP_socket, SOL_SOCKET, SO_REUSEADDR, (LPSTR)&isocktrue, sizeof(isocktrue)); - ret = setsockopt(TCP_socket, SOL_SOCKET, SO_BROADCAST, (LPSTR)&isocktrue, sizeof(unsigned int)); + ret = setsockopt(TCP_socket, SOL_SOCKET, SO_BROADCAST, (LPSTR)&isocktrue, sizeof(uint32_t)); if (ret == SOCKET_ERROR) { int wserr; wserr = WSAGetLastError(); @@ -856,7 +856,7 @@ void nw_GetNumbersFromHostAddress(network_address *address, char *str) { #define CLOSE_TIMEOUT_TIME 3 // 3 seconds // returns the ip address of this computer -unsigned int nw_GetThisIP() { +uint32_t nw_GetThisIP() { SOCKADDR_IN local_address; int address_size = sizeof(SOCKADDR); @@ -893,7 +893,7 @@ unsigned int nw_GetThisIP() { // Calculates a unique ushort checksum for a stream of data ushort nw_CalculateChecksum(void *vptr, int len) { ubyte *ptr = (ubyte *)vptr; - unsigned int sum1, sum2; + uint32_t sum1, sum2; sum1 = sum2 = 0; @@ -1076,7 +1076,7 @@ int nw_CheckListenSocket(network_address *from_addr) { return INVALID_SOCKET; } -int nw_SendReliable(unsigned int socketid, ubyte *data, int length, bool urgent) { +int nw_SendReliable(uint32_t socketid, ubyte *data, int length, bool urgent) { int i; int bytesout; int use_buffer = -1; @@ -1214,15 +1214,15 @@ int nw_InitReliableSocket() { return 1; } // MTS: only used in this file -void nw_SendReliableAck(SOCKADDR *raddr, unsigned int sig, network_protocol link_type, float time_sent) { +void nw_SendReliableAck(SOCKADDR *raddr, uint32_t sig, network_protocol link_type, float time_sent) { int ret; reliable_header ack_header; ack_header.type = RNT_ACK; // mprintf((0,"Sending ACK for sig %d.\n",sig)); - ack_header.data_len = INTEL_SHORT((short)sizeof(unsigned int)); + ack_header.data_len = INTEL_SHORT((short)sizeof(uint32_t)); ack_header.send_time = INTEL_FLOAT(time_sent); sig = INTEL_INT(sig); - memcpy(&ack_header.data, &sig, sizeof(unsigned int)); + memcpy(&ack_header.data, &sig, sizeof(uint32_t)); network_address send_address; memset(&send_address, 0, sizeof(network_address)); @@ -1236,7 +1236,7 @@ void nw_SendReliableAck(SOCKADDR *raddr, unsigned int sig, network_protocol link send_address.connection_type = NP_TCP; } - ret = nw_SendWithID(NWT_RELIABLE, (ubyte *)&ack_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + sizeof(unsigned int), + ret = nw_SendWithID(NWT_RELIABLE, (ubyte *)&ack_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + sizeof(uint32_t), &send_address); } @@ -1257,7 +1257,7 @@ void nw_WorkReliable(ubyte *data, int len, network_address *naddr) { static SOCKADDR rcv_addr; int bytesin = 0; int addrlen = sizeof(SOCKADDR); - unsigned int rcvid; // The id of who we actually received a packet from, as opposed to socketid parm + uint32_t rcvid; // The id of who we actually received a packet from, as opposed to socketid parm if (NP_TCP == naddr->connection_type) { SOCKADDR_IN *inaddr = (SOCKADDR_IN *)&rcv_addr; @@ -1433,7 +1433,7 @@ void nw_WorkReliable(ubyte *data, int len, network_address *naddr) { rsocket->ping_pos = 0; } for (i = 0; i < MAXNETBUFFERS; i++) { - unsigned int *acksig = (unsigned int *)&rcv_buff.data; + uint32_t *acksig = (uint32_t *)&rcv_buff.data; *acksig = INTEL_INT(*acksig); if (rsocket) if (rsocket->sbuffers[i]) @@ -1955,7 +1955,7 @@ int nw_psnet_buffer_get_next(ubyte *data, int *length, network_address *from) { #ifdef WIN32 // MTS: only used in this file // functions to get the status of a RAS connection -unsigned int psnet_ras_status() { +uint32_t psnet_ras_status() { int rval; DWORD size, num_connections, i; RASCONN rasbuffer[25]; @@ -2108,7 +2108,7 @@ void nw_LoadThreadLibrary(void) { void CDECLCALL gethostbynameworker(void *parm); #endif -int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { +int nw_Asyncgethostbyname(uint32_t *ip, int command, char *hostname) { if (command == NW_AGHBN_LOOKUP) { if (lastaslu) { @@ -2126,7 +2126,7 @@ int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { #if (!defined(__LINUX__)) async_dns_lookup *newaslu; newaslu = (async_dns_lookup *)mem_malloc(sizeof(async_dns_lookup)); - memset(&newaslu->ip, 0, sizeof(unsigned int)); + memset(&newaslu->ip, 0, sizeof(uint32_t)); newaslu->host = hostname; newaslu->done = false; newaslu->error = false; @@ -2134,7 +2134,7 @@ int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { lastaslu = newaslu; aslu.done = false; #else - memset(&aslu.ip, 0, sizeof(unsigned int)); + memset(&aslu.ip, 0, sizeof(uint32_t)); aslu.host = hostname; aslu.done = false; aslu.error = false; @@ -2159,7 +2159,7 @@ int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { } else { - memcpy(&lastaslu->ip,he->h_addr_list[0],sizeof(unsigned int)); + memcpy(&lastaslu->ip,he->h_addr_list[0],sizeof(uint32_t)); lastaslu->done = true; memcpy(&aslu,lastaslu,sizeof(async_dns_lookup)); } @@ -2177,7 +2177,7 @@ int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { if (he == NULL) { lastaslu->error = true; } else { - memcpy(&lastaslu->ip, he->h_addr_list[0], sizeof(unsigned int)); + memcpy(&lastaslu->ip, he->h_addr_list[0], sizeof(uint32_t)); lastaslu->done = true; memcpy(&aslu, lastaslu, sizeof(async_dns_lookup)); } @@ -2203,7 +2203,7 @@ int nw_Asyncgethostbyname(unsigned int *ip, int command, char *hostname) { #endif lastaslu = NULL; - memcpy(ip, &aslu.ip, sizeof(unsigned int)); + memcpy(ip, &aslu.ip, sizeof(uint32_t)); return 1; } else if (aslu.error) { // rcg06212000 join the thread. @@ -2247,7 +2247,7 @@ void CDECLCALL gethostbynameworker(void *parm) return; #endif } else if (!lookup->abort) { - memcpy(&lookup->ip, he->h_addr_list[0], sizeof(unsigned int)); + memcpy(&lookup->ip, he->h_addr_list[0], sizeof(uint32_t)); mprintf((0, "IPLOOKUP: [%s] is %d.%d.%d.%d ...", lookup->host, (lookup->ip & 0x000000FF), (lookup->ip & 0x0000FF00) >> 8, (lookup->ip & 0x00FF0000) >> 16, (lookup->ip & 0xFF000000) >> 24)); // memcpy(&aslu,lookup,sizeof(async_dns_lookup)); diff --git a/rtperformance/rtperformance.cpp b/rtperformance/rtperformance.cpp index 3f113a15..dd95c88e 100644 --- a/rtperformance/rtperformance.cpp +++ b/rtperformance/rtperformance.cpp @@ -82,7 +82,7 @@ float rtp_startlog_time; INT64 Runtime_performance_flags = RTI_FRAMETIME; INT64 Runtime_performance_clockfreq = 0; INT64 Runtime_performance_frame_counter = 0; -unsigned int Runtime_performance_counter = 0; +uint32_t Runtime_performance_counter = 0; unsigned char Runtime_performance_enabled = 0; tRTFrameInfo RTP_SingleFrame; @@ -98,8 +98,8 @@ void rtp_WriteBufferLog(void) { #ifdef USE_RTP Runtime_performance_enabled = 1; // make sure it's enabled for the macros // determine how many frames to write out - unsigned int Num_frames; - unsigned int counter; + uint32_t Num_frames; + uint32_t counter; char buffer[4096]; Num_frames = std::min(Runtime_performance_counter, MAX_RTP_SAMPLES); diff --git a/scripts/lnx/osiris_common.h b/scripts/lnx/osiris_common.h index 93653deb..1be0404a 100644 --- a/scripts/lnx/osiris_common.h +++ b/scripts/lnx/osiris_common.h @@ -930,8 +930,8 @@ typedef int OMMSHANDLE; typedef unsigned char ubyte; typedef signed char sbyte; typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned int ddgr_color; +typedef uint32_t uint; +typedef uint32_t ddgr_color; #ifndef NULL #define NULL 0 @@ -1296,7 +1296,7 @@ typedef struct { int count; int flags; void *list; - unsigned int control_mask; + uint32_t control_mask; unsigned char control_val; // Object lighting stuff diff --git a/scripts/osiris_common.h b/scripts/osiris_common.h index 9a97b039..73ab4d5b 100644 --- a/scripts/osiris_common.h +++ b/scripts/osiris_common.h @@ -931,8 +931,8 @@ typedef int OMMSHANDLE; typedef unsigned char ubyte; typedef signed char sbyte; typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned int ddgr_color; +typedef uint32_t uint; +typedef uint32_t ddgr_color; #ifndef NULL #define NULL 0 diff --git a/sndlib/eax.h b/sndlib/eax.h index d7fe450e..6c415881 100644 --- a/sndlib/eax.h +++ b/sndlib/eax.h @@ -42,7 +42,7 @@ typedef enum { // use this structure for get/set all properties... typedef struct { - unsigned int environment; // 0 to EAX_ENVIRONMENT_COUNT-1 + uint32_t environment; // 0 to EAX_ENVIRONMENT_COUNT-1 float fVolume; // 0 to 1 float fDecayTime_sec; // seconds, 0.1 to 100 float fDamping; // 0 to 1 diff --git a/sndlib/hlsoundlib.h b/sndlib/hlsoundlib.h index f2585bda..488b9812 100644 --- a/sndlib/hlsoundlib.h +++ b/sndlib/hlsoundlib.h @@ -225,7 +225,7 @@ public: sound_object() { m_obj_type_flags = SIF_UNUSED; } public: - unsigned int m_obj_type_flags; + uint32_t m_obj_type_flags; int m_sound_uid; int m_sound_index; int m_hlsound_uid; diff --git a/sndlib/sdlsound.cpp b/sndlib/sdlsound.cpp index 44f95ca0..6aeb3d33 100644 --- a/sndlib/sdlsound.cpp +++ b/sndlib/sdlsound.cpp @@ -118,8 +118,8 @@ int lnxsound::InitSoundLib(char mixer_type, oeApplication *sos, unsigned char ma return true; } -bool lnxsound::GetDeviceSettings(SDL_AudioDeviceID *device, unsigned int *freq, unsigned int *bit_depth, - unsigned int *channels) const { +bool lnxsound::GetDeviceSettings(SDL_AudioDeviceID *device, uint32_t *freq, uint32_t *bit_depth, + uint32_t *channels) const { if (sound_device == 0) return false; diff --git a/sndlib/sdlsound.h b/sndlib/sdlsound.h index 892681ab..a6cfca70 100644 --- a/sndlib/sdlsound.h +++ b/sndlib/sdlsound.h @@ -117,8 +117,8 @@ public: // decay 0.1 to 100 seconds, how long it takes for a sound to die. bool SetGlobalReverbProperties(float volume, float damping, float decay) override; - bool GetDeviceSettings(SDL_AudioDeviceID *sound_device, unsigned int *freq, unsigned int *bit_depth, - unsigned int *channels) const; + bool GetDeviceSettings(SDL_AudioDeviceID *sound_device, uint32_t *freq, uint32_t *bit_depth, + uint32_t *channels) const; friend void lnxsound_SetError(int code); friend void lnxsound_ErrorText(const char *fmt, ...); diff --git a/sndlib/ssl_lib.h b/sndlib/ssl_lib.h index 4f4c0e2c..c39b9227 100644 --- a/sndlib/ssl_lib.h +++ b/sndlib/ssl_lib.h @@ -329,7 +329,7 @@ typedef struct sound_info { int loop_start; // Start byte of repeated loop for looping samples int loop_end; // End byte of repeating loop for looping samples - unsigned int flags; // 2d/3d, variable frequency + uint32_t flags; // 2d/3d, variable frequency float max_distance; // Maximum distance in which a sound is heard float min_distance; // Sound gets no louder at min_distance int inner_cone_angle; // Angle in which sound is played at full base volume diff --git a/stream_audio/streamaudio.cpp b/stream_audio/streamaudio.cpp index 4803844b..a51d4a18 100644 --- a/stream_audio/streamaudio.cpp +++ b/stream_audio/streamaudio.cpp @@ -445,10 +445,10 @@ bool AudioStream::ReopenDigitalStream(ubyte fbufidx, int nbufs) { } // instatiate decompression facility or use raw source data - unsigned int sample_count = 0; - unsigned int channels = 0; + uint32_t sample_count = 0; + uint32_t channels = 0; if (m_archive.StreamComp() == OSF_DIGIACM_STRM) { - unsigned int sample_rate; + uint32_t sample_rate; m_decoder = AudioDecoder::CreateDecoder(ADecodeFileRead, this, channels, sample_rate, sample_count); if (!m_decoder) { delete m_decoder; @@ -747,9 +747,9 @@ void AudioStream::Reset() { if (m_decoder) { delete m_decoder; - unsigned int channels; - unsigned int sample_rate; - unsigned int sample_count; + uint32_t channels; + uint32_t sample_rate; + uint32_t sample_count; m_decoder = AudioDecoder::CreateDecoder(ADecodeFileRead, this, channels, sample_rate, sample_count); } } diff --git a/stream_audio/streamaudio.h b/stream_audio/streamaudio.h index 125b9f6b..49ede15f 100644 --- a/stream_audio/streamaudio.h +++ b/stream_audio/streamaudio.h @@ -144,7 +144,7 @@ #include "TaskSystem.h" void *AudioStreamCB(void *user_data, int handle, int *size); -int ADecodeFileRead(void *data, void *buf, unsigned int qty); +int ADecodeFileRead(void *data, void *buf, uint32_t qty); int StreamPlay(const char *filename, float volume, int flags); void StreamStop(int handle); int StreamGetSoundHandle(int handle); @@ -270,7 +270,7 @@ class AudioStream { bool m_start_on_frame_looped; // the stream that will play on next frame is looped. private: friend void *AudioStreamCB(void *user_data, int handle, int *size); - friend int ADecodeFileRead(void *data, void *buf, unsigned int qty); + friend int ADecodeFileRead(void *data, void *buf, uint32_t qty); void *StreamCallback(int *size); // invoked by omsStreamCB. int ReadFileData(int buf, int len); // reads in decompressed raw data. int ReadFileDirect(char *buf, int len); // reads in decompressed raw data. diff --git a/unzip/unzip.cpp b/unzip/unzip.cpp index a235a3db..6166b14a 100644 --- a/unzip/unzip.cpp +++ b/unzip/unzip.cpp @@ -593,7 +593,7 @@ int ZIP::InflateFile(FILE *in_file, unsigned in_size, ubyte *out_data, unsigned int ZIP::InflateFileToFile(FILE *in_file, unsigned in_size, FILE *file, unsigned out_size) { ubyte out_data[DATA_CHUNK_SIZE]; int err; - unsigned int last_out; + uint32_t last_out; unsigned char *in_buffer; unsigned char *next_out; z_stream d_stream; diff --git a/win32/WinController.cpp b/win32/WinController.cpp index 9f9a2627..6fd38405 100644 --- a/win32/WinController.cpp +++ b/win32/WinController.cpp @@ -1473,7 +1473,7 @@ void gameWinController::mouse_geteval() { return; int x, y, dx, dy; - unsigned int btnmask = (unsigned int)ddio_MouseGetState(&x, &y, &dx, &dy); + uint32_t btnmask = (uint32_t)ddio_MouseGetState(&x, &y, &dx, &dy); m_MseState.m_deltaX = dx; m_MseState.m_deltaY = dy; diff --git a/win32/winapp.cpp b/win32/winapp.cpp index dc16d2d8..4657500f 100644 --- a/win32/winapp.cpp +++ b/win32/winapp.cpp @@ -653,7 +653,7 @@ LRESULT WINAPI MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { case WM_SYSCOMMAND: { // bypass screen saver and system menu. - unsigned int maskedWParam = wParam & 0xFFF0; + uint32_t maskedWParam = wParam & 0xFFF0; if (maskedWParam == SC_SCREENSAVE || maskedWParam == SC_MONITORPOWER) return 0; if (maskedWParam == SC_KEYMENU)