Browse Source

- Suppressed compilation warnings (unsigned and signed mismatches)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6793 54d463be-8e91-2dee-dedb-b68131a5f0ec
Lance 19 years ago
parent
commit
bb1b0409a1
6 changed files with 20 additions and 17 deletions
  1. 2 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/battle.c
  3. 1 1
      src/map/mob.c
  4. 4 3
      src/map/pc.c
  5. 8 8
      src/map/skill.c
  6. 4 4
      src/map/status.c

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2006/05/28
+	- Suppressed compilation warnings (unsigned and signed mismatches) [Lance]
 2006/05/27
 	- Added structure status_data which holds status-related information (str,
 	  agi, etc, speed, amotion, adelay, dmotion, weapon-damage, race, size, etc)

+ 1 - 1
src/map/battle.c

@@ -2747,7 +2747,7 @@ void battle_drain(TBL_PC *sd, TBL_PC* tsd, int rdamage, int ldamage, int race, i
 		if (rhp || rsp)
 			status_zap(&tsd->bl, rhp, rsp);
 		if (rand()%1000 < sd->sp_vanish_rate)
-			status_percent_damage(&sd->bl, &tsd->bl, 0, sd->sp_vanish_per);
+			status_percent_damage(&sd->bl, &tsd->bl, 0, (unsigned char)sd->sp_vanish_per);
 	}
 }
 /*==========================================

+ 1 - 1
src/map/mob.c

@@ -1761,7 +1761,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 			continue;
 		temp++;
 
-		if(mvp_damage<md->dmglog[temp].dmg){
+		if(mvp_damage<(unsigned int)md->dmglog[temp].dmg){
 			third_sd = second_sd;
 			second_sd = mvp_sd;
 			mvp_sd=tmpsd[temp];

+ 4 - 3
src/map/pc.c

@@ -290,7 +290,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) {
 			status_heal(&sd->bl, b_status->hp, b_status->sp>status->sp?b_status->sp-status->sp:0, 1);
 	} else { //Just for saving on the char-server
 		sd->status.hp = b_status->hp;
-		if (sd->status.sp < b_status->sp)
+		if ((unsigned int)sd->status.sp < b_status->sp)
 			sd->status.sp = b_status->sp;
 	}
 	/* removed exp penalty on spawn [Valaris] */
@@ -2888,6 +2888,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
 
 	sd_status= status_get_status_data(&sd->bl);
 	md_status= status_get_status_data(bl);
+	md = (TBL_MOB *)bl;
 
 	if(md->state.steal_flag>=battle_config.skill_steal_max_tries || md_status->mode&MD_BOSS || md->master_id ||
 		(md->class_>=1324 && md->class_<1364) || // prevent stealing from treasure boxes [Valaris]
@@ -4479,7 +4480,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
 		if(md->target_id==sd->bl.id)
 			mob_unlocktarget(md,tick);
 		if(battle_config.mobs_level_up && md->status.hp &&
-			md->level < pc_maxbaselv(sd) &&
+			(unsigned int)md->level < pc_maxbaselv(sd) &&
 			!md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex]
 		) { 	// monster level up [Valaris]
 			clif_misceffect(&md->bl,0);
@@ -6515,7 +6516,7 @@ static void pc_natural_heal_hp(struct map_session_data *sd)
 			hp+= bonus;
 		} while(sd->hp_sub >= battle_config.natural_healhp_interval);
 		
-		if (status_heal(&sd->bl, hp, 0, 1) < hp)
+		if ((unsigned int)status_heal(&sd->bl, hp, 0, 1) < hp)
 		{	//At full.
 			sd->inchealhptick = 0;
 			return;

+ 8 - 8
src/map/skill.c

@@ -1848,7 +1848,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 			case MO_TRIPLEATTACK:
 			{
 				int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex;
-				if (damage < tstatus->hp &&
+				if (damage < (signed int)tstatus->hp &&
 					pc_checkskill(sd, MO_CHAINCOMBO) > 0)
 					delay += 300 * battle_config.combo_delay_rate / 100;
 				sc_start4(src,SC_COMBO,100,MO_TRIPLEATTACK,skilllv,0,0,delay);
@@ -1861,7 +1861,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 			case MO_CHAINCOMBO:
 			{
 				int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex;
-				if(damage < tstatus->hp &&
+				if(damage < (signed int)tstatus->hp &&
 					(pc_checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0))
 					delay += 300 * battle_config.combo_delay_rate /100;
 				sc_start4(src,SC_COMBO,100,MO_CHAINCOMBO,skilllv,0,0,delay);
@@ -1871,7 +1871,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 			case MO_COMBOFINISH:
 			{
 				int delay = 700 - 4*sstatus->agi - 2*sstatus->dex;
-				if(damage < tstatus->hp &&
+				if(damage < (signed int)tstatus->hp &&
 				(
 					(pc_checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball >= 4 && sd->sc.data[SC_EXPLOSIONSPIRITS].timer != -1) ||
 					(pc_checkskill(sd, CH_TIGERFIST) > 0 && sd->spiritball > 0) ||
@@ -1885,7 +1885,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 			case CH_TIGERFIST:
 			{	//Tigerfist is now a combo-only skill. [Skotlex]
 				int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex;
-				if(damage < tstatus->hp &&
+				if(damage < (signed int)tstatus->hp &&
 				(
 					(pc_checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball >= 3 && sd->sc.data[SC_EXPLOSIONSPIRITS].timer != -1) ||
 					(pc_checkskill(sd, CH_CHAINCRUSH) > 0)
@@ -1898,14 +1898,14 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 			case CH_CHAINCRUSH:
 			{
 				int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex;
-				if(damage < tstatus->hp)
+				if(damage < (signed int)tstatus->hp)
 					delay += 300 * battle_config.combo_delay_rate /100;
 				sc_start4(src,SC_COMBO,100,CH_CHAINCRUSH,skilllv,0,0,delay);
 				clif_combo_delay(src,delay);
 				break;
 			}
 			case AC_DOUBLE:
-				if((tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && damage < tstatus->hp && pc_checkskill(sd, HT_POWER)) {
+				if((tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && damage < (signed int)tstatus->hp && pc_checkskill(sd, HT_POWER)) {
 					//TODO: This code was taken from Triple Blows,is this even how it should be? [Skotlex]
 					sc_start4(src,SC_COMBO,100,HT_POWER,bl->id,0,0,2000);
 					clif_combo_delay(src,2000);
@@ -7967,11 +7967,11 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ
 	}
 
 	if(!(type&2)){
-		if( hp>0 && status->hp <= hp) {				/* HPチェック */
+		if( hp>0 && status->hp <= (unsigned int)hp) {				/* HPチェック */
 			clif_skill_fail(sd,skill,2,0);		/* HP不足?F失敗通知 */
 			return 0;
 		}
-		if( sp>0 && status->sp < sp) {				/* SPチェック */
+		if( sp>0 && status->sp < (unsigned int)sp) {				/* SPチェック */
 			clif_skill_fail(sd,skill,1,0);		/* SP不足?F失敗通知 */
 			return 0;
 		}

+ 4 - 4
src/map/status.c

@@ -1663,7 +1663,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
 	if (!battle_config.weapon_defense_type && status->def > battle_config.max_def)
 	{
 		status->def2 += battle_config.over_def_bonus*(status->def -battle_config.max_def);
-		status->def = battle_config.max_def;
+		status->def = (unsigned char)battle_config.max_def;
 	}
 
 // ----- INT-MDEF CALCULATION -----
@@ -1680,7 +1680,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
 	if (!battle_config.weapon_defense_type && status->mdef > battle_config.max_def)
 	{
 		status->mdef2 += battle_config.over_def_bonus*(status->mdef -battle_config.max_def);
-		status->mdef = battle_config.max_def;
+		status->mdef = (unsigned char)battle_config.max_def;
 	}
 	
 // ----- WALKING SPEED CALCULATION -----
@@ -1962,7 +1962,7 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
 		if(battle_config.hp_rate != 100)
 			status->max_hp = status->max_hp * battle_config.hp_rate/100;
 		
-		if(status->max_hp > battle_config.max_hp)
+		if(status->max_hp > (unsigned int)battle_config.max_hp)
 			status->max_hp = battle_config.max_hp;
 		else if(!status->max_hp)
 			status->max_hp = 1;
@@ -2014,7 +2014,7 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
 		if(battle_config.sp_rate != 100)
 			status->max_sp = status->max_sp * battle_config.sp_rate/100;
 		
-		if(status->max_sp > battle_config.max_sp)
+		if(status->max_sp > (unsigned int)battle_config.max_sp)
 			status->max_sp = battle_config.max_sp;
 		else if(!status->max_sp)
 			status->max_sp = 1;