From f26dbc30528f8627310fa03f46cefd940ee40588 Mon Sep 17 00:00:00 2001 From: ultramage Date: Thu, 18 Oct 2007 21:59:20 +0000 Subject: Fixed some gcc-specific stuff, silenced some more warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11515 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.h | 7 +++++++ src/map/clif.c | 12 ++++++------ src/map/clif.h | 2 +- src/map/map.h | 7 ------- src/map/skill.c | 4 ++-- src/map/unit.c | 6 +++--- src/map/unit.h | 6 +++--- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.h b/src/map/battle.h index e7d385b3c..f82e8a3de 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -4,6 +4,13 @@ #ifndef _BATTLE_H_ #define _BATTLE_H_ +// state of a single attack attempt; used in flee/def penalty calculations when mobbed +enum damage_lv { + ATK_LUCKY=1, // attack was lucky-dodged + ATK_FLEE, // attack was dodged + ATK_DEF // attack connected +}; + // ダメージ struct Damage { int damage,damage2; diff --git a/src/map/clif.c b/src/map/clif.c index b67e2cd87..54812fd05 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4569,7 +4569,7 @@ void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short sk WFIFOW(fd,0) = 0x11c; WFIFOW(fd,2) = skill_num; memset(WFIFOP(fd,4), 0x00, 4*MAP_NAME_LENGTH_EXT); - if (map1 == -1) strcpy((char*)WFIFOP(fd,4), "Random"); + if (map1 == (unsigned short)-1) strcpy((char*)WFIFOP(fd,4), "Random"); if (map1 > 0) mapindex_getmapname_ext(mapindex_id2name(map1), (char*)WFIFOP(fd,4)); if (map2 > 0) mapindex_getmapname_ext(mapindex_id2name(map2), (char*)WFIFOP(fd,20)); if (map3 > 0) mapindex_getmapname_ext(mapindex_id2name(map3), (char*)WFIFOP(fd,36)); @@ -7628,9 +7628,9 @@ void clif_feel_hate_reset(struct map_session_data *sd) /// Returns true if the packet was parsed successfully. /// Formats: 0 - .w .w ( : ).?B 00 /// 1 - .w .w .24B .?B 00 -static bool clif_process_message(struct map_session_data* sd, int format, const char** name_, int* namelen_, const char** message_, int* messagelen_) +static bool clif_process_message(struct map_session_data* sd, int format, char** name_, int* namelen_, char** message_, int* messagelen_) { - const char *text, *name, *message; + char *text, *name, *message; unsigned int packetlen, textlen, namelen, messagelen; int fd = sd->fd; @@ -8240,7 +8240,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) const char* text = (char*)RFIFOP(fd,4); int textlen = RFIFOW(fd,2) - 4; - const char *name, *message; + char *name, *message; int namelen, messagelen; // validate packet and retrieve name and message @@ -9955,7 +9955,7 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd) const char* text = (char*)RFIFOP(fd,4); int textlen = RFIFOW(fd,2) - 4; - const char *name, *message; + char *name, *message; int namelen, messagelen; // validate packet and retrieve name and message @@ -10228,7 +10228,7 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd) const char* text = (char*)RFIFOP(fd,4); int textlen = RFIFOW(fd,2) - 4; - const char *name, *message; + char *name, *message; int namelen, messagelen; // validate packet and retrieve name and message diff --git a/src/map/clif.h b/src/map/clif.h index 3310769a8..543a17da1 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -203,7 +203,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int int clif_skill_nodamage(struct block_list *src,struct block_list *dst,int skill_id,int heal,int fail); int clif_skill_poseffect(struct block_list *src,int skill_id,int val,int x,int y,int tick); int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst); -void clif_skill_warppoint(struct map_session_data* sd, int skill_num, int skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4); +void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4); int clif_skill_memo(struct map_session_data *sd,int flag); int clif_skill_teleportmessage(struct map_session_data *sd,int flag); int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger); diff --git a/src/map/map.h b/src/map/map.h index a5f4a6357..6eb92530e 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1023,13 +1023,6 @@ struct pet_data { struct map_session_data *msd; }; -// state of a single attack attempt; used in flee/def penalty calculations when mobbed -enum damage_lv { - ATK_LUCKY=1, // attack was lucky-dodged - ATK_FLEE, // attack was dodged - ATK_DEF // attack connected -}; - struct map_data { char name[MAP_NAME_LENGTH]; unsigned short index; // The map index used by the mapindex* functions. diff --git a/src/map/skill.c b/src/map/skill.c index a1f5c8b05..2db05ed82 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4565,12 +4565,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if(skilllv == 1) { // possibility to skip menu [LuzZza] if(!battle_config.skip_teleport_lv1_menu && sd->skillitem != AL_TELEPORT) - clif_skill_warppoint(sd,skillid,skilllv, -1,0,0,0); + clif_skill_warppoint(sd,skillid,skilllv, (unsigned short)-1,0,0,0); else pc_randomwarp(sd,3); } else { if (sd->skillitem != AL_TELEPORT) - clif_skill_warppoint(sd,skillid,skilllv, -1,sd->status.save_point.map,0,0); + clif_skill_warppoint(sd,skillid,skilllv, (unsigned short)-1,sd->status.save_point.map,0,0); else //Autocasted Teleport level 2?? pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3); } diff --git a/src/map/unit.c b/src/map/unit.c index 5621eedc2..616781b7a 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -550,7 +550,7 @@ uint8 unit_getdir(struct block_list *bl) //Warps a unit/ud to a given map/position. //In the case of players, pc_setpos is used. //it respects the no warp flags, so it is safe to call this without doing nowarpto/nowarp checks. -int unit_warp(struct block_list *bl,short m,short x,short y,uint8 type) +int unit_warp(struct block_list *bl,short m,short x,short y,int type) { struct unit_data *ud; nullpo_retr(0, bl); @@ -1605,7 +1605,7 @@ int unit_changeviewsize(struct block_list *bl,short size) * Otherwise it is assumed bl is being warped. * On-Kill specific stuff is not performed here, look at status_damage for that. *------------------------------------------*/ -int unit_remove_map(struct block_list *bl, uint8 clrtype) +int unit_remove_map(struct block_list *bl, int clrtype) { struct unit_data *ud = unit_bl2ud(bl); struct status_change *sc = status_get_sc(bl); @@ -1753,7 +1753,7 @@ int unit_remove_map(struct block_list *bl, uint8 clrtype) * If clrtype is <0, no saving is performed. This is only for non-authed * objects that shouldn't be on a map yet. *------------------------------------------*/ -int unit_free(struct block_list *bl, uint8 clrtype) +int unit_free(struct block_list *bl, int clrtype) { struct unit_data *ud = unit_bl2ud( bl ); nullpo_retr(0, ud); diff --git a/src/map/unit.h b/src/map/unit.h index 1880b3b99..6c6124f5c 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -29,7 +29,7 @@ int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int int unit_escape(struct block_list *bl, struct block_list *target, short dist); // 位置の強制移動(吹き飛ばしなど) int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath); -int unit_warp(struct block_list *bl, short map, short x, short y, uint8 type); +int unit_warp(struct block_list *bl, short map, short x, short y, int type); int unit_setdir(struct block_list *bl,unsigned char dir); uint8 unit_getdir(struct block_list *bl); @@ -61,8 +61,8 @@ void unit_dataset(struct block_list *bl); int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2); // その他 struct unit_data* unit_bl2ud(struct block_list *bl); -int unit_remove_map(struct block_list *bl, uint8 clrtype); -int unit_free(struct block_list *bl, uint8 clrtype); +int unit_remove_map(struct block_list *bl, int clrtype); +int unit_free(struct block_list *bl, int clrtype); int unit_changeviewsize(struct block_list *bl,short size); // 初期化ルーチン -- cgit v1.2.3-60-g2f50