Browse Source

Replaced some more int leftovers with int32 (#8862)

Fixed some comments

Thanks to @datawulf
Lemongrass3110 5 tháng trước cách đây
mục cha
commit
ba33455635
62 tập tin đã thay đổi với 445 bổ sung445 xóa
  1. 2 2
      src/char/char.cpp
  2. 1 1
      src/char/char_mapif.cpp
  3. 1 1
      src/char/int_achievement.cpp
  4. 3 3
      src/char/int_elemental.cpp
  5. 2 2
      src/char/int_guild.cpp
  6. 6 6
      src/char/int_homun.cpp
  7. 1 1
      src/char/int_mail.cpp
  8. 3 3
      src/char/int_mercenary.cpp
  9. 1 1
      src/char/int_party.cpp
  10. 1 1
      src/char/int_pet.cpp
  11. 2 2
      src/char/inter.cpp
  12. 1 1
      src/common/database.cpp
  13. 3 3
      src/common/db.cpp
  14. 8 8
      src/common/db.hpp
  15. 2 2
      src/common/grfio.cpp
  16. 4 4
      src/common/showmsg.cpp
  17. 1 1
      src/common/showmsg.hpp
  18. 5 5
      src/common/socket.cpp
  19. 2 2
      src/common/sql.cpp
  20. 3 3
      src/common/strlib.cpp
  21. 3 3
      src/common/timer.cpp
  22. 2 2
      src/login/loginchrif.cpp
  23. 1 1
      src/login/loginclif.cpp
  24. 9 9
      src/map/achievement.cpp
  25. 12 12
      src/map/atcommand.cpp
  26. 18 18
      src/map/battle.cpp
  27. 4 4
      src/map/battleground.cpp
  28. 1 1
      src/map/battleground.hpp
  29. 1 1
      src/map/buyingstore.cpp
  30. 1 1
      src/map/channel.cpp
  31. 1 1
      src/map/chrif.cpp
  32. 25 25
      src/map/clif.cpp
  33. 1 1
      src/map/clif.hpp
  34. 4 4
      src/map/guild.cpp
  35. 2 2
      src/map/instance.cpp
  36. 1 1
      src/map/instance.hpp
  37. 2 2
      src/map/intif.cpp
  38. 3 3
      src/map/itemdb.cpp
  39. 1 1
      src/map/itemdb.hpp
  40. 6 6
      src/map/map.cpp
  41. 5 5
      src/map/map.hpp
  42. 23 23
      src/map/mob.cpp
  43. 1 1
      src/map/navi.cpp
  44. 17 17
      src/map/npc.cpp
  45. 1 1
      src/map/npc_chat.cpp
  46. 2 2
      src/map/party.cpp
  47. 1 1
      src/map/path.cpp
  48. 19 19
      src/map/pc.cpp
  49. 16 16
      src/map/pc.hpp
  50. 1 1
      src/map/quest.cpp
  51. 60 60
      src/map/script.cpp
  52. 58 58
      src/map/skill.cpp
  53. 3 3
      src/map/skill.hpp
  54. 70 70
      src/map/status.cpp
  55. 1 1
      src/map/storage.cpp
  56. 1 1
      src/map/unit.cpp
  57. 5 5
      src/map/vending.cpp
  58. 4 4
      src/tool/csv2yaml.cpp
  59. 4 4
      src/tool/csv2yaml.hpp
  60. 1 1
      src/tool/yaml.hpp
  61. 1 1
      src/web/web.cpp
  62. 1 1
      src/web/web.hpp

+ 2 - 2
src/char/char.cpp

@@ -1503,7 +1503,7 @@ int32 char_make_new_char( struct char_session_data* sd, char* name_, int32 str,
 	}
 
 	//Retrieve the newly auto-generated char id
-	char_id = (int)Sql_LastInsertId(sql_handle);
+	char_id = (int32)Sql_LastInsertId(sql_handle);
 	//Give the char the default items
 	for (k = 0; k <= MAX_STARTITEM && tmp_start_items[k].nameid != 0; k++) {
 		if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `equip`, `identify`) VALUES ('%d', '%u', '%hu', '%u', '%d')", schema_config.inventory_db, char_id, tmp_start_items[k].nameid, tmp_start_items[k].amount, tmp_start_items[k].pos, 1) )
@@ -1840,7 +1840,7 @@ int32 char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p){
 	else if( charserv_config.charmove_config.char_moves_unlimited )
 		info->chr_slot_changeCnt = 1;
 	else
-		info->chr_slot_changeCnt = max( 0, (int)p->character_moves );
+		info->chr_slot_changeCnt = max( 0, (int32)p->character_moves );
 #endif
 #if PACKETVER >= 20111025
 	info->chr_name_changeCnt = ( p->rename > 0 ) ? 1 : 0; // (0 = disabled, otherwise displays "Add-Ons" sidebar)

+ 1 - 1
src/char/char_mapif.cpp

@@ -715,7 +715,7 @@ int32 chmapif_parse_reqcharname(int32 fd){
 	WFIFOHEAD(fd,30);
 	WFIFOW(fd,0) = 0x2b09;
 	WFIFOL(fd,2) = RFIFOL(fd,2);
-	char_loadName((int)RFIFOL(fd,2), WFIFOCP(fd,6));
+	char_loadName((int32)RFIFOL(fd,2), WFIFOCP(fd,6));
 	WFIFOSET(fd,30);
 
 	RFIFOSKIP(fd,6);

+ 1 - 1
src/char/int_achievement.cpp

@@ -59,7 +59,7 @@ struct achievement *mapif_achievements_fromsql(uint32 char_id, int32 *count)
 	for (i = 0; i < MAX_ACHIEVEMENT_OBJECTIVES; ++i)
 		stmt.BindColumn(3 + i, SQLDT_INT, &tmp_achieve.count[i], 0, nullptr, nullptr);
 
-	*count = (int)stmt.NumRows();
+	*count = (int32)stmt.NumRows();
 	if (*count > 0) {
 		i = 0;
 

+ 3 - 3
src/char/int_elemental.cpp

@@ -28,7 +28,7 @@ bool mapif_elemental_save(struct s_elemental* ele) {
 			flag = false;
 		}
 		else
-			ele->elemental_id = (int)Sql_LastInsertId(sql_handle);
+			ele->elemental_id = (int32)Sql_LastInsertId(sql_handle);
 	} else if( SQL_ERROR == Sql_Query(sql_handle,
 									"UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%u', `sp` = '%u',"
 									"`max_hp` = '%u', `max_sp` = '%u', `atk1` = '%d', `atk2` = '%d', `matk` = '%d', `aspd` = '%d', `def` = '%d',"
@@ -153,8 +153,8 @@ int32 inter_elemental_parse_frommap(int32 fd) {
 
 	switch( cmd ) {
 		case 0x307c: mapif_parse_elemental_create(fd, (struct s_elemental*)RFIFOP(fd,4)); break;
-		case 0x307d: mapif_parse_elemental_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
-		case 0x307e: mapif_parse_elemental_delete(fd, (int)RFIFOL(fd,2)); break;
+		case 0x307d: mapif_parse_elemental_load(fd, (int32)RFIFOL(fd,2), (int32)RFIFOL(fd,6)); break;
+		case 0x307e: mapif_parse_elemental_delete(fd, (int32)RFIFOL(fd,2)); break;
 		case 0x307f: mapif_parse_elemental_save(fd, (struct s_elemental*)RFIFOP(fd,4)); break;
 		default:
 			return 0;

+ 2 - 2
src/char/int_guild.cpp

@@ -149,7 +149,7 @@ int32 inter_guild_tosql( mmo_guild &g, int32 flag ){
 		}
 		else
 		{
-			g.guild_id = (int)Sql_LastInsertId(sql_handle);
+			g.guild_id = (int32)Sql_LastInsertId(sql_handle);
 			new_guild = 1;
 		}
 	}
@@ -1166,7 +1166,7 @@ int32 mapif_guild_master_changed( const struct mmo_guild &g, int32 aid, int32 ci
 
 int32 mapif_guild_castle_dataload(int32 fd, int32 sz, int32 *castle_ids)
 {
-	int32 num = (sz - 4) / sizeof(int);
+	int32 num = (sz - 4) / sizeof(int32);
 	int32 len = 4 + num * sizeof( struct guild_castle );
 	int32 i;
 

+ 6 - 6
src/char/int_homun.cpp

@@ -103,7 +103,7 @@ bool mapif_homunculus_save(struct s_homunculus* hd)
 		}
 		else
 		{
-			hd->hom_id = (int)Sql_LastInsertId(sql_handle);
+			hd->hom_id = (int32)Sql_LastInsertId(sql_handle);
 		}
 	}
 	else
@@ -301,11 +301,11 @@ int32 inter_homunculus_parse_frommap(int32 fd)
 
 	switch( cmd )
 	{
-		case 0x3090: mapif_parse_homunculus_create(fd, (int)RFIFOW(fd,2), (int)RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,8)); break;
-		case 0x3091: mapif_parse_homunculus_load  (fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
-		case 0x3092: mapif_parse_homunculus_save  (fd, (int)RFIFOW(fd,2), (int)RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,8)); break;
-		case 0x3093: mapif_parse_homunculus_delete(fd, (int)RFIFOL(fd,2)); break;
-		case 0x3094: mapif_parse_homunculus_rename(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6), RFIFOCP(fd,10)); break;
+		case 0x3090: mapif_parse_homunculus_create(fd, (int32)RFIFOW(fd,2), (int32)RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,8)); break;
+		case 0x3091: mapif_parse_homunculus_load  (fd, (int32)RFIFOL(fd,2), (int32)RFIFOL(fd,6)); break;
+		case 0x3092: mapif_parse_homunculus_save  (fd, (int32)RFIFOW(fd,2), (int32)RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,8)); break;
+		case 0x3093: mapif_parse_homunculus_delete(fd, (int32)RFIFOL(fd,2)); break;
+		case 0x3094: mapif_parse_homunculus_rename(fd, (int32)RFIFOL(fd,2), (int32)RFIFOL(fd,6), RFIFOCP(fd,10)); break;
 		default:
 			return 0;
 	}

+ 1 - 1
src/char/int_mail.cpp

@@ -110,7 +110,7 @@ int32 mail_savemessage(struct mail_message* msg)
 		Sql_QueryStr( sql_handle, "ROLLBACK" );
 		return msg->id = 0;
 	} else
-		msg->id = (int)stmt.LastInsertId();
+		msg->id = (int32)stmt.LastInsertId();
 	
 	StringBuf_Clear(&buf);
 	StringBuf_Printf(&buf,"INSERT INTO `%s` (`id`, `index`, `amount`, `nameid`, `refine`, `attribute`, `identify`, `unique_id`, `bound`, `enchantgrade`", schema_config.mail_attachment_db);

+ 3 - 3
src/char/int_mercenary.cpp

@@ -80,7 +80,7 @@ bool mapif_mercenary_save(struct s_mercenary* merc)
 			flag = false;
 		}
 		else
-			merc->mercenary_id = (int)Sql_LastInsertId(sql_handle);
+			merc->mercenary_id = (int32)Sql_LastInsertId(sql_handle);
 	}
 	else if( SQL_ERROR == Sql_Query(sql_handle,
 		"UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `hp` = '%u', `sp` = '%u', `kill_counter` = '%u', `life_time` = '%" PRtf "' WHERE `mer_id` = '%d'",
@@ -208,8 +208,8 @@ int32 inter_mercenary_parse_frommap(int32 fd)
 	switch( cmd )
 	{
 		case 0x3070: mapif_parse_mercenary_create(fd, (struct s_mercenary*)RFIFOP(fd,4)); break;
-		case 0x3071: mapif_parse_mercenary_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
-		case 0x3072: mapif_parse_mercenary_delete(fd, (int)RFIFOL(fd,2)); break;
+		case 0x3071: mapif_parse_mercenary_load(fd, (int32)RFIFOL(fd,2), (int32)RFIFOL(fd,6)); break;
+		case 0x3072: mapif_parse_mercenary_delete(fd, (int32)RFIFOL(fd,2)); break;
 		case 0x3073: mapif_parse_mercenary_save(fd, (struct s_mercenary*)RFIFOP(fd,4)); break;
 		default:
 			return 0;

+ 1 - 1
src/char/int_party.cpp

@@ -152,7 +152,7 @@ int32 inter_party_tosql(struct party *p, int32 flag, int32 index)
 			Sql_ShowDebug(sql_handle);
 			return 0;
 		}
-		party_id = p->party_id = (int)Sql_LastInsertId(sql_handle);
+		party_id = p->party_id = (int32)Sql_LastInsertId(sql_handle);
 	}
 
 	if( flag & PS_BASIC )

+ 1 - 1
src/char/int_pet.cpp

@@ -41,7 +41,7 @@ int32 inter_pet_tosql(int32 pet_id, struct s_pet* p)
 			Sql_ShowDebug(sql_handle);
 			return 0;
 		}
-		p->pet_id = (int)Sql_LastInsertId(sql_handle);
+		p->pet_id = (int32)Sql_LastInsertId(sql_handle);
 	}
 	else
 	{// Update pet.

+ 2 - 2
src/char/inter.cpp

@@ -515,7 +515,7 @@ void mapif_parse_accinfo(int32 fd) {
 				Sql_GetData(sql_handle, 0, &data, nullptr); account_id = atoi(data);
 				Sql_FreeResult(sql_handle);
 			} else {// more than one, listing... [Dekamaster/Nightroad]
-				inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(214),(int)Sql_NumRows(sql_handle));
+				inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(214),(int32)Sql_NumRows(sql_handle));
 				while ( SQL_SUCCESS == Sql_NextRow(sql_handle) ) {
 					int32 class_;
 					short base_level, job_level, online;
@@ -1414,7 +1414,7 @@ int32 inter_check_length(int32 fd, int32 length)
 		length = RFIFOW(fd,2);
 	}
 
-	if( (int)RFIFOREST(fd) < length )
+	if( (int32)RFIFOREST(fd) < length )
 		return 0;
 
 	return length;

+ 1 - 1
src/common/database.cpp

@@ -363,7 +363,7 @@ void YamlDatabase::invalidWarning( const ryml::NodeRef& node, const char* fmt, .
 
 	// Remove any remaining garbage of a previous loading line
 	ShowMessage( CL_CLL );
-	// Print32 the actual error
+	// Print the actual error
 	_vShowMessage( MSG_ERROR, fmt, ap );
 
 	va_end(ap);

+ 3 - 3
src/common/db.cpp

@@ -49,7 +49,7 @@
  *  HISTORY:
  *    2013/08/25 - Added int64/uint64 support for keys [Ind/Hercules]
  *    2013/04/27 - Added ERS to speed up iterator memory allocation [Ind/Hercules]
- *    2012/03/09 - Added enum for data types (int, uint, void*)
+ *    2012/03/09 - Added enum for data types (int32, uint32, void*)
  *    2008/02/19 - Fixed db_obj_get not handling deleted entries correctly.
  *    2007/11/09 - Added an iterator to the database.
  *    2006/12/21 - Added 1-node cache to the database.
@@ -178,7 +178,7 @@ struct db_free {
  * @param maxlen Maximum length of strings in DB_STRING and DB_ISTRING databases
  * @param global_lock Global lock of the database
  * @private
- * @see #db_alloc(const char*,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc(const char*,int32,DBType,DBOptions,unsigned short)
  */
 typedef struct DBMap_impl {
 	// Database interface
@@ -2373,7 +2373,7 @@ static DBOptions db_obj_options(DBMap* self)
  * @return Fixed options of the database
  * @private
  * @see #db_default_release(DBType,DBOptions)
- * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc(const char *,int32,DBType,DBOptions,unsigned short)
  */
 DBOptions db_fix_options(DBType type, DBOptions options)
 {

+ 8 - 8
src/common/db.hpp

@@ -21,7 +21,7 @@
  *                                                                           *
  *  HISTORY:                                                                 *
  *    2013/08/25 - Added int64/uint64 support for keys                       *
- *    2012/03/09 - Added enum for data types (int, uint, void*)              *
+ *    2012/03/09 - Added enum for data types (int32, uint32, void*)          *
  *    2007/11/09 - Added an iterator to the database.                        *
  *    2.1 (Athena build #???#) - Portability fix                             *
  *      - Fixed the portability of casting to union and added the functions  *
@@ -95,7 +95,7 @@ typedef enum DBRelease {
  * @see #db_default_cmp(DBType)
  * @see #db_default_hash(DBType)
  * @see #db_default_release(DBType,DBOptions)
- * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc(const char *,int32,DBType,DBOptions,unsigned short)
  */
 typedef enum DBType {
 	DB_INT,
@@ -125,7 +125,7 @@ typedef enum DBType {
  * @public
  * @see #db_fix_options(DBType,DBOptions)
  * @see #db_default_release(DBType,DBOptions)
- * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc(const char *,int32,DBType,DBOptions,unsigned short)
  */
 typedef enum DBOptions {
 	DB_OPT_BASE            = 0x00,
@@ -372,7 +372,7 @@ struct DBIterator
  * Public interface of a database. Only contains functions.
  * All the functions take the interface as the first argument.
  * @public
- * @see #db_alloc(const char*,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc(const char*,int32,DBType,DBOptions,unsigned short)
  */
 struct DBMap {
 
@@ -700,7 +700,7 @@ struct DBMap {
 #define ui64db_ensure(db,k,f) ( db_data2ptr((db)->ensure((db),db_ui642key(k),(f))) )
 
 // Database creation and destruction macros
-#define idb_alloc(opt)            db_alloc(__FILE__,__func__,__LINE__,DB_INT,(opt),sizeof(int))
+#define idb_alloc(opt)            db_alloc(__FILE__,__func__,__LINE__,DB_INT,(opt),sizeof(int32))
 #define uidb_alloc(opt)           db_alloc(__FILE__,__func__,__LINE__,DB_UINT,(opt),sizeof(uint32))
 #define strdb_alloc(opt,maxlen)   db_alloc(__FILE__,__func__,__LINE__,DB_STRING,(opt),(maxlen))
 #define stridb_alloc(opt,maxlen)  db_alloc(__FILE__,__func__,__LINE__,DB_ISTRING,(opt),(maxlen))
@@ -989,7 +989,7 @@ void  linkdb_foreach (struct linkdb_node** head, LinkDBFunc func, ...);
 
 /// Moves an entry of the array.
 /// Use ARR_MOVERIGHT/ARR_MOVELEFT if __from and __to are direct numbers.
-/// ex: ARR_MOVE(i, 0, list, int);// move index i to index 0
+/// ex: ARR_MOVE(i, 0, list, int32);// move index i to index 0
 ///
 ///
 /// @param __from   Initial index of the entry
@@ -1013,7 +1013,7 @@ void  linkdb_foreach (struct linkdb_node** head, LinkDBFunc func, ...);
 
 
 /// Moves an entry of the array to the right.
-/// ex: ARR_MOVERIGHT(1, 4, list, int);// move index 1 to index 4
+/// ex: ARR_MOVERIGHT(1, 4, list, int32);// move index 1 to index 4
 ///
 /// @param __from   Initial index of the entry
 /// @param __to     Target index of the entry
@@ -1030,7 +1030,7 @@ void  linkdb_foreach (struct linkdb_node** head, LinkDBFunc func, ...);
 
 
 /// Moves an entry of the array to the left.
-/// ex: ARR_MOVELEFT(3, 0, list, int);// move index 3 to index 0
+/// ex: ARR_MOVELEFT(3, 0, list, int32);// move index 3 to index 0
 ///
 /// @param __from   Initial index of the entry
 /// @param __end    Target index of the entry

+ 2 - 2
src/common/grfio.cpp

@@ -434,7 +434,7 @@ void* grfio_reads(const char* fname, size_t* size)
 				len = entry->declen;
 				decode_zip(buf2, &len, buf, entry->srclen);
 				if (len != (uLong)entry->declen) {
-					ShowError("decode_zip size mismatch err: %d != %d\n", (int)len, entry->declen);
+					ShowError("decode_zip size mismatch err: %d != %d\n", (int32)len, entry->declen);
 					aFree(buf);
 					aFree(buf2);
 					return nullptr;
@@ -626,7 +626,7 @@ static int32 grfio_entryread(const char* grfname, int32 gentry)
 			FILELIST aentry;
 
 			char* fname = (char*)(grf_filelist+ofs);
-			int32 ofs2 = ofs + (int)strlen(fname)+1;
+			int32 ofs2 = ofs + (int32)strlen(fname)+1;
 			int32 type = grf_filelist[ofs2+12];
 
 			if( strlen(fname) > sizeof(aentry.fn)-1 ) {

+ 4 - 4
src/common/showmsg.cpp

@@ -205,7 +205,7 @@ int32	VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
 	if(!fmt || !*fmt)
 		return 0;
 
-	// Print32 everything to the buffer
+	// Print everything to the buffer
 	BUFVPRINTF(tempbuf,fmt,argptr);
 
 	if( !is_console(handle) && stdout_with_ansisequence )
@@ -542,14 +542,14 @@ int32	VFPRINTF(FILE *file, const char *fmt, va_list argptr)
 		return 0;
 	}
 
-	// Print32 everything to the buffer
+	// Print everything to the buffer
 	BUFVPRINTF(tempbuf,fmt,argptr);
 
 	// start with processing
 	p = BUFVAL(tempbuf);
 	while ((q = strchr(p, 0x1b)) != nullptr)
 	{	// find the escape character
-		fprintf(file, "%.*s", (int)(q-p), p); // write up to the escape
+		fprintf(file, "%.*s", (int32)(q-p), p); // write up to the escape
 		if( q[1]!='[' )
 		{	// write the escape char (whatever purpose it has) 
 			fprintf(file, "%.*s", 1, q);
@@ -716,7 +716,7 @@ int32 _vShowMessage(enum msg_type flag, const char *string, va_list ap)
 	    (flag == MSG_SQL && msg_silent&16) ||
 	    (flag == MSG_DEBUG && msg_silent&32)
 	)
-		return 0; //Do not print32 it.
+		return 0; //Do not print it.
 
 	if (timestamp_format[0] && flag != MSG_NONE)
 	{	//Display time format. [Skotlex]

+ 1 - 1
src/common/showmsg.hpp

@@ -67,7 +67,7 @@
 #define CL_XXBL			"\033[0;44m"	// default on blue
 #define CL_PASS			"\033[0;32;42m"	// green on green
 
-#define CL_SPACE		"           "	// space aquivalent of the print32 messages
+#define CL_SPACE		"           "	// space aquivalent of the print messages
 
 extern int32 stdout_with_ansisequence; //If the color ansi sequences are to be used. [flaviojs]
 extern int32 msg_silent; //Specifies how silent the console is. [Skotlex]

+ 5 - 5
src/common/socket.cpp

@@ -375,7 +375,7 @@ int32 recv_to_fifo(int32 fd)
 	if( !session_isActive(fd) )
 		return -1;
 
-	len = sRecv(fd, (char *) session[fd]->rdata + session[fd]->rdata_size, (int)RFIFOSPACE(fd), 0);
+	len = sRecv(fd, (char *) session[fd]->rdata + session[fd]->rdata_size, (int32)RFIFOSPACE(fd), 0);
 
 	if( len == SOCKET_ERROR )
 	{//An exception has occured
@@ -415,7 +415,7 @@ int32 send_from_fifo(int32 fd)
 	if( session[fd]->wdata_size == 0 )
 		return 0; // nothing to send
 
-	len = sSend(fd, (const char *) session[fd]->wdata, (int)session[fd]->wdata_size, MSG_NOSIGNAL);
+	len = sSend(fd, (const char *) session[fd]->wdata, (int32)session[fd]->wdata_size, MSG_NOSIGNAL);
 
 	if( len == SOCKET_ERROR )
 	{//An exception has occured
@@ -950,7 +950,7 @@ int32 do_sockets(t_tick next)
 
 #if defined(WIN32)
 	// on windows, enumerating all members of the fd_set is way faster if we access the internals
-	for( i = 0; i < (int)rfd.fd_count; ++i )
+	for( i = 0; i < (int32)rfd.fd_count; ++i )
 	{
 		int32 fd = sock2fd(rfd.fd_array[i]);
 		if( session[fd] )
@@ -1566,13 +1566,13 @@ void socket_init(void)
 					int32 rlim_ori;
 					// set to maximum allowed
 					getrlimit(RLIMIT_NOFILE, &rlp);
-					rlim_ori = (int)rlp.rlim_cur;
+					rlim_ori = (int32)rlp.rlim_cur;
 					rlp.rlim_cur = rlp.rlim_max;
 					setrlimit(RLIMIT_NOFILE, &rlp);
 					// report limit
 					getrlimit(RLIMIT_NOFILE, &rlp);
 					rlim_cur = rlp.rlim_cur;
-					ShowWarning("socket_init: failed to set socket limit to %d, setting to maximum allowed (original limit=%d, current limit=%d, maximum allowed=%d, %s).\n", MAXCONN, rlim_ori, (int)rlp.rlim_cur, (int)rlp.rlim_max, errmsg);
+					ShowWarning("socket_init: failed to set socket limit to %d, setting to maximum allowed (original limit=%d, current limit=%d, maximum allowed=%d, %s).\n", MAXCONN, rlim_ori, (int32)rlp.rlim_cur, (int32)rlp.rlim_max, errmsg);
 				}
 			}
 		}

+ 2 - 2
src/common/sql.cpp

@@ -527,8 +527,8 @@ static int32 Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_typ
 		bind->is_unsigned = 1;
 		[[fallthrough]];
 	case SQLDT_INT:
-		bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int));
-		buffer_len = sizeof(int);
+		bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int32));
+		buffer_len = sizeof(int32);
 		break;
 	case SQLDT_ULONG:
 		bind->is_unsigned = 1;

+ 3 - 3
src/common/strlib.cpp

@@ -243,7 +243,7 @@ int32 config_switch(const char* str)
 	if (strcmpi(str, "off") == 0 || strcmpi(str, "no") == 0 || strcmpi(str, "non") == 0 || strcmpi(str, "nein") == 0 || strcmpi(str, "nao") == 0)
 		return 0;
 
-	return (int)strtol(str, nullptr, 0);
+	return (int32)strtol(str, nullptr, 0);
 }
 
 /// strncpy that always nul-terminates the string
@@ -1005,7 +1005,7 @@ size_t _StringBuf_Vprintf( const char* file, int32 line, const char* func, Strin
 	for(;;)
 	{
 		va_list apcopy;
-		/* Try to print32 in the allocated space. */
+		/* Try to print in the allocated space. */
 		size_t size = self->max_ - (self->ptr_ - self->buf_);
 		va_copy(apcopy, ap);
 		int32 n = vsnprintf( self->ptr_, size, fmt, apcopy );
@@ -1065,7 +1065,7 @@ size_t _StringBuf_AppendStr(const char *file, int32 line, const char *func,Strin
 // Returns the length of the data in the Stringbuf
 int32 StringBuf_Length(StringBuf* self)
 {
-	return (int)(self->ptr_ - self->buf_);
+	return (int32)(self->ptr_ - self->buf_);
 }
 
 /// Returns the data in the StringBuf

+ 3 - 3
src/common/timer.cpp

@@ -44,7 +44,7 @@ static int32 free_timer_list_pos = 0;
 #define DIFFTICK_MINTOPCMP(tid1,tid2) DIFF_TICK(timer_data[tid1].tick,timer_data[tid2].tick)
 
 // timer heap (binary heap of tid's)
-static BHEAP_VAR(int, timer_heap);
+static BHEAP_VAR(int32, timer_heap);
 
 
 // server startup time
@@ -392,8 +392,8 @@ t_tick do_timer(t_tick tick)
 				timer_data[tid].type = 0;
 				if (free_timer_list_pos >= free_timer_list_max) {
 					free_timer_list_max += 256;
-					RECREATE(free_timer_list,int,free_timer_list_max);
-					memset(free_timer_list + (free_timer_list_max - 256), 0, 256 * sizeof(int));
+					RECREATE(free_timer_list,int32,free_timer_list_max);
+					memset(free_timer_list + (free_timer_list_max - 256), 0, 256 * sizeof(int32));
 				}
 				free_timer_list[free_timer_list_pos++] = tid;
 			break;

+ 2 - 2
src/login/loginchrif.cpp

@@ -8,7 +8,7 @@
 
 #include <common/showmsg.hpp> //show notice
 #include <common/socket.hpp> //wfifo session
-#include <common/strlib.hpp> //safeprint32
+#include <common/strlib.hpp> //safeprint
 #include <common/timer.hpp> //difftick
 
 #include "account.hpp"
@@ -216,7 +216,7 @@ int32 logchrif_sendvipdata(int32 fd, struct mmo_account* acc, unsigned char flag
 	WFIFOHEAD(fd,19);
 	WFIFOW(fd,0) = 0x2743;
 	WFIFOL(fd,2) = acc->account_id;
-	WFIFOL(fd,6) = (int)acc->vip_time;
+	WFIFOL(fd,6) = (int32)acc->vip_time;
 	WFIFOB(fd,10) = flag;
 	WFIFOL(fd,11) = acc->group_id; //new group id
 	WFIFOL(fd,15) = mapfd; //link to mapserv

+ 1 - 1
src/login/loginclif.cpp

@@ -12,7 +12,7 @@
 #include <common/random.hpp>
 #include <common/showmsg.hpp> //show notice
 #include <common/socket.hpp> //wfifo session
-#include <common/strlib.hpp> //safeprint32
+#include <common/strlib.hpp> //safeprint
 #include <common/timer.hpp> //difftick
 #include <common/utils.hpp>
 

+ 9 - 9
src/map/achievement.cpp

@@ -796,7 +796,7 @@ int32 achievement_check_progress(map_session_data *sd, int32 achievement_id, int
 	else if (type == ACHIEVEINFO_COMPLETE)
 		return sd->achievement_data.achievements[i].completed > 0;
 	else if (type == ACHIEVEINFO_COMPLETEDATE)
-		return (int)sd->achievement_data.achievements[i].completed;
+		return (int32)sd->achievement_data.achievements[i].completed;
 	else if (type == ACHIEVEINFO_GOTREWARD)
 		return sd->achievement_data.achievements[i].rewarded > 0;
 	return -2;
@@ -912,7 +912,7 @@ bool achievement_check_condition( struct script_code* condition, map_session_dat
  * @param current_count: Current target data
  * @return True if all target values meet the requirements or false otherwise
  */
-static bool achievement_target_complete(std::shared_ptr<s_achievement_db> ad, std::array<int, MAX_ACHIEVEMENT_OBJECTIVES> current_count) {
+static bool achievement_target_complete(std::shared_ptr<s_achievement_db> ad, std::array<int32, MAX_ACHIEVEMENT_OBJECTIVES> current_count) {
 	return std::find_if(ad->targets.begin(), ad->targets.end(),
 		[current_count](const std::pair<uint16, std::shared_ptr<achievement_target>> &target) -> bool {
 		return current_count[target.first] < target.second->count;
@@ -927,7 +927,7 @@ static bool achievement_target_complete(std::shared_ptr<s_achievement_db> ad, st
  * @param update_count: Objective values from event
  * @return 1 on success and false on failure
  */
-static bool achievement_update_objectives(map_session_data *sd, std::shared_ptr<struct s_achievement_db> ad, enum e_achievement_group group, const std::array<int, MAX_ACHIEVEMENT_OBJECTIVES> &update_count)
+static bool achievement_update_objectives(map_session_data *sd, std::shared_ptr<struct s_achievement_db> ad, enum e_achievement_group group, const std::array<int32, MAX_ACHIEVEMENT_OBJECTIVES> &update_count)
 {
 	if (!ad || !sd)
 		return false;
@@ -940,7 +940,7 @@ static bool achievement_update_objectives(map_session_data *sd, std::shared_ptr<
 
 	struct achievement *entry = nullptr;
 	bool isNew = false, changed = false, complete = false;
-	std::array<int, MAX_ACHIEVEMENT_OBJECTIVES> current_count = {}; // Player's current objective values
+	std::array<int32, MAX_ACHIEVEMENT_OBJECTIVES> current_count = {}; // Player's current objective values
 	int32 i;
 
 	ARR_FIND(0, sd->achievement_data.count, i, sd->achievement_data.achievements[i].achievement_id == ad->achievement_id);
@@ -1094,15 +1094,15 @@ void achievement_update_objective(map_session_data *sd, enum e_achievement_group
 
 	if (sd) {
 		va_list ap;
-		std::array<int, MAX_ACHIEVEMENT_OBJECTIVES> count = {};
+		std::array<int32, MAX_ACHIEVEMENT_OBJECTIVES> count = {};
 
 		va_start(ap, arg_count);
 		for (int32 i = 0; i < arg_count; i++){
 			std::string name = "ARG" + std::to_string(i);
 
-			count[i] = va_arg(ap, int);
+			count[i] = va_arg(ap, int32);
 
-			pc_setglobalreg( sd, add_str( name.c_str() ), (int)count[i] );
+			pc_setglobalreg( sd, add_str( name.c_str() ), (int32)count[i] );
 		}
 		va_end(ap);
 
@@ -1133,8 +1133,8 @@ int32 achievement_update_objective_sub(block_list *bl, va_list ap)
 	nullpo_ret(bl);
 	nullpo_ret(sd = (map_session_data *)bl);
 
-	party_id = va_arg(ap, int);
-	mob_id = va_arg(ap, int);
+	party_id = va_arg(ap, int32);
+	mob_id = va_arg(ap, int32);
 
 	if (sd->achievement_data.achievements == nullptr)
 		return 0;

+ 12 - 12
src/map/atcommand.cpp

@@ -357,7 +357,7 @@ ACMD_FUNC(send)
 				// parse string
 				++message;
 				CHECK_EOS(message);
-				end=(num<=0? 0: min(off+((int)num),len));
+				end=(num<=0? 0: min(off+((int32)num),len));
 				for(; *message != '"' && (off < end || end == 0); ++off){
 					if(*message == '\\'){
 						++message;
@@ -472,7 +472,7 @@ ACMD_FUNC(send)
 /**
  * Retrieves map name suggestions for a given string.
  * This will first check if any map names contain the given string, and will
- *   print32 out MAX_SUGGESTIONS results if any maps are found.
+ *   print out MAX_SUGGESTIONS results if any maps are found.
  * Otherwise, suggestions will be calculated through Levenshtein distance,
  *   and up to 5 of the closest matches will be printed.
  *
@@ -511,7 +511,7 @@ static void warp_get_suggestions(map_session_data* sd, const char *name) {
 		// Levenshtein > 4 is bad
 		const int32 LEVENSHTEIN_MAX = 4;
 
-		std::unordered_map<int, std::vector<const char*>> maps;
+		std::unordered_map<int32, std::vector<const char*>> maps;
 
 		for (int32 i = 0; i < map_num; i++) {
 			struct map_data *mapdata = map_getmapdata(i);
@@ -2320,7 +2320,7 @@ ACMD_FUNC(monster)
 		ShowInfo("%s monster='%s' name='%s' id=%d count=%d (%d,%d)\n", command, monster, name, mob_id, number, sd->bl.x, sd->bl.y);
 
 	count = 0;
-	range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
+	range = (int32)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
 	for (i = 0; i < number; i++) {
 		int32 k;
 		map_search_freecell(&sd->bl, 0, &mx,  &my, range, range, 0);
@@ -2355,7 +2355,7 @@ static int32 atkillmonster_sub(struct block_list *bl, va_list ap)
 	int32 flag;
 
 	nullpo_ret(md=(struct mob_data *)bl);
-	flag = va_arg(ap, int);
+	flag = va_arg(ap, int32);
 
 	if (md->guardian_data)
 		return 0; //Do not touch WoE mobs!
@@ -5176,7 +5176,7 @@ char* txt_time(t_tick duration_)
 	memset(temp1, '\0', sizeof(temp1));
 
 	// Cap it
-	int32 duration = (int)duration_;
+	int32 duration = (int32)duration_;
 
 	days = duration / (60 * 60 * 24);
 	duration = duration - (60 * 60 * 24 * days);
@@ -5377,7 +5377,7 @@ ACMD_FUNC(jailfor) {
 	atcmd_output[sizeof(atcmd_output)-1] = '\0';
 
 	modif_p = atcmd_output;
-	jailtime = (int)solve_time(modif_p)/60; // Change to minutes
+	jailtime = (int32)solve_time(modif_p)/60; // Change to minutes
 
 	if (jailtime == 0) {
 		clif_displaymessage(fd, msg_txt(sd,1136)); // Invalid time for jail command.
@@ -6734,7 +6734,7 @@ ACMD_FUNC(autoloot)
 	} else {
 		double drate;
 		drate = atof(message);
-		rate = (int)(drate*100);
+		rate = (int32)(drate*100);
 	}
 	if (rate < 0) rate = 0;
 	if (rate > 10000) rate = 10000;
@@ -8344,7 +8344,7 @@ ACMD_FUNC(homshuffle)
 		return -1;
 
 	clif_displaymessage(sd->fd, msg_txt(sd,1275)); // Homunculus stats altered.
-	atcommand_homstats(fd, sd, command, message); //Print32 out the new stats
+	atcommand_homstats(fd, sd, command, message); //Print out the new stats
 	return 0;
 }
 
@@ -8547,8 +8547,8 @@ static int32 atcommand_mutearea_sub(struct block_list *bl,va_list ap)
 	if (pl_sd == nullptr)
 		return 0;
 
-	id = va_arg(ap, int);
-	time = va_arg(ap, int);
+	id = va_arg(ap, int32);
+	time = va_arg(ap, int32);
 
 	if (id != bl->id && !pc_get_group_level(pl_sd)) {
 		pl_sd->status.manner -= time;
@@ -10377,7 +10377,7 @@ ACMD_FUNC(vip) {
 		int32 year,month,day,hour,minute,second;
 		char timestr[21];
 		
-		split_time((int)(pl_sd->vip.time-now),&year,&month,&day,&hour,&minute,&second);
+		split_time((int32)(pl_sd->vip.time-now),&year,&month,&day,&hour,&minute,&second);
 		sprintf(atcmd_output,msg_txt(pl_sd,705),year,month,day,hour,minute); // Your VIP status is valid for %d years, %d months, %d days, %d hours and %d minutes.
 		clif_displaymessage(pl_sd->fd,atcmd_output);
 		timestamp2string(timestr,20,pl_sd->vip.time,"%Y-%m-%d %H:%M");

+ 18 - 18
src/map/battle.cpp

@@ -79,7 +79,7 @@ static int32 battle_gettargeted_sub(struct block_list *bl, va_list ap)
 
 	bl_list = va_arg(ap, struct block_list **);
 	c = va_arg(ap, int32 *);
-	target_id = va_arg(ap, int);
+	target_id = va_arg(ap, int32);
 
 	if (bl->id == target_id)
 		return 0;
@@ -211,7 +211,7 @@ static int32 battle_getenemyarea_sub(struct block_list *bl, va_list ap)
 	bl_list = va_arg(ap, struct block_list **);
 	c = va_arg(ap, int32 *);
 	src = va_arg(ap, struct block_list *);
-	ignore_id = va_arg(ap, int);
+	ignore_id = va_arg(ap, int32);
 
 	if( bl->id == src->id || bl->id == ignore_id )
 		return 0; // Ignores Caster and a possible pre-target
@@ -1159,7 +1159,7 @@ int32 battle_calc_cardfix(int32 attack_type, struct block_list *src, struct bloc
 
 #undef APPLY_CARDFIX
 
-	return (int)cap_value(damage - original_damage, INT_MIN, INT_MAX);
+	return (int32)cap_value(damage - original_damage, INT_MIN, INT_MAX);
 }
 
 /**
@@ -2200,7 +2200,7 @@ static int32 battle_calc_drain(int64 damage, int32 rate, int32 per)
 				diff = -1;
 		}
 	}
-	return (int)cap_value(diff, INT_MIN, INT_MAX);
+	return (int32)cap_value(diff, INT_MIN, INT_MAX);
 }
 
 /**
@@ -2228,7 +2228,7 @@ int64 battle_addmastery(map_session_data *sd,struct block_list *target,int64 dmg
 	if((skill = pc_checkskill(sd,AL_DEMONBANE)) > 0 &&
 		target->type == BL_MOB && //This bonus doesn't work against players.
 		(battle_check_undead(status->race,status->def_ele) || status->race == RC_DEMON) )
-		damage += (skill*(int)(3+(sd->status.base_level+1)*0.05));	// submitted by orn
+		damage += (skill*(int32)(3+(sd->status.base_level+1)*0.05));	// submitted by orn
 	if( (skill = pc_checkskill(sd, RA_RANGERMAIN)) > 0 && (status->race == RC_BRUTE || status->race == RC_PLAYER_DORAM || status->race == RC_PLANT || status->race == RC_FISH) )
 		damage += (skill * 5);
 	if( (skill = pc_checkskill(sd,NC_RESEARCHFE)) > 0 && (status->def_ele == ELE_FIRE || status->def_ele == ELE_EARTH) )
@@ -2366,7 +2366,7 @@ static int32 battle_calc_sizefix(int64 damage, map_session_data *sd, unsigned ch
 	if (sd && !sd->special_state.no_sizefix && !flag) // Size fix only for players
 		damage = damage * (weapon_type == EQI_HAND_L ? sd->left_weapon.atkmods[t_size] : sd->right_weapon.atkmods[t_size]) / 100;
 
-	return (int)cap_value(damage, INT_MIN, INT_MAX);
+	return (int32)cap_value(damage, INT_MIN, INT_MAX);
 }
 
 /**
@@ -2412,8 +2412,8 @@ static int32 battle_calc_base_weapon_attack(struct block_list *src, struct statu
 		float variance = 5.0f * wa->atk * wa->wlv / 100.0f;
 		float base_stat_bonus = wa->atk * base_stat / 200.0f;
 
-		atkmin = max(0, (int)(atkmin - variance + base_stat_bonus));
-		atkmax = min(UINT16_MAX, (int)(atkmax + variance + base_stat_bonus));
+		atkmin = max(0, (int32)(atkmin - variance + base_stat_bonus));
+		atkmax = min(UINT16_MAX, (int32)(atkmax + variance + base_stat_bonus));
 
 		if ((sc && sc->getSCE(SC_MAXIMIZEPOWER)) || critical == true)
 			damage = atkmax;
@@ -2428,7 +2428,7 @@ static int32 battle_calc_base_weapon_attack(struct block_list *src, struct statu
 
 	damage = battle_calc_sizefix(damage, sd, tstatus->size, type, weapon_perfection);
 
-	return (int)cap_value(damage, INT_MIN, INT_MAX);
+	return (int32)cap_value(damage, INT_MIN, INT_MAX);
 }
 #endif
 
@@ -6655,7 +6655,7 @@ static void battle_calc_defense_reduction(struct Damage* wd, struct block_list *
 #endif
 		if (src->type == BL_MOB && (battle_check_undead(sstatus->race, sstatus->def_ele) || sstatus->race == RC_DEMON) && //This bonus already doesn't work vs players
 			(skill = pc_checkskill(tsd, AL_DP)) > 0)
-			vit_def += (int)(((float)tsd->status.base_level / 25.0 + 3.0) * skill + 0.5);
+			vit_def += (int32)(((float)tsd->status.base_level / 25.0 + 3.0) * skill + 0.5);
 		if( src->type == BL_MOB && (skill=pc_checkskill(tsd,RA_RANGERMAIN))>0 &&
 			(sstatus->race == RC_BRUTE || sstatus->race == RC_PLAYER_DORAM || sstatus->race == RC_FISH || sstatus->race == RC_PLANT) )
 			vit_def += skill*5;
@@ -7312,7 +7312,7 @@ void battle_do_reflect(int32 attack_type, struct Damage *wd, struct block_list*
 
 		auto * sce = tsc->getSCE(SC_MAXPAIN);
 		if (sce) {
-			sce->val2 = (int)damage;
+			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 short weapon attack.
 				skill_castend_damage_id(target, src, NPC_MAXPAIN_ATK, sce->val1, tick, ((wd->flag & 1) ? wd->flag - 1 : wd->flag));
 		}
@@ -9251,7 +9251,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
 #else
 		case CR_ACIDDEMONSTRATION:
 			if(tstatus->vit+sstatus->int_) //crash fix
-				md.damage = (int)((int64)7*tstatus->vit*sstatus->int_*sstatus->int_ / (10*(tstatus->vit+sstatus->int_)));
+				md.damage = (int32)((int64)7*tstatus->vit*sstatus->int_*sstatus->int_ / (10*(tstatus->vit+sstatus->int_)));
 			else
 				md.damage = 0;
 			if (tsd)
@@ -9851,9 +9851,9 @@ int32 battle_damage_area(struct block_list *bl, va_list ap) {
 
 	tick = va_arg(ap, t_tick);
 	src = va_arg(ap,struct block_list *);
-	amotion = va_arg(ap,int);
-	dmotion = va_arg(ap,int);
-	damage = va_arg(ap,int);
+	amotion = va_arg(ap,int32);
+	dmotion = va_arg(ap,int32);
+	damage = va_arg(ap,int32);
 
 	if (status_bl_has_mode(bl, MD_SKILLIMMUNE) || status_get_class(bl) == MOBID_EMPERIUM)
 		return 0;
@@ -10956,9 +10956,9 @@ int32 battle_check_target( struct block_list *src, struct block_list *target,int
 			if (
 				(sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
 				(sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
-				(int)sd->status.base_level < battle_config.pk_min_level ||
-			  	(int)sd2->status.base_level < battle_config.pk_min_level ||
-				(battle_config.pk_level_range && abs((int)sd->status.base_level - (int)sd2->status.base_level) > battle_config.pk_level_range)
+				(int32)sd->status.base_level < battle_config.pk_min_level ||
+			  	(int32)sd2->status.base_level < battle_config.pk_min_level ||
+				(battle_config.pk_level_range && abs((int32)sd->status.base_level - (int32)sd2->status.base_level) > battle_config.pk_level_range)
 			)
 				state &= ~BCT_ENEMY;
 		}

+ 4 - 4
src/map/battleground.cpp

@@ -29,7 +29,7 @@
 using namespace rathena;
 
 BattlegroundDatabase battleground_db;
-std::unordered_map<int, std::shared_ptr<s_battleground_data>> bg_team_db;
+std::unordered_map<int32, std::shared_ptr<s_battleground_data>> bg_team_db;
 std::vector<std::shared_ptr<s_battleground_queue>> bg_queues;
 int32 bg_queue_count = 1;
 
@@ -780,7 +780,7 @@ TIMER_FUNC(bg_send_xy_timer)
  */
 static TIMER_FUNC(bg_on_ready_loopback)
 {
-	int32 queue_id = (int)data;
+	int32 queue_id = (int32)data;
 	std::shared_ptr<s_battleground_queue> queue = bg_search_queue(queue_id);
 
 	if (queue == nullptr) {
@@ -808,7 +808,7 @@ static TIMER_FUNC(bg_on_ready_loopback)
  */
 static TIMER_FUNC(bg_on_ready_expire)
 {
-	int32 queue_id = (int)data;
+	int32 queue_id = (int32)data;
 	std::shared_ptr<s_battleground_queue> queue = bg_search_queue(queue_id);
 
 	if (queue == nullptr) {
@@ -841,7 +841,7 @@ static TIMER_FUNC(bg_on_ready_expire)
  */
 static TIMER_FUNC(bg_on_ready_start)
 {
-	int32 queue_id = (int)data;
+	int32 queue_id = (int32)data;
 	std::shared_ptr<s_battleground_queue> queue = bg_search_queue(queue_id);
 
 	if (queue == nullptr) {

+ 1 - 1
src/map/battleground.hpp

@@ -123,7 +123,7 @@ public:
 };
 
 extern BattlegroundDatabase battleground_db;
-extern std::unordered_map<int, std::shared_ptr<s_battleground_data>> bg_team_db;
+extern std::unordered_map<int32, std::shared_ptr<s_battleground_data>> bg_team_db;
 extern std::vector<std::shared_ptr<s_battleground_queue>> bg_queues;
 
 std::shared_ptr<s_battleground_type> bg_search_name(const char *name);

+ 1 - 1
src/map/buyingstore.cpp

@@ -92,7 +92,7 @@ int8 buyingstore_setup(map_session_data* sd, unsigned char slots){
 
 	if( slots > MAX_BUYINGSTORE_SLOTS )
 	{
-		ShowWarning("buyingstore_setup: Requested %d slots, but server supports only %d slots.\n", (int)slots, MAX_BUYINGSTORE_SLOTS);
+		ShowWarning("buyingstore_setup: Requested %d slots, but server supports only %d slots.\n", (int32)slots, MAX_BUYINGSTORE_SLOTS);
 		slots = MAX_BUYINGSTORE_SLOTS;
 	}
 

+ 1 - 1
src/map/channel.cpp

@@ -93,7 +93,7 @@ struct Channel* channel_create_simple(char *name, char *pass, enum Channel_Type
 	switch (chantype) {
 		case CHAN_TYPE_ALLY:
 			memcpy(&tmp_chan, &channel_config.ally_tmpl, sizeof(channel_config.ally_tmpl));
-			tmp_chan.gid = (int)owner;
+			tmp_chan.gid = (int32)owner;
 			break;
 		case CHAN_TYPE_MAP:
 			memcpy(&tmp_chan, &channel_config.map_tmpl, sizeof(channel_config.map_tmpl));

+ 1 - 1
src/map/chrif.cpp

@@ -1755,7 +1755,7 @@ int32 chrif_parse(int32 fd) {
 			packet_len = RFIFOW(fd,2);
 		}
 
-		if ((int)RFIFOREST(fd) < packet_len)
+		if ((int32)RFIFOREST(fd) < packet_len)
 			return 0;
 
 		//ShowDebug("Received packet 0x%4x (%d bytes) from char-server (connection %d)\n", RFIFOW(fd,0), packet_len, fd);

+ 25 - 25
src/map/clif.cpp

@@ -414,9 +414,9 @@ static int32 clif_send_sub(struct block_list *bl, va_list ap)
 	}
 
 	buf = va_arg(ap,unsigned char*);
-	len = va_arg(ap,int);
+	len = va_arg(ap,int32);
 	nullpo_ret(src_bl = va_arg(ap,struct block_list*));
-	type = va_arg(ap,int);
+	type = va_arg(ap,int32);
 
 	switch(type) {
 	case AREA_WOS:
@@ -1006,7 +1006,7 @@ void clif_clearunit_delayed(struct block_list* bl, clr_type type, t_tick tick)
 	tbl->x = bl->x;
 	tbl->y = bl->y;
 	tbl->type = BL_NUL;
-	add_timer(tick, clif_clearunit_delayed_sub, (int)type, (intptr_t)tbl);
+	add_timer(tick, clif_clearunit_delayed_sub, (int32)type, (intptr_t)tbl);
 }
 
 void clif_get_weapon_view(map_session_data* sd, t_itemid *rhand, t_itemid *lhand)
@@ -3018,7 +3018,7 @@ static void clif_inventoryStart( map_session_data*sd, e_inventory_type type, con
 	p->invType = type;
 #endif
 #if PACKETVER_RE_NUM >= 20180919 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
-	int32 strLen = (int)safestrnlen(name, 24) + 1;
+	int32 strLen = (int32)safestrnlen(name, 24) + 1;
 	if (strLen > 24)
 		strLen = 24;
 	const int32 len = sizeof(PACKET_ZC_INVENTORY_START) + strLen;
@@ -5175,8 +5175,8 @@ static int32 clif_hallucination_damage()
 ///     12 = (touch skill?)
 ///     13 = multi-hit critical
 int32 clif_damage(block_list& src, block_list& dst, t_tick tick, int32 sdelay, int32 ddelay, int64 sdamage, int32 div, enum e_damage_type type, int64 sdamage2, bool spdamage){
-	int32 damage = (int)cap_value(sdamage,INT_MIN,INT_MAX);
-	int32 damage2 = (int)cap_value(sdamage2,INT_MIN,INT_MAX);
+	int32 damage = (int32)cap_value(sdamage,INT_MIN,INT_MAX);
+	int32 damage2 = (int32)cap_value(sdamage2,INT_MIN,INT_MAX);
 
 	if (type != DMG_MULTI_HIT_CRITICAL)
 		type = clif_calc_delay(type,div,damage+damage2,ddelay);
@@ -5976,7 +5976,7 @@ void clif_skill_cooldown( map_session_data &sd, uint16 skill_id, t_tick tick ){
 int32 clif_skill_damage(struct block_list *src,struct block_list *dst,t_tick tick,int32 sdelay,int32 ddelay,int64 sdamage,int32 div,uint16 skill_id,uint16 skill_lv,enum e_damage_type type)
 {
 	unsigned char buf[64];
-	int32 damage = (int)cap_value(sdamage,INT_MIN,INT_MAX);
+	int32 damage = (int32)cap_value(sdamage,INT_MIN,INT_MAX);
 
 	nullpo_ret(src);
 	nullpo_ret(dst);
@@ -10567,7 +10567,7 @@ inline void clif_pk_mode_message(map_session_data * sd)
 {
 	if (battle_config.pk_mode && battle_config.pk_mode_mes &&
 		sd && map_getmapflag(sd->bl.m, MF_PVP)) {
-		if( (int)sd->status.base_level < battle_config.pk_min_level ) {
+		if( (int32)sd->status.base_level < battle_config.pk_min_level ) {
 			char output[CHAT_SIZE_MAX];
 			// 1504: You've entered a PK Zone (safe until level %d).
 			safesnprintf(output, CHAT_SIZE_MAX, msg_txt(sd,1504), 
@@ -10610,13 +10610,13 @@ static int32 clif_parse_WantToConnection_sub(int32 fd)
 	// case.
 	if( packet_len != packet_db[cmd].len )
 		return 1; /* wrong length */
-	else if( (value=(int)RFIFOL(fd, packet_db[cmd].pos[0])) < START_ACCOUNT_NUM || value > END_ACCOUNT_NUM )
+	else if( (value=(int32)RFIFOL(fd, packet_db[cmd].pos[0])) < START_ACCOUNT_NUM || value > END_ACCOUNT_NUM )
 		return 2; /* invalid account_id */
-	else if( (value=(int)RFIFOL(fd, packet_db[cmd].pos[1])) <= 0 )
+	else if( (value=(int32)RFIFOL(fd, packet_db[cmd].pos[1])) <= 0 )
 		return 3; /* invalid char_id */
 	/*                   RFIFOL(fd, packet_db[cmd].pos[2]) - don't care about login_id1 */
 	/*                   RFIFOL(fd, packet_db[cmd].pos[3]) - don't care about client_tick */
-	else if( (value=(int)RFIFOB(fd, packet_db[cmd].pos[4])) != 0 && value != 1 )
+	else if( (value=(int32)RFIFOB(fd, packet_db[cmd].pos[4])) != 0 && value != 1 )
 		return 6; /* invalid sex */
 	else
 		return 0;
@@ -12596,7 +12596,7 @@ void clif_parse_SelectCart(int32 fd,map_session_data *sd) {
 	if( !sd || pc_checkskill(sd,MC_CARTDECORATE) < 1 || RFIFOL(fd,2) != sd->status.account_id )
 	return;
 
-	type = (int)RFIFOB(fd,6);
+	type = (int32)RFIFOB(fd,6);
 
 	// Check type
 	if( type < 10 || type > 12 ) 
@@ -12623,7 +12623,7 @@ void clif_parse_ChangeCart(int32 fd,map_session_data *sd)
 	}
 #endif
 
-	type = (int)RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0]);
+	type = (int32)RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0]);
 
 	if( 
 #ifdef NEW_CARTS
@@ -13285,7 +13285,7 @@ void clif_parse_NpcNextClicked(int32 fd,map_session_data *sd)
 void clif_parse_NpcAmountInput(int32 fd,map_session_data *sd){
 	struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
 	int32 npcid = RFIFOL(fd,info->pos[0]);
-	int32 amount = (int)RFIFOL(fd,info->pos[1]);
+	int32 amount = (int32)RFIFOL(fd,info->pos[1]);
 
 	sd->npc_amount = amount;
 
@@ -15134,7 +15134,7 @@ void clif_parse_NoviceExplosionSpirits(int32 fd, map_session_data *sd)
 		t_exp next = pc_nextbaseexp(sd);
 
 		if( next ) {
-			int32 percent = (int)( ( (double)sd->status.base_exp/(double)next )*1000. );
+			int32 percent = (int32)( ( (double)sd->status.base_exp/(double)next )*1000. );
 
 			if( percent && ( percent%100 ) == 0 ) {// 10.0%, 20.0%, ..., 90.0%
 				sc_start(&sd->bl,&sd->bl, SC_EXPLOSIONSPIRITS, 100, 17, skill_get_time(MO_EXPLOSIONSPIRITS, 5)); //Lv17-> +50 critical (noted by Poki) [Skotlex]
@@ -15181,9 +15181,9 @@ void clif_friendslist_toggle(map_session_data *sd,uint32 account_id, uint32 char
 int32 clif_friendslist_toggle_sub(map_session_data *sd,va_list ap)
 {
 	uint32 account_id, char_id, online;
-	account_id = va_arg(ap, int);
-	char_id = va_arg(ap, int);
-	online = va_arg(ap, int);
+	account_id = va_arg(ap, int32);
+	char_id = va_arg(ap, int32);
+	online = va_arg(ap, int32);
 	clif_friendslist_toggle(sd, account_id, char_id, online);
 	return 0;
 }
@@ -16280,7 +16280,7 @@ void clif_parse_Mail_read(int32 fd, map_session_data *sd){
 	int32 mail_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
 #else
 	//uint8 openType = RFIFOB(fd, 2);
-	int32 mail_id = (int)RFIFOQ(fd, 3);
+	int32 mail_id = (int32)RFIFOQ(fd, 3);
 #endif
 
 	if( mail_id <= 0 )
@@ -16381,7 +16381,7 @@ void clif_parse_Mail_getattach( int32 fd, map_session_data *sd ){
 	int32 attachment = MAIL_ATT_ALL;
 #else
 	uint16 packet_id = RFIFOW(fd, 0);
-	int32 mail_id = (int)RFIFOQ(fd, 2);
+	int32 mail_id = (int32)RFIFOQ(fd, 2);
 	//int32 openType = RFIFOB(fd, 10);
 	int32 attachment = packet_id == 0x9f1 ? MAIL_ATT_ZENY : packet_id == 0x9f3 ? MAIL_ATT_ITEM : MAIL_ATT_NONE;
 #endif
@@ -16484,7 +16484,7 @@ void clif_parse_Mail_delete(int32 fd, map_session_data *sd){
 	int32 mail_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
 #else
 	//int32 openType = RFIFOB(fd, 2);
-	int32 mail_id = (int)RFIFOQ(fd, 3);
+	int32 mail_id = (int32)RFIFOQ(fd, 3);
 #endif
 	int32 i, j;
 
@@ -19198,7 +19198,7 @@ void clif_buyingstore_update_item( map_session_data* sd, t_itemid nameid, unsign
 #if PACKETVER >= 20141016
 	p.zeny = zeny;
 	p.charId = char_id;  // GID
-	p.updateTime = (int)time(nullptr);
+	p.updateTime = (int32)time(nullptr);
 #endif
 
 	clif_send( &p, sizeof( p ), &sd->bl, SELF );
@@ -25505,7 +25505,7 @@ static int32 clif_parse(int32 fd)
 			return 0;
 		}
 	}
-	if ((int)RFIFOREST(fd) < packet_len){
+	if ((int32)RFIFOREST(fd) < packet_len){
 		ShowWarning( "clif_parse: Received packet 0x%04x with expected packet length %d, but only %d bytes remaining, disconnecting session #%d.\n", cmd, packet_len, RFIFOREST( fd ), fd );
 #ifdef DUMP_INVALID_PACKET
 		ShowDump( RFIFOP( fd, 0 ), RFIFOREST( fd ) );
@@ -25540,7 +25540,7 @@ static int32 clif_parse(int32 fd)
 	return 0;
 }
 
-void packetdb_addpacket( uint16 cmd, uint16 length, void (*func)(int, map_session_data *), ... ){
+void packetdb_addpacket( uint16 cmd, uint16 length, void (*func)(int32, map_session_data *), ... ){
 	va_list argp;
 	int32 i;
 
@@ -25553,7 +25553,7 @@ void packetdb_addpacket( uint16 cmd, uint16 length, void (*func)(int, map_sessio
 	va_start(argp, func);
 
 	for( i = 0; i < MAX_PACKET_POS; i++ ){
-		int32 offset = va_arg(argp, int);
+		int32 offset = va_arg(argp, int32);
 
 		if( offset == 0 ){
 			break;

+ 1 - 1
src/map/clif.hpp

@@ -64,7 +64,7 @@ enum e_PacketDBVersion { // packet DB
 
 struct s_packet_db {
 	short len;
-	void (*func)(int, map_session_data *);
+	void (*func)(int32, map_session_data *);
 	short pos[MAX_PACKET_POS];
 };
 

+ 4 - 4
src/map/guild.cpp

@@ -34,7 +34,7 @@
 
 using namespace rathena;
 
-std::unordered_map<int, std::shared_ptr<MapGuild>> guild_db;
+std::unordered_map<int32, std::shared_ptr<MapGuild>> guild_db;
 CastleDatabase castle_db;
 
 static DBMap* guild_expcache_db; // uint32 char_id -> struct guild_expcache*
@@ -2448,8 +2448,8 @@ int32 guild_castledatasave(int32 castle_id, int32 index, int32 value) {
 }
 
 void guild_castle_reconnect_sub(void *key, void *data, va_list ap) {
-	int32 castle_id = GetWord((int)__64BPRTSIZE(key), 0);
-	int32 index = GetWord((int)__64BPRTSIZE(key), 1);
+	int32 castle_id = GetWord((int32)__64BPRTSIZE(key), 0);
+	int32 index = GetWord((int32)__64BPRTSIZE(key), 1);
 	intif_guild_castle_datasave(castle_id, index, *(int32 *)data);
 	aFree(data);
 }
@@ -2470,7 +2470,7 @@ void guild_castle_reconnect(int32 castle_id, int32 index, int32 value) {
 		linkdb_final(&gc_save_pending);
 	} else {
 		int32 *data;
-		CREATE(data, int, 1);
+		CREATE(data, int32, 1);
 		*data = value;
 		linkdb_replace(&gc_save_pending, (void*)__64BPRTSIZE((MakeDWord(castle_id, index))), data);
 	}

+ 2 - 2
src/map/instance.cpp

@@ -38,7 +38,7 @@ struct s_instance_wait {
 int16 instance_start = 0; // Instance MapID start
 int32 instance_count = 1; // Total created instances
 
-std::unordered_map<int, std::shared_ptr<s_instance_data>> instances;
+std::unordered_map<int32, std::shared_ptr<s_instance_data>> instances;
 
 const std::string InstanceDatabase::getDefaultLocation() {
 	return std::string(db_path) + "/instance_db.yml";
@@ -574,7 +574,7 @@ static int32 instance_addnpc_sub(struct block_list *bl, va_list ap)
 	nullpo_retr(0, bl);
 	nullpo_retr(0, nd = (struct npc_data *)bl);
 
-	return npc_duplicate4instance(nd, va_arg(ap, int));
+	return npc_duplicate4instance(nd, va_arg(ap, int32));
 }
 
 /**

+ 1 - 1
src/map/instance.hpp

@@ -114,7 +114,7 @@ public:
 
 extern InstanceDatabase instance_db;
 
-extern std::unordered_map<int, std::shared_ptr<s_instance_data>> instances;
+extern std::unordered_map<int32, std::shared_ptr<s_instance_data>> instances;
 
 std::shared_ptr<s_instance_db> instance_search_db_name(const char* name);
 void instance_getsd(int32 instance_id, map_session_data *&sd, enum send_target *target);

+ 2 - 2
src/map/intif.cpp

@@ -1352,7 +1352,7 @@ static int32 mapif_parse_WisToGM_sub(map_session_data* sd,va_list va)
 		return 0;
 	wisp_name = va_arg(va, char*);
 	message = va_arg(va, char*);
-	len = va_arg(va, int);
+	len = va_arg(va, int32);
 	clif_wis_message(sd, wisp_name, message, len,0);
 	return 1;
 }
@@ -3778,7 +3778,7 @@ int32 intif_parse(int32 fd)
 			return 2;
 		packet_len = RFIFOW(fd,2);
 	}
-	if((int)RFIFOREST(fd)<packet_len){
+	if((int32)RFIFOREST(fd)<packet_len){
 		return 2;
 	}
 	// Processing branch

+ 3 - 3
src/map/itemdb.cpp

@@ -3216,7 +3216,7 @@ bool itemdb_canauction_sub(struct item_data* item, int32 gmlv, int32 unused) {
 	return (item && (!(item->flag.trade_restriction.auction) || gmlv >= item->gm_lv_trade_override));
 }
 
-bool itemdb_isrestricted(struct item* item, int32 gmlv, int32 gmlv2, bool (*func)(struct item_data*, int, int))
+bool itemdb_isrestricted(struct item* item, int32 gmlv, int32 gmlv2, bool (*func)(struct item_data*, int32, int32))
 {
 	struct item_data* item_data = itemdb_search(item->nameid);
 	int32 i;
@@ -3829,7 +3829,7 @@ bool itemdb_parse_roulette_db(void)
 			j = rd.items[i];
 			RECREATE(rd.nameid[i], t_itemid, ++rd.items[i]);
 			RECREATE(rd.qty[i], unsigned short, rd.items[i]);
-			RECREATE(rd.flag[i], int, rd.items[i]);
+			RECREATE(rd.flag[i], int32, rd.items[i]);
 
 			rd.nameid[i][j] = item_id;
 			rd.qty[i][j] = amount;
@@ -3860,7 +3860,7 @@ bool itemdb_parse_roulette_db(void)
 		rd.items[i] = limit;
 		RECREATE(rd.nameid[i], t_itemid, rd.items[i]);
 		RECREATE(rd.qty[i], unsigned short, rd.items[i]);
-		RECREATE(rd.flag[i], int, rd.items[i]);
+		RECREATE(rd.flag[i], int32, rd.items[i]);
 
 		for (j = 0; j < MAX_ROULETTE_COLUMNS - i; j++) {
 			if (rd.qty[i][j])

+ 1 - 1
src/map/itemdb.hpp

@@ -3539,7 +3539,7 @@ bool itemdb_canstore_sub(struct item_data *itd, int32 gmlv, int32 unused);
 bool itemdb_canguildstore_sub(struct item_data *itd, int32 gmlv, int32 unused);
 bool itemdb_canmail_sub(struct item_data *itd, int32 gmlv, int32 unused);
 bool itemdb_canauction_sub(struct item_data *itd, int32 gmlv, int32 unused);
-bool itemdb_isrestricted(struct item* item, int32 gmlv, int32 gmlv2, bool (*func)(struct item_data*, int, int));
+bool itemdb_isrestricted(struct item* item, int32 gmlv, int32 gmlv2, bool (*func)(struct item_data*, int32, int32));
 bool itemdb_ishatched_egg(struct item* item);
 #define itemdb_isdropable(item, gmlv) itemdb_isrestricted(item, gmlv, 0, itemdb_isdropable_sub)
 #define itemdb_cantrade(item, gmlv, gmlv2) itemdb_isrestricted(item, gmlv, gmlv2, itemdb_cantrade_sub)

+ 6 - 6
src/map/map.cpp

@@ -757,7 +757,7 @@ int32 map_foreachinshootrange(int32 (*func)(struct block_list*,va_list),struct b
  * @param y1: North end of area
  * @param type: Type of bl to search for
 *------------------------------------------*/
-int32 map_foreachinareaV(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, va_list ap, bool wall_check)
+int32 map_foreachinareaV(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, va_list ap, bool wall_check)
 {
 	int32 bx, by, cx, cy;
 	int32 returnCount = 0;	//total sum of returned values of func()
@@ -845,7 +845,7 @@ int32 map_foreachinallarea(int32 (*func)(struct block_list*,va_list), int16 m, i
 	return returnCount;
 }
 
-int32 map_foreachinshootarea(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...)
+int32 map_foreachinshootarea(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...)
 {
 	int32 returnCount = 0;
 	va_list ap;
@@ -854,7 +854,7 @@ int32 map_foreachinshootarea(int(*func)(struct block_list*, va_list), int16 m, i
  	va_end(ap);
 	return returnCount;
 }
-int32 map_foreachinarea(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...)
+int32 map_foreachinarea(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...)
 {
 	int32 returnCount = 0;
 	va_list ap;
@@ -1237,7 +1237,7 @@ int32 map_foreachinpath(int32 (*func)(struct block_list*,va_list),int16 m,int16
 
 	if ( length ) { //Adjust final position to fit in the given area.
 		//TODO: Find an alternate method which does not requires a square root calculation.
-		k = (int)sqrt((float)magnitude2);
+		k = (int32)sqrt((float)magnitude2);
 		mx1 = x0 + (x1 - x0) * length / k;
 		my1 = y0 + (y1 - y0) * length / k;
 		len_limit = MAGNITUDE2(x0, y0, mx1, my1);
@@ -1377,7 +1377,7 @@ int32 map_foreachinpath(int32 (*func)(struct block_list*,va_list),int16 m,int16
 * @param offset: Moves the whole path, half-length for diagonal paths
 * @param type: Type of bl to search for
 *------------------------------------------*/
-int32 map_foreachindir(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int16 range, int32 length, int32 offset, int32 type, ...)
+int32 map_foreachindir(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int16 range, int32 length, int32 offset, int32 type, ...)
 {
 	int32 returnCount = 0;  //Total sum of returned values of func()
 
@@ -3301,7 +3301,7 @@ void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag)
 		case CELL_ICEWALL:		 mapdata->cell[j].icewall = flag;		  break;
 		case CELL_NOBUYINGSTORE: mapdata->cell[j].nobuyingstore = flag; break;
 		default:
-			ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell);
+			ShowWarning("map_setcell: invalid cell type '%d'\n", (int32)cell);
 			break;
 	}
 }

+ 5 - 5
src/map/map.hpp

@@ -1101,7 +1101,7 @@ enum save_settings_type {
 };
 
 // users
-void map_setusers(int);
+void map_setusers(int32);
 int32 map_getusers(void);
 int32 map_usercount(void);
 
@@ -1112,13 +1112,13 @@ int32 map_freeblock_unlock(void);
 // blocklist manipulation
 int32 map_addblock(struct block_list* bl);
 int32 map_delblock(struct block_list* bl);
-int32 map_moveblock(struct block_list *, int, int, t_tick);
+int32 map_moveblock(struct block_list *, int32, int32, t_tick);
 int32 map_foreachinrange(int32 (*func)(struct block_list*,va_list), struct block_list* center, int16 range, int32 type, ...);
 int32 map_foreachinallrange(int32 (*func)(struct block_list*,va_list), struct block_list* center, int16 range, int32 type, ...);
 int32 map_foreachinshootrange(int32 (*func)(struct block_list*,va_list), struct block_list* center, int16 range, int32 type, ...);
-int32 map_foreachinarea(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...);
-int32 map_foreachinallarea(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...);
-int32 map_foreachinshootarea(int(*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...);
+int32 map_foreachinarea(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...);
+int32 map_foreachinallarea(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...);
+int32 map_foreachinshootarea(int32 (*func)(struct block_list*, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 type, ...);
 int32 map_forcountinrange(int32 (*func)(struct block_list*,va_list), struct block_list* center, int16 range, int32 count, int32 type, ...);
 int32 map_forcountinarea(int32 (*func)(struct block_list*,va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int32 count, int32 type, ...);
 int32 map_foreachinmovearea(int32 (*func)(struct block_list*,va_list), struct block_list* center, int16 range, int16 dx, int16 dy, int32 type, ...);

+ 23 - 23
src/map/mob.cpp

@@ -793,11 +793,11 @@ static TIMER_FUNC(mob_spawn_guardian_sub){
 
 	md = (struct mob_data*)bl;
 	nullpo_ret(md->guardian_data);
-	auto g = guild_search((int)data);
+	auto g = guild_search((int32)data);
 
 	if (g == nullptr)
 	{	//Liberate castle, if the guild is not found this is an error! [Skotlex]
-		ShowError("mob_spawn_guardian_sub: Couldn't load guild %d!\n", (int)data);
+		ShowError("mob_spawn_guardian_sub: Couldn't load guild %d!\n", (int32)data);
 		if (md->mob_id == MOBID_EMPERIUM)
 		{	//Not sure this is the best way, but otherwise we'd be invoking this for ALL guardians spawned later on.
 			md->guardian_data->guild_id = 0;
@@ -912,7 +912,7 @@ int32 mob_spawn_guardian(const char* mapname, int16 x, int16 y, const char* mobn
 		if( i == gc->temp_guardians_max )
 		{
 			++(gc->temp_guardians_max);
-			RECREATE(gc->temp_guardians, int, gc->temp_guardians_max);
+			RECREATE(gc->temp_guardians, int32, gc->temp_guardians_max);
 		}
 		gc->temp_guardians[i] = md->bl.id;
 	}
@@ -1012,7 +1012,7 @@ int32 mob_linksearch(struct block_list *bl,va_list ap)
 
 	nullpo_ret(bl);
 	md=(struct mob_data *)bl;
-	mob_id = va_arg(ap, int);
+	mob_id = va_arg(ap, int32);
 	target = va_arg(ap, struct block_list *);
 	tick=va_arg(ap, t_tick);
 
@@ -1091,7 +1091,7 @@ int32 mob_setdelayspawn(struct mob_data *md)
 
 int32 mob_count_sub(struct block_list *bl, va_list ap) {
     int32 mobid[10], i;
-    ARR_FIND(0, 10, i, (mobid[i] = va_arg(ap, int)) == 0); //fetch till 0
+    ARR_FIND(0, 10, i, (mobid[i] = va_arg(ap, int32)) == 0); //fetch till 0
 	mob_data* md = BL_CAST(BL_MOB, bl);
 	if (md && mobid[0]) { //if there one let's check it otherwise go backward
         ARR_FIND(0, 10, i, md->mob_id == mobid[i]);
@@ -1291,7 +1291,7 @@ static int32 mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
 	nullpo_ret(bl);
 	md=va_arg(ap,struct mob_data *);
 	target= va_arg(ap,struct block_list**);
-	mode= static_cast<enum e_mode>(va_arg(ap, int));
+	mode= static_cast<enum e_mode>(va_arg(ap, int32));
 
 	//If can't seek yet, not an enemy, or you can't attack it, skip.
 	if ((*target) == bl || !status_check_skilluse(&md->bl, bl, 0, 0))
@@ -2103,7 +2103,7 @@ static int32 mob_ai_sub_lazy(struct mob_data *md, va_list args)
 	t_tick tick = va_arg(args,t_tick);
 
 	if (battle_config.mob_ai&0x20 && map_getmapdata(md->bl.m)->users>0)
-		return (int)mob_ai_sub_hard(md, tick);
+		return (int32)mob_ai_sub_hard(md, tick);
 
 	if (md->bl.prev==nullptr || md->status.hp == 0)
 		return 1;
@@ -2114,7 +2114,7 @@ static int32 mob_ai_sub_lazy(struct mob_data *md, va_list args)
 		DIFF_TICK(tick,md->last_thinktime) > MIN_MOBTHINKTIME)
 	{
 		if (DIFF_TICK(tick,md->last_pcneartime) < battle_config.mob_active_time)
-			return (int)mob_ai_sub_hard(md, tick);
+			return (int32)mob_ai_sub_hard(md, tick);
 		md->last_pcneartime = 0;
 	}
 
@@ -2124,7 +2124,7 @@ static int32 mob_ai_sub_lazy(struct mob_data *md, va_list args)
 		DIFF_TICK(tick,md->last_thinktime) > MIN_MOBTHINKTIME)
 	{
 		if (DIFF_TICK(tick,md->last_pcneartime) < battle_config.boss_active_time)
-			return (int)mob_ai_sub_hard(md, tick);
+			return (int32)mob_ai_sub_hard(md, tick);
 		md->last_pcneartime = 0;
 	}
 
@@ -2369,7 +2369,7 @@ int32 mob_deleteslave_sub(struct block_list *bl,va_list ap)
 	nullpo_ret(bl);
 	nullpo_ret(md = (struct mob_data *)bl);
 
-	id=va_arg(ap,int);
+	id=va_arg(ap,int32);
 	if(md->master_id > 0 && md->master_id == id )
 		status_kill(bl);
 	return 0;
@@ -2530,7 +2530,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int32 damage)
 		else if (md->tdmg == UINT_MAX)
 			damage = 0; //Stop recording damage once the cap has been reached.
 		else { //Cap damage log...
-			damage = (int)(UINT_MAX - md->tdmg);
+			damage = (int32)(UINT_MAX - md->tdmg);
 			md->tdmg = UINT_MAX;
 		}
 		if ((src != &md->bl) && md->state.aggressive) //No longer aggressive, change to retaliate AI.
@@ -2582,14 +2582,14 @@ int32 mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int
 		if (battle_config.drops_by_luk) // Drops affected by luk as a fixed increase [Valaris]
 			drop_rate += status_get_luk(src) * battle_config.drops_by_luk / 100;
 		if (battle_config.drops_by_luk2) // Drops affected by luk as a % increase [Skotlex]
-			drop_rate += (int)(0.5 + drop_rate * status_get_luk(src) * battle_config.drops_by_luk2 / 10000.);
+			drop_rate += (int32)(0.5 + drop_rate * status_get_luk(src) * battle_config.drops_by_luk2 / 10000.);
 
 		if (src->type == BL_PC) { // Player specific drop rate adjustments
 			map_session_data *sd = (map_session_data*)src;
 			int32 drop_rate_bonus = 100;
 
 			// In PK mode players get an additional drop chance bonus of 25% if there is a 20 level difference
-			if( battle_config.pk_mode && (int)(mob->lv - sd->status.base_level) >= 20 ){
+			if( battle_config.pk_mode && (int32)(mob->lv - sd->status.base_level) >= 20 ){
 				drop_rate_bonus += 25;
 			}
 
@@ -2611,7 +2611,7 @@ int32 mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int
 			} else
 				cap = battle_config.drop_rate_cap;
 
-			drop_rate = (int)( 0.5 + drop_rate * drop_rate_bonus / 100. );
+			drop_rate = (int32)( 0.5 + drop_rate * drop_rate_bonus / 100. );
 
 			// Now limit the drop rate to never be exceed the cap (default: 90%), unless it is originally above it already.
 			if( drop_rate > cap && base_rate < cap ){
@@ -2807,7 +2807,7 @@ int32 mob_dead(struct mob_data *md, struct block_list *src, int32 type)
 
 			if(battle_config.zeny_from_mobs && md->level) {
 				 // zeny calculation moblv + random moblv [Valaris]
-				zeny=(int) ((md->level+rnd()%md->level)*per*bonus/100.);
+				zeny=(int32) ((md->level+rnd()%md->level)*per*bonus/100.);
 				if( md->get_bosstype() == BOSSTYPE_MVP )
 					zeny*=rnd()%250;
 			}
@@ -3563,7 +3563,7 @@ int32 mob_warpslave_sub(struct block_list *bl,va_list ap)
 	struct block_list *master;
 	short x,y,range=0;
 	master = va_arg(ap, struct block_list*);
-	range = va_arg(ap, int);
+	range = va_arg(ap, int32);
 
 	if(md->master_id!=master->id)
 		return 0;
@@ -3593,7 +3593,7 @@ int32 mob_countslave_sub(struct block_list *bl,va_list ap)
 {
 	int32 id;
 	struct mob_data *md;
-	id=va_arg(ap,int);
+	id=va_arg(ap,int32);
 
 	md = (struct mob_data *)bl;
 	if( md->master_id==id )
@@ -3616,7 +3616,7 @@ int32 mob_countslave(struct block_list *bl)
  * @return 1 on removal, otherwise 0
  */
 int32 mob_removeslaves_sub(block_list *bl, va_list ap) {
-	int32 id = va_arg(ap, int);
+	int32 id = va_arg(ap, int32);
 	mob_data *md = (mob_data *)bl;
 
 	if (md != nullptr && md->master_id == id) {
@@ -6117,11 +6117,11 @@ static bool mob_parse_row_mobskilldb( char** str, size_t columns, size_t current
 	if( j < ARRAYLENGTH(cond2) )
 		ms->cond2 = cond2[j].id;
 
-	ms->val[0] = (int)strtol(str[12],nullptr,0);
-	ms->val[1] = (int)strtol(str[13],nullptr,0);
-	ms->val[2] = (int)strtol(str[14],nullptr,0);
-	ms->val[3] = (int)strtol(str[15],nullptr,0);
-	ms->val[4] = (int)strtol(str[16],nullptr,0);
+	ms->val[0] = (int32)strtol(str[12],nullptr,0);
+	ms->val[1] = (int32)strtol(str[13],nullptr,0);
+	ms->val[2] = (int32)strtol(str[14],nullptr,0);
+	ms->val[3] = (int32)strtol(str[15],nullptr,0);
+	ms->val[4] = (int32)strtol(str[16],nullptr,0);
 
 	if(ms->skill_id == NPC_EMOTION && mob_id > 0 &&
 		ms->val[1] == mob->status.mode)

+ 1 - 1
src/map/navi.cpp

@@ -362,7 +362,7 @@ void write_warp(std::ostream& os, const struct navi_link &nl) {
 	// 205 = airport  (currently we only support warps)
 	os << ((nl.npc->subtype == NPCTYPE_WARP) ? 200 : 201) << ", ";
 	// sprite id, 99999 = warp portal
-	os << ((nl.npc->vd.class_ == JT_WARPNPC) ? 99999 : (int)nl.npc->vd.class_) << ", ";
+	os << ((nl.npc->vd.class_ == JT_WARPNPC) ? 99999 : (int32)nl.npc->vd.class_) << ", ";
 	if (nl.name.empty())
 		os << "\"" << msrc->name << "_" << mdest->name << "_" << nl.id << "\", ";
 	else

+ 17 - 17
src/map/npc.cpp

@@ -885,7 +885,7 @@ int32 npc_isnear_sub(struct block_list* bl, va_list args) {
 		return 0;
 	}
 
-	int32 skill_id = va_arg(args, int);
+	int32 skill_id = va_arg(args, int32);
 
 	if (skill_id > 0) { //If skill_id > 0 that means is used for INF2_DISABLENEARNPC [Cydh]
 		std::shared_ptr<s_skill_db> skill = skill_db.find(skill_id);
@@ -986,7 +986,7 @@ static int32 npc_cloaked_sub(struct block_list *bl, va_list ap)
 
 	nullpo_ret(bl);
 	nullpo_ret(sd = (map_session_data *)bl);
-	int32 id = va_arg(ap, int);
+	int32 id = va_arg(ap, int32);
 
 	auto it = std::find(sd->cloaked_npc.begin(), sd->cloaked_npc.end(), id);
 
@@ -1229,7 +1229,7 @@ int32 npc_event_doall_sub(DBKey key, DBData *data, va_list ap)
 	nullpo_ret(ev = (struct event_data*)db_data2ptr(data));
 	nullpo_ret(c = va_arg(ap, int32 *));
 	nullpo_ret(name = va_arg(ap, const char *));
-	rid = va_arg(ap, int);
+	rid = va_arg(ap, int32);
 
 	p = strchr(p, ':'); // match only the event name
 	if( p && strcmpi(name, p) == 0 /* && !ev->nd->src_id */ ) // Do not run on duplicates. [Paradox924X]
@@ -1257,7 +1257,7 @@ static int32 npc_event_do_sub(DBKey key, DBData *data, va_list ap)
 	nullpo_ret(ev = (struct event_data*)db_data2ptr(data));
 	nullpo_ret(c = va_arg(ap, int32 *));
 	nullpo_ret(name = va_arg(ap, const char *));
-	rid = va_arg(ap, int);
+	rid = va_arg(ap, int32);
 
 	if( p && strcmpi(name, p) == 0 )
 	{
@@ -1800,7 +1800,7 @@ int32 npc_touch_areanpc_sub(struct block_list *bl, va_list ap)
 	nullpo_ret(bl);
 	nullpo_ret((sd = map_id2sd(bl->id)));
 
-	pc_id = va_arg(ap,int);
+	pc_id = va_arg(ap,int32);
 	name = va_arg(ap,char*);
 
 	if( sd->state.warping )
@@ -2270,8 +2270,8 @@ bool npc_scriptcont(map_session_data* sd, int32 id, bool closing){
 		TBL_NPC* nd_sd = (TBL_NPC*)map_id2bl(sd->npc_id);
 
 		ShowDebug("npc_scriptcont: %s (sd->npc_id=%d) is not %s (id=%d).\n",
-			nd_sd?(char*)nd_sd->name:"'Unknown NPC'", (int)sd->npc_id,
-			nd?(char*)nd->name:"'Unknown NPC'", (int)id);
+			nd_sd?(char*)nd_sd->name:"'Unknown NPC'", (int32)sd->npc_id,
+			nd?(char*)nd->name:"'Unknown NPC'", (int32)id);
 		return true;
 	}
 
@@ -2858,7 +2858,7 @@ e_purchase_result npc_buylist( map_session_data* sd, std::vector<s_npc_buy_list>
 	if( pc_inventoryblank(sd) < new_ )
 		return e_purchase_result::PURCHASE_FAIL_COUNT;	// Not enough space to store items
 
-	pc_payzeny(sd, (int)z, LOG_TYPE_NPC);
+	pc_payzeny(sd, (int32)z, LOG_TYPE_NPC);
 
 	for( int32 i = 0; i < item_list.size(); ++i ) {
 		t_itemid nameid = item_list[i].nameid;
@@ -2906,7 +2906,7 @@ e_purchase_result npc_buylist( map_session_data* sd, std::vector<s_npc_buy_list>
 			z = z * (double)skill * (double)battle_config.shop_exp/10000.;
 			if( z < 1 )
 				z = 1;
-			pc_gainexp(sd,nullptr,0,(int)z, 0);
+			pc_gainexp(sd,nullptr,0,(int32)z, 0);
 		}
 	}
 
@@ -3082,7 +3082,7 @@ uint8 npc_selllist(map_session_data* sd, int32 list_length, const PACKET_CZ_PC_S
 	if( z > MAX_ZENY )
 		z = MAX_ZENY;
 
-	pc_getzeny(sd, (int)z, LOG_TYPE_NPC);
+	pc_getzeny(sd, (int32)z, LOG_TYPE_NPC);
 
 	// custom merchant shop exp bonus
 	if( battle_config.shop_exp > 0 && z > 0 && ( skill = pc_checkskill(sd,MC_OVERCHARGE) ) > 0)
@@ -3096,7 +3096,7 @@ uint8 npc_selllist(map_session_data* sd, int32 list_length, const PACKET_CZ_PC_S
 			z = z * (double)skill * (double)battle_config.shop_exp/10000.;
 			if( z < 1 )
 				z = 1;
-			pc_gainexp(sd, nullptr, 0, (int)z, 0);
+			pc_gainexp(sd, nullptr, 0, (int32)z, 0);
 		}
 	}
 
@@ -3315,7 +3315,7 @@ e_purchase_result npc_barter_purchase( map_session_data& sd, std::shared_ptr<s_n
 		}
 	}
 
-	if( pc_payzeny( &sd, (int)requiredZeny, LOG_TYPE_BARTER ) != 0 ){
+	if( pc_payzeny( &sd, (int32)requiredZeny, LOG_TYPE_BARTER ) != 0 ){
 		return e_purchase_result::PURCHASE_FAIL_MONEY;
 	}
 
@@ -3425,7 +3425,7 @@ static int32 npc_unload_dup_sub(struct npc_data* nd, va_list args)
 {
 	int32 src_id;
 
-	src_id = va_arg(args, int);
+	src_id = va_arg(args, int32);
 	if (nd->src_id == src_id)
 		npc_unload(nd, true);
 	return 0;
@@ -4120,7 +4120,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
 		}
 		if( ( type == NPCTYPE_SHOP || type == NPCTYPE_MARKETSHOP ) && value*0.75 < id->value_sell*1.24 ) { // Exploit possible: you can buy and sell back with profit
 			ShowWarning("npc_parse_shop: Item %s [%u] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) at file '%s', line '%d'.\n",
-				id->name.c_str(), nameid2, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));
+				id->name.c_str(), nameid2, value, (int32)(value*0.75), id->value_sell, (int32)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));
 		}
 		if (type == NPCTYPE_MARKETSHOP && qty < -1) {
 			ShowWarning("npc_parse_shop: Item %s [%u] is stocked with invalid value %hd, changed to unlimited (-1). File '%s', line '%d'.\n",
@@ -4925,7 +4925,7 @@ static void npc_market_fromsql(void) {
 
 		if (list.value * 0.75 < id->value_sell * 1.24) { // Exploit possible: you can buy and sell back with profit
 			ShowWarning("npc_market_fromsql: Item %s [%u] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) in table '%s'. Assigning to current sell value.\n",
-						id->name.c_str(), list.nameid, list.value, (int)(list.value * 0.75), id->value_sell, (int)(id->value_sell * 1.24), market_table);
+						id->name.c_str(), list.nameid, list.value, (int32)(list.value * 0.75), id->value_sell, (int32)(id->value_sell * 1.24), market_table);
 			list.value = id->value_sell;
 		}
 
@@ -4974,7 +4974,7 @@ void npc_setcells(struct npc_data* nd)
 int32 npc_unsetcells_sub(struct block_list* bl, va_list ap)
 {
 	struct npc_data *nd = (struct npc_data*)bl;
-	int32 id =  va_arg(ap,int);
+	int32 id =  va_arg(ap,int32);
 	if (nd->bl.id == id) return 0;
 	npc_setcells(nd);
 	return 1;
@@ -5992,7 +5992,7 @@ void npc_read_event_script(void)
 	}
 
 	if (battle_config.etc_log) {
-		//Print32 summary.
+		//Print summary.
 		for (i = 0; i < NPCE_MAX; i++)
 			ShowInfo("%" PRIuPTR " '%s' events.\n", script_event[static_cast<enum npce_event>(i)].size(), npc_get_script_event_name(i));
 	}

+ 1 - 1
src/map/npc_chat.cpp

@@ -354,7 +354,7 @@ int32 npc_chat_sub(struct block_list* bl, va_list ap)
 		return 0;
 	
 	msg = va_arg(ap,char*);
-	len = va_arg(ap,int);
+	len = va_arg(ap,int32);
 	sd = va_arg(ap,map_session_data *);
 	
 	// iterate across all active sets

+ 2 - 2
src/map/party.cpp

@@ -1490,7 +1490,7 @@ void party_booking_register(map_session_data *sd, short level, short mapid, shor
 	}
 
 	memcpy(pb_ad->charname,sd->status.name,NAME_LENGTH);
-	pb_ad->starttime = (int)time(nullptr);
+	pb_ad->starttime = (int32)time(nullptr);
 	pb_ad->p_detail.level = level;
 	pb_ad->p_detail.mapid = mapid;
 
@@ -1513,7 +1513,7 @@ void party_booking_update(map_session_data *sd, short* job)
 	if( pb_ad == nullptr )
 		return;
 
-	pb_ad->starttime = (int)time(nullptr);// Update time.
+	pb_ad->starttime = (int32)time(nullptr);// Update time.
 
 	for(i = 0; i < MAX_PARTY_BOOKING_JOBS; i++)
 		if(job[i] != 0xFF)

+ 1 - 1
src/map/path.cpp

@@ -506,7 +506,7 @@ int32 distance_client(int32 dx, int32 dy)
 
 	if(temp_dist < 0) temp_dist = 0;
 
-	return ((int)temp_dist);
+	return ((int32)temp_dist);
 }
 
 bool direction_diagonal( enum directions direction ){

+ 19 - 19
src/map/pc.cpp

@@ -812,7 +812,7 @@ static TIMER_FUNC(pc_spiritball_timer){
 
 	sd->spiritball--;
 	if( i != sd->spiritball )
-		memmove(sd->spirit_timer+i, sd->spirit_timer+i+1, (sd->spiritball-i)*sizeof(int));
+		memmove(sd->spirit_timer+i, sd->spirit_timer+i+1, (sd->spiritball-i)*sizeof(int32));
 	sd->spirit_timer[sd->spiritball] = INVALID_TIMER;
 
 	clif_spiritball(&sd->bl);
@@ -844,14 +844,14 @@ void pc_addspiritball(map_session_data *sd,int32 interval,int32 max)
 			delete_timer(sd->spirit_timer[0],pc_spiritball_timer);
 		sd->spiritball--;
 		if( sd->spiritball != 0 )
-			memmove(sd->spirit_timer+0, sd->spirit_timer+1, (sd->spiritball)*sizeof(int));
+			memmove(sd->spirit_timer+0, sd->spirit_timer+1, (sd->spiritball)*sizeof(int32));
 		sd->spirit_timer[sd->spiritball] = INVALID_TIMER;
 	}
 
 	tid = add_timer(gettick()+interval, pc_spiritball_timer, sd->bl.id, 0);
 	ARR_FIND(0, sd->spiritball, i, sd->spirit_timer[i] == INVALID_TIMER || DIFF_TICK(get_timer(tid)->tick, get_timer(sd->spirit_timer[i])->tick) < 0);
 	if( i != sd->spiritball )
-		memmove(sd->spirit_timer+i+1, sd->spirit_timer+i, (sd->spiritball-i)*sizeof(int));
+		memmove(sd->spirit_timer+i+1, sd->spirit_timer+i, (sd->spiritball-i)*sizeof(int32));
 	sd->spirit_timer[i] = tid;
 	sd->spiritball++;
 	if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
@@ -1146,7 +1146,7 @@ void pc_inventory_rentals(map_session_data *sd)
 		} else {
 			uint32 expire_tick = (uint32)(sd->inventory.u.items_inventory[i].expire_time - time(nullptr));
 
-			clif_rental_time(sd, sd->inventory.u.items_inventory[i].nameid, (int)expire_tick);
+			clif_rental_time(sd, sd->inventory.u.items_inventory[i].nameid, (int32)expire_tick);
 			next_tick = umin(expire_tick * 1000U, next_tick);
 			c++;
 		}
@@ -5574,7 +5574,7 @@ int32 pc_modifybuyvalue(map_session_data *sd,int32 orig_value)
 		rate2 = 5+skill*4;
 	if(rate1 < rate2) rate1 = rate2;
 	if(rate1)
-		val = (int)((double)orig_value*(double)(100-rate1)/100.);
+		val = (int32)((double)orig_value*(double)(100-rate1)/100.);
 	if(val < battle_config.min_shop_buy)
 		val = battle_config.min_shop_buy;
 
@@ -5590,7 +5590,7 @@ int32 pc_modifysellvalue(map_session_data *sd,int32 orig_value)
 	if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)	//OverCharge
 		rate = 5+skill*2-((skill==10)? 1:0);
 	if(rate)
-		val = (int)((double)orig_value*(double)(100+rate)/100.);
+		val = (int32)((double)orig_value*(double)(100+rate)/100.);
 	if (val < battle_config.min_shop_sell)
 		val = battle_config.min_shop_sell;
 
@@ -6641,7 +6641,7 @@ int32 pc_show_steal(struct block_list *bl,va_list ap)
 	char output[100];
 
 	sd=va_arg(ap,map_session_data *);
-	itemid=va_arg(ap,int);
+	itemid=va_arg(ap,int32);
 
 	std::shared_ptr<item_data> id = item_db.find(itemid);
 
@@ -8238,7 +8238,7 @@ static void pc_calcexp(map_session_data *sd, t_exp *base_exp, t_exp *job_exp, st
 			bonus += sd->indexed_bonus.expaddclass[CLASS_ALL];
 
 		if (battle_config.pk_mode &&
-			(int)(status_get_lv(src) - sd->status.base_level) >= 20)
+			(int32)(status_get_lv(src) - sd->status.base_level) >= 20)
 			bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]
 
 		if (src && src->type == BL_MOB && pc_isvip(sd)) { // EXP bonus for VIP player
@@ -10264,7 +10264,7 @@ bool pc_setparam(map_session_data *sd,int64 type,int64 val_tmp)
 		if (val > pc_maxbaselv(sd)) //Capping to max
 			val = pc_maxbaselv(sd);
 		if (val > sd->status.base_level) {
-			for( int32 i = 0; i < (int)( val - sd->status.base_level ); i++ ){
+			for( int32 i = 0; i < (int32)( val - sd->status.base_level ); i++ ){
 				sd->status.status_point += statpoint_db.pc_gets_status_point( sd->status.base_level + i );
 				sd->status.trait_point += statpoint_db.pc_gets_trait_point( sd->status.base_level + i );
 			}
@@ -10332,7 +10332,7 @@ bool pc_setparam(map_session_data *sd,int64 type,int64 val_tmp)
 		sd->max_weight = val;
 		break;
 	case SP_HP:
-		sd->battle_status.hp = cap_value(val, 1, (int)sd->battle_status.max_hp);
+		sd->battle_status.hp = cap_value(val, 1, (int32)sd->battle_status.max_hp);
 		break;
 	case SP_MAXHP:
 		if (sd->status.base_level < 100)
@@ -10349,7 +10349,7 @@ bool pc_setparam(map_session_data *sd,int64 type,int64 val_tmp)
 		}
 		break;
 	case SP_SP:
-		sd->battle_status.sp = cap_value(val, 0, (int)sd->battle_status.max_sp);
+		sd->battle_status.sp = cap_value(val, 0, (int32)sd->battle_status.max_sp);
 		break;
 	case SP_MAXSP:
 		sd->battle_status.max_sp = cap_value(val, 1, battle_config.max_sp);
@@ -10361,7 +10361,7 @@ bool pc_setparam(map_session_data *sd,int64 type,int64 val_tmp)
 		}
 		break;
 	case SP_AP:
-		sd->battle_status.ap = cap_value(val, 0, (int)sd->battle_status.max_ap);
+		sd->battle_status.ap = cap_value(val, 0, (int32)sd->battle_status.max_ap);
 		break;
 	case SP_MAXAP:
 		sd->battle_status.max_ap = cap_value(val, 1, battle_config.max_ap);
@@ -10673,7 +10673,7 @@ static int32 jobchange_killclone(struct block_list *bl, va_list ap)
 		int32 flag;
 	md = (struct mob_data *)bl;
 	nullpo_ret(md);
-	flag = va_arg(ap, int);
+	flag = va_arg(ap, int32);
 
 	if (md->master_id && md->special_state.clone && md->master_id == flag)
 		status_kill(&md->bl);
@@ -12363,7 +12363,7 @@ int32 pc_equipswitch( map_session_data* sd, int32 index ){
 
 		return position;
 	}else{
-		std::map<int, int> unequipped;
+		std::map<int32, int32> unequipped;
 		int32 unequipped_position = 0;
 
 		// Unequip all items that interfere
@@ -12405,7 +12405,7 @@ int32 pc_equipswitch( map_session_data* sd, int32 index ){
 		}
 
 		// Place all unequipped items into the equip switch window
-		for( std::pair<int, int> pair : unequipped ){
+		for( std::pair<int32, int32> pair : unequipped ){
 			int32 unequipped_index = pair.first;
 			int32 unequipped_position = pair.second;
 
@@ -13059,7 +13059,7 @@ static TIMER_FUNC(pc_spiritcharm_timer){
 	sd->spiritcharm--;
 
 	if (i != sd->spiritcharm)
-		memmove(sd->spiritcharm_timer + i, sd->spiritcharm_timer + i + 1, (sd->spiritcharm - i) * sizeof(int));
+		memmove(sd->spiritcharm_timer + i, sd->spiritcharm_timer + i + 1, (sd->spiritcharm - i) * sizeof(int32));
 
 	sd->spiritcharm_timer[sd->spiritcharm] = INVALID_TIMER;
 
@@ -13098,7 +13098,7 @@ void pc_addspiritcharm(map_session_data *sd, int32 interval, int32 max, int32 ty
 			delete_timer(sd->spiritcharm_timer[0], pc_spiritcharm_timer);
 		sd->spiritcharm--;
 		if (sd->spiritcharm != 0)
-			memmove(sd->spiritcharm_timer + 0, sd->spiritcharm_timer + 1, (sd->spiritcharm) * sizeof(int));
+			memmove(sd->spiritcharm_timer + 0, sd->spiritcharm_timer + 1, (sd->spiritcharm) * sizeof(int32));
 		sd->spiritcharm_timer[sd->spiritcharm] = INVALID_TIMER;
 	}
 
@@ -13106,7 +13106,7 @@ void pc_addspiritcharm(map_session_data *sd, int32 interval, int32 max, int32 ty
 	ARR_FIND(0, sd->spiritcharm, i, sd->spiritcharm_timer[i] == INVALID_TIMER || DIFF_TICK(get_timer(tid)->tick, get_timer(sd->spiritcharm_timer[i])->tick) < 0);
 
 	if (i != sd->spiritcharm)
-		memmove(sd->spiritcharm_timer + i + 1, sd->spiritcharm_timer + i, (sd->spiritcharm - i) * sizeof(int));
+		memmove(sd->spiritcharm_timer + i + 1, sd->spiritcharm_timer + i, (sd->spiritcharm - i) * sizeof(int32));
 
 	sd->spiritcharm_timer[i] = tid;
 	sd->spiritcharm++;
@@ -14476,7 +14476,7 @@ uint8 pc_itemcd_check(map_session_data *sd, struct item_data *id, t_tick tick, u
 	// Send reply of delay remains
 	if (sc->getSCE(id->delay.sc)) {
 		const struct TimerData *timer = get_timer(sc->getSCE(id->delay.sc)->timer);
-		clif_msg_value(sd, MSI_ITEM_REUSE_LIMIT_SECOND, (int)(timer ? DIFF_TICK(timer->tick, tick) / 1000 : 99));
+		clif_msg_value(sd, MSI_ITEM_REUSE_LIMIT_SECOND, (int32)(timer ? DIFF_TICK(timer->tick, tick) / 1000 : 99));
 		return 1;
 	}
 

+ 16 - 16
src/map/pc.hpp

@@ -1496,10 +1496,10 @@ int32 pc_identifyall(map_session_data *sd, bool identify_item);
 bool pc_steal_item(map_session_data *sd,struct block_list *bl, uint16 skill_lv);
 int32 pc_steal_coin(map_session_data *sd,struct block_list *bl);
 
-int32 pc_modifybuyvalue(map_session_data*,int);
-int32 pc_modifysellvalue(map_session_data*,int);
+int32 pc_modifybuyvalue(map_session_data*,int32);
+int32 pc_modifysellvalue(map_session_data*,int32);
 
-int32 pc_follow(map_session_data*, int); // [MouseJstr]
+int32 pc_follow(map_session_data*, int32); // [MouseJstr]
 int32 pc_stop_following(map_session_data*);
 
 uint32 pc_maxbaselv(map_session_data *sd);
@@ -1513,30 +1513,30 @@ void pc_gainexp_disp(map_session_data *sd, t_exp base_exp, t_exp next_base_exp,
 void pc_lostexp(map_session_data *sd, t_exp base_exp, t_exp job_exp);
 t_exp pc_nextbaseexp(map_session_data *sd);
 t_exp pc_nextjobexp(map_session_data *sd);
-int32 pc_need_status_point(map_session_data *,int,int);
-int32 pc_maxparameterincrease(map_session_data*,int);
-bool pc_statusup(map_session_data*,int,int);
-int32 pc_statusup2(map_session_data*,int,int);
+int32 pc_need_status_point(map_session_data *,int32,int32);
+int32 pc_maxparameterincrease(map_session_data*,int32);
+bool pc_statusup(map_session_data*,int32,int32);
+int32 pc_statusup2(map_session_data*,int32,int32);
 int32 pc_getstat(map_session_data *sd, int32 type);
 int32 pc_setstat(map_session_data* sd, int32 type, int32 val);
-int32 pc_need_trait_point(map_session_data *, int, int);
-int32 pc_maxtraitparameterincrease(map_session_data*, int);
-bool pc_traitstatusup(map_session_data*, int, int);
-int32 pc_traitstatusup2(map_session_data*, int, int);
+int32 pc_need_trait_point(map_session_data *, int32, int32);
+int32 pc_maxtraitparameterincrease(map_session_data*, int32);
+bool pc_traitstatusup(map_session_data*, int32, int32);
+int32 pc_traitstatusup2(map_session_data*, int32, int32);
 void pc_skillup(map_session_data*,uint16 skill_id);
 int32 pc_allskillup(map_session_data*);
 int32 pc_resetlvl(map_session_data*,int32 type);
 int32 pc_resetstate(map_session_data*);
-int32 pc_resetskill(map_session_data*, int);
+int32 pc_resetskill(map_session_data*, int32);
 int32 pc_resetfeel(map_session_data*);
 int32 pc_resethate(map_session_data*);
 bool pc_equipitem(map_session_data *sd, short n, int32 req_pos, bool equipswitch=false);
-bool pc_unequipitem(map_session_data*,int,int);
+bool pc_unequipitem(map_session_data*,int32,int32);
 int32 pc_equipswitch( map_session_data* sd, int32 index );
 void pc_equipswitch_remove( map_session_data* sd, int32 index );
 void pc_checkitem(map_session_data*);
 void pc_check_available_item(map_session_data *sd, uint8 type);
-int32 pc_useitem(map_session_data*,int);
+int32 pc_useitem(map_session_data*,int32);
 
 int32 pc_skillatk_bonus(map_session_data *sd, uint16 skill_id);
 int32 pc_sub_skillatk_bonus(map_session_data *sd, uint16 skill_id);
@@ -1549,14 +1549,14 @@ void pc_revive(map_session_data *sd,uint32 hp, uint32 sp, uint32 ap = 0);
 bool pc_revive_item(map_session_data *sd);
 void pc_heal(map_session_data *sd,uint32 hp,uint32 sp, uint32 ap, int32 type);
 int32 pc_itemheal(map_session_data *sd, t_itemid itemid, int32 hp,int32 sp);
-int32 pc_percentheal(map_session_data *sd,int,int);
+int32 pc_percentheal(map_session_data *sd,int32,int32);
 bool pc_jobchange(map_session_data *sd, int32 job, char upper);
 void pc_setoption(map_session_data *,int32 type, int32 subtype = 0);
 bool pc_setcart(map_session_data* sd, int32 type);
 void pc_setfalcon(map_session_data* sd, int32 flag);
 void pc_setriding(map_session_data* sd, int32 flag);
 void pc_setmadogear(map_session_data* sd, bool flag, e_mado_type type = MADO_ROBOT);
-void pc_changelook(map_session_data *,int,int);
+void pc_changelook(map_session_data *,int32,int32);
 void pc_equiplookall(map_session_data *sd);
 void pc_set_costume_view(map_session_data *sd);
 

+ 1 - 1
src/map/quest.cpp

@@ -737,7 +737,7 @@ int32 quest_update_objective_sub(struct block_list *bl, va_list ap)
 	if( !sd->avail_quests )
 		return 0;
 	
-	if( sd->status.party_id != va_arg(ap, int))
+	if( sd->status.party_id != va_arg(ap, int32))
 		return 0;
 
 	quest_update_objective(sd, va_arg(ap, struct mob_data*));

+ 60 - 60
src/map/script.cpp

@@ -198,7 +198,7 @@ static int32 script_pos = 0, script_size = 0;
 
 static inline int32 GETVALUE(const unsigned char* buf, int32 i)
 {
-	return (int)MakeDWord(MakeWord(buf[i], buf[i+1]), MakeWord(buf[i+2], 0));
+	return (int32)MakeDWord(MakeWord(buf[i], buf[i+1]), MakeWord(buf[i+2], 0));
 }
 static inline void SETVALUE(unsigned char* buf, int32 i, int32 n)
 {
@@ -732,7 +732,7 @@ int32 add_str(const char* p)
 		memset(str_data + (str_data_size - 128), '\0', 128);
 	}
 
-	len=(int)strlen(p);
+	len=(int32)strlen(p);
 
 	// grow string buffer if neccessary
 	while( str_pos+len+1 >= str_size )
@@ -1343,7 +1343,7 @@ const char* parse_simpleexpr(const char *p)
 				size_t len = skip_escaped_c(p) - p;
 				size_t n = sv_unescape_c(buf, p, len);
 				if( n != 1 )
-					ShowDebug("parse_simpleexpr: unexpected length %d after unescape (\"%.*s\" -> %.*s)\n", (int)n, (int)len, p, (int)n, buf);
+					ShowDebug("parse_simpleexpr: unexpected length %d after unescape (\"%.*s\" -> %.*s)\n", (int32)n, (int32)len, p, (int32)n, buf);
 				p += len;
 				add_scriptb(*buf);
 				continue;
@@ -1678,7 +1678,7 @@ const char* parse_syntax(const char* p)
 				// check whether case label is integer or not
 				if(is_number(p)) {
 					//Numeric value
-					v = (int)strtol(p,&np,0);
+					v = (int32)strtol(p,&np,0);
 					if((*p == '-' || *p == '+') && ISDIGIT(p[1])) // pre-skip because '-' can not skip_word
 						p++;
 					p = skip_word(p);
@@ -1687,7 +1687,7 @@ const char* parse_syntax(const char* p)
 				} else {
 					//Check for constants
 					p2 = skip_word(p);
-					v = (int)(size_t) (p2-p); // length of word at p2
+					v = (int32)(size_t) (p2-p); // length of word at p2
 					memcpy(label,p,static_cast<int>(v));
 					label[v]='\0';
 					if( !script_get_constant(label, &v) )
@@ -4108,7 +4108,7 @@ int32 run_func(struct script_state *st)
 
 	data = &st->stack->stack_data[st->start];
 	if( data->type == C_NAME && str_data[data->u.num].type == C_FUNC ) {
-		func = (int)data->u.num;
+		func = (int32)data->u.num;
 		st->funcname = reference_getname(data);
 	} else {
 		ShowError("script:run_func: not a buildin command.\n");
@@ -4243,7 +4243,7 @@ TIMER_FUNC(run_script_timer){
 	}
 
 	while (node && st->sleep.timer != INVALID_TIMER) {
-		if ((int)__64BPRTSIZE(node->key) == st->oid && ((struct script_state *)node->data)->sleep.timer == st->sleep.timer) {
+		if ((int32)__64BPRTSIZE(node->key) == st->oid && ((struct script_state *)node->data)->sleep.timer == st->sleep.timer) {
 			script_erase_sleepdb(node);
 			st->sleep.timer = INVALID_TIMER;
 			break;
@@ -5655,10 +5655,10 @@ static int32 buildin_areawarp_sub(struct block_list *bl,va_list ap)
 	int32 x2,y2,x3,y3;
 
 	uint32 index = va_arg(ap,uint32);
-	x2 = va_arg(ap,int);
-	y2 = va_arg(ap,int);
-	x3 = va_arg(ap,int);
-	y3 = va_arg(ap,int);
+	x2 = va_arg(ap,int32);
+	y2 = va_arg(ap,int32);
+	x3 = va_arg(ap,int32);
+	y3 = va_arg(ap,int32);
 
 	if(index == 0)
 		pc_randomwarp((TBL_PC *)bl,CLR_TELEPORT,true);
@@ -5731,8 +5731,8 @@ BUILDIN_FUNC(areawarp)
 static int32 buildin_areapercentheal_sub(struct block_list *bl,va_list ap)
 {
 	int32 hp, sp;
-	hp = va_arg(ap, int);
-	sp = va_arg(ap, int);
+	hp = va_arg(ap, int32);
+	sp = va_arg(ap, int32);
 	pc_percentheal((TBL_PC *)bl,hp,sp);
 	return 0;
 }
@@ -6170,7 +6170,7 @@ BUILDIN_FUNC(input)
 		sd->state.menu_or_input = 0;
 		if( is_string_variable(name) )
 		{
-			int32 len = (int)strlen(sd->npc_str);
+			int32 len = (int32)strlen(sd->npc_str);
 			set_reg_str(st, sd, uid, name, sd->npc_str, script_getref(st,2));
 			script_pushint(st, (len > max ? 1 : len < min ? -1 : 0));
 		}
@@ -6941,12 +6941,12 @@ BUILDIN_FUNC(viewpoint)
 static int32 buildin_viewpointmap_sub(block_list *bl, va_list ap) {
 	int32 oid, type, x, y, id, color;
 
-	oid = va_arg(ap, int);
-	type = va_arg(ap, int);
-	x = va_arg(ap, int);
-	y = va_arg(ap, int);
-	id = va_arg(ap, int);
-	color = va_arg(ap, int);
+	oid = va_arg(ap, int32);
+	type = va_arg(ap, int32);
+	x = va_arg(ap, int32);
+	y = va_arg(ap, int32);
+	id = va_arg(ap, int32);
+	color = va_arg(ap, int32);
 
 	clif_viewpoint( *reinterpret_cast<map_session_data*>( bl ), oid, type, x, y, id, color );
 
@@ -8805,7 +8805,7 @@ BUILDIN_FUNC(readparam)
 	// If you use a parameter, return the value behind it
 	if( reference_toparam(data) ){
 		get_val_(st, data, sd);
-		value = (int)data->u.num;
+		value = (int32)data->u.num;
 	}else{
 		value = static_cast<int>(pc_readparam(sd,script_getnum(st, 2)));
 	}
@@ -9646,7 +9646,7 @@ BUILDIN_FUNC(successrefitem) {
 		}
 		if (sd->inventory.u.items_inventory[i].refine == battle_config.blacksmith_fame_refine_threshold &&
 			sd->inventory.u.items_inventory[i].card[0] == CARD0_FORGE &&
-			sd->status.char_id == (int)MakeDWord(sd->inventory.u.items_inventory[i].card[2],sd->inventory.u.items_inventory[i].card[3]) &&
+			sd->status.char_id == (int32)MakeDWord(sd->inventory.u.items_inventory[i].card[2],sd->inventory.u.items_inventory[i].card[3]) &&
 			sd->inventory_data[i]->type == IT_WEAPON )
 		{ // Fame point system [DracoRPG]
 			switch( sd->inventory_data[i]->weapon_level ){
@@ -10746,7 +10746,7 @@ BUILDIN_FUNC(gettimetick)	/* Asgard Version */
 	case 2:
 		//type 2:(Get the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
 		//        from the system clock.)
-		script_pushint(st,(int)time(nullptr));
+		script_pushint(st,(int32)time(nullptr));
 		break;
 	case 1:
 		//type 1:(Second Ticks: 0-86399, 00:00:00-23:59:59)
@@ -11322,7 +11322,7 @@ BUILDIN_FUNC(areamonster)
 { //same fix but with killmonster instead - stripping events from mobs.
 	TBL_MOB* md = (TBL_MOB*)bl;
 	char *event=va_arg(ap,char *);
-	int32 allflag=va_arg(ap,int);
+	int32 allflag=va_arg(ap,int32);
 
 	md->state.npc_killmonster = 1;
 
@@ -11341,7 +11341,7 @@ static int32 buildin_killmonster_sub(struct block_list *bl,va_list ap)
 {
 	TBL_MOB* md = (TBL_MOB*)bl;
 	char *event=va_arg(ap,char *);
-	int32 allflag=va_arg(ap,int);
+	int32 allflag=va_arg(ap,int32);
 
 	if(!allflag){
 		if(strcmp(event,md->npc_event)==0)
@@ -11870,16 +11870,16 @@ BUILDIN_FUNC(announce)
 		}
 
 		if (fontColor)
-			clif_broadcast2(bl, mes, (int)strlen(mes)+1, strtol(fontColor, (char **)nullptr, 0), fontType, fontSize, fontAlign, fontY, target);
+			clif_broadcast2(bl, mes, (int32)strlen(mes)+1, strtol(fontColor, (char **)nullptr, 0), fontType, fontSize, fontAlign, fontY, target);
 		else
-			clif_broadcast(bl, mes, (int)strlen(mes)+1, flag&BC_COLOR_MASK, target);
+			clif_broadcast(bl, mes, (int32)strlen(mes)+1, flag&BC_COLOR_MASK, target);
 	}
 	else
 	{
 		if (fontColor)
-			intif_broadcast2(mes, (int)strlen(mes)+1, strtol(fontColor, (char **)nullptr, 0), fontType, fontSize, fontAlign, fontY);
+			intif_broadcast2(mes, (int32)strlen(mes)+1, strtol(fontColor, (char **)nullptr, 0), fontType, fontSize, fontAlign, fontY);
 		else
-			intif_broadcast(mes, (int)strlen(mes)+1, flag&BC_COLOR_MASK);
+			intif_broadcast(mes, (int32)strlen(mes)+1, flag&BC_COLOR_MASK);
 	}
 	return SCRIPT_CMD_SUCCESS;
 }
@@ -11889,13 +11889,13 @@ BUILDIN_FUNC(announce)
 static int32 buildin_announce_sub(struct block_list *bl, va_list ap)
 {
 	char *mes       = va_arg(ap, char *);
-	int32   len       = va_arg(ap, int);
-	int32   type      = va_arg(ap, int);
+	int32   len       = va_arg(ap, int32);
+	int32   type      = va_arg(ap, int32);
 	char *fontColor = va_arg(ap, char *);
-	short fontType  = (short)va_arg(ap, int);
-	short fontSize  = (short)va_arg(ap, int);
-	short fontAlign = (short)va_arg(ap, int);
-	short fontY     = (short)va_arg(ap, int);
+	short fontType  = (short)va_arg(ap, int32);
+	short fontSize  = (short)va_arg(ap, int32);
+	short fontAlign = (short)va_arg(ap, int32);
+	short fontY     = (short)va_arg(ap, int32);
 	if (fontColor)
 		clif_broadcast2(bl, mes, len, strtol(fontColor, (char **)nullptr, 0), fontType, fontSize, fontAlign, fontY, SELF);
 	else
@@ -13257,7 +13257,7 @@ static int32 buildin_addrid_sub(struct block_list *bl,va_list ap)
 	struct script_state* st;
 
 	st = va_arg(ap,struct script_state*);
-	forceflag = va_arg(ap,int);
+	forceflag = va_arg(ap,int32);
 
 	if(!forceflag || !sd->st)
 		if(sd->status.account_id != st->rid)
@@ -13717,9 +13717,9 @@ BUILDIN_FUNC(emotion)
 
 static int32 buildin_maprespawnguildid_sub_pc(map_session_data* sd, va_list ap)
 {
-	int16 m=va_arg(ap,int);
-	int32 g_id=va_arg(ap,int);
-	int32 flag=va_arg(ap,int);
+	int16 m=va_arg(ap,int32);
+	int32 g_id=va_arg(ap,int32);
+	int32 flag=va_arg(ap,int32);
 
 	if(!sd || sd->bl.m != m)
 		return 0;
@@ -15172,7 +15172,7 @@ BUILDIN_FUNC(soundeffect)
 int32 soundeffect_sub(struct block_list* bl,va_list ap)
 {
 	char* name = va_arg(ap,char*);
-	int32 type = va_arg(ap,int);
+	int32 type = va_arg(ap,int32);
 
 	clif_soundeffect( *bl, name, type, SELF );
 
@@ -15846,7 +15846,7 @@ BUILDIN_FUNC(getpetinfo)
 		case PETINFO_INTIMATE:	script_pushint(st,pd->pet.intimate); break;
 		case PETINFO_HUNGRY:	script_pushint(st,pd->pet.hungry); break;
 		case PETINFO_RENAMED:	script_pushint(st,pd->pet.rename_flag); break;
-		case PETINFO_LEVEL:		script_pushint(st,(int)pd->pet.level); break;
+		case PETINFO_LEVEL:		script_pushint(st,(int32)pd->pet.level); break;
 		case PETINFO_BLOCKID:	script_pushint(st,pd->bl.id); break;
 		case PETINFO_EGGID:		script_pushint(st,pd->pet.egg_id); break;
 		case PETINFO_FOODID:	script_pushint(st,pd->get_pet_db()->FoodID); break;
@@ -16917,7 +16917,7 @@ BUILDIN_FUNC(getstrlen)
 {
 
 	const char *str = script_getstr(st,2);
-	int32 len = (str) ? (int)strlen(str) : 0;
+	int32 len = (str) ? (int32)strlen(str) : 0;
 
 	script_pushint(st,len);
 	return SCRIPT_CMD_SUCCESS;
@@ -17735,7 +17735,7 @@ BUILDIN_FUNC(setnpcdisplay)
 	if( newname )
 		npc_setdisplayname(nd, newname);
 
-	if( size != -1 && size != (int)nd->size )
+	if( size != -1 && size != (int32)nd->size )
 		nd->size = size;
 	else
 		size = -1;
@@ -17764,7 +17764,7 @@ BUILDIN_FUNC(axtoi)
 #if LONG_MAX > INT_MAX || LONG_MIN < INT_MIN
 	value = cap_value(value, INT_MIN, INT_MAX);
 #endif
-	script_pushint(st, (int)value);
+	script_pushint(st, (int32)value);
 	return SCRIPT_CMD_SUCCESS;
 }
 
@@ -17776,7 +17776,7 @@ BUILDIN_FUNC(strtol)
 #if LONG_MAX > INT_MAX || LONG_MIN < INT_MIN
 	value = cap_value(value, INT_MIN, INT_MAX);
 #endif
-	script_pushint(st, (int)value);
+	script_pushint(st, (int32)value);
 	return SCRIPT_CMD_SUCCESS;
 }
 
@@ -17807,7 +17807,7 @@ BUILDIN_FUNC(sqrt)
 	double i, a;
 	i = script_getnum(st,2);
 	a = sqrt(i);
-	script_pushint(st,(int)a);
+	script_pushint(st,(int32)a);
 	return SCRIPT_CMD_SUCCESS;
 }
 
@@ -17817,7 +17817,7 @@ BUILDIN_FUNC(pow)
 	a = script_getnum(st,2);
 	b = script_getnum(st,3);
 	i = pow(a,b);
-	script_pushint(st,(int)i);
+	script_pushint(st,(int32)i);
 	return SCRIPT_CMD_SUCCESS;
 }
 
@@ -21704,10 +21704,10 @@ BUILDIN_FUNC(instance_id)
 static int32 buildin_instance_warpall_sub(struct block_list *bl, va_list ap)
 {
 	uint32 m = va_arg(ap,uint32);
-	int32 x = va_arg(ap,int);
-	int32 y = va_arg(ap,int);
-	int32 instance_id = va_arg(ap, int);
-	int32 flag = va_arg(ap, int);
+	int32 x = va_arg(ap,int32);
+	int32 y = va_arg(ap,int32);
+	int32 instance_id = va_arg(ap, int32);
+	int32 flag = va_arg(ap, int32);
 	map_session_data *sd;
 
 	nullpo_retr(0, bl);
@@ -22223,13 +22223,13 @@ static int32 buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
 {
 	TBL_MOB* md		= (TBL_MOB*)bl;
 	struct block_list *tbl;
-	int32 mobid		= va_arg(ap,int);
-	uint16 skill_id	= va_arg(ap,int);
-	uint16 skill_lv	= va_arg(ap,int);
-	int32 casttime	= va_arg(ap,int);
-	int32 cancel		= va_arg(ap,int);
-	int32 emotion		= va_arg(ap,int);
-	int32 target		= va_arg(ap,int);
+	int32 mobid		= va_arg(ap,int32);
+	uint16 skill_id	= va_arg(ap,int32);
+	uint16 skill_lv	= va_arg(ap,int32);
+	int32 casttime	= va_arg(ap,int32);
+	int32 cancel		= va_arg(ap,int32);
+	int32 emotion		= va_arg(ap,int32);
+	int32 target		= va_arg(ap,int32);
 
 	if( md->mob_id != mobid )
 		return 0;
@@ -25853,7 +25853,7 @@ BUILDIN_FUNC(round) {
 		script_pushint(st, num + precision - (num % precision));
 	}
 	else {
-		script_pushint(st, (int)(round(num / (precision * 1.))) * precision);
+		script_pushint(st, (int32)(round(num / (precision * 1.))) * precision);
 	}
 
 	return SCRIPT_CMD_SUCCESS;
@@ -27503,7 +27503,7 @@ BUILDIN_FUNC(preg_match) {
 	re = pcre_compile(pattern, 0, &error, &erroffset, nullptr);
 	pcreExtra = pcre_study(re, 0, &error);
 
-	r = pcre_exec(re, pcreExtra, subject, (int)strlen(subject), offset, 0, subStrVec, 30);
+	r = pcre_exec(re, pcreExtra, subject, (int32)strlen(subject), offset, 0, subStrVec, 30);
 
 	pcre_free(re);
 	if (pcreExtra != nullptr)

+ 58 - 58
src/map/skill.cpp

@@ -760,7 +760,7 @@ int32 skill_calc_heal(struct block_list *src, struct block_list *target, uint16
 	}
 
 #ifdef RENEWAL
-	hp = (int)(hp * global_bonus);
+	hp = (int32)(hp * global_bonus);
 
 	// Final heal increased by HPlus.
 	// Is this the right place for this??? [Rytech]
@@ -2611,7 +2611,7 @@ int32 skill_counter_additional_effect (struct block_list* src, struct block_list
 		map_getmapflag(sd->bl.m, MF_NOSUNMOONSTARMIRACLE) == 0) {	//SG_MIRACLE [Komurka]
 		// 0.005% chance per sg_miracle_skill_ratio
 		// Chance is further reduced if agi is above 46
-		if (rnd_chance(battle_config.sg_miracle_skill_ratio, 20000) && rnd_chance(46, (int)sd->battle_status.agi))
+		if (rnd_chance(battle_config.sg_miracle_skill_ratio, 20000) && rnd_chance(46, (int32)sd->battle_status.agi))
 			sc_start(src, src, SC_MIRACLE, 100, 1, battle_config.sg_miracle_skill_duration);
 	}
 
@@ -3693,7 +3693,7 @@ int64 skill_attack (int32 attack_type, struct block_list* src, struct block_list
 
 	if ((dmg.flag & BF_MAGIC) && tsc && tsc->getSCE(SC_MAXPAIN)) {
 		auto * sce = tsc->getSCE(SC_MAXPAIN);
-		sce->val3 = (int)damage;
+		sce->val3 = (int32)damage;
 		sce->val2 = 0;
 		if (!tsc->getSCE(SC_KYOMU)) //SC_KYOMU invalidates reflecting ability.
 			skill_castend_damage_id(bl, src, NPC_MAXPAIN_ATK, sce->val1, tick, flag);
@@ -4134,7 +4134,7 @@ int64 skill_attack (int32 attack_type, struct block_list* src, struct block_list
  * Checking bl battle flag and display damage
  * then call func with source,target,skill_id,skill_lv,tick,flag
  *------------------------------------------*/
-typedef int32 (*SkillFunc)(struct block_list *, struct block_list *, int, int, t_tick, int);
+typedef int32 (*SkillFunc)(struct block_list *, struct block_list *, int32, int32, t_tick, int32);
 int32 skill_area_sub(struct block_list *bl, va_list ap)
 {
 	struct block_list *src;
@@ -4146,10 +4146,10 @@ int32 skill_area_sub(struct block_list *bl, va_list ap)
 	nullpo_ret(bl);
 
 	src = va_arg(ap,struct block_list *);
-	skill_id = va_arg(ap,int);
-	skill_lv = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
+	skill_lv = va_arg(ap,int32);
 	tick = va_arg(ap,t_tick);
-	flag = va_arg(ap,int);
+	flag = va_arg(ap,int32);
 	func = va_arg(ap,SkillFunc);
 
 	if (flag&BCT_WOS && src == bl)
@@ -4181,7 +4181,7 @@ static int32 skill_check_unit_range_sub(struct block_list *bl, va_list ap)
 	if(!unit->alive)
 		return 0;
 
-	skill_id = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
 	g_skill_id = unit->group->skill_id;
 
 	switch (skill_id) {
@@ -4261,7 +4261,7 @@ static int32 skill_check_unit_range2_sub (struct block_list *bl, va_list ap)
 	if(bl->prev == nullptr)
 		return 0;
 
-	skill_id = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
 
 	if( status_isdead(*bl) && skill_id != AL_WARP )
 		return 0;
@@ -5754,7 +5754,7 @@ int32 skill_castend_damage_id (struct block_list* src, struct block_list *bl, ui
 			if ((skill_id == SP_SHA || skill_id == SP_SWHOO) && !battle_config.allow_es_magic_pc && bl->type != BL_MOB)
 				break;
 
-			heal = (int)skill_attack(skill_get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, sflag);
+			heal = (int32)skill_attack(skill_get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, sflag);
 
 			switch (skill_id) {
 				case NPC_VAMPIRE_GIFT:
@@ -6337,7 +6337,7 @@ int32 skill_castend_damage_id (struct block_list* src, struct block_list *bl, ui
 	case NPC_BLOODDRAIN:
 	case NPC_ENERGYDRAIN:
 		{
-			int32 heal = (int)skill_attack( (skill_id == NPC_BLOODDRAIN) ? BF_WEAPON : BF_MAGIC,
+			int32 heal = (int32)skill_attack( (skill_id == NPC_BLOODDRAIN) ? BF_WEAPON : BF_MAGIC,
 					src, src, bl, skill_id, skill_lv, tick, flag);
 			if (heal > 0){
 				clif_skill_nodamage(nullptr, *src, AL_HEAL, heal);
@@ -6447,7 +6447,7 @@ int32 skill_castend_damage_id (struct block_list* src, struct block_list *bl, ui
 
 	case WL_DRAINLIFE:
 		{
-			int32 heal = (int)skill_attack(skill_get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag);
+			int32 heal = (int32)skill_attack(skill_get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag);
 			int32 rate = 70 + 5 * skill_lv;
 
 			heal = heal * (5 + 5 * skill_lv) / 100;
@@ -7173,10 +7173,10 @@ int32 skill_castend_damage_id (struct block_list* src, struct block_list *bl, ui
  */
 static int32 skill_apply_songs(struct block_list* target, va_list ap)
 {
-	int32 flag = va_arg(ap, int);
+	int32 flag = va_arg(ap, int32);
 	struct block_list* src = va_arg(ap, struct block_list*);
-	uint16 skill_id = static_cast<uint16>(va_arg(ap, int));
-	uint16 skill_lv = static_cast<uint16>(va_arg(ap, int));
+	uint16 skill_id = static_cast<uint16>(va_arg(ap, int32));
+	uint16 skill_lv = static_cast<uint16>(va_arg(ap, int32));
 	t_tick tick = va_arg(ap, t_tick);
 
 	if (flag & BCT_WOS && src == target)
@@ -13464,7 +13464,7 @@ TIMER_FUNC(skill_castend_id){
 			// When monsters used a skill they won't walk for amotion, this does not apply to players
 			// This is also important for monster skill usage behavior
 			if (src->type == BL_MOB)
-				unit_set_walkdelay(src, tick, max((int)status_get_amotion(src), skill_get_walkdelay(ud->skill_id, ud->skill_lv)), 1);
+				unit_set_walkdelay(src, tick, max((int32)status_get_amotion(src), skill_get_walkdelay(ud->skill_id, ud->skill_lv)), 1);
 			else
 				unit_set_walkdelay(src, tick, battle_config.default_walk_delay + skill_get_walkdelay(ud->skill_id, ud->skill_lv), 1);
 		}
@@ -13678,7 +13678,7 @@ TIMER_FUNC(skill_castend_pos){
 		// When monsters used a skill they won't walk for amotion, this does not apply to players
 		// This is also important for monster skill usage behavior
 		if (src->type == BL_MOB)
-			unit_set_walkdelay(src, tick, max((int)status_get_amotion(src), skill_get_walkdelay(ud->skill_id, ud->skill_lv)), 1);
+			unit_set_walkdelay(src, tick, max((int32)status_get_amotion(src), skill_get_walkdelay(ud->skill_id, ud->skill_lv)), 1);
 		else
 			unit_set_walkdelay(src, tick, battle_config.default_walk_delay + skill_get_walkdelay(ud->skill_id, ud->skill_lv), 1);
 		map_freeblock_lock();
@@ -14466,7 +14466,7 @@ int32 skill_castend_pos2(struct block_list* src, int32 x, int32 y, uint16 skill_
 				switch (skill_lv) {
 				case 1: {
 					// TODO:
-					int32 duration = (int)(unit_group->limit - DIFF_TICK(tick, unit_group->tick));
+					int32 duration = (int32)(unit_group->limit - DIFF_TICK(tick, unit_group->tick));
 
 					skill_delunit(su);
 					skill_unitsetting(src, GN_DEMONIC_FIRE, 1, x, y, duration);
@@ -14918,7 +14918,7 @@ static int32 skill_dance_overlap_sub(struct block_list* bl, va_list ap)
 {
 	struct skill_unit* target = (struct skill_unit*)bl;
 	struct skill_unit* src = va_arg(ap, struct skill_unit*);
-	int32 flag = va_arg(ap, int);
+	int32 flag = va_arg(ap, int32);
 
 	if (src == target)
 		return 0;
@@ -16134,7 +16134,7 @@ int32 skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t
 						skill_attack(skill_get_type(sg->skill_id),ss,&unit->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
 					break;
 				case NPC_WIDESUCK: {
-						int32 heal = (int)skill_attack(skill_get_type(sg->skill_id),ss,&unit->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
+						int32 heal = (int32)skill_attack(skill_get_type(sg->skill_id),ss,&unit->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
 
 						if (heal > 0) {
 							clif_skill_nodamage(ss,*bl,sg->skill_id,sg->skill_lv);
@@ -17087,7 +17087,7 @@ int64 skill_unit_ondamaged(struct skill_unit *unit, int64 damage)
 		case UNT_WALLOFTHORN:
 		case UNT_REVERBERATION:
 		case UNT_NETHERWORLD:
-			unit->val1 -= (int)cap_value(damage,INT_MIN,INT_MAX);
+			unit->val1 -= (int32)cap_value(damage,INT_MIN,INT_MAX);
 			break;
 		default:
 			damage = 0;
@@ -17120,7 +17120,7 @@ int32 skill_check_condition_char_sub (struct block_list *bl, va_list ap)
 
 	c=va_arg(ap,int32 *);
 	p_sd = va_arg(ap, int32 *);
-	skill_id = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
 
 	bool is_chorus = skill_get_inf2(skill_id, INF2_ISCHORUS);
 
@@ -17285,9 +17285,9 @@ static int32 skill_check_condition_mob_master_sub(struct block_list *bl, va_list
 	struct mob_data *md;
 
 	md=(struct mob_data*)bl;
-	src_id=va_arg(ap,int);
-	mob_class=va_arg(ap,int);
-	skill=va_arg(ap,int);
+	src_id=va_arg(ap,int32);
+	mob_class=va_arg(ap,int32);
+	skill=va_arg(ap,int32);
 	c=va_arg(ap,int32 *);
 
 	switch (skill) {
@@ -17414,7 +17414,7 @@ int32 skill_check_bl_sc(struct block_list *target, va_list ap) {
 
 	nullpo_ret(target);
 
-	int32 sc_id = va_arg(ap,int);
+	int32 sc_id = va_arg(ap,int32);
 
 	status_change *sc = status_get_sc(target);
 
@@ -19305,10 +19305,10 @@ int32 skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
 	if (battle_config.cast_rate != 100)
 		time = time * battle_config.cast_rate / 100;
 	// return final cast time
-	time = max((int)time, 0);
+	time = max((int32)time, 0);
 	//ShowInfo("Castime castfix = %f\n",time);
 
-	return (int)time;
+	return (int32)time;
 }
 
 #ifndef RENEWAL_CAST
@@ -19324,7 +19324,7 @@ int32 skill_castfix_sc(struct block_list *bl, double time, uint8 flag)
 		return 0;
 
 	if (bl->type == BL_MOB || bl->type == BL_NPC)
-		return (int)time;
+		return (int32)time;
 
 	status_change *sc = status_get_sc(bl);
 
@@ -19348,7 +19348,7 @@ int32 skill_castfix_sc(struct block_list *bl, double time, uint8 flag)
 	time = std::max(time, 0.0);
 	//ShowInfo("Castime castfix_sc = %f\n",time);
 
-	return (int)time;
+	return (int32)time;
 }
 #else
 /**
@@ -19374,7 +19374,7 @@ int32 skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint1
 		return 0;
 
 	if (bl->type == BL_MOB || bl->type == BL_NPC)
-		return (int)time;
+		return (int32)time;
 
 	status_change *sc = status_get_sc(bl);
 	map_session_data *sd = BL_CAST(BL_PC, bl);
@@ -19383,7 +19383,7 @@ int32 skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint1
 
 	if (fixed < 0) {
 		if (battle_config.default_fixed_castrate > 0) {
-			fixed = (int)time * battle_config.default_fixed_castrate / 100; // fixed time
+			fixed = (int32)time * battle_config.default_fixed_castrate / 100; // fixed time
 			time = time * (100 - battle_config.default_fixed_castrate) / 100; // variable time
 		} else
 			fixed = 0;
@@ -19489,9 +19489,9 @@ int32 skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint1
 		time = time * (1 - sqrt(((float)(status_get_dex(bl) * 2 + status_get_int(bl)) / battle_config.vcast_stat_scale)));
 
 	time = time * (1 - (float)min(reduce_cast_rate, 100) / 100);
-	time = max((int)time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed, 0); //Underflow checking/capping
+	time = max((int32)time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed, 0); //Underflow checking/capping
 
-	return (int)time;
+	return (int32)time;
 }
 #endif
 
@@ -19606,7 +19606,7 @@ int32 skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
 
 	//ShowInfo("Delay delayfix = %f\n",time);
 
-	return max((int)time,0);
+	return max((int32)time,0);
 }
 
 
@@ -19758,7 +19758,7 @@ void skill_weaponrefine( map_session_data& sd, int32 idx ){
 			if( sd.class_&JOBL_THIRD )
 				per += 10;
 			else
-				per += (((signed int)sd.status.job_level)-50)/2; //Updated per the new kro descriptions. [Skotlex]
+				per += (((int32)sd.status.job_level)-50)/2; //Updated per the new kro descriptions. [Skotlex]
 
 			pc_delitem(&sd, i, 1, 0, 0, LOG_TYPE_OTHER);
 			if (per > rnd() % 100) {
@@ -19782,7 +19782,7 @@ void skill_weaponrefine( map_session_data& sd, int32 idx ){
 				clif_misceffect( sd.bl, NOTIFYEFFECT_REFINE_SUCCESS );
 				if(item->refine == 10 &&
 					item->card[0] == CARD0_FORGE &&
-					(int)MakeDWord(item->card[2],item->card[3]) == sd.status.char_id)
+					(int32)MakeDWord(item->card[2],item->card[3]) == sd.status.char_id)
 				{ // Fame point system [DracoRPG]
 					switch(ditem->weapon_level){
 						case 1:
@@ -19870,7 +19870,7 @@ int32 skill_autospell(map_session_data *sd, uint16 skill_id)
 static int32 skill_sit_count(struct block_list *bl, va_list ap)
 {
 	map_session_data *sd = (map_session_data*)bl;
-	int32 flag = va_arg(ap, int);
+	int32 flag = va_arg(ap, int32);
 
 	if (!pc_issit(sd))
 		return 0;
@@ -19893,7 +19893,7 @@ static int32 skill_sit_count(struct block_list *bl, va_list ap)
 static int32 skill_sit_in(struct block_list *bl, va_list ap)
 {
 	map_session_data *sd = (map_session_data*)bl;
-	int32 flag = va_arg(ap, int);
+	int32 flag = va_arg(ap, int32);
 
 	if (!pc_issit(sd))
 		return 0;
@@ -19919,7 +19919,7 @@ static int32 skill_sit_in(struct block_list *bl, va_list ap)
 static int32 skill_sit_out(struct block_list *bl, va_list ap)
 {
 	map_session_data *sd = (map_session_data*)bl;
-	int32 flag = va_arg(ap, int), range = va_arg(ap, int);
+	int32 flag = va_arg(ap, int32), range = va_arg(ap, int32);
 
 	if (map_foreachinallrange(skill_sit_count, &sd->bl, range, BL_PC, flag) > 1)
 		return 0;
@@ -19988,8 +19988,8 @@ int32 skill_frostjoke_scream(struct block_list *bl, va_list ap)
 	nullpo_ret(bl);
 	nullpo_ret(src = va_arg(ap,struct block_list*));
 
-	skill_id = va_arg(ap,int);
-	skill_lv = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
+	skill_lv = va_arg(ap,int32);
 	if(!skill_lv)
 		return 0;
 	tick = va_arg(ap,t_tick);
@@ -20043,17 +20043,17 @@ int32 skill_attack_area(struct block_list *bl, va_list ap)
 	if(status_isdead(*bl))
 		return 0;
 
-	atk_type = va_arg(ap,int);
+	atk_type = va_arg(ap,int32);
 	src = va_arg(ap,struct block_list*);
 	dsrc = va_arg(ap,struct block_list*);
-	skill_id = va_arg(ap,int);
-	skill_lv = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
+	skill_lv = va_arg(ap,int32);
 	tick = va_arg(ap,t_tick);
-	flag = va_arg(ap,int);
-	type = va_arg(ap,int);
+	flag = va_arg(ap,int32);
+	type = va_arg(ap,int32);
 
 	if (skill_area_temp[1] == bl->id) { //This is the target of the skill, do a full attack and skip target checks.
-		return (int)skill_attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag);
+		return (int32)skill_attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag);
 	}
 
 	if(battle_check_target(dsrc,bl,type) <= 0 ||
@@ -20073,10 +20073,10 @@ int32 skill_attack_area(struct block_list *bl, va_list ap)
 		case NPC_ICEBREATH:
 		case NPC_ICEBREATH2:
 		case NPC_THUNDERBREATH:
-			return (int)skill_attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag);
+			return (int32)skill_attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag);
 		default:
 			//Area-splash, disable skill animation.
-			return (int)skill_attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag|SD_ANIMATION);
+			return (int32)skill_attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag|SD_ANIMATION);
 	}
 }
 
@@ -20180,7 +20180,7 @@ std::shared_ptr<s_skill_unit_group> skill_locate_element_field(struct block_list
 int32 skill_graffitiremover(struct block_list *bl, va_list ap)
 {
 	struct skill_unit *unit = nullptr;
-	int32 remove = va_arg(ap, int);
+	int32 remove = va_arg(ap, int32);
 
 	nullpo_retr(0, bl);
 
@@ -20314,7 +20314,7 @@ static int32 skill_cell_overlap(struct block_list *bl, va_list ap)
 	int32 *alive;
 	struct skill_unit *unit;
 
-	skill_id = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
 	alive = va_arg(ap,int32 *);
 	unit = (struct skill_unit *)bl;
 
@@ -20580,8 +20580,8 @@ int32 skill_maelstrom_suction(struct block_list *bl, va_list ap)
 
 	nullpo_ret(bl);
 
-	skill_id = va_arg(ap,int);
-	skill_lv = va_arg(ap,int);
+	skill_id = va_arg(ap,int32);
+	skill_lv = va_arg(ap,int32);
 	unit = (struct skill_unit *)bl;
 
 	if( unit == nullptr || unit->group == nullptr )
@@ -20939,7 +20939,7 @@ int32 skill_delunit(struct skill_unit* unit)
 }
 
 
-static std::unordered_map<int, std::shared_ptr<s_skill_unit_group>> skillunit_group_db; /// Skill unit group DB. Key int32 group_id -> struct s_skill_unit_group*
+static std::unordered_map<int32, std::shared_ptr<s_skill_unit_group>> skillunit_group_db; /// Skill unit group DB. Key int32 group_id -> struct s_skill_unit_group*
 
 /// Returns the target s_skill_unit_group or nullptr if not found.
 std::shared_ptr<s_skill_unit_group> skill_id2group(int32 group_id) {
@@ -21600,7 +21600,7 @@ int32 skill_unit_move_sub(struct block_list* bl, va_list ap)
 	struct skill_unit* unit = (struct skill_unit *)bl;
 	struct block_list* target = va_arg(ap,struct block_list*);
 	t_tick tick = va_arg(ap,t_tick);
-	int32 flag = va_arg(ap,int);
+	int32 flag = va_arg(ap,int32);
 	bool dissonance;
 	uint16 skill_id;
 
@@ -21770,7 +21770,7 @@ void skill_unit_move_unit_group(std::shared_ptr<s_skill_unit_group> group, int16
 	if (skill_get_unit_flag(group->skill_id, UF_ENSEMBLE))
 		return; //Ensembles may not be moved around.
 
-	m_flag = (int32 *) aCalloc(group->unit_count, sizeof(int));
+	m_flag = (int32 *) aCalloc(group->unit_count, sizeof(int32));
 	//    m_flag
 	//		0: Neither of the following (skill_unit_onplace & skill_unit_onout are needed)
 	//		1: Unit will move to a slot that had another unit of the same group (skill_unit_onplace not needed)
@@ -23021,7 +23021,7 @@ int32 skill_blockpc_get(map_session_data *sd, int32 skillid) {
 
 TIMER_FUNC(skill_blockpc_end){
 	map_session_data *sd = map_id2sd(id);
-	int32 i = (int)data;
+	int32 i = (int32)data;
 
 	if (!sd || data < 0 || data >= MAX_SKILLCOOLDOWN)
 		return 0;

+ 3 - 3
src/map/skill.hpp

@@ -634,12 +634,12 @@ int32 skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,u
 int32 skill_castend_damage_id( struct block_list* src, struct block_list *bl,uint16 skill_id,uint16 skill_lv,t_tick tick,int32 flag );
 int32 skill_castend_pos2( struct block_list *src, int32 x,int32 y,uint16 skill_id,uint16 skill_lv,t_tick tick,int32 flag);
 
-int32 skill_blockpc_start(map_session_data*, int, t_tick);
+int32 skill_blockpc_start(map_session_data*, int32, t_tick);
 int32 skill_blockpc_get(map_session_data *sd, int32 skillid);
 int32 skill_blockpc_clear(map_session_data *sd);
 TIMER_FUNC(skill_blockpc_end);
-int32 skill_blockhomun_start (struct homun_data*,uint16 skill_id,int);
-int32 skill_blockmerc_start (s_mercenary_data*,uint16 skill_id,int);
+int32 skill_blockhomun_start (struct homun_data*,uint16 skill_id,int32);
+int32 skill_blockmerc_start (s_mercenary_data*,uint16 skill_id,int32);
 
 
 // (Epoque:) To-do: replace this macro with some sort of skill tree check (rather than hard-coded skill names)

+ 70 - 70
src/map/status.cpp

@@ -58,41 +58,41 @@ short current_equip_opt_index; /// Contains random option index of an equipped i
 
 uint16 SCDisabled[SC_MAX]; ///< List of disabled SC on map zones. [Cydh]
 
-static unsigned short status_calc_str(struct block_list *,status_change *,int);
-static unsigned short status_calc_agi(struct block_list *,status_change *,int);
-static unsigned short status_calc_vit(struct block_list *,status_change *,int);
-static unsigned short status_calc_int(struct block_list *,status_change *,int);
-static unsigned short status_calc_dex(struct block_list *,status_change *,int);
-static unsigned short status_calc_luk(struct block_list *,status_change *,int);
-static unsigned short status_calc_pow(struct block_list *, status_change *, int);
-static unsigned short status_calc_sta(struct block_list *, status_change *, int);
-static unsigned short status_calc_wis(struct block_list *, status_change *, int);
-static unsigned short status_calc_spl(struct block_list *, status_change *, int);
-static unsigned short status_calc_con(struct block_list *, status_change *, int);
-static unsigned short status_calc_crt(struct block_list *, status_change *, int);
-static unsigned short status_calc_batk(struct block_list *,status_change *,int);
-static unsigned short status_calc_watk(struct block_list *,status_change *,int);
-static signed short status_calc_hit(struct block_list *,status_change *,int);
-static signed short status_calc_critical(struct block_list *,status_change *,int);
-static signed short status_calc_flee(struct block_list *,status_change *,int);
-static signed short status_calc_flee2(struct block_list *,status_change *,int);
-static defType status_calc_def(struct block_list *bl, status_change *sc, int);
-static signed short status_calc_def2(struct block_list *,status_change *,int);
-static defType status_calc_mdef(struct block_list *bl, status_change *sc, int);
-static signed short status_calc_mdef2(struct block_list *,status_change *,int);
-static unsigned short status_calc_speed(struct block_list *,status_change *,int);
-static short status_calc_aspd_rate(struct block_list *,status_change *,int);
+static unsigned short status_calc_str(struct block_list *,status_change *,int32);
+static unsigned short status_calc_agi(struct block_list *,status_change *,int32);
+static unsigned short status_calc_vit(struct block_list *,status_change *,int32);
+static unsigned short status_calc_int(struct block_list *,status_change *,int32);
+static unsigned short status_calc_dex(struct block_list *,status_change *,int32);
+static unsigned short status_calc_luk(struct block_list *,status_change *,int32);
+static unsigned short status_calc_pow(struct block_list *, status_change *, int32);
+static unsigned short status_calc_sta(struct block_list *, status_change *, int32);
+static unsigned short status_calc_wis(struct block_list *, status_change *, int32);
+static unsigned short status_calc_spl(struct block_list *, status_change *, int32);
+static unsigned short status_calc_con(struct block_list *, status_change *, int32);
+static unsigned short status_calc_crt(struct block_list *, status_change *, int32);
+static unsigned short status_calc_batk(struct block_list *,status_change *,int32);
+static unsigned short status_calc_watk(struct block_list *,status_change *,int32);
+static signed short status_calc_hit(struct block_list *,status_change *,int32);
+static signed short status_calc_critical(struct block_list *,status_change *,int32);
+static signed short status_calc_flee(struct block_list *,status_change *,int32);
+static signed short status_calc_flee2(struct block_list *,status_change *,int32);
+static defType status_calc_def(struct block_list *bl, status_change *sc, int32);
+static signed short status_calc_def2(struct block_list *,status_change *,int32);
+static defType status_calc_mdef(struct block_list *bl, status_change *sc, int32);
+static signed short status_calc_mdef2(struct block_list *,status_change *,int32);
+static unsigned short status_calc_speed(struct block_list *,status_change *,int32);
+static short status_calc_aspd_rate(struct block_list *,status_change *,int32);
 static unsigned short status_calc_dmotion(struct block_list *bl, status_change *sc, int32 dmotion);
 #ifdef RENEWAL_ASPD
 static short status_calc_aspd(struct block_list *bl, status_change *sc, bool fixed);
 #endif
-static short status_calc_fix_aspd(struct block_list *bl, status_change *sc, int);
-static signed short status_calc_patk(struct block_list *, status_change *, int);
-static signed short status_calc_smatk(struct block_list *, status_change *, int);
-static signed short status_calc_res(struct block_list *, status_change *, int);
-static signed short status_calc_mres(struct block_list *, status_change *, int);
-static signed short status_calc_hplus(struct block_list *, status_change *, int);
-static signed short status_calc_crate(struct block_list *, status_change *, int);
+static short status_calc_fix_aspd(struct block_list *bl, status_change *sc, int32);
+static signed short status_calc_patk(struct block_list *, status_change *, int32);
+static signed short status_calc_smatk(struct block_list *, status_change *, int32);
+static signed short status_calc_res(struct block_list *, status_change *, int32);
+static signed short status_calc_mres(struct block_list *, status_change *, int32);
+static signed short status_calc_hplus(struct block_list *, status_change *, int32);
+static signed short status_calc_crate(struct block_list *, status_change *, int32);
 static uint32 status_calc_maxhp(struct block_list *bl, uint64 maxhp);
 static uint32 status_calc_maxsp(struct block_list *bl, uint64 maxsp);
 static uint32 status_calc_maxap(struct block_list *bl, uint64 maxap);
@@ -1412,7 +1412,7 @@ int32 status_set_maxap(struct block_list *bl, uint32 maxap, int32 flag)
 int64 status_charge(struct block_list* bl, int64 hp, int64 sp)
 {
 	if(!(bl->type&BL_CONSUME))
-		return (int)hp+sp; // Assume all was charged so there are no 'not enough' fails.
+		return (int32)hp+sp; // Assume all was charged so there are no 'not enough' fails.
 	return status_damage(nullptr, bl, hp, sp, 0, 3, 0);
 }
 
@@ -1437,9 +1437,9 @@ int64 status_charge(struct block_list* bl, int64 hp, int64 sp)
 int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp, int64 dsp, int64 dap, t_tick walkdelay, int32 flag, uint16 skill_id)
 {
 	status_change *sc;
-	int32 hp = (int)cap_value(dhp,INT_MIN,INT_MAX);
-	int32 sp = (int)cap_value(dsp,INT_MIN,INT_MAX);
-	int32 ap = (int)cap_value(dap,INT_MIN,INT_MAX);
+	int32 hp = (int32)cap_value(dhp,INT_MIN,INT_MAX);
+	int32 sp = (int32)cap_value(dsp,INT_MIN,INT_MAX);
+	int32 ap = (int32)cap_value(dap,INT_MIN,INT_MAX);
 
 	nullpo_ret(target);
 
@@ -1466,7 +1466,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 
 	if (target->type == BL_SKILL) {
 		if (!src || src->type&battle_config.can_damage_skill)
-			return (int)skill_unit_ondamaged((struct skill_unit *)target, hp);
+			return (int32)skill_unit_ondamaged((struct skill_unit *)target, hp);
 		return 0;
 	}
 
@@ -1587,7 +1587,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 	case BL_PC:
 		pc_damage(reinterpret_cast<map_session_data*>(target), src, hp, sp, ap); break;
 	case BL_MOB:
-		mob_damage(reinterpret_cast<mob_data*>(target), src, (int)dhp);
+		mob_damage(reinterpret_cast<mob_data*>(target), src, (int32)dhp);
 		break;
 	case BL_HOM:
 		hom_heal(reinterpret_cast<homun_data&>(*target), hp != 0, sp != 0);
@@ -1607,7 +1607,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 	if( status->hp || (flag&8) ) { // Still lives or has been dead before this damage.
 		if (walkdelay)
 			unit_set_walkdelay(target, gettick(), walkdelay, 0);
-		return (int)(hp+sp+ap);
+		return (int32)(hp+sp+ap);
 	}
 
 	status->hp = 0;
@@ -1630,7 +1630,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 	}
 
 	if(!flag) // Death cancelled.
-		return (int)(hp+sp+ap);
+		return (int32)(hp+sp+ap);
 
 	// Normal death
 	if (battle_config.clear_unit_ondeath &&
@@ -1662,7 +1662,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 		if( target->type == BL_MOB )
 			((TBL_MOB*)target)->state.rebirth = 1;
 
-		return (int)(hp+sp+ap);
+		return (int32)(hp+sp+ap);
 	}
 
 	// Disable Ultimate Sacrifice on GVG maps
@@ -1674,7 +1674,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 		if (target->type == BL_MOB)
 			((TBL_MOB*)target)->state.rebirth = 1;
 
-		return (int)(hp+sp+ap);
+		return (int32)(hp+sp+ap);
 	}
 
 	if (target->type == BL_MOB && sc && sc->getSCE(SC_REBIRTH) && !((TBL_MOB*) target)->state.rebirth) { // Ensure the monster has not already rebirthed before doing so.
@@ -1682,7 +1682,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 		status_change_clear(target,0);
 		((TBL_MOB*)target)->state.rebirth = 1;
 
-		return (int)(hp+sp+ap);
+		return (int32)(hp+sp+ap);
 	}
 
 	status_change_clear(target,0);
@@ -1715,7 +1715,7 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 		npc_script_event( *sd, NPCE_DIE );
 	}
 
-	return (int)(hp+sp+ap);
+	return (int32)(hp+sp+ap);
 }
 
 /**
@@ -1732,9 +1732,9 @@ int32 status_damage(struct block_list *src,struct block_list *target,int64 dhp,
 int32 status_heal(struct block_list *bl,int64 hhp,int64 hsp, int64 hap, int32 flag)
 {
 	status_change *sc;
-	int32 hp = (int)cap_value(hhp,INT_MIN,INT_MAX);
-	int32 sp = (int)cap_value(hsp,INT_MIN,INT_MAX);
-	int32 ap = (int)cap_value(hap,INT_MIN,INT_MAX);
+	int32 hp = (int32)cap_value(hhp,INT_MIN,INT_MAX);
+	int32 sp = (int32)cap_value(hsp,INT_MIN,INT_MAX);
+	int32 ap = (int32)cap_value(hap,INT_MIN,INT_MAX);
 
 	status_data* status = status_get_status_data(*bl);
 
@@ -1822,7 +1822,7 @@ int32 status_heal(struct block_list *bl,int64 hhp,int64 hsp, int64 hap, int32 fl
 		break;
 	}
 
-	return (int)hp+sp+ap;
+	return (int32)hp+sp+ap;
 }
 
 /**
@@ -2337,7 +2337,7 @@ int32 status_base_amotion_pc(map_session_data* sd, struct status_data* status)
 		val -= 50 - 10 * pc_checkskill(sd, KN_CAVALIERMASTERY);
 	else if (pc_isridingdragon(sd))
 		val -= 25 - 5 * pc_checkskill(sd, RK_DRAGONTRAINING);
-	amotion = ((int)(temp_aspd + ((float)(status_calc_aspd(&sd->bl, &sd->sc, true) + val) * status->agi / 200)) - min(amotion, 200));
+	amotion = ((int32)(temp_aspd + ((float)(status_calc_aspd(&sd->bl, &sd->sc, true) + val) * status->agi / 200)) - min(amotion, 200));
 #else
 	// Angra Manyu disregards aspd_base and similar
 	if (pc_checkequip2(sd, ITEMID_ANGRA_MANYU, EQI_ACC_L, EQI_MAX))
@@ -2567,7 +2567,7 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int32 l
 		stat += status_get_homvit(bl) + level / 2;
 		status->def = cap_value(stat, 0, SHRT_MAX);
 		// Mdef
-		stat = (int)(((float)status_get_homvit(bl) + level) / 4 + (float)status_get_homint(bl) / 2);
+		stat = (int32)(((float)status_get_homvit(bl) + level) / 4 + (float)status_get_homint(bl) / 2);
 		status->mdef = cap_value(stat, 0, SHRT_MAX);
 		// Hit
 		stat = level + status->dex + 150;
@@ -2588,18 +2588,18 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int32 l
 		status->flee = cap_value(stat, 1, SHRT_MAX);
 		// Def2
 		if (bl->type == BL_MER)
-			stat = (int)(status->vit + ((float)level / 10) + ((float)status->vit / 5));
+			stat = (int32)(status->vit + ((float)level / 10) + ((float)status->vit / 5));
 		else {
 			stat = status->def2;
-			stat += (int)(((float)level + status->vit) / 2 + (bl->type == BL_PC ? ((float)status->agi / 5) : 0)); //base level + (every 2 vit = +1 def) + (every 5 agi = +1 def)
+			stat += (int32)(((float)level + status->vit) / 2 + (bl->type == BL_PC ? ((float)status->agi / 5) : 0)); //base level + (every 2 vit = +1 def) + (every 5 agi = +1 def)
 		}
 		status->def2 = cap_value(stat, 0, SHRT_MAX);
 		// Mdef2
 		if (bl->type == BL_MER)
-			stat = (int)(((float)level / 10) + ((float)status->int_ / 5));
+			stat = (int32)(((float)level / 10) + ((float)status->int_ / 5));
 		else {
 			stat = status->mdef2;
-			stat += (int)(bl->type == BL_PC ? (status->int_ + ((float)level / 4) + ((float)(status->dex + status->vit) / 5)) : ((float)(status->int_ + level) / 4)); //(every 4 base level = +1 mdef) + (every 1 int32 = +1 mdef) + (every 5 dex = +1 mdef) + (every 5 vit = +1 mdef)
+			stat += (int32)(bl->type == BL_PC ? (status->int_ + ((float)level / 4) + ((float)(status->dex + status->vit) / 5)) : ((float)(status->int_ + level) / 4)); //(every 4 base level = +1 mdef) + (every 1 int32 = +1 mdef) + (every 5 dex = +1 mdef) + (every 5 vit = +1 mdef)
 		}
 		status->mdef2 = cap_value(stat, 0, SHRT_MAX);
 		// PAtk
@@ -5700,7 +5700,7 @@ void status_calc_bl_main(struct block_list& bl, std::bitset<SCB_MAX> flag)
 		else
 			status->def2 = status_calc_def2(&bl, sc, b_status->def2
 #ifdef RENEWAL
-			+ (int)( ((float)status->vit/2 - (float)b_status->vit/2) + ((float)status->agi/5 - (float)b_status->agi/5) )
+			+ (int32)( ((float)status->vit/2 - (float)b_status->vit/2) + ((float)status->agi/5 - (float)b_status->agi/5) )
 #else
 			+ (status->vit - b_status->vit)
 #endif
@@ -5724,7 +5724,7 @@ void status_calc_bl_main(struct block_list& bl, std::bitset<SCB_MAX> flag)
 		else
 			status->mdef2 = status_calc_mdef2(&bl, sc, b_status->mdef2 +(status->int_ - b_status->int_)
 #ifdef RENEWAL
-			+ (int)( ((float)status->dex/5 - (float)b_status->dex/5) + ((float)status->vit/5 - (float)b_status->vit/5) )
+			+ (int32)( ((float)status->dex/5 - (float)b_status->dex/5) + ((float)status->vit/5 - (float)b_status->vit/5) )
 #else
 			+ ((status->vit - b_status->vit) / 2)
 #endif
@@ -9760,7 +9760,7 @@ int32 status_change_start(struct block_list* src, struct block_list* bl,enum sc_
 			return 0;
 	}
 
-	int32 tick = (int)duration;
+	int32 tick = (int32)duration;
 
 	sd = BL_CAST(BL_PC, bl);
 	vd = status_get_viewdata(bl);
@@ -11018,8 +11018,8 @@ int32 status_change_start(struct block_list* src, struct block_list* bl,enum sc_
 			//Store time at which you started running.
 			t_tick currenttick = gettick();
 			// Note: this int64 value is stored in two separate int32 variables (FIXME)
-			val3 = (int)(currenttick & 0x00000000ffffffffLL);
-			val4 = (int)((currenttick & 0xffffffff00000000LL) >> 32);
+			val3 = (int32)(currenttick & 0x00000000ffffffffLL);
+			val4 = (int32)((currenttick & 0xffffffff00000000LL) >> 32);
 			tick = INFINITE_TICK;
 			break;
 		}
@@ -11412,8 +11412,8 @@ int32 status_change_start(struct block_list* src, struct block_list* bl,enum sc_
 			//Store time at which you started running.
 			t_tick currenttick = gettick();
 			// Note: this int64 value is stored in two separate int32 variables (FIXME)
-			val3 = (int)(currenttick&0x00000000ffffffffLL);
-			val4 = (int)((currenttick&0xffffffff00000000LL)>>32);
+			val3 = (int32)(currenttick&0x00000000ffffffffLL);
+			val4 = (int32)((currenttick&0xffffffff00000000LL)>>32);
 			tick = INFINITE_TICK;
 			break;
 		}
@@ -13665,7 +13665,7 @@ TIMER_FUNC(status_change_timer){
 				interval = 1000; // Assign here since status_get_sc_internval() contains the target interval.
 
 				if (status->sp < status->max_sp)
-					status_heal(bl, 0, (int)status->max_sp * 1 / 100, 1);
+					status_heal(bl, 0, (int32)status->max_sp * 1 / 100, 1);
 			}
 		}
 		break;
@@ -13726,7 +13726,7 @@ TIMER_FUNC(status_change_timer){
 		
 	case SC_LEECHESEND:
 		if (sce->val4 >= 0) {
-			int64 damage = status->vit * (sce->val1 - 3) + (int)status->max_hp / 100; // {Target VIT x (New Poison Research Skill Level - 3)} + (Target HP/100)
+			int64 damage = status->vit * (sce->val1 - 3) + (int32)status->max_hp / 100; // {Target VIT x (New Poison Research Skill Level - 3)} + (Target HP/100)
 			map_freeblock_lock();
 			dounlock = true;
 			status_fix_damage(bl, bl, damage, clif_damage(*bl, *bl, tick, status->amotion, status->dmotion + 500, damage, 1, DMG_NORMAL, 0, false),0);
@@ -13737,7 +13737,7 @@ TIMER_FUNC(status_change_timer){
 	case SC_DEATHHURT:
 		if (sce->val4 >= 0) {
 			if (status->hp < status->max_hp)
-				status_heal(bl, (int)status->max_hp * 1 / 100, 0, 1);
+				status_heal(bl, (int32)status->max_hp * 1 / 100, 0, 1);
 		}
 		break;
 
@@ -14560,7 +14560,7 @@ int32 status_change_timer_sub(struct block_list* bl, va_list ap)
 
 	struct block_list* src = va_arg(ap,struct block_list*);
 	struct status_change_entry* sce = va_arg(ap,struct status_change_entry*);
-	enum sc_type type = (sc_type)va_arg(ap,int); // gcc: enum args get promoted to int32
+	enum sc_type type = (sc_type)va_arg(ap,int32); // gcc: enum args get promoted to int32
 	t_tick tick = va_arg(ap,t_tick);
 
 	if (status_isdead(*bl))
@@ -14814,7 +14814,7 @@ static int32 status_natural_heal(struct block_list* bl, va_list args)
 	{ // Apply sitting regen bonus.
 		sregen = regen->ssregen;
 		if(flag&(RGN_SHP)) { // Sitting HP regen
-			rate = (int)(natural_heal_diff_tick * (sregen->rate.hp / 100.));
+			rate = (int32)(natural_heal_diff_tick * (sregen->rate.hp / 100.));
 			if (regen->state.overweight)
 				rate /= 2; // Half as fast when overweight.
 			sregen->tick.hp += rate;
@@ -14827,7 +14827,7 @@ static int32 status_natural_heal(struct block_list* bl, va_list args)
 			}
 		}
 		if(flag&(RGN_SSP)) { // Sitting SP regen
-			rate = (int)(natural_heal_diff_tick * (sregen->rate.sp / 100.));
+			rate = (int32)(natural_heal_diff_tick * (sregen->rate.sp / 100.));
 			if (regen->state.overweight)
 				rate /= 2; // Half as fast when overweight.
 			sregen->tick.sp += rate;
@@ -14868,7 +14868,7 @@ static int32 status_natural_heal(struct block_list* bl, va_list args)
 	// Natural Hp regen
 	if (flag&RGN_HP) {
 		// Interval to next recovery tick
-		rate = (int)(battle_config.natural_healhp_interval / (regen->rate.hp/100. * multi));
+		rate = (int32)(battle_config.natural_healhp_interval / (regen->rate.hp/100. * multi));
 		// Half recovery while moving only applies to players with certain traits
 		if (sd && ud && ud->walktimer != INVALID_TIMER)
 			rate *= 2;
@@ -14897,7 +14897,7 @@ static int32 status_natural_heal(struct block_list* bl, va_list args)
 	// Natural SP regen
 	if(flag&RGN_SP) {
 		// Interval to next recovery tick
-		rate = (int)(battle_config.natural_healsp_interval / (regen->rate.sp/100. * multi));
+		rate = (int32)(battle_config.natural_healsp_interval / (regen->rate.sp/100. * multi));
 		// Homun SP regen fix (4 seconds instead of 8 seconds)
 		if(bl->type==BL_HOM)
 			rate /= 2;
@@ -14932,7 +14932,7 @@ static int32 status_natural_heal(struct block_list* bl, va_list args)
 	sregen = regen->sregen;
 
 	if(flag&RGN_SHP) { // Skill HP regen
-		sregen->tick.hp += (int)(natural_heal_diff_tick * (sregen->rate.hp / 100.));
+		sregen->tick.hp += (int32)(natural_heal_diff_tick * (sregen->rate.hp / 100.));
 
 		while(sregen->tick.hp >= (uint32)battle_config.natural_heal_skill_interval) {
 			sregen->tick.hp -= battle_config.natural_heal_skill_interval;
@@ -14941,7 +14941,7 @@ static int32 status_natural_heal(struct block_list* bl, va_list args)
 		}
 	}
 	if(flag&RGN_SSP) { // Skill SP regen
-		sregen->tick.sp += (int)(natural_heal_diff_tick * (sregen->rate.sp /100.));
+		sregen->tick.sp += (int32)(natural_heal_diff_tick * (sregen->rate.sp /100.));
 		while(sregen->tick.sp >= (uint32)battle_config.natural_heal_skill_interval) {
 			int32 val = sregen->sp;
 			if (sd && sd->state.doridori) {

+ 1 - 1
src/map/storage.cpp

@@ -29,7 +29,7 @@ using namespace rathena;
 std::unordered_map<uint16, std::shared_ptr<struct s_storage_table>> storage_db;
 
 ///Databases of guild_storage : int32 guild_id -> struct guild_storage
-std::map<int, struct s_storage> guild_storage_db;
+std::map<int32, struct s_storage> guild_storage_db;
 
 /**
  * Get storage name

+ 1 - 1
src/map/unit.cpp

@@ -2441,7 +2441,7 @@ int32 unit_set_target(struct unit_data* ud, int32 target_id)
 int32 unit_stopattack(struct block_list *bl, va_list ap)
 {
 	struct unit_data *ud = unit_bl2ud(bl);
-	int32 id = va_arg(ap, int);
+	int32 id = va_arg(ap, int32);
 
 	if (ud && ud->attacktimer != INVALID_TIMER && (!id || id == ud->target)) {
 		unit_stop_attack(bl);

+ 5 - 5
src/map/vending.cpp

@@ -213,10 +213,10 @@ void vending_purchasereq(map_session_data* sd, int32 aid, int32 uid, const uint8
 		}
 	}
 
-	pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd->status.char_id);
-	achievement_update_objective(sd, AG_SPEND_ZENY, 1, (int)z);
+	pc_payzeny(sd, (int32)z, LOG_TYPE_VENDING, vsd->status.char_id);
+	achievement_update_objective(sd, AG_SPEND_ZENY, 1, (int32)z);
 	z = vending_calc_tax(sd, z);
-	pc_getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd->status.char_id);
+	pc_getzeny(vsd, (int32)z, LOG_TYPE_VENDING, sd->status.char_id);
 
 	for( i = 0; i < count; i++ ) {
 		short amount = *(uint16*)(data + 4*i + 0);
@@ -241,9 +241,9 @@ void vending_purchasereq(map_session_data* sd, int32 aid, int32 uid, const uint8
 
 		pc_cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
 		z = vending_calc_tax(sd, z);
-		clif_vendingreport( *vsd, idx, amount, sd->status.char_id, (int)z );
+		clif_vendingreport( *vsd, idx, amount, sd->status.char_id, (int32)z );
 
-		//print32 buyer's name
+		//print buyer's name
 		if( battle_config.buyer_name ) {
 			char temp[256];
 			sprintf(temp, msg_txt(sd,265), sd->status.name);

+ 4 - 4
src/tool/csv2yaml.cpp

@@ -5182,9 +5182,9 @@ static bool read_homunculusdb( char* str[], size_t columns, size_t current ){
 
 			body << YAML::BeginMap;
 			body << YAML::Key << "Skill" << YAML::Value << *skill_name;
-			body << YAML::Key << "MaxLevel" << YAML::Value << (int)skillit.max;
+			body << YAML::Key << "MaxLevel" << YAML::Value << (int32)skillit.max;
 			if (skillit.need_level > 0)
-				body << YAML::Key << "RequiredLevel" << YAML::Value << (int)skillit.need_level;
+				body << YAML::Key << "RequiredLevel" << YAML::Value << (int32)skillit.need_level;
 			if (skillit.intimacy > 0)
 				body << YAML::Key << "RequiredIntimacy" << YAML::Value << skillit.intimacy;
 
@@ -5228,9 +5228,9 @@ static bool read_homunculusdb( char* str[], size_t columns, size_t current ){
 
 			body << YAML::BeginMap;
 			body << YAML::Key << "Skill" << YAML::Value << *skill_name;
-			body << YAML::Key << "MaxLevel" << YAML::Value << (int)skillit.max;
+			body << YAML::Key << "MaxLevel" << YAML::Value << (int32)skillit.max;
 			if (skillit.need_level > 0)
-				body << YAML::Key << "RequiredLevel" << YAML::Value << (int)skillit.need_level;
+				body << YAML::Key << "RequiredLevel" << YAML::Value << (int32)skillit.need_level;
 			if (skillit.intimacy > 0)
 				body << YAML::Key << "RequiredIntimacy" << YAML::Value << skillit.intimacy;
 			body << YAML::Key << "RequireEvolution" << YAML::Value << "true";

+ 4 - 4
src/tool/csv2yaml.hpp

@@ -150,10 +150,10 @@ struct s_job_param {
 	int32 str, agi, vit, int_, dex, luk;
 };
 
-std::unordered_map<int, std::vector<int>> job_db2;
-std::unordered_map<int, std::vector<int64>> job_hp, job_sp;
-std::unordered_map<int, s_job_param> job_param;
-std::unordered_map<int, int> exp_base_level, exp_job_level;
+std::unordered_map<int32, std::vector<int32>> job_db2;
+std::unordered_map<int32, std::vector<int64>> job_hp, job_sp;
+std::unordered_map<int32, s_job_param> job_param;
+std::unordered_map<int32, int32> exp_base_level, exp_job_level;
 
 struct s_elemental_skill_csv {
 	std::string skill_name,

+ 1 - 1
src/tool/yaml.hpp

@@ -140,7 +140,7 @@ bool fileExists(const std::string &path) {
 
 /**
  * Prompt for confirmation.
- * @param fmt: Message to print32
+ * @param fmt: Message to print
  * @param va_arg: Any arguments needed for message
  * @return True on yes or false otherwise
  */

+ 1 - 1
src/web/web.cpp

@@ -416,7 +416,7 @@ void logger(const Request & req, const Response & res) {
 			ShowDebug("\t%s: %s\n", header.first.c_str(), header.second.c_str());
 		}
 		ShowDebug("Response status is: %d\n", res.status);
-		// since the body may be binary, might not print32 entire body (has null character).
+		// since the body may be binary, might not print entire body (has null character).
 		ShowDebug("Body is:\n%s\n", res.body.c_str());
 	}
 	ShowInfo("%s [%s %s] %d\n", req.remote_addr.c_str(), req.method.c_str(), req.path.c_str(), res.status);

+ 1 - 1
src/web/web.hpp

@@ -39,7 +39,7 @@ namespace rathena{
 struct Web_Config {
 	std::string web_ip;								// the address to bind to
 	uint16 web_port;								// the port to bind to
-	bool print_req_res;								// Whether or not to print32 requests/responses
+	bool print_req_res;								// Whether or not to print requests/responses
 
 	char webconf_name[256];						/// name of main config file
 	char msgconf_name[256];							/// name of msg_conf config file