Browse Source

Follow up to f870478

Thanks to @munkrej
Lemongrass3110 3 months ago
parent
commit
fbf0542768

+ 1 - 1
src/common/mmo.hpp

@@ -801,7 +801,7 @@ struct guild_castle {
 		unsigned visible : 1;
 		int32 id; // object id
 	} guardian[MAX_GUARDIANS];
-	int* temp_guardians; // ids of temporary guardians (mobs)
+	int32* temp_guardians; // ids of temporary guardians (mobs)
 	int32 temp_guardians_max;
 };
 

+ 1 - 1
src/common/socket.cpp

@@ -126,7 +126,7 @@ int32 sock2newfd(SOCKET s)
 	return fd;
 }
 
-int32 sAccept(int32 fd, struct sockaddr* addr, int* addrlen)
+int32 sAccept(int32 fd, struct sockaddr* addr, int32* addrlen)
 {
 	SOCKET s;
 

+ 2 - 2
src/common/timer.cpp

@@ -30,7 +30,7 @@ static int32 timer_data_max = 0;
 static int32 timer_data_num = 0;
 
 // free timers (array)
-static int* free_timer_list = nullptr;
+static int32* free_timer_list = nullptr;
 static int32 free_timer_list_max = 0;
 static int32 free_timer_list_pos = 0;
 
@@ -434,7 +434,7 @@ const char* timestamp2string(char* str, size_t size, time_t timestamp, const cha
 /*
  * Split given timein into year, month, day, hour, minute, second
  */
-void split_time(int32 timein, int* year, int* month, int* day, int* hour, int* minute, int32 *second) {
+void split_time(int32 timein, int32* year, int32* month, int32* day, int32* hour, int32* minute, int32 *second) {
 	const int32 factor_min = 60;
 	const int32 factor_hour = factor_min*60;
 	const int32 factor_day = factor_hour*24;

+ 1 - 1
src/common/timer.hpp

@@ -65,7 +65,7 @@ unsigned long get_uptime(void);
 
 //transform a timestamp to string
 const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format);
-void split_time(int32 time, int* year, int* month, int* day, int* hour, int* minute, int* second);
+void split_time(int32 time, int32* year, int32* month, int32* day, int32* hour, int32* minute, int32* second);
 double solve_time(char* modif_p);
 
 t_tick do_timer(t_tick tick);

+ 1 - 1
src/map/atcommand.cpp

@@ -7494,7 +7494,7 @@ ACMD_FUNC(pettalk)
 		};
 		int32 i;
 		ARR_FIND( 0, ARRAYLENGTH(emo), i, stricmp(message, emo[i]) == 0 );
-		if( i == ET_DICE1 ) i = rnd_value<int>(ET_DICE1, ET_DICE6); // randomize /dice
+		if( i == ET_DICE1 ) i = rnd_value<int32>(ET_DICE1, ET_DICE6); // randomize /dice
 		if( i < ARRAYLENGTH(emo) )
 		{
 			if (sd->emotionlasttime + 1 >= time(nullptr)) { // not more than 1 per second

+ 4 - 4
src/map/battle.cpp

@@ -2601,14 +2601,14 @@ void battle_consume_ammo(map_session_data*sd, int32 skill, int32 lv)
 
 static int32 battle_range_type(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv)
 {
-	// [Akinari] , [Xynvaroth]: Traps are always int16 range.
+	// [Akinari] , [Xynvaroth]: Traps are always short range.
 	if (skill_get_inf2(skill_id, INF2_ISTRAP))
 		return BF_SHORT;
 
 	switch (skill_id) {
 		case AC_SHOWER:
 		case AM_DEMONSTRATION:
-			// When monsters use Arrow Shower or Bomb, it is always int16 range
+			// When monsters use Arrow Shower or Bomb, it is always short range
 			if (src->type == BL_MOB)
 				return BF_SHORT;
 			break;
@@ -7486,7 +7486,7 @@ void battle_do_reflect(int32 attack_type, struct Damage *wd, struct block_list*
 		auto * sce = tsc->getSCE(SC_MAXPAIN);
 		if (sce) {
 			sce->val2 = (int32)damage;
-			if (!tsc->getSCE(SC_KYOMU) && !(tsc->getSCE(SC_DARKCROW) && (wd->flag&BF_SHORT))) //SC_KYOMU invalidates reflecting ability. SC_DARKCROW also does, but only for int16 weapon attack.
+			if (!tsc->getSCE(SC_KYOMU) && !(tsc->getSCE(SC_DARKCROW) && (wd->flag&BF_SHORT))) //SC_KYOMU invalidates reflecting ability. SC_DARKCROW also does, but only for short weapon attack.
 				skill_castend_damage_id(target, src, NPC_MAXPAIN_ATK, sce->val1, tick, ((wd->flag & 1) ? wd->flag - 1 : wd->flag));
 		}
 		
@@ -11309,7 +11309,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int32 ran
  */
 static const struct _battle_data {
 	const char* str;
-	int* val;
+	int32* val;
 	int32 defval;
 	int32 min;
 	int32 max;

+ 1 - 1
src/map/duel.cpp

@@ -93,7 +93,7 @@ bool duel_check_player_limit(struct duel& pDuel)
 static int32 duel_showinfo_sub(map_session_data* sd, va_list va)
 {
 	map_session_data *ssd = va_arg(va, map_session_data*);
-	int32 *p = va_arg(va, int*);
+	int32 *p = va_arg(va, int32*);
 
 	if (sd->duel_group != ssd->duel_group) 
 		return 0;

+ 1 - 1
src/map/instance.cpp

@@ -29,7 +29,7 @@ using namespace rathena;
 
 /// Instance Idle Queue data
 struct s_instance_wait {
-	std::deque<int> id;
+	std::deque<int32> id;
 	int32 timer;
 } instance_wait;
 

+ 3 - 3
src/map/map.hpp

@@ -825,7 +825,7 @@ struct map_data {
 	uint32 zone; // zone number (for item/skill restrictions)
 	struct s_skill_damage damage_adjust; // Used for overall skill damage adjustment
 	std::unordered_map<uint16, s_skill_damage> skill_damage; // Used for single skill damage adjustment
-	std::unordered_map<uint16, int> skill_duration;
+	std::unordered_map<uint16, int32> skill_duration;
 
 	struct npc_data *npc[MAX_NPC_PER_MAP];
 	struct spawn_data *moblist[MAX_MOB_LIST_PER_MAP]; // [Wizputer]
@@ -839,7 +839,7 @@ struct map_data {
 	struct Channel *channel;
 
 	/* ShowEvent Data Cache */
-	std::vector<int> qi_npc;
+	std::vector<int32> qi_npc;
 
 	/* speeds up clif_updatestatus processing by causing hpmeter to run only when someone with the permission can view it */
 	uint16 hpmeter_visible;
@@ -857,7 +857,7 @@ struct map_data {
 	void copyFlags(const map_data& other);
 
 private:
-	std::vector<int> flags;
+	std::vector<int32> flags;
 };
 
 /// Stores information about a remote map (for multi-mapserver setups).

+ 1 - 1
src/map/mob.cpp

@@ -1423,7 +1423,7 @@ static int32 mob_warpchase_sub(struct block_list *bl,va_list ap) {
 
 	target= va_arg(ap, struct block_list*);
 	target_nd= va_arg(ap, struct npc_data**);
-	min_distance= va_arg(ap, int*);
+	min_distance= va_arg(ap, int32*);
 
 	nd = (TBL_NPC*) bl;
 

+ 4 - 4
src/map/npc.cpp

@@ -1222,7 +1222,7 @@ int32 npc_event_doall_sub(DBKey key, DBData *data, va_list ap)
 {
 	const char* p = key.str;
 	struct event_data* ev;
-	int* c;
+	int32* c;
 	const char* name;
 	int32 rid;
 
@@ -1251,7 +1251,7 @@ static int32 npc_event_do_sub(DBKey key, DBData *data, va_list ap)
 {
 	const char* p = key.str;
 	struct event_data* ev;
-	int* c, rid;
+	int32* c, rid;
 	const char* name;
 
 	nullpo_ret(ev = (struct event_data*)db_data2ptr(data));
@@ -4237,13 +4237,13 @@ int32 npc_convertlabel_db(DBKey key, DBData *data, va_list ap)
 	const char* lname = (const char*)key.str;
 	int32 lpos = db_data2i(data);
 	struct npc_label_list** label_list;
-	int* label_list_num;
+	int32* label_list_num;
 	const char* filepath;
 	struct npc_label_list* label;
 	const char *p;
 
 	nullpo_ret(label_list = va_arg(ap,struct npc_label_list**));
-	nullpo_ret(label_list_num = va_arg(ap,int*));
+	nullpo_ret(label_list_num = va_arg(ap,int32*));
 	nullpo_ret(filepath = va_arg(ap,const char*));
 
 	// In case of labels not terminated with ':', for user defined function support

+ 1 - 1
src/map/path.cpp

@@ -324,7 +324,7 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
 
 		return false; // easy path unsuccessful
 	} else { // !(flag&1)
-		// FIXME: This array is too small to ensure all paths int16er than MAX_WALKPATH
+		// FIXME: This array is too small to ensure all paths shorter than MAX_WALKPATH
 		// can be found without node collision: calc_index(node1) = calc_index(node2).
 		// Figure out more proper size or another way to keep track of known nodes.
 		struct path_node tp[MAX_WALKPATH * MAX_WALKPATH];

+ 1 - 1
src/map/pc.cpp

@@ -9572,7 +9572,7 @@ TIMER_FUNC(pc_close_npc_timer){
 	map_session_data* sd = map_id2sd( id );
 
 	if( sd != nullptr ){
-		pc_close_npc( sd, static_cast<int>( data ) );
+		pc_close_npc( sd, static_cast<int32>( data ) );
 	}
 
 	return 0;

+ 4 - 4
src/map/pc.hpp

@@ -500,8 +500,8 @@ public:
 	unsigned char head_dir; //0: Look forward. 1: Look right, 2: Look left.
 	t_tick client_tick;
 	int32 npc_id,npc_shopid; //for script follow scriptoid;   ,npcid
-	std::vector<int> npc_id_dynamic;
-	std::vector<int> areanpc, npc_ontouch_;	///< Array of OnTouch and OnTouch_ NPC ID
+	std::vector<int32> npc_id_dynamic;
+	std::vector<int32> areanpc, npc_ontouch_;	///< Array of OnTouch and OnTouch_ NPC ID
 	int32 npc_item_flag; //Marks the npc_id with which you can use items during interactions with said npc (see script command enable_itemuse)
 	int32 npc_menu; // internal variable, used in npc menu handling
 	int32 npc_amount;
@@ -818,9 +818,9 @@ public:
 	} achievement_data;
 
 	// Title system
-	std::vector<int> titles;
+	std::vector<int32> titles;
 
-	std::vector<int> cloaked_npc;
+	std::vector<int32> cloaked_npc;
 
 	/* ShowEvent Data Cache flags from map */
 	std::vector<s_qi_display> qi_display;

+ 2 - 2
src/map/quest.cpp

@@ -28,7 +28,7 @@
 
 using namespace rathena;
 
-static int32 split_exact_quest_time(char* modif_p, int* week, int* day, int* hour, int* minute, int32 *second);
+static int32 split_exact_quest_time(char* modif_p, int32* week, int32* day, int32* hour, int32* minute, int32 *second);
 
 const std::string QuestDatabase::getDefaultLocation() {
 	return std::string(db_path) + "/quest_db.yml";
@@ -446,7 +446,7 @@ uint64 QuestDatabase::parseBodyNode(const ryml::NodeRef& node) {
 }
 
 
-static int32 split_exact_quest_time(char* modif_p, int* week, int* day, int* hour, int* minute, int32 *second) {
+static int32 split_exact_quest_time(char* modif_p, int32* week, int32* day, int32* hour, int32* minute, int32 *second) {
 	int32 w = -1, d = -1, h = -1, mn = -1, s = -1;
 
 	nullpo_retr(0, modif_p);

+ 7 - 7
src/map/script.cpp

@@ -354,7 +354,7 @@ static struct {
 
 const char* parse_curly_close(const char* p);
 const char* parse_syntax_close(const char* p);
-const char* parse_syntax_close_sub(const char* p,int* flag);
+const char* parse_syntax_close_sub(const char* p,int32* flag);
 const char* parse_syntax(const char* p);
 static int32 parse_syntax_for_flag = 0;
 
@@ -2048,7 +2048,7 @@ const char* parse_syntax_close(const char *p) {
 // Close judgment if, for, while, of do
 //	 flag == 1 : closed
 //	 flag == 0 : not closed
-const char* parse_syntax_close_sub(const char* p,int* flag)
+const char* parse_syntax_close_sub(const char* p,int32* flag)
 {
 	char label[256];
 	int32 pos = syntax.curly_count - 1;
@@ -2634,11 +2634,11 @@ struct script_code* parse_script_( const char *src, const char *file, int32 line
 				ShowMessage(" %d", get_num(script_buf,&i));
 				break;
 			case C_POS:
-				ShowMessage(" 0x%06x", *(int*)(script_buf+i)&0xffffff);
+				ShowMessage(" 0x%06x", *(int32*)(script_buf+i)&0xffffff);
 				i += 3;
 				break;
 			case C_NAME:
-				j = (*(int*)(script_buf+i)&0xffffff);
+				j = (*(int32*)(script_buf+i)&0xffffff);
 				ShowMessage(" %s", ( j == 0xffffff ) ? "?? unknown ??" : get_str(j));
 				i += 3;
 				break;
@@ -4665,7 +4665,7 @@ void script_cleararray_pc( map_session_data* sd, const char* varname ){
 
 /// sets a temporary character array variable element idx to given value
 /// @param refcache Pointer to an int32 variable, which keeps a copy of the reference to varname and must be initialized to 0. Can be nullptr if only one element is set.
-void script_setarray_pc(map_session_data* sd, const char* varname, uint32 idx, int64 value, int* refcache)
+void script_setarray_pc(map_session_data* sd, const char* varname, uint32 idx, int64 value, int32* refcache)
 {
 	int32 key;
 
@@ -5049,7 +5049,7 @@ BUILDIN_FUNC(close2)
 /// Counts the number of valid and total number of options in 'str'
 /// If max_count > 0 the counting stops when that valid option is reached
 /// total is incremented for each option (nullptr is supported)
-static int32 menu_countoptions(const char* str, int32 max_count, int* total)
+static int32 menu_countoptions(const char* str, int32 max_count, int32* total)
 {
 	int32 count = 0;
 	int32 bogus_total;
@@ -8301,7 +8301,7 @@ BUILDIN_FUNC(makeitem2) {
 /// Counts / deletes the current item given by idx.
 /// Used by buildin_delitem_search
 /// Relies on all input data being already fully valid.
-static void buildin_delitem_delete(map_session_data* sd, int32 idx, int* amount, uint8 loc, bool delete_items)
+static void buildin_delitem_delete(map_session_data* sd, int32 idx, int32* amount, uint8 loc, bool delete_items)
 {
 	int32 delamount;
 	struct item *itm = nullptr;

+ 1 - 1
src/map/script.hpp

@@ -2288,7 +2288,7 @@ void script_set_constant_(const char* name, int64 value, const char* constant_na
 void script_hardcoded_constants(void);
 
 void script_cleararray_pc(map_session_data* sd, const char* varname);
-void script_setarray_pc(map_session_data* sd, const char* varname, uint32 idx, int64 value, int* refcache);
+void script_setarray_pc(map_session_data* sd, const char* varname, uint32 idx, int64 value, int32* refcache);
 
 int32 script_config_read(const char *cfgName);
 void do_init_script(void);

+ 3 - 3
src/map/unit.cpp

@@ -273,7 +273,7 @@ TBL_PC* unit_get_master(struct block_list *bl)
  * @param bl: char to get his master's teleport timer [HOM|ELEM|PET|MER]
  * @return timer or nullptr
  */
-int* unit_get_masterteleport_timer(struct block_list *bl)
+int32* unit_get_masterteleport_timer(struct block_list *bl)
 {
 	if(bl)
 		switch(bl->type) {
@@ -2818,7 +2818,7 @@ int32 unit_calc_pos(struct block_list *bl, int32 tx, int32 ty, uint8 dir)
 			int32 i;
 
 			for( i = 0; i < 12; i++ ) {
-				int32 k = rnd_value<int>(DIR_NORTH, DIR_NORTHEAST); // Pick a Random Dir
+				int32 k = rnd_value<int32>(DIR_NORTH, DIR_NORTHEAST); // Pick a Random Dir
 
 				dx = -dirx[k] * 2;
 				dy = -diry[k] * 2;
@@ -3941,7 +3941,7 @@ static TIMER_FUNC(unit_shadowscar_timer) {
 	if (ud == nullptr)
 		return 1;
 
-	std::vector<int>::iterator it = ud->shadow_scar_timer.begin();
+	std::vector<int32>::iterator it = ud->shadow_scar_timer.begin();
 
 	while (it != ud->shadow_scar_timer.end()) {
 		if (*it == tid) {

+ 1 - 1
src/map/unit.hpp

@@ -63,7 +63,7 @@ struct unit_data {
 	char title[NAME_LENGTH];
 	int32 group_id;
 
-	std::vector<int> shadow_scar_timer;
+	std::vector<int32> shadow_scar_timer;
 };
 
 struct view_data {

+ 1 - 1
src/tool/csv2yaml.cpp

@@ -4251,7 +4251,7 @@ static bool read_constdb( char* fields[], size_t columns, size_t current ){
 // job_db.yml function
 //----------------------
 static bool pc_readdb_job2( char* fields[], size_t columns, size_t current ){
-	std::vector<int> stats;
+	std::vector<int32> stats;
 
 	stats.resize(MAX_LEVEL);
 	std::fill(stats.begin(), stats.end(), 0); // Fill with 0 so we don't produce arbitrary stats

+ 1 - 1
src/tool/csv2yaml.hpp

@@ -170,7 +170,7 @@ struct s_mercenary_skill_csv {
 
 std::unordered_map<uint16, std::vector<s_mercenary_skill_csv>> mercenary_skill_tree;
 
-static std::map<std::string, int> um_mapid2jobname {
+static std::map<std::string, int32> um_mapid2jobname {
 	{ "Novice", JOB_NOVICE }, // Novice and Super Novice share the same value
 	{ "SuperNovice", JOB_NOVICE },
 	{ "Swordman", JOB_SWORDMAN },

+ 1 - 1
src/tool/yaml.hpp

@@ -340,7 +340,7 @@ uint8 skill_split_atoi2(char *str, int64 *val, const char *delim, int32 min_valu
  * @param val1: Temporary storage to first value
  * @param val2: Temporary storage to second value
  */
-static void itemdb_re_split_atoi(char* str, int* val1, int* val2) {
+static void itemdb_re_split_atoi(char* str, int32* val1, int32* val2) {
 	int32 i, val[2];
 
 	for (i = 0; i < 2; i++) {