diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/ladmin/ladmin.c | 3 | ||||
-rw-r--r-- | src/login/login.c | 2 | ||||
-rw-r--r-- | src/map/atcommand.c | 6 | ||||
-rw-r--r-- | src/map/clif.c | 5 | ||||
-rw-r--r-- | src/map/map.c | 2 | ||||
-rw-r--r-- | src/map/npc.c | 8 | ||||
-rw-r--r-- | src/map/path.c | 2 |
8 files changed, 16 insertions, 14 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 19b4978f9..3f595f1c5 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,6 +1,8 @@ Date Added 2010/12/22 + * Resolved random compiler warnings. [Ai4rei] + - Silenced pointer size mismatch gcc warning for variables passed to script_setarray_pc (bugreport:4661, since r14613). * Fixed sql mapreg loading code specifying output buffer size for SqlStmt_BindColumn without zero-terminator, leading to truncations of variable names and/or their values when using the maximum length (bugreport:1939, since r11245). [Ai4rei] 2010/12/21 * Added script_setarray_pc for setting temporary character array variables outside of script.c without requiring them to use script-interal code (add_str and reference_uid). [Ai4rei] diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c index 3f02a240a..d7a78c119 100644 --- a/src/ladmin/ladmin.c +++ b/src/ladmin/ladmin.c @@ -261,7 +261,7 @@ int ladmin_log(char *fmt, ...) } //--------------------------------------------- -// Function to return ordonal text of a number. +// Function to return ordinal text of a number. //--------------------------------------------- char* makeordinal(int number) { @@ -275,7 +275,6 @@ char* makeordinal(int number) } else { return "th"; } - return ""; } //----------------------------------------------------------------------------------------- diff --git a/src/login/login.c b/src/login/login.c index e888d21f6..6b3a1bcaf 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -402,7 +402,7 @@ int parse_fromchar(int fd) uint32 login_id1 = RFIFOL(fd,6); uint32 login_id2 = RFIFOL(fd,10); uint8 sex = RFIFOB(fd,14); - uint32 ip_ = ntohl(RFIFOL(fd,15)); + //uint32 ip_ = ntohl(RFIFOL(fd,15)); int request_id = RFIFOL(fd,19); RFIFOSKIP(fd,23); diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0c584223f..5200d3ba6 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6352,7 +6352,7 @@ ACMD_FUNC(mobsearch) clif_displaymessage(fd, atcmd_output); it = mapit_geteachmob(); - while( true ) + for(;;) { TBL_MOB* md = (TBL_MOB*)mapit_next(it); if( md == NULL ) @@ -6502,7 +6502,7 @@ ACMD_FUNC(users) // count users on each map iter = mapit_getallusers(); - while( true ) + for(;;) { struct map_session_data* sd2 = (struct map_session_data*)mapit_next(iter); if( sd2 == NULL ) @@ -7081,7 +7081,7 @@ ACMD_FUNC(showmobs) clif_displaymessage(fd, atcmd_output); it = mapit_geteachmob(); - while( true ) + for(;;) { TBL_MOB* md = (TBL_MOB*)mapit_next(it); if( md == NULL ) diff --git a/src/map/clif.c b/src/map/clif.c index 151937d98..0765b8665 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9373,7 +9373,8 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd) { int item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2; int item_amount = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]); - do { + + for(;;) { if (pc_isdead(sd)) break; @@ -9391,7 +9392,7 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd) break; return; - } while (0); + } //Because the client does not like being ignored. clif_dropitem(sd, item_index,0); diff --git a/src/map/map.c b/src/map/map.c index be2c53526..b052cd7bc 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2906,7 +2906,7 @@ int map_readallmaps (void) int i; FILE* fp=NULL; int maps_removed = 0; - unsigned char *map_cache_buffer; // Has the uncompressed gat data of all maps, so just one allocation has to be made + unsigned char *map_cache_buffer = NULL; // Has the uncompressed gat data of all maps, so just one allocation has to be made unsigned char map_cache_decode_buffer[MAX_MAP_SIZE]; if( enable_grf ) diff --git a/src/map/npc.c b/src/map/npc.c index ee3eb95ed..545ec9add 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1152,8 +1152,8 @@ static int npc_buylist_sub(struct map_session_data* sd, int n, unsigned short* i // save list of bought items for( i = 0; i < n; i++ ) { - script_setarray_pc(sd, "@bought_nameid", i, (void*)item_list[i*2+1], &key_nameid); - script_setarray_pc(sd, "@bought_quantity", i, (void*)item_list[i*2], &key_amount); + script_setarray_pc(sd, "@bought_nameid", i, (void*)(intptr)item_list[i*2+1], &key_nameid); + script_setarray_pc(sd, "@bought_quantity", i, (void*)(intptr)item_list[i*2], &key_amount); } // invoke event @@ -1418,8 +1418,8 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list) if( nd ) { - script_setarray_pc(sd, "@sold_nameid", i, (void*)sd->status.inventory[idx].nameid, &key_nameid); - script_setarray_pc(sd, "@sold_quantity", i, (void*)qty, &key_amount); + script_setarray_pc(sd, "@sold_nameid", i, (void*)(intptr)sd->status.inventory[idx].nameid, &key_nameid); + script_setarray_pc(sd, "@sold_quantity", i, (void*)(intptr)qty, &key_amount); } pc_delitem(sd,idx,qty,0,6); } diff --git a/src/map/path.c b/src/map/path.c index e2e3ae44b..bbbb99a08 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -345,7 +345,7 @@ bool path_search(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int xs = md->xs-1; // あらかじめ1減算しておく ys = md->ys-1; - while(1) + for(;;) { int e=0,f=0,dist,cost,dc[4]={0,0,0,0}; |