Viewing Issue Advanced Details Jump to Notes ] Wiki ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007414 [DCSS] Patches trivial have not tried 2013-07-31 03:59 2013-08-06 12:19
Reporter chris View Status public  
Assigned To Kate
Priority normal Resolution done Local or Remote Local
Status closed   Operating System Windows
Projection none   Console or Tiles Console
ETA none Fixed in Branch 0.13 ancient branch Product Branch 0.13 ancient branch
  Product Version
Summary 0007414: More padding fixes for ternary operator
Description
From 26b6366084c9c553720dd77b33327f6b52d18ecc Mon Sep 17 00:00:00 2001
From: Chris Oelmueller <chris.oelmueller@gmail.com>
Date: Wed, 31 Jul 2013 03:58:01 +0200
Subject: More padding fixes for ternary operator

---
 crawl-ref/source/command.cc      |  2 +-
 crawl-ref/source/dgn-layouts.cc  |  2 +-
 crawl-ref/source/dgn-shoals.cc   |  4 ++--
 crawl-ref/source/directn.cc      |  4 ++--
 crawl-ref/source/dungeon.cc      |  4 ++--
 crawl-ref/source/feature.cc      |  2 +-
 crawl-ref/source/kills.cc        |  6 +++---
 crawl-ref/source/libunix.cc      |  2 +-
 crawl-ref/source/libw32c.cc      |  2 +-
 crawl-ref/source/mapdef.cc       |  2 +-
 crawl-ref/source/melee_attack.cc |  2 +-
 crawl-ref/source/pattern.cc      |  2 +-
 crawl-ref/source/shout.cc        |  4 ++--
 crawl-ref/source/show.cc         |  2 +-
 crawl-ref/source/sqldbm.cc       | 10 +++++-----
 crawl-ref/source/stash.cc        |  4 ++--
 crawl-ref/source/travel.cc       |  6 +++---
 17 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index d01ebc6..a922a8b 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1799,7 +1799,7 @@ help_highlighter::help_highlighter(string highlight_string) :
 
 int help_highlighter::entry_colour(const MenuEntry *entry) const
 {
-    return !pattern.empty() && pattern.matches(entry->text)? WHITE : -1;
+    return !pattern.empty() && pattern.matches(entry->text) ? WHITE : -1;
 }
 
 // To highlight species in aptitudes list. ('?%')
diff --git a/crawl-ref/source/dgn-layouts.cc b/crawl-ref/source/dgn-layouts.cc
index 1574e18..eed4566 100644
--- a/crawl-ref/source/dgn-layouts.cc
+++ b/crawl-ref/source/dgn-layouts.cc
@@ -287,7 +287,7 @@ void dgn_build_chaotic_city_level(dungeon_feature_type force_wall)
 
         dungeon_feature_type feature = DNGN_FLOOR;
         if (one_chance_in(10))
-            feature = coinflip()? DNGN_DEEP_WATER : DNGN_LAVA;
+            feature = coinflip() ? DNGN_DEEP_WATER : DNGN_LAVA;
 
         _octa_room(room, oblique_max, feature);
     }
diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc
index d51e20e..592d77f 100644
--- a/crawl-ref/source/dgn-shoals.cc
+++ b/crawl-ref/source/dgn-shoals.cc
@@ -108,7 +108,7 @@ static int _shoals_feature_height(dungeon_feature_type feat)
     case DNGN_DEEP_WATER:
         return SHT_SHALLOW_WATER - 1;
     default:
-        return feat_is_solid(feat)? SHT_ROCK : SHT_FLOOR;
+        return feat_is_solid(feat) ? SHT_ROCK : SHT_FLOOR;
     }
 }
 
@@ -1008,7 +1008,7 @@ static tide_direction _shoals_feature_tide_height_change(
         _shoals_feature_height(newfeat) - _shoals_feature_height(oldfeat);
     // If the apparent height of the new feature is greater (floor vs water),
     // the tide is receding.
-    return height_delta < 0? TIDE_RISING : TIDE_FALLING;
+    return height_delta < 0 ? TIDE_RISING : TIDE_FALLING;
 }
 
 static void _shoals_apply_tide_at(coord_def c, int tide, bool incremental_tide)
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index a119c7b..626c4e5 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2539,7 +2539,7 @@ static int _next_los(int dir, int los, bool wrap)
         //    so we can go back to the first item in LOS. Unless we set
         //    fliphv, we can't flip from hidden to visible.
         //
-        los = flipvh? LS_FLIPHV : LS_FLIPVH;
+        los = flipvh ? LS_FLIPHV : LS_FLIPVH;
     }
     else
     {
@@ -2553,7 +2553,7 @@ static int _next_los(int dir, int los, bool wrap)
             return LS_NONE;
     }
 
-    los = (los & ~LS_VISMASK) | (vis? LS_HIDDEN : LS_VISIBLE);
+    los = (los & ~LS_VISMASK) | (vis ? LS_HIDDEN : LS_VISIBLE);
     return los;
 }
 
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 053349d..946f7e9 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -3834,7 +3834,7 @@ static void _builder_monsters()
     // letting all the merfolk be generated in the middle of the
     // water.
     const dungeon_feature_type preferred_grid_feature =
-        in_shoals? DNGN_FLOOR : DNGN_UNSEEN;
+        in_shoals ? DNGN_FLOOR : DNGN_UNSEEN;
 
     dprf("_builder_monsters: Generating %d monsters", mon_wanted);
     for (int i = 0; i < mon_wanted; i++)
@@ -5601,7 +5601,7 @@ static void _place_spec_shop(const coord_def& where,
             else
             {
                 orb = items(1, _item_in_shop(env.shop[i].type), subtype, true,
-                             one_chance_in(4)? MAKE_GOOD_ITEM : item_level,
+                             one_chance_in(4) ? MAKE_GOOD_ITEM : item_level,
                              MAKE_ITEM_RANDOM_RACE);
             }
 
diff --git a/crawl-ref/source/feature.cc b/crawl-ref/source/feature.cc
index c2ad9c0..0b95abb 100644
--- a/crawl-ref/source/feature.cc
+++ b/crawl-ref/source/feature.cc
@@ -14,7 +14,7 @@ const feature_def &get_feature_def(show_type object)
     // If this is a monster that is hidden explicitly, show items if
     // any instead, or the base feature if there are no items.
     if (object.cls == SH_MONSTER)
-        object.cls = (object.item != SHOW_ITEM_NONE)? SH_ITEM : SH_FEATURE;
+        object.cls = (object.item != SHOW_ITEM_NONE) ? SH_ITEM : SH_FEATURE;
     return Features[object];
 }
 
diff --git a/crawl-ref/source/kills.cc b/crawl-ref/source/kills.cc
index 7540e3a..8961094 100644
--- a/crawl-ref/source/kills.cc
+++ b/crawl-ref/source/kills.cc
@@ -102,9 +102,9 @@ void KillMaster::load(reader& inf)
 void KillMaster::record_kill(const monster* mon, int killer, bool ispet)
 {
     const kill_category kc =
-        YOU_KILL(killer)? KC_YOU :
-        ispet?            KC_FRIENDLY :
-                          KC_OTHER;
+        YOU_KILL(killer) ? KC_YOU :
+        ispet            ? KC_FRIENDLY :
+                           KC_OTHER;
     categorized_kills[kc].record_kill(mon);
 }
 
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc
index aa92856..adc75fb 100644
--- a/crawl-ref/source/libunix.cc
+++ b/crawl-ref/source/libunix.cc
@@ -173,7 +173,7 @@ static void termio_init()
 void set_mouse_enabled(bool enabled)
 {
 #ifdef NCURSES_MOUSE_VERSION
-    const int mask = enabled? ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION : 0;
+    const int mask = enabled ? ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION : 0;
     mmask_t oldmask = 0;
     mousemask(mask, &oldmask);
 #endif
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index 62dca09..c7b11c8 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -460,7 +460,7 @@ static void _setcursortype_internal(bool curstype)
     cci.dwSize = have_initial_cci && initial_cci.dwSize ? initial_cci.dwSize
                                                         : 5;
 
-    cci.bVisible = curstype? TRUE : FALSE;
+    cci.bVisible = curstype ? TRUE : FALSE;
     cursor_is_enabled = curstype;
     SetConsoleCursorInfo(outbuf, &cci);
 
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index a2cfd9f..b6d0e56 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -4772,7 +4772,7 @@ item_spec item_list::parse_corpse_spec(item_spec &result, string s)
     const bool skeleton = !corpse && strip_suffix(s, "skeleton");
     const bool chunk = !corpse && !skeleton && strip_suffix(s, "chunk");

 
-    result.base_type = chunk? OBJ_FOOD : OBJ_CORPSES;
+    result.base_type = chunk ? OBJ_FOOD : OBJ_CORPSES;
     result.sub_type  = (chunk  ? static_cast<int>(FOOD_CHUNK) :
                         static_cast<int>(corpse ? CORPSE_BODY :
                                          CORPSE_SKELETON));
diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc
index 879df00..557ee07 100644
--- a/crawl-ref/source/melee_attack.cc
+++ b/crawl-ref/source/melee_attack.cc
@@ -3340,7 +3340,7 @@ bool melee_attack::apply_damage_brand()
             // Declaring these just to pass to the enchant function.
             bolt beam_temp;
             beam_temp.thrower =
-                attacker->is_player()? KILL_YOU : KILL_MON;
+                attacker->is_player() ? KILL_YOU : KILL_MON;
             beam_temp.flavour = BEAM_CONFUSION;
             beam_temp.beam_source = attacker->mindex();
             beam_temp.apply_enchantment_to_monster(defender->as_monster());
diff --git a/crawl-ref/source/pattern.cc b/crawl-ref/source/pattern.cc
index e2296f9..43792f5 100644
--- a/crawl-ref/source/pattern.cc
+++ b/crawl-ref/source/pattern.cc
@@ -23,7 +23,7 @@ static void *_compile_pattern(const char *pattern, bool icase)
 {
     const char *error;
     int erroffset;
-    int flags = icase? PCRE_CASELESS : 0;
+    int flags = icase ? PCRE_CASELESS : 0;
     return pcre_compile(pattern,
                         flags,
                         &error,
diff --git a/crawl-ref/source/shout.cc b/crawl-ref/source/shout.cc
index aa2d4c0..6526f78 100644
--- a/crawl-ref/source/shout.cc
+++ b/crawl-ref/source/shout.cc
@@ -516,8 +516,8 @@ bool noisy(int original_loudness, const coord_def& where,
                 noise_msg,
                 (scaled_loudness + 1) * 1000,
                 who,
-                0 | (mermaid? NF_MERMAID : 0)
-                | (message_if_unseen? NF_MESSAGE_IF_UNSEEN : 0)));
+                0 | (mermaid ? NF_MERMAID : 0)
+                | (message_if_unseen ? NF_MESSAGE_IF_UNSEEN : 0)));
 
     // Some users of noisy() want an immediate answer to whether the
     // player heard the noise. The deferred noise system also means
diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc
index 1a6b2f7..b302afc 100644
--- a/crawl-ref/source/show.cc
+++ b/crawl-ref/source/show.cc
@@ -213,7 +213,7 @@ static show_item_type _item_to_show_code(const item_def &item)
     case OBJ_FOOD:       return SHOW_ITEM_FOOD;
     case OBJ_SCROLLS:    return SHOW_ITEM_SCROLL;
     case OBJ_JEWELLERY:
-        return (jewellery_is_amulet(item)? SHOW_ITEM_AMULET : SHOW_ITEM_RING);
+        return (jewellery_is_amulet(item) ? SHOW_ITEM_AMULET : SHOW_ITEM_RING);
     case OBJ_POTIONS:    return SHOW_ITEM_POTION;
     case OBJ_BOOKS:      return SHOW_ITEM_BOOK;
     case OBJ_STAVES:     return SHOW_ITEM_STAVE;
diff --git a/crawl-ref/source/sqldbm.cc b/crawl-ref/source/sqldbm.cc
index 44c0d31..7f9ede6 100644
--- a/crawl-ref/source/sqldbm.cc
+++ b/crawl-ref/source/sqldbm.cc
@@ -106,7 +106,7 @@ From SQLite's documentation:
 #else
     if (ec(sqlite3_open_v2(
                 dbfile.c_str(), &db,
-                readonly? SQLITE_OPEN_READONLY :
+                readonly ? SQLITE_OPEN_READONLY :
                 (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE),
                 NULL
 #endif
@@ -196,7 +196,7 @@ int SQL_DBM::do_insert(const string &key, const string &value)
 
 int SQL_DBM::init_insert()
 {
-    return s_insert? SQLITE_OK :
+    return s_insert ? SQLITE_OK :
         prepare_query(&s_insert, "INSERT INTO dbm VALUES (?, ?)");
 }
 
@@ -217,7 +217,7 @@ int SQL_DBM::remove(const string &key)
 
 int SQL_DBM::init_remove()
 {
-    return s_remove? SQLITE_OK :
+    return s_remove ? SQLITE_OK :
         prepare_query(&s_remove, "DELETE FROM dbm WHERE key = ?");
 }
 
@@ -280,13 +280,13 @@ unique_ptr<string> SQL_DBM::nextkey()
 
 int SQL_DBM::init_query()
 {
-    return s_query? SQLITE_OK :
+    return s_query ? SQLITE_OK :
         prepare_query(&s_query, "SELECT value FROM dbm WHERE key = ?");
 }
 
 int SQL_DBM::init_iterator()
 {
-    return s_iterator? SQLITE_OK :
+    return s_iterator ? SQLITE_OK :
         prepare_query(&s_iterator, "SELECT key FROM dbm");
 }
 
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index aa5e796..7cab850 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -1137,7 +1137,7 @@ Stash *LevelStashes::find_stash(coord_def c)
 
     const int abspos = (GXM * c.y) + c.x;
     stashes_t::iterator st = m_stashes.find(abspos);
-    return (st == m_stashes.end()? NULL : &st->second);
+    return (st == m_stashes.end() ? NULL : &st->second);
 }
 
 const Stash *LevelStashes::find_stash(coord_def c) const
@@ -1148,7 +1148,7 @@ const Stash *LevelStashes::find_stash(coord_def c) const
 
     const int abspos = (GXM * c.y) + c.x;
     stashes_t::const_iterator st = m_stashes.find(abspos);
-    return (st == m_stashes.end()? NULL : &st->second);
+    return (st == m_stashes.end() ? NULL : &st->second);
 }
 
 const ShopInfo *LevelStashes::find_shop(const coord_def& c) const
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index ce94049..1cf3f2f 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -2200,9 +2200,9 @@ static int _prompt_travel_branch(int prompt_flags, bool* to_entrance)
         case '\n': case '\r':
             return ID_REPEAT;
         case '<':
-            return (allow_updown? ID_UP : ID_CANCEL);
+            return (allow_updown ? ID_UP : ID_CANCEL);
         case '>':
-            return (allow_updown? ID_DOWN : ID_CANCEL);
+            return (allow_updown ? ID_DOWN : ID_CANCEL);
         case CONTROL('P'):
             {
                 const branch_type parent = _find_parent_branch(curr.branch);
@@ -3007,7 +3007,7 @@ void start_explore(bool grab_items)
     // Forget interrupted butchering.
     maybe_clear_weapon_swap();
 
-    you.running = (grab_items? RMODE_EXPLORE_GREEDY : RMODE_EXPLORE);
+    you.running = (grab_items ? RMODE_EXPLORE_GREEDY : RMODE_EXPLORE);
 
     if (you.running == RMODE_EXPLORE_GREEDY && god_likes_items(you.religion, true))
     {
-- 
1.8.3.4
Steps To Reproduce
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0023638)
Kate (developer)
2013-08-03 06:18

Applied, thanks.

- Issue History
Date Modified Username Field Change
2013-07-31 03:59 chris New Issue
2013-08-03 06:18 Kate Note Added: 0023638
2013-08-03 06:18 Kate Status new => resolved
2013-08-03 06:18 Kate Fixed in Branch => 0.13 development branch
2013-08-03 06:18 Kate Resolution open => done
2013-08-03 06:18 Kate Assigned To => Kate
2013-08-06 12:19 chris Status resolved => closed


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker