From f5b88f9e0e7868b96c089787cfeccf413d754b56 Mon Sep 17 00:00:00 2001 From: Haru Date: Wed, 20 Apr 2016 17:23:03 +0200 Subject: Corrected the type of the 'length' argument of other message-related functions - Variable types were changed to int - Corrects several warnings in VS2015 - Affected functions: `clif->wis_message()`, `intif->wis_message()`, `intif->guild_change_gm()`. Signed-off-by: Haru --- src/map/clif.c | 10 +++++----- src/map/clif.h | 2 +- src/map/guild.c | 2 +- src/map/intif.c | 4 ++-- src/map/intif.h | 4 ++-- src/map/pc.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index d6a418a47..3dc6ab981 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5805,7 +5805,7 @@ void clif_upgrademessage(int fd, int result, int item_id) /// Whisper is transmitted to the destination player (ZC_WHISPER). /// 0097 .W .24B .?B /// 0097 .W .24B .L .?B (PACKETVER >= 20091104) -void clif_wis_message(int fd, const char *nick, const char *mes, size_t mes_len) +void clif_wis_message(int fd, const char *nick, const char *mes, int mes_len) { #if PACKETVER >= 20091104 struct map_session_data *ssd = NULL; @@ -10229,7 +10229,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) // if there are 'Test' player on an other map-server and 'test' player on this map-server, // and if we ask for 'Test', we must not contact 'test' player // so, we send information to inter-server, which is the only one which decide (and copy correct name). - intif->wis_message(sd, target, message, strlen(message)); + intif->wis_message(sd, target, message, (int)strlen(message)); return; } @@ -10243,10 +10243,10 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) } // if player is autotrading - if( dstsd->state.autotrade ) { + if (dstsd->state.autotrade) { char output[256]; sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name); - clif->wis_message(fd, map->wisp_server_name, output, strlen(output) + 1); + clif->wis_message(fd, map->wisp_server_name, output, (int)strlen(output) + 1); return; } @@ -10263,7 +10263,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) clif->wis_end(fd, 0); // 0: success to send wisper // Normal message - clif->wis_message(dstsd->fd, sd->status.name, message, strlen(message)); + clif->wis_message(dstsd->fd, sd->status.name, message, (int)strlen(message)); } void clif_parse_Broadcast(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); diff --git a/src/map/clif.h b/src/map/clif.h index 459d62d7b..4d22fd4af 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -841,7 +841,7 @@ struct clif_interface { void (*clearchat) (struct chat_data *cd,int fd); void (*leavechat) (struct chat_data* cd, struct map_session_data* sd, bool flag); void (*changechatstatus) (struct chat_data* cd); - void (*wis_message) (int fd, const char* nick, const char* mes, size_t mes_len); + void (*wis_message) (int fd, const char *nick, const char *mes, int mes_len); void (*wis_end) (int fd, int flag); void (*disp_message) (struct block_list *src, const char *mes, enum send_target target); void (*broadcast) (struct block_list *bl, const char *mes, int len, int type, enum send_target target); diff --git a/src/map/guild.c b/src/map/guild.c index a231ebd9b..1929808ca 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1829,7 +1829,7 @@ int guild_gm_change(int guild_id, struct map_session_data *sd) return 0; //Notify servers that master has changed. - intif->guild_change_gm(guild_id, sd->status.name, strlen(sd->status.name)+1); + intif->guild_change_gm(guild_id, sd->status.name, (int)strlen(sd->status.name)+1); return 1; } diff --git a/src/map/intif.c b/src/map/intif.c index 0b2f34ce2..05b1d7c29 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -231,7 +231,7 @@ int intif_main_message(struct map_session_data* sd, const char* message) } // The transmission of Wisp/Page to inter-server (player not found on this server) -int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, size_t mes_len) +int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) { if (intif->CheckForCharServer()) return 0; @@ -660,7 +660,7 @@ int intif_guild_addmember(int guild_id,struct guild_member *m) } // Request a new leader for guild -int intif_guild_change_gm(int guild_id, const char* name, size_t len) +int intif_guild_change_gm(int guild_id, const char *name, int len) { if (intif->CheckForCharServer()) return 0; diff --git a/src/map/intif.h b/src/map/intif.h index 11d301ad0..5e7f86fc2 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -62,7 +62,7 @@ struct intif_interface { int (*broadcast) (const char *mes, int len, int type); int (*broadcast2) (const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); int (*main_message) (struct map_session_data* sd, const char* message); - int (*wis_message) (struct map_session_data *sd, const char *nick, const char *mes, size_t mes_len); + int (*wis_message) (struct map_session_data *sd, const char *nick, const char *mes, int mes_len); int (*wis_message_to_gm) (char *Wisp_name, int permission, char *mes); int (*saveregistry) (struct map_session_data *sd); int (*request_registry) (struct map_session_data *sd, int flag); @@ -84,7 +84,7 @@ struct intif_interface { int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class_); int (*guild_break) (int guild_id); int (*guild_message) (int guild_id, int account_id, const char *mes, int len); - int (*guild_change_gm) (int guild_id, const char* name, size_t len); + int (*guild_change_gm) (int guild_id, const char *name, int len); int (*guild_change_basicinfo) (int guild_id, int type, const void *data, int len); int (*guild_change_memberinfo) (int guild_id, int account_id, int char_id, int type, const void *data, int len); int (*guild_position) (int guild_id, int idx, struct guild_position *p); diff --git a/src/map/pc.c b/src/map/pc.c index 670f7741a..113638912 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -11195,7 +11195,7 @@ void pc_scdata_received(struct map_session_data *sd) { time_t exp_time = sd->expiration_time; char tmpstr[1024]; strftime(tmpstr, sizeof(tmpstr) - 1, msg_sd(sd,501), localtime(&exp_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S." - clif->wis_message(sd->fd, map->wisp_server_name, tmpstr, strlen(tmpstr)+1); + clif->wis_message(sd->fd, map->wisp_server_name, tmpstr, (int)strlen(tmpstr)+1); pc->expire_check(sd); } -- cgit v1.2.3-60-g2f50