summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-19 18:24:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-19 18:24:22 +0300
commit8dc7572164d1f630fed49e695d4bf62ea8e09a15 (patch)
tree66138d10ef1fd4f6d14666a5a078641e4c9f1b77 /src/map/atcommand.c
parentc2c1322b230dc0f564397ac68615640f1083ee56 (diff)
downloadhercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.tar.gz
hercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.tar.bz2
hercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.tar.xz
hercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.zip
Fix all known warnings from compiler flags -Wformat*
Add all missing -Wformat flags into configure.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 4eb2051da..a9b071fda 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -223,8 +223,8 @@ ACMD(send)
// read message type as hex number (without the 0x)
if (!*message
- || !((sscanf(message, "len %x", &type)==1 && (len=1, true))
- || sscanf(message, "%x", &type)==1)
+ || !((sscanf(message, "len %x", (unsigned int*)&type)==1 && (len=1, true))
+ || sscanf(message, "%x", (unsigned int*)&type)==1)
) {
clif->message(fd, msg_fd(fd,900)); // Usage:
clif->message(fd, msg_fd(fd,901)); // @send len <packet hex number>
@@ -252,7 +252,7 @@ ACMD(send)
} while(0) //define SKIP_VALUE
#define GET_VALUE(p,num) do { \
- if(sscanf((p), "x%lx", &(num)) < 1 && sscanf((p), "%ld ", &(num)) < 1){\
+ if(sscanf((p), "x%lx", (long unsigned int*)&(num)) < 1 && sscanf((p), "%ld ", &(num)) < 1){\
PARSE_ERROR("Invalid number in:",(p));\
return false;\
}\
@@ -2272,11 +2272,11 @@ ACMD(gat) {
for (y = 2; y >= -2; y--) {
safesnprintf(atcmd_output, sizeof(atcmd_output), "%s (x= %d, y= %d) %02X %02X %02X %02X %02X",
map->list[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y,
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
clif->message(fd, atcmd_output);
}