diff options
author | Haru <haru@dotalux.com> | 2016-04-20 15:40:19 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-04-23 19:08:11 +0200 |
commit | e4feddf5198f1c9d45a6c34a95b251df773ab6db (patch) | |
tree | 7d6fb02f933f6772851f375f7c176bd2f32a617f /src/map/clif.c | |
parent | dc23fd3ee6029efe881fa73ed9f4f85e4548bc59 (diff) | |
download | hercules-e4feddf5198f1c9d45a6c34a95b251df773ab6db.tar.gz hercules-e4feddf5198f1c9d45a6c34a95b251df773ab6db.tar.bz2 hercules-e4feddf5198f1c9d45a6c34a95b251df773ab6db.tar.xz hercules-e4feddf5198f1c9d45a6c34a95b251df773ab6db.zip |
Corrected the type of the 'length' argument of various broadcast-related functions
- Variable types were changed to int
- Corrects several warnings in VS2015
- Affected functions: `clif->broadcast()`, `clif->broadcast2()`,
`intif->broadcast()`, `intif->broadcast2()`
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 70a88bfda..11d6076e9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5582,7 +5582,7 @@ void clif_displaymessage_sprintf(const int fd, const char *mes, ...) { } /// Send broadcast message in yellow or blue without font formatting (ZC_BROADCAST). /// 009a <packet len>.W <message>.?B -void clif_broadcast(struct block_list *bl, const char *mes, size_t len, int type, enum send_target target) +void clif_broadcast(struct block_list *bl, const char *mes, int len, int type, enum send_target target) { int lp = (type&BC_COLOR_MASK) ? 4 : 0; unsigned char *buf = NULL; @@ -5631,13 +5631,13 @@ void clif_GlobalMessage(struct block_list *bl, const char *message) /// Send broadcast message with font formatting (ZC_BROADCAST2). /// 01c3 <packet len>.W <fontColor>.L <fontType>.W <fontSize>.W <fontAlign>.W <fontY>.W <message>.?B -void clif_broadcast2(struct block_list* bl, const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target) +void clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target) { unsigned char *buf; nullpo_retv(mes); - buf = (unsigned char*)aMalloc((16 + len)*sizeof(unsigned char)); + buf = aMalloc((16 + len)*sizeof(unsigned char)); WBUFW(buf,0) = 0x1c3; WBUFW(buf,2) = len + 16; WBUFL(buf,4) = fontColor; @@ -9428,7 +9428,7 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) { if( map->list[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) { char output[128]; sprintf(output, "[ Kill Steal Protection Disabled. KS is allowed in this map ]"); - clif->broadcast(&sd->bl, output, strlen(output) + 1, BC_BLUE, SELF); + clif->broadcast(&sd->bl, output, (int)strlen(output) + 1, BC_BLUE, SELF); } map->iwall_get(sd); // Updates Walls Info on this Map to Client @@ -18044,7 +18044,7 @@ void clif_show_modifiers (struct map_session_data *sd) { snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%", sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death); - clif->broadcast2(&sd->bl,output, strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF); + clif->broadcast2(&sd->bl, output, (int)strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF); } } |