From 64eaae34457c2d9ef32936bfd52d85623ebb24ca Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 14 May 2016 15:56:53 +0200 Subject: Replaced 'unsigned int' with 'uint32' (guaranteed size) in all packed structs Signed-off-by: Haru --- src/map/clif.c | 2 +- src/map/packets_struct.h | 124 +++++++++++++++++++++++------------------------ 2 files changed, 63 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index 9b90b946e..259bc7253 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -12821,7 +12821,7 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) { //uint8 b; //uint8 g; //uint8 r; - unsigned int rgb:24; + uint32 rgb:24; } __attribute__((packed)); #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index a7a7d0463..8cc1ba029 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -324,7 +324,7 @@ struct NORMALITEM_INFO { #endif short count; #if PACKETVER >= 20120925 - unsigned int WearState; + uint32 WearState; #else uint16 WearState; #endif @@ -357,8 +357,8 @@ struct EQUIPITEM_INFO { uint8 IsIdentified; #endif #if PACKETVER >= 20120925 - unsigned int location; - unsigned int WearState; + uint32 location; + uint32 WearState; #else uint16 location; uint16 WearState; @@ -393,7 +393,7 @@ struct EQUIPITEM_INFO { struct packet_authok { short PacketType; - unsigned int startTime; + uint32 startTime; uint8 PosDir[3]; uint8 xSize; uint8 ySize; @@ -407,7 +407,7 @@ struct packet_authok { struct packet_monster_hp { short PacketType; - unsigned int GID; + uint32 GID; int HP; int MaxHP; } __attribute__((packed)); @@ -415,7 +415,7 @@ struct packet_monster_hp { struct packet_sc_notick { short PacketType; short index; - unsigned int AID; + uint32 AID; uint8 state; } __attribute__((packed)); @@ -429,7 +429,7 @@ struct packet_additem { uint8 refiningLevel; struct EQUIPSLOTINFO slot; #if PACKETVER >= 20120925 - unsigned int location; + uint32 location; #else uint16 location; #endif @@ -448,7 +448,7 @@ struct packet_additem { struct packet_dropflooritem { short PacketType; - unsigned int ITAID; + uint32 ITAID; uint16 ITID; #if PACKETVER >= 20130000 /* not sure date */ uint16 type; @@ -466,7 +466,7 @@ struct packet_idle_unit2 { #if PACKETVER >= 20071106 uint8 objecttype; #endif - unsigned int GID; + uint32 GID; short speed; short bodyState; short healthState; @@ -481,7 +481,7 @@ struct packet_idle_unit2 { short headpalette; short bodypalette; short headDir; - unsigned int GUID; + uint32 GUID; short GEmblemVer; short honor; short virtue; @@ -503,7 +503,7 @@ struct packet_spawn_unit2 { #if PACKETVER >= 20071106 uint8 objecttype; #endif - unsigned int GID; + uint32 GID; short speed; short bodyState; short healthState; @@ -535,9 +535,9 @@ struct packet_spawn_unit { uint8 objecttype; #endif #if PACKETVER >= 20131223 - unsigned int AID; + uint32 AID; #endif - unsigned int GID; + uint32 GID; short speed; short bodyState; short healthState; @@ -565,7 +565,7 @@ struct packet_spawn_unit { #if PACKETVER >= 20101124 short robe; #endif - unsigned int GUID; + uint32 GUID; short GEmblemVer; short honor; #if PACKETVER > 7 @@ -602,9 +602,9 @@ struct packet_unit_walking { uint8 objecttype; #endif #if PACKETVER >= 20131223 - unsigned int AID; + uint32 AID; #endif - unsigned int GID; + uint32 GID; short speed; short bodyState; short healthState; @@ -621,7 +621,7 @@ struct packet_unit_walking { int weapon; #endif short accessory; - unsigned int moveStartTime; + uint32 moveStartTime; #if PACKETVER < 7 short shield; #endif @@ -633,7 +633,7 @@ struct packet_unit_walking { #if PACKETVER >= 20101124 short robe; #endif - unsigned int GUID; + uint32 GUID; short GEmblemVer; short honor; #if PACKETVER > 7 @@ -668,9 +668,9 @@ struct packet_idle_unit { uint8 objecttype; #endif #if PACKETVER >= 20131223 - unsigned int AID; + uint32 AID; #endif - unsigned int GID; + uint32 GID; short speed; short bodyState; short healthState; @@ -698,7 +698,7 @@ struct packet_idle_unit { #if PACKETVER >= 20101124 short robe; #endif - unsigned int GUID; + uint32 GUID; short GEmblemVer; short honor; #if PACKETVER > 7 @@ -730,13 +730,13 @@ struct packet_idle_unit { struct packet_status_change { short PacketType; short index; - unsigned int AID; + uint32 AID; uint8 state; #if PACKETVER >= 20120618 - unsigned int Total; + uint32 Total; #endif #if PACKETVER >= 20090121 - unsigned int Left; + uint32 Left; int val1; int val2; int val3; @@ -746,16 +746,16 @@ struct packet_status_change { struct packet_status_change_end { short PacketType; short index; - unsigned int AID; + uint32 AID; uint8 state; } __attribute__((packed)); struct packet_status_change2 { short PacketType; short index; - unsigned int AID; + uint32 AID; uint8 state; - unsigned int Left; + uint32 Left; int val1; int val2; int val3; @@ -765,18 +765,18 @@ struct packet_maptypeproperty2 { short PacketType; short type; struct { - unsigned int party : 1; // Show attack cursor on non-party members (PvP) - unsigned int guild : 1; // Show attack cursor on non-guild members (GvG) - unsigned int siege : 1; // Show emblem over characters' heads when in GvG (WoE castle) - unsigned int mineffect : 1; // Automatically enable /mineffect - unsigned int nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members) - unsigned int countpk : 1; /// Show the PvP counter - unsigned int nopartyformation : 1; /// Prevent party creation/modification - unsigned int bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect - unsigned int nocostume : 1; /// Does not show costume sprite. - unsigned int usecart : 1; /// Allow opening cart inventory - unsigned int summonstarmiracle : 1; // TODO: What does this do? Related to Taekwon Masters, but I have no idea. - unsigned int SpareBits : 15; /// Currently ignored, reserved for future updates + uint32 party : 1; // Show attack cursor on non-party members (PvP) + uint32 guild : 1; // Show attack cursor on non-guild members (GvG) + uint32 siege : 1; // Show emblem over characters' heads when in GvG (WoE castle) + uint32 mineffect : 1; // Automatically enable /mineffect + uint32 nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members) + uint32 countpk : 1; /// Show the PvP counter + uint32 nopartyformation : 1; /// Prevent party creation/modification + uint32 bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect + uint32 nocostume : 1; /// Does not show costume sprite. + uint32 usecart : 1; /// Allow opening cart inventory + uint32 summonstarmiracle : 1; // TODO: What does this do? Related to Taekwon Masters, but I have no idea. + uint32 SpareBits : 15; /// Currently ignored, reserved for future updates } flag; } __attribute__((packed)); @@ -835,7 +835,7 @@ struct packet_bgqueue_battlebegins { struct packet_script_clear { short PacketType; - unsigned int NpcID; + uint32 NpcID; } __attribute__((packed)); /* made possible thanks to Yommy!! */ @@ -875,13 +875,13 @@ struct packet_banking_check { struct packet_banking_deposit_req { short PacketType; - unsigned int AID; + uint32 AID; int Money; } __attribute__((packed)); struct packet_banking_withdraw_req { short PacketType; - unsigned int AID; + uint32 AID; int Money; } __attribute__((packed)); @@ -915,7 +915,7 @@ struct packet_roulette_open_ack { struct packet_roulette_info_ack { short PacketType; short PacketLength; - unsigned int RouletteSerial; + uint32 RouletteSerial; struct { uint16 Row; uint16 Position; @@ -985,7 +985,7 @@ struct packet_equip_item { short PacketType; uint16 index; #if PACKETVER >= 20120925 - unsigned int wearLocation; + uint32 wearLocation; #else uint16 wearLocation; #endif @@ -995,7 +995,7 @@ struct packet_equipitem_ack { short PacketType; uint16 index; #if PACKETVER >= 20120925 - unsigned int wearLocation; + uint32 wearLocation; #else uint16 wearLocation; #endif @@ -1009,7 +1009,7 @@ struct packet_unequipitem_ack { short PacketType; uint16 index; #if PACKETVER >= 20120925 - unsigned int wearLocation; + uint32 wearLocation; #else uint16 wearLocation; #endif @@ -1044,8 +1044,8 @@ struct packet_skill_entry { #if PACKETVER >= 20110718 short PacketLength; #endif - unsigned int AID; - unsigned int creatorAID; + uint32 AID; + uint32 creatorAID; short xPos; short yPos; #if PACKETVER >= 20121212 @@ -1064,8 +1064,8 @@ struct packet_skill_entry { struct packet_graffiti_entry { short PacketType; - unsigned int AID; - unsigned int creatorAID; + uint32 AID; + uint32 creatorAID; short xPos; short yPos; uint8 job; @@ -1076,9 +1076,9 @@ struct packet_graffiti_entry { struct packet_damage { short PacketType; - unsigned int GID; - unsigned int targetGID; - unsigned int startTime; + uint32 GID; + uint32 targetGID; + uint32 startTime; int attackMT; int attackedMT; #if PACKETVER < 20071113 @@ -1123,7 +1123,7 @@ struct packet_npc_market_result_ack { struct { uint16 ITID; uint16 qty; - unsigned int price; + uint32 price; } list[MAX_INVENTORY];/* assuming MAX_INVENTORY is max since you can't hold more than MAX_INVENTORY items thus cant buy that many at once. */ } __attribute__((packed)); @@ -1134,8 +1134,8 @@ struct packet_npc_market_open { struct { uint16 nameid; uint8 type; - unsigned int price; - unsigned int qty; + uint32 price; + uint32 qty; uint16 view; // It seems that the client doesn't have any hard-coded limit for this list // it's possible to send up to 1890 items without dropping a packet that's @@ -1147,15 +1147,15 @@ struct packet_wis_end { short PacketType; char result; #if PACKETVER >= 20131223 - unsigned int unknown;/* maybe AID, not sure what for (works sending as 0) */ + uint32 unknown;/* maybe AID, not sure what for (works sending as 0) */ #endif } __attribute__((packed)); struct packet_party_leader_changed { short PacketType; - unsigned int prev_leader_aid; - unsigned int new_leader_aid; + uint32 prev_leader_aid; + uint32 new_leader_aid; } __attribute__((packed)); struct packet_hotkey { @@ -1165,9 +1165,9 @@ struct packet_hotkey { char Rotate; #endif struct { - char isSkill; // 0: Item, 1:Skill - unsigned int ID; // Item/Skill ID - short count; // Item Quantity/Skill Level + char isSkill; // 0: Item, 1:Skill + uint32 ID; // Item/Skill ID + short count; // Item Quantity/Skill Level } hotkey[MAX_HOTKEYS]; #else // not HOTKEY_SAVING UNAVAILABLE_STRUCT; -- cgit v1.2.3-60-g2f50