Fixed some gcc-specific stuff, silenced some more warnings

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11515 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2007-10-18 21:59:20 +00:00
parent 4cfb15d8bb
commit ee02c2190b
9 changed files with 26 additions and 26 deletions

View File

@ -32,7 +32,7 @@ struct Login_Config {
// bool case_sensitive; // are logins case sensitive ? // bool case_sensitive; // are logins case sensitive ?
bool use_md5_passwds; // work with password hashes instead of plaintext passwords? bool use_md5_passwds; // work with password hashes instead of plaintext passwords?
// bool login_gm_read; // should the login server handle info about gm accounts? // bool login_gm_read; // should the login server handle info about gm accounts?
uint8 min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect
bool online_check; // reject incoming players that are already registered as online ? bool online_check; // reject incoming players that are already registered as online ?
bool check_client_version; // check the clientversion set in the clientinfo ? bool check_client_version; // check the clientversion set in the clientinfo ?
unsigned int client_version_to_connect; // the client version needed to connect (if checking is enabled) unsigned int client_version_to_connect; // the client version needed to connect (if checking is enabled)
@ -3622,7 +3622,7 @@ int login_config_read(const char* cfgName)
else if(!strcmpi(w1, "use_MD5_passwords")) else if(!strcmpi(w1, "use_MD5_passwords"))
login_config.use_md5_passwds = (bool)config_switch(w2); login_config.use_md5_passwds = (bool)config_switch(w2);
else if(!strcmpi(w1, "min_level_to_connect")) else if(!strcmpi(w1, "min_level_to_connect"))
login_config.min_level_to_connect = (uint8)atoi(w2); login_config.min_level_to_connect = atoi(w2);
else if(!strcmpi(w1, "date_format")) else if(!strcmpi(w1, "date_format"))
safestrncpy(login_config.date_format, w2, sizeof(login_config.date_format)); safestrncpy(login_config.date_format, w2, sizeof(login_config.date_format));
else if(!strcmpi(w1, "console")) else if(!strcmpi(w1, "console"))

View File

@ -32,7 +32,7 @@ struct Login_Config {
bool case_sensitive; // are logins case sensitive ? bool case_sensitive; // are logins case sensitive ?
bool use_md5_passwds; // work with password hashes instead of plaintext passwords? bool use_md5_passwds; // work with password hashes instead of plaintext passwords?
bool login_gm_read; // should the login server handle info about gm accounts? bool login_gm_read; // should the login server handle info about gm accounts?
uint8 min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect
bool online_check; // reject incoming players that are already registered as online ? bool online_check; // reject incoming players that are already registered as online ?
bool check_client_version; // check the clientversion set in the clientinfo ? bool check_client_version; // check the clientversion set in the clientinfo ?
unsigned int client_version_to_connect; // the client version needed to connect (if checking is enabled) unsigned int client_version_to_connect; // the client version needed to connect (if checking is enabled)
@ -1774,7 +1774,7 @@ int login_config_read(const char* cfgName)
else if(!strcmpi(w1, "use_MD5_passwords")) else if(!strcmpi(w1, "use_MD5_passwords"))
login_config.use_md5_passwds = (bool)config_switch(w2); login_config.use_md5_passwds = (bool)config_switch(w2);
else if(!strcmpi(w1, "min_level_to_connect")) else if(!strcmpi(w1, "min_level_to_connect"))
login_config.min_level_to_connect = (uint8)atoi(w2); login_config.min_level_to_connect = atoi(w2);
else if(!strcmpi(w1, "date_format")) else if(!strcmpi(w1, "date_format"))
safestrncpy(login_config.date_format, w2, sizeof(login_config.date_format)); safestrncpy(login_config.date_format, w2, sizeof(login_config.date_format));
else if(!strcmpi(w1, "console")) else if(!strcmpi(w1, "console"))

View File

@ -4,6 +4,13 @@
#ifndef _BATTLE_H_ #ifndef _BATTLE_H_
#define _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 { struct Damage {
int damage,damage2; int damage,damage2;

View File

@ -4569,7 +4569,7 @@ void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short sk
WFIFOW(fd,0) = 0x11c; WFIFOW(fd,0) = 0x11c;
WFIFOW(fd,2) = skill_num; WFIFOW(fd,2) = skill_num;
memset(WFIFOP(fd,4), 0x00, 4*MAP_NAME_LENGTH_EXT); 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 (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 (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)); 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. /// Returns true if the packet was parsed successfully.
/// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00 /// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00
/// 1 - <packet id>.w <packet len>.w <name>.24B <message>.?B 00 /// 1 - <packet id>.w <packet len>.w <name>.24B <message>.?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; unsigned int packetlen, textlen, namelen, messagelen;
int fd = sd->fd; 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); const char* text = (char*)RFIFOP(fd,4);
int textlen = RFIFOW(fd,2) - 4; int textlen = RFIFOW(fd,2) - 4;
const char *name, *message; char *name, *message;
int namelen, messagelen; int namelen, messagelen;
// validate packet and retrieve name and message // 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); const char* text = (char*)RFIFOP(fd,4);
int textlen = RFIFOW(fd,2) - 4; int textlen = RFIFOW(fd,2) - 4;
const char *name, *message; char *name, *message;
int namelen, messagelen; int namelen, messagelen;
// validate packet and retrieve name and message // 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); const char* text = (char*)RFIFOP(fd,4);
int textlen = RFIFOW(fd,2) - 4; int textlen = RFIFOW(fd,2) - 4;
const char *name, *message; char *name, *message;
int namelen, messagelen; int namelen, messagelen;
// validate packet and retrieve name and message // validate packet and retrieve name and message

View File

@ -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_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_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); 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_memo(struct map_session_data *sd,int flag);
int clif_skill_teleportmessage(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); int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger);

View File

@ -1023,13 +1023,6 @@ struct pet_data {
struct map_session_data *msd; 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 { struct map_data {
char name[MAP_NAME_LENGTH]; char name[MAP_NAME_LENGTH];
unsigned short index; // The map index used by the mapindex* functions. unsigned short index; // The map index used by the mapindex* functions.

View File

@ -4565,12 +4565,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if(skilllv == 1) { if(skilllv == 1) {
// possibility to skip menu [LuzZza] // possibility to skip menu [LuzZza]
if(!battle_config.skip_teleport_lv1_menu && sd->skillitem != AL_TELEPORT) 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 else
pc_randomwarp(sd,3); pc_randomwarp(sd,3);
} else { } else {
if (sd->skillitem != AL_TELEPORT) 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?? else //Autocasted Teleport level 2??
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3); pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
} }

View File

@ -550,7 +550,7 @@ uint8 unit_getdir(struct block_list *bl)
//Warps a unit/ud to a given map/position. //Warps a unit/ud to a given map/position.
//In the case of players, pc_setpos is used. //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. //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; struct unit_data *ud;
nullpo_retr(0, bl); 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. * Otherwise it is assumed bl is being warped.
* On-Kill specific stuff is not performed here, look at status_damage for that. * 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 unit_data *ud = unit_bl2ud(bl);
struct status_change *sc = status_get_sc(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 * If clrtype is <0, no saving is performed. This is only for non-authed
* objects that shouldn't be on a map yet. * 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 ); struct unit_data *ud = unit_bl2ud( bl );
nullpo_retr(0, ud); nullpo_retr(0, ud);

View File

@ -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_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_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); int unit_setdir(struct block_list *bl,unsigned char dir);
uint8 unit_getdir(struct block_list *bl); 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); 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); struct unit_data* unit_bl2ud(struct block_list *bl);
int unit_remove_map(struct block_list *bl, uint8 clrtype); int unit_remove_map(struct block_list *bl, int clrtype);
int unit_free(struct block_list *bl, uint8 clrtype); int unit_free(struct block_list *bl, int clrtype);
int unit_changeviewsize(struct block_list *bl,short size); int unit_changeviewsize(struct block_list *bl,short size);
// 初期化ルーチン // 初期化ルーチン