|
From: <gi...@cr...> - 2013-07-31 02:15:23
|
via 2e76cfd839a904a35b6f407666c80403d83974af (commit)
via 5e2a970f1475e397300623dae72b4f85106d5d93 (commit)
via f13214863725794c6f0749fd66f93c62b657f7ca (commit)
from 07a0b80f945cf9971cf29834f28f279ccdfbefdb (commit)
-----------------------------------------------------------------------
commit 2e76cfd839a904a35b6f407666c80403d83974af
Author: Adam Borowski <kil...@an...>
Date: Mon Jul 29 22:23:07 2013 +0200
Let the compiler inline new trivial accessors.
Not sure if religion is queried from any tight loops, but this doesn't hurt,
and servers don't use LTO yet.
commit 5e2a970f1475e397300623dae72b4f85106d5d93
Author: Adam Borowski <kil...@an...>
Date: Mon Jul 29 21:30:31 2013 +0200
Indendation & brace fixes.
commit f13214863725794c6f0749fd66f93c62b657f7ca
Author: Adam Borowski <kil...@an...>
Date: Wed Jul 31 04:11:37 2013 +0200
Drop an unused variable.
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/bitary.h | 6 +-----
crawl-ref/source/player.cc | 5 -----
crawl-ref/source/player.h | 9 +++++++--
crawl-ref/source/religion.cc | 5 -----
crawl-ref/source/religion.h | 7 ++++++-
crawl-ref/source/spl-damage.cc | 1 -
crawl-ref/source/wiz-you.cc | 2 --
7 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/crawl-ref/source/bitary.h b/crawl-ref/source/bitary.h
index 5190365..4fd7e2f 100644
--- a/crawl-ref/source/bitary.h
+++ b/crawl-ref/source/bitary.h
@@ -94,9 +94,7 @@ public:
{
data.reset();
if (value)
- {
- data.flip();
- }
+ data.flip();
}
};
@@ -114,9 +112,7 @@ public:
{
data.reset();
if (def)
- {
data.flip();
- }
}
FixedBitArray()
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index a25e7f2..d37fba3 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -487,11 +487,6 @@ bool player_can_open_doors()
return (you.form != TRAN_BAT && you.form != TRAN_JELLY);
}
-int player_under_penance(god_type which_god)
-{
- return (you.penance[which_god]);
-}
-
// TODO: get rid of this.
bool player_genus(genus_type which_genus, species_type species)
{
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index c1cd436..90f00d0 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -796,7 +796,9 @@ bool player_in_connected_branch(void);
bool player_in_hell(void);
static inline bool player_in_branch(int branch)
-{ return you.where_are_you == branch; };
+{
+ return you.where_are_you == branch;
+};
bool berserk_check_wielded_weapon(void);
bool player_equip_unrand_effect(int unrand_index);
@@ -809,7 +811,10 @@ bool player_is_shapechanged(void);
bool is_effectively_light_armour(const item_def *item);
bool player_effectively_in_light_armour();
-int player_under_penance(god_type which_god = you.religion);
+static inline int player_under_penance(god_type god = you.religion)
+{
+ return you.penance[god];
+}
int burden_change(void);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 4cbe67e..7ec9535 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3784,11 +3784,6 @@ void god_pitch(god_type which_god)
learned_something_new(HINT_CONVERT);
}
-bool you_worship(const god_type god)
-{
- return you.religion == god;
-}
-
int had_gods()
{
int count = 0;
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index c5ac3d4..52082de 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -54,7 +54,12 @@ int god_colour(god_type god);
colour_t god_message_altar_colour(god_type god);
bool player_can_join_god(god_type which_god);
void god_pitch(god_type which_god);
-bool you_worship(god_type god);
+
+static inline bool you_worship(god_type god)
+{
+ return you.religion == god;
+}
+
int had_gods();
int piety_rank(int piety = -1);
int piety_scale(int piety_change);
diff --git a/crawl-ref/source/spl-damage.cc b/crawl-ref/source/spl-damage.cc
index 49b12ef..fd9c442 100644
--- a/crawl-ref/source/spl-damage.cc
+++ b/crawl-ref/source/spl-damage.cc
@@ -552,7 +552,6 @@ spret_type cast_los_attack_spell(spell_type spell, int pow, actor* agent,
bool actual, bool added_effects, bool fail)
{
monster* mons = agent ? agent->as_monster() : NULL;
- coord_def start_pos = agent ? agent->pos() : you.pos();
colour_t flash_colour = BLACK;
string player_msg, global_msg, mons_vis_msg, mons_invis_msg,
diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc
index e5e4539..9bec2b1 100644
--- a/crawl-ref/source/wiz-you.cc
+++ b/crawl-ref/source/wiz-you.cc
@@ -1028,9 +1028,7 @@ void wizard_god_mollify()
for (int i = GOD_NO_GOD; i < NUM_GODS; ++i)
{
if (player_under_penance((god_type) i))
- {
dec_penance((god_type) i, you.penance[i]);
- }
}
}
--
Dungeon Crawl Stone Soup
|