diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-07-05 13:22:39 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-05 14:00:11 +0200 |
commit | 68935e461e64eeb85ea44c616d1eab58975b8e20 (patch) | |
tree | 471804168af54b681856211f26fefb5091b34c34 /crawl-ref | |
parent | 15d548d4ba1148531b8d755d4130962126bccb52 (diff) | |
download | crawl-ref-68935e461e64eeb85ea44c616d1eab58975b8e20.tar.gz crawl-ref-68935e461e64eeb85ea44c616d1eab58975b8e20.zip |
Some more return deparenthesization.
Diffstat (limited to 'crawl-ref')
122 files changed, 458 insertions, 458 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 1724ab22e9..ae3bc90693 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -484,10 +484,10 @@ static const ability_def& _get_ability_def(ability_type abil) i < sizeof(Ability_List) / sizeof(Ability_List[0]); i++) { if (Ability_List[i].ability == abil) - return (Ability_List[i]); + return Ability_List[i]; } - return (Ability_List[0]); + return Ability_List[0]; } bool string_matches_ability_name(const std::string& key) @@ -572,7 +572,7 @@ static std::string _zd_mons_description_for_ability(const ability_def &abil) case ABIL_MAKE_LIGHTNING_SPIRE: return "You mount a charged rod inside a coil."; default: - return (""); + return ""; } } @@ -817,7 +817,7 @@ const std::string make_cost_description(ability_type ability) if (ret.str().empty()) ret << "None"; - return (ret.str()); + return ret.str(); } static std::string _get_piety_amount_str(int value) @@ -909,7 +909,7 @@ static const std::string _detailed_cost_description(ability_type ability) if (abil.flags & ABFLAG_STAT_DRAIN) ret << "\nIt will temporarily drain your strength, intelligence or dexterity when used."; - return (ret.str()); + return ret.str(); } static ability_type _fixup_ability(ability_type ability) @@ -1497,7 +1497,7 @@ static bool _check_ability_possible(const ability_def& abil, return true; case ABIL_LUGONU_CORRUPT: - return (!is_level_incorruptible()); + return !is_level_incorruptible(); case ABIL_LUGONU_ABYSS_ENTER: if (player_in_branch(BRANCH_ABYSS)) @@ -1718,7 +1718,7 @@ static int _calc_breath_ability_range(ability_type ability) die("Bad breath type!"); break; } - return (-2); + return -2; } static bool _do_ability(const ability_def& abil) @@ -3347,7 +3347,7 @@ static int _find_ability_slot(const ability_def &abil) } // All letters are assigned. - return (-1); + return -1; } std::vector<ability_type> get_god_abilities(bool include_unusable) diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc index 245bc3f264..49b6807625 100644 --- a/crawl-ref/source/abyss.cc +++ b/crawl-ref/source/abyss.cc @@ -163,7 +163,7 @@ static void _write_abyssal_features() static int _abyssal_rune_roll() { if (you.runes[RUNE_ABYSSAL]) - return (-1); + return -1; // The longer the player's hung around in the Abyss, the more // likely the rune. Never generate a new rune if the player @@ -1620,7 +1620,7 @@ static bool _is_grid_corruptible(const coord_def &c) case DNGN_ROCK_WALL: case DNGN_CLEAR_ROCK_WALL: - return (!one_chance_in(3)); + return !one_chance_in(3); default: return true; diff --git a/crawl-ref/source/act-iter.cc b/crawl-ref/source/act-iter.cc index 75af9a1145..251c9c7fbc 100644 --- a/crawl-ref/source/act-iter.cc +++ b/crawl-ref/source/act-iter.cc @@ -40,20 +40,20 @@ actor_iterator::operator bool() const actor* actor_iterator::operator*() const { if (!did_you) - return (&you); + return &you; else - return (*mi); + return *mi; } actor* actor_iterator::operator->() const { - return (**this); + return **this; } actor_iterator& actor_iterator::operator++() { advance(); - return (*this); + return *this; } actor_iterator actor_iterator::operator++(int) @@ -74,7 +74,7 @@ bool actor_iterator::valid(const actor* a) const case R_LOS: return (los->see_cell(a->pos())); case R_ACT: - return (act->can_see(a)); + return act->can_see(a); default: return true; } diff --git a/crawl-ref/source/actor-los.cc b/crawl-ref/source/actor-los.cc index 145fe84c46..dd566f9bd0 100644 --- a/crawl-ref/source/actor-los.cc +++ b/crawl-ref/source/actor-los.cc @@ -29,7 +29,7 @@ bool player::see_cell(const coord_def &p) const return true; if (xray_vision) return ((pos() - p).abs() <= dist_range(you.current_vision)); - return (actor::see_cell(p)); + return actor::see_cell(p); } bool actor::can_see(const actor *target) const @@ -50,7 +50,7 @@ bool player::trans_wall_blocking(const coord_def &p) const const los_base* actor::get_los() { los = los_glob(pos(), LOS_DEFAULT); - return (&los); + return &los; } const los_base* player::get_los() @@ -60,22 +60,22 @@ const los_base* player::get_los() // env.show.init iterates over these bounds for arena los = los_glob(crawl_view.vgrdc, LOS_ARENA, circle_def(LOS_MAX_RANGE, C_SQUARE)); - return (&los); + return &los; } else if (xray_vision) { los = los_glob(pos(), LOS_ARENA, circle_def(you.current_vision, C_ROUND)); - return (&los); + return &los; } else - return (actor::get_los()); + return actor::get_los(); } const los_base* actor::get_los_no_trans() { los_no_trans = los_glob(pos(), LOS_NO_TRANS); - return (&los_no_trans); + return &los_no_trans; } bool player::can_see(const actor* a) const @@ -85,5 +85,5 @@ bool player::can_see(const actor* a) const else if (xray_vision) return see_cell(a->pos()); else - return (actor::can_see(a)); + return actor::can_see(a); } diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc index 8db3c9dd0d..7afe166d93 100644 --- a/crawl-ref/source/actor.cc +++ b/crawl-ref/source/actor.cc @@ -116,7 +116,7 @@ int actor::skill_rdiv(skill_type sk, int mult, int div) const int actor::res_holy_fire() const { if (is_evil() || is_unholy()) - return (-1); + return -1; else if (is_holy()) return 3; return 0; @@ -140,7 +140,7 @@ int actor::check_res_magic(int power) // help them out (or building a level or two of their base skill so they // aren't resisted as often). - bwr if (is_monster() && mrs < 6 && coinflip()) - return (-1); + return -1; power = stepdown_value(power, 30, 40, 100, 120); diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc index 7943f4e839..b7baebde45 100644 --- a/crawl-ref/source/areas.cc +++ b/crawl-ref/source/areas.cc @@ -488,7 +488,7 @@ void create_sanctuary(const coord_def& center, int time) static int _silence_range(int dur) { if (dur <= 0) - return (-1); + return -1; dur /= BASELINE_DELAY; // now roughly number of turns return std::max(0, std::min(dur - 6, 37)); } @@ -504,7 +504,7 @@ int monster::silence_radius2() const return 150; if (!has_ench(ENCH_SILENCE)) - return (-1); + return -1; const int dur = get_ench(ENCH_SILENCE).duration; // The below is arbitrarily chosen to make monster decay look reasonable. @@ -621,7 +621,7 @@ int player::liquefying_radius2() const int monster::liquefying_radius2() const { if (!has_ench(ENCH_LIQUEFYING)) - return (-1); + return -1; const int dur = get_ench(ENCH_LIQUEFYING).duration; // The below is arbitrarily chosen to make monster decay look reasonable. const int moddur = BASELINE_DELAY * @@ -686,20 +686,20 @@ bool actor::umbraed() const // Stub for player umbra. int player::umbra_radius2() const { - return (-1); + return -1; } int monster::umbra_radius2() const { if (holiness() != MH_UNDEAD) - return (-1); + return -1; switch (type) { case MONS_PROFANE_SERVITOR: return 40; // Very unholy! default: - return (-1); + return -1; } } @@ -721,7 +721,7 @@ int monster::suppression_radius2() const if (type == MONS_MOTH_OF_SUPPRESSION) return 150; else - return (-1); + return -1; } bool actor::suppressed() const @@ -731,5 +731,5 @@ bool actor::suppressed() const int player::suppression_radius2() const { - return (-1); + return -1; } diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc index a6f954bf62..c51b7810b3 100644 --- a/crawl-ref/source/arena.cc +++ b/crawl-ref/source/arena.cc @@ -1066,7 +1066,7 @@ monster_type arena_pick_random_monster(const level_id &place, int power, if (arena_veto_random_monster(arena::cycle_random_pos)) continue; - return (arena::cycle_random_pos); + return arena::cycle_random_pos; } game_ended_with_error( diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc index c7b2a48018..82a7d306bf 100644 --- a/crawl-ref/source/artefact.cc +++ b/crawl-ref/source/artefact.cc @@ -1402,7 +1402,7 @@ static bool _artefact_name_lookup(std::string &result, const std::string &lookup) { result = _artefact_name_lookup(item, lookup); - return (!result.empty()); + return !result.empty(); } std::string make_artefact_name(const item_def &item, bool appearance) @@ -1540,7 +1540,7 @@ void set_artefact_name(item_def &item, const std::string &name) int find_unrandart_index(const item_def& artefact) { - return (artefact.special); + return artefact.special; } unrandart_entry* get_unrand_entry(int unrand_index) diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc index f4882073cf..cf4bd4ffa9 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -86,7 +86,7 @@ std::string attack::anon_name(description_level_type desc, switch (desc) { case DESC_NONE: - return (""); + return ""; case DESC_YOUR: case DESC_ITS: return "its"; @@ -138,7 +138,7 @@ std::string attack::debug_damage_number() if (you.wizard) return make_stringf(" for %d", damage_done); else - return (""); + return ""; } /* Returns special punctuation diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 2d3d78bf0f..8d0cf58915 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -106,7 +106,7 @@ const tracer_info& tracer_info::operator+=(const tracer_info &other) dont_stop = dont_stop || other.dont_stop; - return (*this); + return *this; } bool bolt::is_blockable() const @@ -2343,9 +2343,9 @@ static int _potion_beam_flavour_to_colour(beam_type flavour) default: // Leave it the colour of the potion, the clouds will colour // themselves on the next refresh. -- bwr - return (-1); + return -1; } - return (-1); + return -1; } void bolt::affect_endpoint() @@ -2909,7 +2909,7 @@ bool bolt::is_harmless(const monster* mon) const { // For enchantments, this is already handled in nasty_to(). if (is_enchantment()) - return (!nasty_to(mon)); + return !nasty_to(mon); // The others are handled here. switch (flavour) @@ -2931,7 +2931,7 @@ bool bolt::is_harmless(const monster* mon) const return (mon->res_cold() >= 3); case BEAM_MIASMA: - return (mon->res_rotting()); + return mon->res_rotting(); case BEAM_NEG: return (mon->res_negative_energy() == 3); @@ -2976,7 +2976,7 @@ bool bolt::harmless_to_player() const return (player_res_steam(false) >= 3); case BEAM_MIASMA: - return (you.res_rotting()); + return you.res_rotting(); case BEAM_NEG: return (player_prot_life(false) >= 3); @@ -5726,7 +5726,7 @@ actor* bolt::agent() const nominal_source = reflector; } if (YOU_KILL(nominal_ktype)) - return (&you); + return &you; else if (!invalid_monster_index(nominal_source)) return (&menv[nominal_source]); else diff --git a/crawl-ref/source/bitary.cc b/crawl-ref/source/bitary.cc index f6cca8fc11..61137c771a 100644 --- a/crawl-ref/source/bitary.cc +++ b/crawl-ref/source/bitary.cc @@ -52,7 +52,7 @@ bit_array& bit_array::operator |= (const bit_array& other) ASSERT(size == other.size); for (int w = 0; w < nwords; ++w) data[w] |= other.data[w]; - return (*this); + return *this; } bit_array& bit_array::operator &= (const bit_array& other) @@ -60,7 +60,7 @@ bit_array& bit_array::operator &= (const bit_array& other) ASSERT(size == other.size); for (int w = 0; w < nwords; ++w) data[w] &= other.data[w]; - return (*this); + return *this; } bit_array bit_array::operator & (const bit_array& other) const diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc index cfa61db3e6..09c6481ba7 100644 --- a/crawl-ref/source/cio.cc +++ b/crawl-ref/source/cio.cc @@ -561,7 +561,7 @@ int line_reader::process_key(int ch) break; case CK_MOUSE_CLICK: // FIXME: ought to move cursor to click location, if it's within the input - return (-1); + return -1; default: if (wcwidth(ch) >= 0 && length + wclen(ch) < static_cast<int>(bufsz)) { @@ -597,7 +597,7 @@ int line_reader::process_key(int ch) break; } - return (-1); + return -1; } ///////////////////////////////////////////////////////////////////////////// diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 60f2e16a21..5762c77a8b 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -229,14 +229,14 @@ int CLua::loadfile(lua_State *ls, const char *filename, bool trusted, bool die_on_fail) { if (!ls) - return (-1); + return -1; if (!is_path_safe(filename, trusted)) { lua_pushstring( ls, make_stringf("invalid filename: %s", filename).c_str()); - return (-1); + return -1; } std::string file = datafile_path(filename, die_on_fail); @@ -244,7 +244,7 @@ int CLua::loadfile(lua_State *ls, const char *filename, bool trusted, { lua_pushstring(ls, make_stringf("Can't find \"%s\"", filename).c_str()); - return (-1); + return -1; } FileLineInput f(file.c_str()); @@ -692,7 +692,7 @@ CLua &CLua::get_vm(lua_State *ls) CLua *vm = clua_get_lightuserdata<CLua>(ls, -1); if (!vm) luaL_error(ls, "Could not find matching clua for lua state"); - return (*vm); + return *vm; } bool CLua::is_managed_vm(lua_State *ls) @@ -1149,7 +1149,7 @@ const lua_datum &lua_datum::operator = (const lua_datum &o) cleanup(); set_from(o); } - return (*this); + return *this; } void lua_datum::push() const diff --git a/crawl-ref/source/colour.cc b/crawl-ref/source/colour.cc index d78c5a6bfd..c88efad44a 100644 --- a/crawl-ref/source/colour.cc +++ b/crawl-ref/source/colour.cc @@ -777,19 +777,19 @@ static unsigned _colflag2brand(int colflag) switch (colflag) { case COLFLAG_ITEM_HEAP: - return (Options.heap_brand); + return Options.heap_brand; case COLFLAG_FRIENDLY_MONSTER: - return (Options.friend_brand); + return Options.friend_brand; case COLFLAG_NEUTRAL_MONSTER: - return (Options.neutral_brand); + return Options.neutral_brand; case COLFLAG_WILLSTAB: - return (Options.stab_brand); + return Options.stab_brand; case COLFLAG_MAYSTAB: - return (Options.may_stab_brand); + return Options.may_stab_brand; case COLFLAG_FEATURE_ITEM: - return (Options.feature_item_brand); + return Options.feature_item_brand; case COLFLAG_TRAP_ITEM: - return (Options.trap_item_brand); + return Options.trap_item_brand; default: return CHATTR_NORMAL; } diff --git a/crawl-ref/source/coordit.cc b/crawl-ref/source/coordit.cc index 0f98228041..b084b17a4b 100644 --- a/crawl-ref/source/coordit.cc +++ b/crawl-ref/source/coordit.cc @@ -84,7 +84,7 @@ circle_iterator::operator bool() const coord_def circle_iterator::operator*() const { - return (*iter); + return *iter; } void circle_iterator::operator++() diff --git a/crawl-ref/source/ctest.cc b/crawl-ref/source/ctest.cc index 43ee99df84..bbf69ff92a 100644 --- a/crawl-ref/source/ctest.cc +++ b/crawl-ref/source/ctest.cc @@ -198,7 +198,7 @@ bool run_tests(bool exit_on_complete) end(code, false, "%d %ss, %d succeeded, %d failed", ntests, activity, nsuccess, (int)failures.size()); } - return (failures.empty()); + return failures.empty(); } #endif // DEBUG_DIAGNOSTICS diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index c9e98f62b2..4e61b2968b 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -735,7 +735,7 @@ static std::string _query_database(TextDB &db, std::string key, result = _database_fetch(db.get(), key); if (result.dsize <= 0) - return (""); + return ""; std::string str((const char *)result.dptr, result.dsize); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 1004d3f5bb..37707bc03d 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -525,7 +525,7 @@ static void _maybe_interrupt_swap(bool force_unsafe) bool you_are_delayed(void) { - return (!you.delay_queue.empty()); + return !you.delay_queue.empty(); } delay_type current_delay_action(void) @@ -1870,7 +1870,7 @@ static const char *_activity_interrupt_name(activity_interrupt_type ai) COMPILE_CHECK(ARRAYSZ(activity_interrupt_names) == NUM_AINTERRUPTS); if (ai == NUM_AINTERRUPTS) - return (""); + return ""; return activity_interrupt_names[ai]; } @@ -1926,7 +1926,7 @@ delay_type get_delay(const std::string &name) const char *delay_name(int delay) { if (delay < 0 || delay >= NUM_DELAYS) - return (""); + return ""; return delay_names[delay]; } diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 42318a02db..7b471435c8 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -378,7 +378,7 @@ void trim_god_gift_inscrip(item_def& item) std::string artefact_auto_inscription(const item_def& item) { if (item.base_type == OBJ_BOOKS) - return (""); + return ""; const std::vector<std::string> propnames = _randart_propnames(item); @@ -549,7 +549,7 @@ std::string trap_name(trap_type trap) if (trap >= TRAP_DART && trap < NUM_TRAPS) return (trap_names[trap]); - return (""); + return ""; } int str_to_trap(const std::string &s) @@ -573,7 +573,7 @@ int str_to_trap(const std::string &s) if (tspec == lowercase_string(trap_names[i])) return i; - return (-1); + return -1; } //--------------------------------------------------------------- @@ -2992,7 +2992,7 @@ static std::string _describe_draconian_role(monster_type type) case MONS_DRACONIAN_KNIGHT: return "It wields a deadly weapon with menacing efficiency."; default: - return (""); + return ""; } } @@ -3019,7 +3019,7 @@ static std::string _describe_draconian_colour(int species) case MONS_PALE_DRACONIAN: return "It is cloaked in a pall of superheated steam."; } - return (""); + return ""; } static std::string _describe_draconian(const monster_info& mi) @@ -3277,7 +3277,7 @@ static std::string _monster_stat_description(const monster_info& mi) else if (sizes[mi.body_size()]) result << uppercase_first(pronoun) << " is " << sizes[mi.body_size()] << ".\n"; - return (result.str()); + return result.str(); } static std::string _serpent_of_hell_flavour(monster_type m) @@ -3705,7 +3705,7 @@ std::string get_ghost_description(const monster_info &mi, bool concise) << god_name(mi.u.ghost.religion); } - return (gstr.str()); + return gstr.str(); } extern ability_type god_abilities[NUM_GODS][MAX_GOD_ABILITIES]; diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index eacf29fb03..aaf13dc129 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -2432,7 +2432,7 @@ static bool _find_monster(const coord_def& where, int mode, bool need_path, return (mons_attitude(mon) == ATT_HOSTILE); if (mode == TARG_FRIEND) - return (mon->friendly()); + return mon->friendly(); if (mode == TARG_INJURED_FRIEND) return (mon->friendly() && mons_get_damage_level(mon) > MDAM_OKAY @@ -2449,7 +2449,7 @@ static bool _find_monster(const coord_def& where, int mode, bool need_path, return false; // Don't target zero xp monsters. - return (!mons_class_flag(mon->type, M_NO_EXP_GAIN)); + return !mons_class_flag(mon->type, M_NO_EXP_GAIN); } static bool _find_feature(const coord_def& where, int mode, @@ -2876,7 +2876,7 @@ std::string thing_do_grammar(description_level_type dtype, case DESC_A: return article_a(desc, true); case DESC_NONE: - return (""); + return ""; default: return desc; } @@ -3156,7 +3156,7 @@ static std::string _base_feature_desc(dungeon_feature_type grid, case DNGN_EXPLORE_HORIZON: return "explore horizon"; default: - return (""); + return ""; } } @@ -3365,7 +3365,7 @@ static std::string _stair_destination_description(const coord_def &pos) else if (feat_is_stair(grd(pos))) return " (unknown stair)"; } - return (""); + return ""; } #endif diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index b4a2bd6b35..5e19215ac6 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -3716,7 +3716,7 @@ static bool _vault_wants_damage(const vault_placement &vp) // tags like "ruin_abyss" or "ruin_lair" std::string place_desc = level_id::current().describe(false, false); lowercase(place_desc); - return (map.has_tag("ruin_" + place_desc)); + return map.has_tag("ruin_" + place_desc); } static void _ruin_vault(const vault_placement &vp) @@ -5494,7 +5494,7 @@ coord_def dgn_find_feature_marker(dungeon_feature_type feat) if (mark->get_type() == MAT_FEATURE && dynamic_cast<map_feature_marker*>(mark)->feat == feat) { - return (mark->pos); + return mark->pos; } } coord_def unfound; @@ -6354,7 +6354,7 @@ vault_place_iterator &vault_place_iterator::operator ++ () if (pos.y <= br.y && vault_place.map.in_map(pos - tl)) break; } - return (*this); + return *this; } vault_place_iterator vault_place_iterator::operator ++ (int) diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 8af56332f0..3c7a37e14f 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -766,7 +766,7 @@ int recharge_wand(int item_slot, bool known, std::string *pre_msg) OSEL_RECHARGE, true, true, false); } if (prompt_failed(item_slot)) - return (-1); + return -1; item_def &wand = you.inv[ item_slot ]; diff --git a/crawl-ref/source/exclude.cc b/crawl-ref/source/exclude.cc index c373ebead4..8ad61c0589 100644 --- a/crawl-ref/source/exclude.cc +++ b/crawl-ref/source/exclude.cc @@ -188,7 +188,7 @@ bool travel_exclude::affects(const coord_def& p) const else if (radius == 1) return ((p - pos).rdist() <= 1); else - return (los.see_cell(p)); + return los.see_cell(p); } bool travel_exclude::in_bounds(const coord_def &p) const @@ -371,7 +371,7 @@ bool is_excluded(const coord_def &p, const exclude_set &exc) bool is_exclude_root(const coord_def &p) { - return (curr_excludes.get_exclude_root(p)); + return curr_excludes.get_exclude_root(p); } int get_exclusion_radius(const coord_def &p) diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 00e77ce553..ad0f662e4b 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -141,42 +141,42 @@ struct coord_def { x += other.x; y += other.y; - return (*this); + return *this; } const coord_def &operator += (int offset) { x += offset; y += offset; - return (*this); + return *this; } const coord_def &operator -= (const coord_def &other) { x -= other.x; y -= other.y; - return (*this); + return *this; } const coord_def &operator -= (int offset) { x -= offset; y -= offset; - return (*this); + return *this; } const coord_def &operator /= (int div) { x /= div; y /= div; - return (*this); + return *this; } const coord_def &operator *= (int mul) { x *= mul; y *= mul; - return (*this); + return *this; } coord_def operator + (const coord_def &other) const @@ -402,7 +402,7 @@ public: { branch = id.branch; depth = id.depth; - return (*this); + return *this; } bool operator == (const level_id &id) const diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 96497e9e98..6903c21092 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -345,7 +345,7 @@ bool is_melee_weapon(const item_def *weapon) if (weapon->base_type != OBJ_WEAPONS) return false; - return (!is_range_weapon(*weapon)); + return !is_range_weapon(*weapon); } bool wielded_weapon_check(item_def *weapon, bool no_message) diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index f0e3b193ce..50d699b92c 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -213,7 +213,7 @@ std::string get_parent_directory(const std::string &filename) if (pos != std::string::npos) return filename.substr(0, pos + 1); #endif - return (""); + return ""; } std::string get_base_filename(const std::string &filename) @@ -301,7 +301,7 @@ time_t file_modtime(const std::string &file) if (stat(file.c_str(), &filestat)) return 0; - return (filestat.st_mtime); + return filestat.st_mtime; } time_t file_modtime(FILE *f) @@ -310,7 +310,7 @@ time_t file_modtime(FILE *f) if (fstat(fileno(f), &filestat)) return 0; - return (filestat.st_mtime); + return filestat.st_mtime; } static bool _create_directory(const char *dir) @@ -465,7 +465,7 @@ std::string datafile_path(std::string basename, basename.c_str()); } - return (""); + return ""; } // Checks if directory 'dir' exists and tries to create it if it diff --git a/crawl-ref/source/flood_find.h b/crawl-ref/source/flood_find.h index e515aa4f9e..10c0cd8961 100644 --- a/crawl-ref/source/flood_find.h +++ b/crawl-ref/source/flood_find.h @@ -81,7 +81,7 @@ bool flood_find<fgrd, bound_check>::points_connected_from( return true; set_floodseed(sp); pathfind(RMODE_EXPLORE); - return (needed_points.empty()); + return needed_points.empty(); } template <typename fgrd, typename bound_check> diff --git a/crawl-ref/source/fontwrapper-ft.cc b/crawl-ref/source/fontwrapper-ft.cc index f3764643b2..a865450e04 100644 --- a/crawl-ref/source/fontwrapper-ft.cc +++ b/crawl-ref/source/fontwrapper-ft.cc @@ -699,17 +699,17 @@ void FTFontWrapper::store(FontBuffer &buf, float &x, float &y, unsigned int FTFontWrapper::char_width() const { - return (m_max_advance.x); + return m_max_advance.x; } unsigned int FTFontWrapper::char_height() const { - return (m_max_advance.y); + return m_max_advance.y; } const GenericTexture *FTFontWrapper::font_tex() const { - return (&m_tex); + return &m_tex; } #endif // USE_FT diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index b26703db3f..beaddbf392 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -1553,11 +1553,11 @@ int prompt_eat_chunks(bool only_auto) case 'q': CASE_ESCAPE canned_msg(MSG_OK); - return (-1); + return -1; case 'i': case '?': // Skip ahead to the inventory. - return (-2); + return -2; case 'e': case 'y': if (can_ingest(*item, false)) @@ -2302,7 +2302,7 @@ bool is_preferred_food(const item_def &food) if (food.base_type == OBJ_POTIONS && food.sub_type == POT_PORRIDGE && item_type_known(food)) { - return (!player_mutation_level(MUT_CARNIVOROUS)); + return !player_mutation_level(MUT_CARNIVOROUS); } if (food.base_type != OBJ_FOOD) diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc index db017e00ca..dd424d4932 100644 --- a/crawl-ref/source/format.cc +++ b/crawl-ref/source/format.cc @@ -277,7 +277,7 @@ const formatted_string & formatted_string::operator += (const formatted_string &other) { ops.insert(ops.end(), other.ops.begin(), other.ops.end()); - return (*this); + return *this; } int formatted_string::width() const @@ -458,7 +458,7 @@ void formatted_string::clear() bool formatted_string::empty() { - return (ops.empty()); + return ops.empty(); } void formatted_string::cprintf(const char *s, ...) diff --git a/crawl-ref/source/geom2d.cc b/crawl-ref/source/geom2d.cc index c8678c0d92..838a8daecb 100644 --- a/crawl-ref/source/geom2d.cc +++ b/crawl-ref/source/geom2d.cc @@ -120,7 +120,7 @@ const vector& vector::operator+=(const vector &v) { x += v.x; y += v.y; - return (*this); + return *this; } vector vector::operator+(const vector &v) const diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc index f8e91177bf..d8f4993630 100644 --- a/crawl-ref/source/ghost.cc +++ b/crawl-ref/source/ghost.cc @@ -739,7 +739,7 @@ static spell_type search_first_list(int ignore_spell) continue; if (_know_spell(search_order_conj[i])) - return (search_order_conj[i]); + return search_order_conj[i]; } return SPELL_NO_SPELL; @@ -756,7 +756,7 @@ static spell_type search_second_list(int ignore_spell) continue; if (_know_spell(search_order_third[i])) - return (search_order_third[i]); + return search_order_third[i]; } return SPELL_NO_SPELL; @@ -773,7 +773,7 @@ static spell_type search_third_list(int ignore_spell) continue; if (_know_spell(search_order_misc[i])) - return (search_order_misc[i]); + return search_order_misc[i]; } return SPELL_NO_SPELL; @@ -1021,13 +1021,13 @@ std::string adjective_for_labrat_colour(colour_t l_colour) case LIGHTMAGENTA: return "mutated"; case MAGENTA: return "shifting"; case GREEN: return "venomous"; - case LIGHTGRAY: return (""); + case LIGHTGRAY: return ""; default: die("invalid labrat adjective"); break; } - return (""); + return ""; } #ifdef USE_TILE diff --git a/crawl-ref/source/glwrapper-ogl.cc b/crawl-ref/source/glwrapper-ogl.cc index 4900a25420..0efd359689 100644 --- a/crawl-ref/source/glwrapper-ogl.cc +++ b/crawl-ref/source/glwrapper-ogl.cc @@ -245,7 +245,7 @@ const char *OGLShapeBuffer::print_statistics() const unsigned int OGLShapeBuffer::size() const { - return (m_position_buffer.size()); + return m_position_buffer.size(); } void OGLShapeBuffer::add(const GLWPrim &rect) diff --git a/crawl-ref/source/glwrapper.cc b/crawl-ref/source/glwrapper.cc index 9e6392c57a..1790267e85 100644 --- a/crawl-ref/source/glwrapper.cc +++ b/crawl-ref/source/glwrapper.cc @@ -63,7 +63,7 @@ const GLState &GLState::operator=(const GLState &state) alpharef = state.alpharef; colour = state.colour; - return (*this); + return *this; } bool GLState::operator==(const GLState &state) const diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index 8cf56980e0..85b6e34727 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -664,7 +664,7 @@ int zin_check_recite_to_monsters(recite_type *prayertype) else if (!found_eligible && found_ineligible) { dprf("No sensible audience found!"); - return (-1); + return -1; } if (!prayertype) @@ -2778,7 +2778,7 @@ int fedhas_corpse_spores(beh_type behavior, bool interactive) true, 'y') <= 0) { viewwindow(false); - return (-1); + return -1; } for (unsigned i = 0; i < positions.size(); ++i) diff --git a/crawl-ref/source/hints.cc b/crawl-ref/source/hints.cc index 5414202f0d..5fd527faa6 100644 --- a/crawl-ref/source/hints.cc +++ b/crawl-ref/source/hints.cc @@ -1074,7 +1074,7 @@ static std::string _describe_portal(const coord_def &gc) "while pressing the <w>Shift key</w> will let you enter any " "portal you're standing on.</tiles>"; - return (text.str()); + return text.str(); } #define DELAY_EVENT \ diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index a24a0ed87a..d35d13871d 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -593,7 +593,7 @@ static bool _hs_read(FILE *scores, scorefile_entry &dest) if (!fgets(inbuf, sizeof inbuf, scores)) return false; - return (dest.parse(inbuf)); + return dest.parse(inbuf); } static int _val_char(char digit) @@ -643,7 +643,7 @@ static const char *_kill_method_name(kill_method_type kmt) COMPILE_CHECK(NUM_KILLBY == ARRAYSZ(kill_method_names)); if (kmt == NUM_KILLBY) - return (""); + return ""; return kill_method_names[kmt]; } @@ -689,7 +689,7 @@ scorefile_entry::scorefile_entry(const scorefile_entry &se) scorefile_entry &scorefile_entry::operator = (const scorefile_entry &se) { init_from(se); - return (*this); + return *this; } void scorefile_entry::init_from(const scorefile_entry &se) @@ -789,7 +789,7 @@ std::string scorefile_entry::raw_string() const set_score_fields(); if (!fields.get()) - return (""); + return ""; return fields->xlog_line() + "\n"; } @@ -806,7 +806,7 @@ static const char* _short_branch_name(int branch) { if (branch >= 0 && branch < NUM_BRANCHES) return branches[branch].abbrevname; - return (""); + return ""; } enum old_job_type @@ -1564,9 +1564,9 @@ std::string scorefile_entry::damage_string(bool terse) const std::string scorefile_entry::strip_article_a(const std::string &s) const { if (s.find("a ") == 0) - return (s.substr(2)); + return s.substr(2); else if (s.find("an ") == 0) - return (s.substr(3)); + return s.substr(3); return s; } @@ -1773,7 +1773,7 @@ std::string scorefile_entry::death_place(death_desc_verbosity verbosity) const std::string place; if (death_type == KILLED_BY_LEAVING || death_type == KILLED_BY_WINNING) - return (""); + return ""; char scratch[ INFO_SIZE ]; @@ -2525,7 +2525,7 @@ std::string xlog_fields::str_field(const std::string &s) const { xl_map::const_iterator i = fieldmap.find(s); if (i == fieldmap.end()) - return (""); + return ""; return i->second; } @@ -2634,6 +2634,6 @@ std::string xlog_status_line() se.set_base_xlog_fields(); xlog_fields xl = se.get_fields(); xl.add_field("time", "%s", make_date_string(time(NULL)).c_str()); - return (xl.xlog_line()); + return xl.xlog_line(); } #endif // DGL_WHEREIS diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 60c3d63c50..e8c72ceb4c 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -1313,7 +1313,7 @@ static std::string _find_crawlrc() // -rc option always wins. if (!SysEnv.crawl_rc.empty()) - return (SysEnv.crawl_rc); + return SysEnv.crawl_rc; // If we have any rcdirs, look in them for files from the // rc_dir_names list. @@ -1421,7 +1421,7 @@ std::string read_init_file(bool runscript) Options.basefilename = get_base_filename(init_file_name); Options.line_num = -1; - return (""); + return ""; } newgame_def read_startup_prefs() @@ -1434,7 +1434,7 @@ newgame_def read_startup_prefs() game_options temp; temp.read_options(fl, false); - return (temp.game); + return temp.game; #endif // !DISABLE_STICKY_STARTUP_OPTIONS } diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 97bbd1d34d..a4d68ec89d 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -1082,7 +1082,7 @@ std::string item_class_name(int type, bool terse) case OBJ_CORPSES: return "Carrion"; } } - return (""); + return ""; } const char* item_slot_name(equipment_type type, bool terse) @@ -1315,7 +1315,7 @@ static unsigned char _invent_select(const char *title = NULL, if (items) *items = menu.get_selitems(); - return (menu.getkey()); + return menu.getkey(); } unsigned char get_invent(int invent_type) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index f0e0160f74..5b5f4e7b3f 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -769,7 +769,7 @@ bool do_wear_armour(int item, bool quiet) if (item_is_worn(item)) { if (Options.equip_unequip) - return (!takeoff_armour(item)); + return !takeoff_armour(item); else { mpr("You're already wearing that object!"); @@ -985,7 +985,7 @@ static int _prompt_ring_to_remove(int new_ring) mesclr(); if (key_is_escape(c) || c == ' ') - return (-1); + return -1; const int eqslot = (c == lslot || c == '<') ? EQ_LEFT_RING : EQ_RIGHT_RING; @@ -1045,7 +1045,7 @@ static int _prompt_ring_to_remove_octopode(int new_ring) if (c == '?') return EQ_NONE; else if (key_is_escape(c) || eqslot == EQ_NONE) - return (-2); + return -2; return (you.equip[eqslot]); } @@ -1343,7 +1343,7 @@ static bool _puton_item(int item_slot) { // "Putting on" an equipped item means taking it off. if (Options.equip_unequip) - return (!remove_ring(item_slot)); + return !remove_ring(item_slot); else { mpr("You're already wearing that object!"); @@ -2529,7 +2529,7 @@ static int _handle_enchant_armour(int item_slot, std::string *pre_msg) OSEL_ENCH_ARM, true, true, false); } if (prompt_failed(item_slot)) - return (-1); + return -1; item_def& arm(you.inv[item_slot]); diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 655444b6a2..110901161e 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -80,7 +80,7 @@ std::string item_def::name(description_level_type descrip, } if (descrip == DESC_NONE) - return (""); + return ""; std::ostringstream buff; @@ -2889,7 +2889,7 @@ bool is_dangerous_item(const item_def &item, bool temp) return (!player_mutation_level(MUT_TORMENT_RESISTANCE) || !temp && you.species == SP_VAMPIRE); case SCR_HOLY_WORD: - return (you.undead_or_demonic()); + return you.undead_or_demonic(); default: return false; } @@ -2978,7 +2978,7 @@ bool is_useless_item(const item_def &item, bool temp) return false; case OBJ_ARMOUR: - return (!can_wear_armour(item, false, true)); + return !can_wear_armour(item, false, true); case OBJ_SCROLLS: if (!item_type_known(item)) @@ -2993,7 +2993,7 @@ bool is_useless_item(const item_def &item, bool temp) case SCR_RANDOM_USELESSNESS: return true; case SCR_TELEPORTATION: - return (crawl_state.game_is_sprint()); + return crawl_state.game_is_sprint(); case SCR_AMNESIA: return (you.religion == GOD_TROG); case SCR_RECHARGING: @@ -3057,7 +3057,7 @@ bool is_useless_item(const item_def &item, bool temp) case POT_WATER: case POT_BLOOD: case POT_BLOOD_COAGULATED: - return (!can_ingest(item, true, false)); + return !can_ingest(item, true, false); case POT_POISON: case POT_STRONG_POISON: // If you're poison resistant, poison is only useless. @@ -3136,7 +3136,7 @@ bool is_useless_item(const item_def &item, bool temp) return player_control_teleport(true, temp, false); case RING_TELEPORTATION: - return (crawl_state.game_is_sprint()); + return crawl_state.game_is_sprint(); case RING_INVISIBILITY: return (temp ? you.backlit(true) @@ -3209,9 +3209,9 @@ bool is_useless_item(const item_def &item, bool temp) case MISC_DISC_OF_STORMS: return (player_res_electricity(false, temp) > 0); case MISC_LAMP_OF_FIRE: - return (!you.skill(SK_FIRE_MAGIC)); + return !you.skill(SK_FIRE_MAGIC); case MISC_AIR_ELEMENTAL_FAN: - return (!you.skill(SK_AIR_MAGIC)); + return !you.skill(SK_AIR_MAGIC); case MISC_HORN_OF_GERYON: return item.plus2; default: @@ -3481,7 +3481,7 @@ item_kind item_kind_by_name(std::string name) item_names_map::iterator i = item_names_cache.find(name); if (i != item_names_cache.end()) - return (i->second); + return i->second; item_kind err = {OBJ_UNASSIGNED, 0, 0, 0}; @@ -3494,7 +3494,7 @@ std::vector<std::string> item_name_list_for_glyph(unsigned glyph) i = item_names_by_glyph_cache.find(glyph); if (i != item_names_by_glyph_cache.end()) - return (i->second); + return i->second; std::vector<std::string> empty; return empty; @@ -3504,7 +3504,7 @@ bool is_named_corpse(const item_def &corpse) { ASSERT(corpse.base_type == OBJ_CORPSES); - return (corpse.props.exists(CORPSE_NAME_KEY)); + return corpse.props.exists(CORPSE_NAME_KEY); } std::string get_corpse_name(const item_def &corpse, uint64_t *name_type) @@ -3512,7 +3512,7 @@ std::string get_corpse_name(const item_def &corpse, uint64_t *name_type) ASSERT(corpse.base_type == OBJ_CORPSES); if (!corpse.props.exists(CORPSE_NAME_KEY)) - return (""); + return ""; if (name_type != NULL) *name_type = corpse.props[CORPSE_NAME_TYPE_KEY].get_int64(); diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 32dbdc5ef1..a1f030aea8 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1148,7 +1148,7 @@ bool origin_is_acquirement(const item_def& item, item_source_type *type) std::string origin_desc(const item_def &item) { if (!origin_describable(item)) - return (""); + return ""; if (_origin_is_original_equip(item)) return "Original Equipment"; @@ -1467,7 +1467,7 @@ static int _userdef_find_free_slot(const item_def &i) #ifdef CLUA_BINDINGS int slot = -1; if (!clua.callfn("c_assign_invletter", "u>d", &i, &slot)) - return (-1); + return -1; return slot; #else @@ -1755,7 +1755,7 @@ int move_item_to_player(int obj, int quant_got, bool quiet, if (inv_count() >= ENDOFPACK) drop_spoiled_chunks(1, true); if (inv_count() >= ENDOFPACK) - return (-1); + return -1; if (!quiet && partial_pickup) mpr("You can only carry some of what is here."); @@ -1765,7 +1765,7 @@ int move_item_to_player(int obj, int quant_got, bool quiet, || you.inv[freeslot].defined()) { // Something is terribly wrong. - return (-1); + return -1; } if (mitm[obj].base_type == OBJ_ORBS diff --git a/crawl-ref/source/kills.cc b/crawl-ref/source/kills.cc index 3f283606f9..dd99cc4d57 100644 --- a/crawl-ref/source/kills.cc +++ b/crawl-ref/source/kills.cc @@ -123,7 +123,7 @@ int KillMaster::total_kills() const std::string KillMaster::kill_info() const { if (empty()) - return (""); + return ""; std::string killtext; diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index 5150701825..4dc11ff707 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -52,7 +52,7 @@ std::string dgn_set_default_depth(const std::string &s) { return error; } - return (""); + return ""; } static void dgn_add_depths(depth_ranges &drs, lua_State *ls, int s, int e) diff --git a/crawl-ref/source/l_dgnevt.cc b/crawl-ref/source/l_dgnevt.cc index f280a4362a..4677676ea9 100644 --- a/crawl-ref/source/l_dgnevt.cc +++ b/crawl-ref/source/l_dgnevt.cc @@ -89,13 +89,13 @@ static dgn_event_type dgn_event_type_by_name(const std::string &name) static const char *dgn_event_type_name(unsigned evmask) { if (evmask == 0) - return (dgn_event_type_names[0]); + return dgn_event_type_names[0]; for (unsigned i = 1; i < ARRAYSZ(dgn_event_type_names); ++i) if (evmask & (1 << (i - 1))) - return (dgn_event_type_names[i]); + return dgn_event_type_names[i]; - return (dgn_event_type_names[0]); + return dgn_event_type_names[0]; } static void dgn_push_event_type(lua_State *ls, int n) diff --git a/crawl-ref/source/l_dgnit.cc b/crawl-ref/source/l_dgnit.cc index 7e2bdbc2ac..7318815b8d 100644 --- a/crawl-ref/source/l_dgnit.cc +++ b/crawl-ref/source/l_dgnit.cc @@ -36,7 +36,7 @@ static item_list _lua_get_ilist(lua_State *ls, int ndx) item_list **ilist = clua_get_userdata<item_list*>(ls, ITEMLIST_METATABLE, ndx); if (ilist) - return (**ilist); + return **ilist; luaL_argerror(ls, ndx, "Expected item list object or string"); return item_list(); diff --git a/crawl-ref/source/l_dgnlvl.cc b/crawl-ref/source/l_dgnlvl.cc index 7d1fb4fd7f..79041af5fe 100644 --- a/crawl-ref/source/l_dgnlvl.cc +++ b/crawl-ref/source/l_dgnlvl.cc @@ -57,7 +57,7 @@ level_id dlua_level_id(lua_State *ls, int ndx) else if (lua_isuserdata(ls, ndx)) { const level_id *lid = static_cast<level_id*>(lua_touserdata(ls, ndx)); - return (*lid); + return *lid; } luaL_argerror(ls, ndx, "Expected level_id"); diff --git a/crawl-ref/source/l_dgnmon.cc b/crawl-ref/source/l_dgnmon.cc index 3267fa0b71..1177463f17 100644 --- a/crawl-ref/source/l_dgnmon.cc +++ b/crawl-ref/source/l_dgnmon.cc @@ -35,7 +35,7 @@ static mons_list _lua_get_mlist(lua_State *ls, int ndx) mons_list **mlist = clua_get_userdata<mons_list*>(ls, MONSLIST_METATABLE, ndx); if (mlist) - return (**mlist); + return **mlist; luaL_argerror(ls, ndx, "Expected monster list object or string"); return mons_list(); diff --git a/crawl-ref/source/l_global.cc b/crawl-ref/source/l_global.cc index ff50a9d49b..2e1f440c80 100644 --- a/crawl-ref/source/l_global.cc +++ b/crawl-ref/source/l_global.cc @@ -21,7 +21,7 @@ static text_pattern &get_text_pattern(const std::string &s, bool checkcase) pattern_cache.clear(); pattern_cache[s] = text_pattern(s, !checkcase); - return (pattern_cache[s]); + return pattern_cache[s]; } static int lua_pmatch(lua_State *ls) diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc index e2a3951fed..eca394ea4c 100644 --- a/crawl-ref/source/l_item.cc +++ b/crawl-ref/source/l_item.cc @@ -402,7 +402,7 @@ static std::string _item_name(lua_State *ls, item_def* item) else if (lua_isnumber(ls, 1)) ndesc = static_cast<description_level_type>(luaL_checkint(ls, 1)); const bool terse = lua_toboolean(ls, 2); - return (item->name(ndesc, terse)); + return item->name(ndesc, terse); } static int l_item_do_name(lua_State *ls) diff --git a/crawl-ref/source/l_option.cc b/crawl-ref/source/l_option.cc index 9af66a9914..4eee1122b2 100644 --- a/crawl-ref/source/l_option.cc +++ b/crawl-ref/source/l_option.cc @@ -97,7 +97,7 @@ static int option_get(lua_State *ls) #ifdef DEBUG_GLOBALS return (oh->handler(ls, opt, (char*)real_Options+(intptr_t)oh->data, true)); #else - return (oh->handler(ls, opt, oh->data, true)); + return oh->handler(ls, opt, oh->data, true); #endif return 0; diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc index d00db41aeb..c983bf985f 100644 --- a/crawl-ref/source/libgui.cc +++ b/crawl-ref/source/libgui.cc @@ -149,7 +149,7 @@ int num_to_lines(int num) int getch_ck() { - return (tiles.getch_ck()); + return tiles.getch_ck(); } int getchk() @@ -175,7 +175,7 @@ coord_def cgetpos(GotoRegion region) GotoRegion get_cursor_region() { - return (tiles.get_cursor_region()); + return tiles.get_cursor_region(); } void delay(unsigned int ms) diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index b7a1e06e46..87560d1e53 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -333,7 +333,7 @@ std::string strip_tag_prefix(std::string &s, const std::string &tagprefix) pos = s.find(tagprefix, pos + 1); if (pos == std::string::npos) - return (""); + return ""; std::string::size_type ns = s.find(" ", pos); if (ns == std::string::npos) diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 6d12315942..fc1f23d7b7 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -880,12 +880,12 @@ void update_screen() int get_number_of_lines() { - return (screensize.Y); + return screensize.Y; } int get_number_of_cols() { - return (screensize.X); + return screensize.X; } int num_to_lines(int num) diff --git a/crawl-ref/source/los_def.cc b/crawl-ref/source/los_def.cc index 4567c3b63e..15fdcdaa5d 100644 --- a/crawl-ref/source/los_def.cc +++ b/crawl-ref/source/los_def.cc @@ -31,7 +31,7 @@ los_def& los_def::operator=(const los_def& los) init(los.center, *los.opc, los.bds); show = los.show; arena = los.arena; - return (*this); + return *this; } void los_def::init(const coord_def &c, const opacity_func &o, @@ -89,7 +89,7 @@ circle_def los_def::get_bounds() const bool los_def::in_bounds(const coord_def& p) const { - return (bds.contains(p - center)); + return bds.contains(p - center); } bool los_def::see_cell(const coord_def& p) const @@ -112,7 +112,7 @@ circle_def los_glob::get_bounds() const bool los_glob::in_bounds(const coord_def& p) const { - return (bds.contains(p - center)); + return bds.contains(p - center); } bool los_glob::see_cell(const coord_def& p) const @@ -125,5 +125,5 @@ los_glob& los_glob::operator=(const los_glob& los) lt = los.lt; center = los.center; bds = los.bds; - return (*this); + return *this; } diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 5c16827d7e..544ff71ade 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -114,7 +114,7 @@ static inline int userfunc_index(int key) static int userfunc_index(const keyseq &seq) { if (seq.empty()) - return (-1); + return -1; return userfunc_index(seq.front()); } @@ -175,7 +175,7 @@ static void userfunc_collectgarbage(void) static int userfunc_getindex(const std::string &fname) { if (fname.length() == 0) - return (-1); + return -1; userfunc_collectgarbage(); @@ -384,7 +384,7 @@ static std::string vtostr(const keyseq &seq) s << static_cast<char>(*i); } - return (s.str()); + return s.str(); } /* @@ -628,7 +628,7 @@ int macro_buf_get() if (macro_keys_left == 0) macro_keys_left = -1; - return (-1); + return -1; } int key = Buffer.front(); @@ -1151,7 +1151,7 @@ void remove_key_recorder(key_recorder* recorder) int get_macro_buf_size() { - return (Buffer.size()); + return Buffer.size(); } /////////////////////////////////////////////////////////////// @@ -1219,7 +1219,7 @@ std::string command_to_name(command_type cmd) if (it == _cmds_to_names.end()) return "CMD_NO_CMD"; - return (it->second); + return it->second; } command_type key_to_command(int key, KeymapContext context) @@ -1279,7 +1279,7 @@ int command_to_key(command_type cmd) if (it == cmd_map.end()) return ('\0'); - return (it->second); + return it->second; } static KeymapContext _context_for_command(command_type cmd) diff --git a/crawl-ref/source/map_knowledge.h b/crawl-ref/source/map_knowledge.h index 378c613433..a101f2315f 100644 --- a/crawl-ref/source/map_knowledge.h +++ b/crawl-ref/source/map_knowledge.h @@ -85,7 +85,7 @@ struct map_cell map_cell& operator=(const map_cell& c) { if (&c == this) - return (*this); + return *this; if (_cloud) delete _cloud; if (_mons) @@ -99,7 +99,7 @@ struct map_cell _mons = new monster_info(*_mons); if (_item) _item = new item_info(*_item); - return (*this); + return *this; } void clear() diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index ee3d336c60..cb47569e30 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -141,7 +141,7 @@ std::string mapdef_split_key_item(const std::string &s, *arg = substitute; *separator = s[sep]; - return (""); + return ""; } int store_tilename_get_index(const std::string tilename) @@ -456,7 +456,7 @@ map_lines &map_lines::operator = (const map_lines &map) { if (this != &map) init_from(map); - return (*this); + return *this; } map_lines::~map_lines() @@ -507,7 +507,7 @@ std::string map_lines::add_feature_marker(const std::string &s) map_marker_spec spec(key, arg); spec.apply_transform(*this); - return (""); + return ""; } std::string map_lines::add_lua_marker(const std::string &key, @@ -515,7 +515,7 @@ std::string map_lines::add_lua_marker(const std::string &key, { map_marker_spec spec(key, function); spec.apply_transform(*this); - return (""); + return ""; } void map_lines::apply_markers(const coord_def &c) @@ -659,7 +659,7 @@ std::string map_lines::check_block_shuffle(const std::string &s) return "block shuffle segment length mismatch"; } - return (""); + return ""; } std::string map_lines::check_shuffle(std::string &s) @@ -672,7 +672,7 @@ std::string map_lines::check_shuffle(std::string &s) if (s.find('/') != std::string::npos) return check_block_shuffle(s); - return (""); + return ""; } std::string map_lines::parse_glyph_replacements(std::string s, @@ -700,7 +700,7 @@ std::string map_lines::parse_glyph_replacements(std::string s, } } - return (""); + return ""; } template<class T> @@ -733,7 +733,7 @@ static std::string _parse_weighted_str(const std::string &spec, T &list) val.c_str(), spec.c_str()); } } - return (""); + return ""; } bool map_colour_list::parse(const std::string &col, int weight) @@ -751,7 +751,7 @@ std::string map_lines::add_colour(const std::string &sub) std::string s = trimmed_string(sub); if (s.empty()) - return (""); + return ""; int sep = 0; std::string key; @@ -769,7 +769,7 @@ std::string map_lines::add_colour(const std::string &sub) colour_spec spec(key, sep == ':', colours); overlay_colours(spec); - return (""); + return ""; } bool map_fprop_list::parse(const std::string &fp, int weight) @@ -803,7 +803,7 @@ std::string map_lines::add_fproperty(const std::string &sub) std::string s = trimmed_string(sub); if (s.empty()) - return (""); + return ""; int sep = 0; std::string key; @@ -821,14 +821,14 @@ std::string map_lines::add_fproperty(const std::string &sub) fprop_spec spec(key, sep == ':', fprops); overlay_fprops(spec); - return (""); + return ""; } std::string map_lines::add_fheight(const std::string &sub) { std::string s = trimmed_string(sub); if (s.empty()) - return (""); + return ""; int sep = 0; std::string key; @@ -846,13 +846,13 @@ std::string map_lines::add_fheight(const std::string &sub) fheight_spec spec(key, sep == ':', fheights); overlay_fheights(spec); - return (""); + return ""; } bool map_string_list::parse(const std::string &fp, int weight) { push_back(map_weighted_string(fp, weight)); - return (!fp.empty()); + return !fp.empty(); } std::string map_lines::add_subst(const std::string &sub) @@ -860,7 +860,7 @@ std::string map_lines::add_subst(const std::string &sub) std::string s = trimmed_string(sub); if (s.empty()) - return (""); + return ""; int sep = 0; std::string key; @@ -878,7 +878,7 @@ std::string map_lines::add_subst(const std::string &sub) subst_spec spec(key, sep == ':', repl); subst(spec); - return (""); + return ""; } std::string map_lines::parse_nsubst_spec(const std::string &s, @@ -903,7 +903,7 @@ std::string map_lines::parse_nsubst_spec(const std::string &s, return err; spec = subst_spec(count, sep == ':', repl); - return (""); + return ""; } std::string map_lines::add_nsubst(const std::string &s) @@ -940,7 +940,7 @@ std::string map_lines::add_nsubst(const std::string &s) nsubst_spec spec(key, substs); nsubst(spec); - return (""); + return ""; } std::string map_lines::add_shuffle(const std::string &raws) @@ -1870,7 +1870,7 @@ std::string map_lines::add_tile(const std::string &sub, bool is_floor, bool is_f std::string s = trimmed_string(sub); if (s.empty()) - return (""); + return ""; bool no_random = strip_tag(s, "no_random"); bool last_tile = strip_tag(s, "last_tile"); @@ -1891,7 +1891,7 @@ std::string map_lines::add_tile(const std::string &sub, bool is_floor, bool is_f tile_spec spec(key, sep == ':', no_random, last_tile, is_floor, is_feat, list); overlay_tiles(spec); - return (""); + return ""; } std::string map_lines::add_rocktile(const std::string &sub) @@ -2415,7 +2415,7 @@ std::string map_def::run_lua(bool run_main) if (err == E_CHUNK_LOAD_FAILURE) lua_pushnil(dlua); else if (err) - return (prelude.orig_error()); + return prelude.orig_error(); if (!dlua.callfn("dgn_run_map", 1, 0)) return rewrite_chunk_errors(dlua.error); @@ -2426,7 +2426,7 @@ std::string map_def::run_lua(bool run_main) if (err == E_CHUNK_LOAD_FAILURE) lua_pushnil(dlua); else if (err) - return (mapchunk.orig_error()); + return mapchunk.orig_error(); if (!dlua.callfn("dgn_run_map", 1, 0)) return rewrite_chunk_errors(dlua.error); @@ -2441,13 +2441,13 @@ std::string map_def::run_lua(bool run_main) if (err == E_CHUNK_LOAD_FAILURE) lua_pushnil(dlua); else if (err) - return (main.orig_error()); + return main.orig_error(); if (!dlua.callfn("dgn_run_map", 1, 0)) return rewrite_chunk_errors(dlua.error); run_hook("post_main"); } - return (dlua.error); + return dlua.error; } void map_def::copy_hooks_from(const map_def &other_map, @@ -2597,7 +2597,7 @@ std::string map_def::validate_temple_map() // Assume that specialized single-god temples are set up // properly. - return (""); + return ""; } else { @@ -2628,13 +2628,13 @@ std::string map_def::validate_temple_map() if (altars.size() > god_list.size()) return "Temple vault has too many altars"; - return (""); + return ""; } std::string map_def::validate_map_placeable() { if (has_depth() || !place.empty()) - return (""); + return ""; // Ok, the map wants to be placed by tag. In this case it should have // at least one tag that's not a map flag. @@ -2780,7 +2780,7 @@ void map_def::add_depth(const level_range &range) bool map_def::has_depth() const { - return (!depths.empty()); + return !depths.empty(); } bool map_def::is_minivault() const @@ -3030,7 +3030,7 @@ void map_def::normalise() std::string map_def::resolve() { dlua_set_map dl(this); - return (""); + return ""; } void map_def::fixup() @@ -3070,12 +3070,12 @@ std::vector<std::string> map_def::get_tags() const keyed_mapspec *map_def::mapspec_at(const coord_def &c) { - return (map.mapspec_at(c)); + return map.mapspec_at(c); } const keyed_mapspec *map_def::mapspec_at(const coord_def &c) const { - return (map.mapspec_at(c)); + return map.mapspec_at(c); } std::string map_def::subvault_from_tagstring(const std::string &sub) @@ -3083,7 +3083,7 @@ std::string map_def::subvault_from_tagstring(const std::string &sub) std::string s = trimmed_string(sub); if (s.empty()) - return (""); + return ""; int sep = 0; std::string key; @@ -3114,7 +3114,7 @@ std::string map_def::subvault_from_tagstring(const std::string &sub) if (!err.empty()) return err; - return (""); + return ""; } std::string map_def::apply_subvault(string_spec &spec) @@ -3124,7 +3124,7 @@ std::string map_def::apply_subvault(string_spec &spec) if (!map.find_bounds(spec.key.c_str(), tl, br)) { // No glyphs, so do nothing. - return (""); + return ""; } int vwidth = br.x - tl.x + 1; @@ -3170,7 +3170,7 @@ std::string map_def::apply_subvault(string_spec &spec) copy_hooks_from(vault, "post_place"); dgn_register_vault(vault); - return (""); + return ""; } // Failure, restore original unique tags and names. @@ -3223,7 +3223,7 @@ int map_def::subvault_width() const if (!svmask) return 0; - return (svmask->width()); + return svmask->width(); } int map_def::subvault_height() const @@ -3231,7 +3231,7 @@ int map_def::subvault_height() const if (!svmask) return 0; - return (svmask->height()); + return svmask->height(); } int map_def::subvault_mismatch_count(const coord_def &offset) const @@ -4070,7 +4070,7 @@ mons_spec mons_list::mons_by_name(std::string name) const name = replace_all(name, "random", "any"); if (name == "nothing") - return (-1); + return -1; // Special casery: if (name == "pandemonium lord") @@ -4190,7 +4190,7 @@ item_spec &item_spec::operator = (const item_spec &other) if (other._corpse_monster_spec) set_corpse_monster_spec(other.corpse_monster_spec()); } - return (*this); + return *this; } item_spec::~item_spec() @@ -4257,7 +4257,7 @@ item_spec item_list::random_item_weighted() item_spec* rn_item = random_choose_weighted(pairs); if (rn_item) - return (*rn_item); + return *rn_item; return none; } @@ -4471,7 +4471,7 @@ static int str_to_ego(item_spec &spec, std::string ego_str) for (int j = 0; list[j] != NULL; j++) if (ego_str == list[j]) // Ego incompatible with base type. - return (-1); + return -1; } // Non-existant ego @@ -5298,7 +5298,7 @@ std::string map_marker_spec::apply_transform(map_lines &map) // Markers with no key are not an error. if (positions.empty()) - return (""); + return ""; for (int i = 0, size = positions.size(); i < size; ++i) { @@ -5316,7 +5316,7 @@ std::string map_marker_spec::apply_transform(map_lines &map) return err; } } - return (""); + return ""; } map_marker *map_marker_spec::create_marker() @@ -5571,7 +5571,7 @@ std::string keyed_mapspec::set_mons(const std::string &s, bool fix) return error; } - return (""); + return ""; } std::string keyed_mapspec::set_item(const std::string &s, bool fix) @@ -5688,7 +5688,7 @@ feature_spec& feature_spec::operator = (const feature_spec& other) { if (this != &other) init_with(other); - return (*this); + return *this; } void feature_spec::init_with(const feature_spec& other) diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index 9ef7589edc..dea57321ff 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -73,7 +73,7 @@ void map_marker::read(reader &inf) std::string map_marker::property(const std::string &pname) const { - return (""); + return ""; } map_marker *map_marker::read_marker(reader &inf) @@ -524,9 +524,9 @@ std::string map_wiz_props_marker::property(const std::string &pname) const i = properties.find(pname); if (i != properties.end()) - return (i->second); + return i->second; else - return (""); + return ""; } std::string map_wiz_props_marker::set_property(const std::string &key, @@ -780,7 +780,7 @@ map_markers &map_markers::operator = (const map_markers &c) clear(); init_from(c); } - return (*this); + return *this; } map_markers::~map_markers() @@ -897,7 +897,7 @@ map_marker *map_markers::find(const coord_def &c, map_marker_type type) els = markers.equal_range(c); for (dgn_marker_map::const_iterator i = els.first; i != els.second; ++i) if (type == MAT_ANY || i->second->get_type() == type) - return (i->second); + return i->second; return NULL; } @@ -907,7 +907,7 @@ map_marker *map_markers::find(map_marker_type type) i != markers.end(); ++i) { if (type == MAT_ANY || i->second->get_type() == type) - return (i->second); + return i->second; } return NULL; } @@ -993,7 +993,7 @@ std::string map_markers::property_at(const coord_def &c, map_marker_type type, if (!prop.empty()) return prop; } - return (""); + return ""; } void map_markers::clear() diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index c6637723c7..4cff262f9d 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -129,7 +129,7 @@ static map_section_type _write_vault(map_def &mdef, place, check_place); if (place.orient != MAP_NONE) - return (place.orient); + return place.orient; } return MAP_NONE; } @@ -799,10 +799,10 @@ static std::string _vault_chance_tag(const map_def &map) for (int i = 0, size = tags.size(); i < size; ++i) { if (tags[i].find("chance_") == 0) - return (tags[i]); + return tags[i]; } } - return (""); + return ""; } typedef std::vector<unsigned> vault_indices; @@ -864,7 +864,7 @@ public: { ++current; find_valid(); - return (*this); + return *this; } vault_chance_roll_iterator operator ++ (int) @@ -1037,7 +1037,7 @@ const map_def *random_map_for_tag(const std::string &tag, int map_count() { - return (vdefs.size()); + return vdefs.size(); } int map_count_for_tag(const std::string &tag, diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc index d538d105e0..9111d02dd4 100644 --- a/crawl-ref/source/melee_attack.cc +++ b/crawl-ref/source/melee_attack.cc @@ -654,7 +654,7 @@ bool melee_attack::handle_phase_damaged() // the brand damage (so we return here). If the monster was killed // by the decapitation, we should stop the rest of the attack, too. if (decapitate_hydra(damage_done, attacker->damage_type(attack_number))) - return (defender->alive()); + return defender->alive(); special_damage = 0; special_damage_message.clear(); @@ -2026,7 +2026,7 @@ bool melee_attack::player_monattk_hit_effects() // Also returns true if the hydra's last head was cut off, in which // case nothing more should be done to the hydra. if (decapitate_hydra(damage_done)) - return (defender->alive()); + return defender->alive(); // Mutually exclusive with (overrides) brand damage! apply_staff_damage(); @@ -4001,7 +4001,7 @@ std::string melee_attack::mons_attack_verb() std::string melee_attack::mons_attack_desc() { if (!you.can_see(attacker)) - return (""); + return ""; std::string ret; int dist = (attacker->pos() - defender->pos()).abs(); @@ -4799,7 +4799,7 @@ bool melee_attack::_tran_forbid_aux_attack(unarmed_attack_type atk) || you.form == TRAN_BAT); case UNAT_CONSTRICT: - return (!form_keeps_mutations()); + return !form_keeps_mutations(); default: return false; diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 40a96d0b18..de1dbc1775 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -306,7 +306,7 @@ void Menu::do_menu() int Menu::get_cursor() const { if (last_selected == -1) - return (-1); + return -1; unsigned int next = (last_selected + 1) % item_count(); @@ -1566,10 +1566,10 @@ int menu_colour(const std::string &text, const std::string &prefix, || cm.tag == "inventory" && tag == "pickup") && cm.pattern.matches(tmp_text)) { - return (cm.colour); + return cm.colour; } } - return (-1); + return -1; } int MenuHighlighter::entry_colour(const MenuEntry *entry) const diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index be0bfd1580..1bd02a3782 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1743,7 +1743,7 @@ int str_to_shoptype(const std::string &s) if (s == shop_types[i]) return i; } - return (-1); + return -1; } // General threat = sum_of_logexpervalues_of_nearby_unfriendly_monsters. diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index d0f078025d..465c0e2c53 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -1781,7 +1781,7 @@ struct complicated_sight_check static bool _basic_sight_check(monster* mons, actor * test) { - return (mons->can_see(test)); + return mons->can_see(test); } template<typename T> diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 645cd6f8fe..802a7f51a5 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -78,7 +78,7 @@ static int _compass_idx(const coord_def& mov) for (int i = 0; i < 8; i++) if (mon_compass[i] == mov) return i; - return (-1); + return -1; } static bool immobile_monster[MAX_MONSTERS]; @@ -336,7 +336,7 @@ static bool _mon_on_interesting_grid(monster* mon) // else fall through case DNGN_ALTAR_ZIN: case DNGN_ALTAR_SHINING_ONE: - return (mon->is_holy()); + return mon->is_holy(); // Orcs will tend to patrol around altars to Beogh, and guard the // stairway from and to the Orcish Mines. diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index a469f020cb..acd31fd56a 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -154,13 +154,13 @@ static bool _flavour_benefits_monster(beam_type flavour, monster& monster) switch (flavour) { case BEAM_HASTE: - return (!monster.has_ench(ENCH_HASTE)); + return !monster.has_ench(ENCH_HASTE); case BEAM_MIGHT: - return (!monster.has_ench(ENCH_MIGHT)); + return !monster.has_ench(ENCH_MIGHT); case BEAM_INVISIBILITY: - return (!monster.has_ench(ENCH_INVIS)); + return !monster.has_ench(ENCH_INVIS); case BEAM_HEALING: return (monster.hit_points != monster.max_hit_points); @@ -2691,7 +2691,7 @@ static int _mons_mesmerise(monster* mons, bool actual) || mons->pacified() // pacified, || mons->friendly()) // or friendly! { - return (-1); + return -1; } // Messages can be simple: if the monster is invisible, it won't try to diff --git a/crawl-ref/source/mon-ench.cc b/crawl-ref/source/mon-ench.cc index b77d39034f..f0ef0de1c3 100644 --- a/crawl-ref/source/mon-ench.cc +++ b/crawl-ref/source/mon-ench.cc @@ -83,7 +83,7 @@ mon_enchant monster::get_ench(enchant_type ench1, enchantments.find(static_cast<enchant_type>(e)); if (i != enchantments.end()) - return (i->second); + return i->second; } return mon_enchant(); @@ -343,7 +343,7 @@ static bool _prepare_del_ench(monster* mon, const mon_enchant &me) } if (okay_squares > 0) - return (mon->move_to_pos(target_square)); + return mon->move_to_pos(target_square); // No available adjacent squares from which the monster could also // have unsubmerged. Can it just stay submerged where it is? @@ -364,7 +364,7 @@ static bool _prepare_del_ench(monster* mon, const mon_enchant &me) } if (okay_squares > 0) - return (mon->move_to_pos(target_square)); + return mon->move_to_pos(target_square); return true; } @@ -957,7 +957,7 @@ std::string monster::describe_enchantments() const oss << ", "; oss << std::string(i->second); } - return (oss.str()); + return oss.str(); } bool monster::decay_enchantment(const mon_enchant &me, bool decay_degree) @@ -1861,7 +1861,7 @@ mon_enchant &mon_enchant::operator += (const mon_enchant &other) duration = INFINITE_DURATION; merge_killer(other.who, other.source); } - return (*this); + return *this; } mon_enchant mon_enchant::operator + (const mon_enchant &other) const diff --git a/crawl-ref/source/mon-grow.cc b/crawl-ref/source/mon-grow.cc index 4ef253793e..9917441823 100644 --- a/crawl-ref/source/mon-grow.cc +++ b/crawl-ref/source/mon-grow.cc @@ -105,7 +105,7 @@ static const monster_level_up *_monster_level_up_target(monster_type type, if (static_cast<int>(me->hpdice[0]) == hit_dice && x_chance_in_y(mlup.chance, 1000)) { - return (&mlup); + return &mlup; } } } diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc index baef1022a1..5a2bb4cc4a 100644 --- a/crawl-ref/source/mon-info.cc +++ b/crawl-ref/source/mon-info.cc @@ -1020,7 +1020,7 @@ std::string monster_info::proper_name(description_level_type desc) const std::string monster_info::full_name(description_level_type desc, bool use_comma) const { if (desc == DESC_NONE) - return (""); + return ""; if (has_proper_name()) { @@ -1178,7 +1178,7 @@ static std::string _verbose_info0(const monster_info& mi) if (mi.is(MB_INVISIBLE)) return "invisible"; - return (""); + return ""; } static std::string _verbose_info(const monster_info& mi) diff --git a/crawl-ref/source/mon-iter.cc b/crawl-ref/source/mon-iter.cc index b44cf9ea49..9ad333d7f6 100644 --- a/crawl-ref/source/mon-iter.cc +++ b/crawl-ref/source/mon-iter.cc @@ -49,7 +49,7 @@ monster* monster_iterator::operator->() const monster_iterator& monster_iterator::operator++() { advance(); - return (*this); + return *this; } monster_iterator monster_iterator::operator++(int) @@ -71,7 +71,7 @@ bool monster_iterator::valid(int mid) const case R_LOS: return (los->see_cell(mon->pos())); case R_ACT: - return (act->can_see(mon)); + return act->can_see(mon); default: return true; } diff --git a/crawl-ref/source/mon-stealth.cc b/crawl-ref/source/mon-stealth.cc index 72d30d3265..bd770f53d9 100644 --- a/crawl-ref/source/mon-stealth.cc +++ b/crawl-ref/source/mon-stealth.cc @@ -13,7 +13,7 @@ static int _clamp_stealth(int stealth) if (stealth > 3) return 3; else if (stealth < -3) - return (-3); + return -3; else { return stealth; diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index a8732bcf6d..fb47bdc439 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -377,16 +377,16 @@ int place_monster_corpse(const monster* mons, bool silent, // case we place no corpse since the explosion means anything left // over would be scattered, tiny chunks of shifter. if (!in_bounds(mons->pos())) - return (-1); + return -1; // Don't attempt to place corpses within walls, either. // Currently, this only applies to (shapeshifter) rock worms. if (feat_is_wall(grd(mons->pos()))) - return (-1); + return -1; // If we were told not to leave a corpse, don't. if (mons->props.exists("never_corpse")) - return (-1); + return -1; item_def corpse; const monster_type corpse_class = fill_out_corpse(mons, mons->type, @@ -412,7 +412,7 @@ int place_monster_corpse(const monster* mons, bool silent, || (mons_corpse_effect(corpse_class) == CE_MUTAGEN && !one_chance_in(3))) { - return (-1); + return -1; } #if TAG_MAJOR_VERSION <= 33 @@ -435,7 +435,7 @@ int place_monster_corpse(const monster* mons, bool silent, if (o == NON_ITEM) { item_was_destroyed(corpse); - return (-1); + return -1; } mitm[o] = corpse; @@ -447,7 +447,7 @@ int place_monster_corpse(const monster* mons, bool silent, // We already have a spray of chunks. item_was_destroyed(mitm[o]); destroy_item(o); - return (-1); + return -1; } move_item_to_grid(&o, mons->pos(), !mons->swimming()); @@ -1474,7 +1474,7 @@ int monster_die(monster* mons, killer_type killer, int killer_index, bool silent, bool wizard, bool fake) { if (invalid_monster(mons)) - return (-1); + return -1; const bool was_visible = you.can_see(mons); @@ -1487,7 +1487,7 @@ int monster_die(monster* mons, killer_type killer, && _monster_avoided_death(mons, killer, killer_index)) { mons->flags &= ~MF_EXPLODE_KILL; - return (-1); + return -1; } // If the monster was calling the tide, let go now. @@ -3095,7 +3095,7 @@ bool monster_blink(monster* mons, bool quiet) coord_def near = _random_monster_nearby_habitable_space(*mons, false, true); - return (mons->blink_to(near, quiet)); + return mons->blink_to(near, quiet); } bool mon_can_be_slimified(monster* mons) @@ -3490,7 +3490,7 @@ bool can_go_straight(const monster* mon, const coord_def& p1, // The default suitable() function for choose_random_nearby_monster(). bool choose_any_monster(const monster* mon) { - return (!mons_is_projectile(mon->type)); + return !mons_is_projectile(mon->type); } // Find a nearby monster and return its index, including you as a @@ -3774,7 +3774,7 @@ bool mons_avoids_cloud(const monster* mons, int cloud_num, bool placement) const cloud_struct &our_cloud = env.cloud[our_cloud_num]; - return (!_mons_avoids_cloud(mons, our_cloud, true)); + return !_mons_avoids_cloud(mons, our_cloud, true); } // Returns a rough estimate of damage from throwing the wielded weapon. @@ -3848,11 +3848,11 @@ int mons_pick_best_missile(monster* mons, item_def **launcher, if (!tdam && !fdam) return NON_ITEM; else if (tdam >= fdam) - return (melee->index()); + return melee->index(); else { *launcher = launch; - return (missiles->index()); + return missiles->index(); } } diff --git a/crawl-ref/source/mon-transit.cc b/crawl-ref/source/mon-transit.cc index 2fc0ad977f..4f46b5f35b 100644 --- a/crawl-ref/source/mon-transit.cc +++ b/crawl-ref/source/mon-transit.cc @@ -148,7 +148,7 @@ void place_followers() static bool place_lost_monster(follower &f) { dprf("Placing lost one: %s", f.mons.name(DESC_PLAIN, true).c_str()); - return (f.place(false)); + return f.place(false); } static void level_place_lost_monsters(m_transit_list &m) diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 49a2d535d2..53d50eea9f 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -410,7 +410,7 @@ int scan_mon_inv_randarts(const monster* mon, mon_holy_type mons_class_holiness(monster_type mc) { ASSERT(smc); - return (smc->holiness); + return smc->holiness; } bool mons_class_is_confusable(monster_type mc) @@ -953,13 +953,13 @@ bool mons_foe_is_mons(const monster* mons) int mons_weight(monster_type mc) { ASSERT(smc); - return (smc->weight); + return smc->weight; } corpse_effect_type mons_corpse_effect(monster_type mc) { ASSERT(smc); - return (smc->corpse_thingy); + return smc->corpse_thingy; } monster_type mons_species(monster_type mc) @@ -981,7 +981,7 @@ monster_type mons_genus(monster_type mc) return MONS_NO_MONSTER; ASSERT(smc); - return (smc->genus); + return smc->genus; } monster_type mons_detected_base(monster_type mc) @@ -1119,7 +1119,7 @@ char mons_base_char(monster_type mc) mon_itemuse_type mons_class_itemuse(monster_type mc) { ASSERT(smc); - return (smc->gmon_use); + return smc->gmon_use; } mon_itemuse_type mons_itemuse(const monster* mon) @@ -1133,7 +1133,7 @@ mon_itemuse_type mons_itemuse(const monster* mon) static mon_itemeat_type _mons_class_itemeat(monster_type mc) { ASSERT(smc); - return (smc->gmon_eat); + return smc->gmon_eat; } mon_itemeat_type mons_itemeat(const monster* mon) @@ -1155,7 +1155,7 @@ int mons_class_colour(monster_type mc) bool mons_class_can_regenerate(monster_type mc) { - return (!mons_class_flag(mc, M_NO_REGEN)); + return !mons_class_flag(mc, M_NO_REGEN); } bool mons_can_regenerate(const monster* mon) @@ -1170,7 +1170,7 @@ bool mons_can_regenerate(const monster* mon) bool mons_class_can_display_wounds(monster_type mc) { - return (!monster_descriptor(mc, MDSC_NOMSG_WOUNDS)); + return !monster_descriptor(mc, MDSC_NOMSG_WOUNDS); } bool mons_can_display_wounds(const monster* mon) @@ -1203,12 +1203,12 @@ zombie_size_type zombie_class_size(monster_type cs) int mons_zombie_size(monster_type mc) { ASSERT(smc); - return (smc->zombie_size); + return smc->zombie_size; } monster_type mons_zombie_base(const monster* mon) { - return (mon->base_monster); + return mon->base_monster; } bool mons_class_is_zombified(monster_type mc) @@ -1267,7 +1267,7 @@ bool mons_can_use_stairs(const monster* mon) bool mons_enslaved_body_and_soul(const monster* mon) { - return (mon->has_ench(ENCH_SOUL_RIPE)); + return mon->has_ench(ENCH_SOUL_RIPE); } bool mons_enslaved_soul(const monster* mon) @@ -1390,7 +1390,7 @@ mon_attack_def mons_attack_spec(const monster* mon, int attk_number) mon->ghost->att_flav)); } - return (mon_attack_def::attk(0, AT_NONE)); + return mon_attack_def::attk(0, AT_NONE); } if (zombified && mc != MONS_KRAKEN_TENTACLE) @@ -1469,7 +1469,7 @@ const char* mons_resist_string(const monster* mon, int res_margin) bool mons_skeleton(monster_type mc) { - return (!mons_class_flag(mc, M_NO_SKELETON)); + return !mons_class_flag(mc, M_NO_SKELETON); } flight_type mons_class_flies(monster_type mc) @@ -2238,7 +2238,7 @@ int ugly_thing_colour_offset(colour_t colour) return i; } - return (-1); + return -1; } static const char *drac_colour_names[] = { @@ -2332,7 +2332,7 @@ static std::string _get_proper_monster_name(const monster* mon) { const monsterentry *me = mon->find_monsterentry(); if (!me) - return (""); + return ""; std::string name = getRandNameString(me->name, " name"); if (!name.empty()) @@ -2371,7 +2371,7 @@ bool give_monster_proper_name(monster* mon, bool orcs_only) if (mon->friendly()) take_note(Note(NOTE_NAMED_ALLY, 0, 0, mon->mname.c_str())); - return (mon->is_named()); + return mon->is_named(); } // See mons_init for initialization of mon_entry array. @@ -2386,13 +2386,13 @@ monsterentry *get_monster_data(monster_type mc) static int _mons_exp_mod(monster_type mc) { ASSERT(smc); - return (smc->exp_mod); + return smc->exp_mod; } int mons_class_base_speed(monster_type mc) { ASSERT(smc); - return (smc->speed); + return smc->speed; } int mons_class_zombie_base_speed(monster_type zombie_base_mc) @@ -2415,7 +2415,7 @@ int mons_base_speed(const monster* mon) mon_intel_type mons_class_intel(monster_type mc) { ASSERT(smc); - return (smc->intel); + return smc->intel; } mon_intel_type mons_intel(const monster* mon) @@ -3112,7 +3112,7 @@ const char *mons_pronoun(monster_type mon_type, pronoun_type variant, (gender == GENDER_MALE) ? "him" : "her"); } - return (""); + return ""; } // Checks if the monster can use smiting/torment to attack without @@ -3260,7 +3260,7 @@ bool mons_class_can_pass(monster_type mc, const dungeon_feature_type grid) || feat_is_rock(grid) && !feat_is_permarock(grid)); } - return (!feat_is_solid(grid)); + return !feat_is_solid(grid); } static bool _mons_can_open_doors(const monster* mon) diff --git a/crawl-ref/source/mon_resist_def.cc b/crawl-ref/source/mon_resist_def.cc index a1202b3a60..f667e82d14 100644 --- a/crawl-ref/source/mon_resist_def.cc +++ b/crawl-ref/source/mon_resist_def.cc @@ -71,7 +71,7 @@ const mon_resist_def &mon_resist_def::operator |= (const mon_resist_def &o) acid += o.acid; sticky_flame = sticky_flame || o.sticky_flame; rotting = rotting || o.rotting; - return (*this); + return *this; } mon_resist_def mon_resist_def::operator | (const mon_resist_def &o) const diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 89d8a9cf5c..418ba30347 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -95,7 +95,7 @@ monster &monster::operator = (const monster& mon) { if (this != &mon) init_with(mon); - return (*this); + return *this; } void monster::reset() @@ -234,7 +234,7 @@ bool monster::wants_submerge() const if (!mons_is_retreating(this) && mons_can_move_towards_target(this)) return false; - return (!mons_landlubbers_in_reach(this)); + return !mons_landlubbers_in_reach(this); } bool monster::submerged() const @@ -441,7 +441,7 @@ brand_type monster::damage_brand(int which_attack) if (!mweap) { if (mons_is_ghost_demon(type)) - return (ghost->brand); + return ghost->brand; return SPWPN_NORMAL; } @@ -490,7 +490,7 @@ item_def *monster::missiles() int monster::missile_count() { if (const item_def *missile = missiles()) - return (missile->quantity); + return missile->quantity; return 0; } @@ -2575,7 +2575,7 @@ std::string monster::pronoun(pronoun_type pro, bool force_visible) const std::string monster::conj_verb(const std::string &verb) const { if (!verb.empty() && verb[0] == '!') - return (verb.substr(1)); + return verb.substr(1); if (verb == "are") return "is"; @@ -3132,7 +3132,7 @@ int monster::constriction_damage() const { const mon_attack_def attack = mons_attack_spec(this, i); if (attack.type == AT_CONSTRICT) - return (attack.damage); + return attack.damage; } return -1; } @@ -3277,7 +3277,7 @@ int monster::shield_bonus() const * (shld->sub_type - ARM_LARGE_SHIELD); return (random2avg(shld_c + hit_dice * 4 / 3, 2) / 2); } - return (-100); + return -100; } int monster::shield_block_penalty() const @@ -3794,10 +3794,10 @@ int monster::res_holy_energy(const actor *attacker) const return 1; if (undead_or_demonic()) - return (-2); + return -2; if (is_evil()) - return (-1); + return -1; if (is_holy() || is_good_god(god) @@ -4404,12 +4404,12 @@ void monster::destroy_inventory() bool monster::is_travelling() const { - return (!travel_path.empty()); + return !travel_path.empty(); } bool monster::is_patrolling() const { - return (!patrol_point.origin()); + return !patrol_point.origin(); } bool monster::needs_abyss_transit() const @@ -4699,7 +4699,7 @@ bool monster::needs_berserk(bool check_spells) const bool monster::can_see_invisible() const { if (mons_is_ghost_demon(type)) - return (ghost->see_invis); + return ghost->see_invis; else if (mons_class_flag(type, M_SEE_INVIS)) return true; else if (scan_mon_inv_randarts(this, ARTP_EYESIGHT) > 0) @@ -5231,7 +5231,7 @@ bool monster::should_drink_potion(potion_type ptype) const return (!has_ench(ENCH_MIGHT) && !has_ench(ENCH_HASTE) && needs_berserk()); case POT_SPEED: - return (!has_ench(ENCH_HASTE)); + return !has_ench(ENCH_HASTE); case POT_MIGHT: return (!has_ench(ENCH_MIGHT) && foe_distance() <= 2); case POT_INVISIBILITY: @@ -5324,7 +5324,7 @@ bool monster::can_evoke_jewellery(jewellery_type jtype) const switch (jtype) { case RING_TELEPORTATION: - return (!has_ench(ENCH_TP)); + return !has_ench(ENCH_TP); case RING_INVISIBILITY: // If there are any item using monsters that are permanently // invisible, this might have to be restricted. diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 7597bb4d65..eec92647b1 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -918,7 +918,7 @@ static bool _mut_matches_class(mutation_type mutclass, const mutation_def& mdef) case RANDOM_MUTATION: return true; case RANDOM_BAD_MUTATION: - return (mdef.bad); + return mdef.bad; case RANDOM_GOOD_MUTATION: return (!mdef.bad); default: @@ -1666,7 +1666,7 @@ bool delete_all_mutations(const std::string &reason) ; } - return (!how_mutated()); + return !how_mutated(); } // Return a string describing the mutation. diff --git a/crawl-ref/source/ng-wanderer.cc b/crawl-ref/source/ng-wanderer.cc index 2f9993ddd9..08888acb97 100644 --- a/crawl-ref/source/ng-wanderer.cc +++ b/crawl-ref/source/ng-wanderer.cc @@ -133,7 +133,7 @@ static skill_type _apt_weighted_choice(const skill_type * skill_array, region_covered += reciprocal_apt; if (probe < region_covered) - return (skill_array[i]); + return skill_array[i]; } return NUM_SKILLS; diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc index fb80a399f2..78f1c8af02 100644 --- a/crawl-ref/source/notes.cc +++ b/crawl-ref/source/notes.cc @@ -147,7 +147,7 @@ static bool _is_noteworthy(const Note& note) // Xom effects are only noteworthy if the option is true. if (note.type == NOTE_XOM_EFFECT) - return (Options.note_xom_effects); + return Options.note_xom_effects; // God powers might be noteworthy if it's an actual power. if (note.type == NOTE_GOD_POWER diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 77be050f22..8bd75db9ee 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1136,13 +1136,13 @@ static void _print_next_monster_desc(const std::vector<monster_info>& mons, int update_monster_pane() { if (!map_bounds(you.pos()) && !crawl_state.game_is_arena()) - return (-1); + return -1; const int max_print = crawl_view.mlistsz.y; textbackground(BLACK); if (max_print <= 0) - return (-1); + return -1; std::vector<monster_info> mons; get_monster_info(mons); @@ -1198,7 +1198,7 @@ int update_monster_pane() } if (mons.empty()) - return (-1); + return -1; return full_info; } diff --git a/crawl-ref/source/place-info.cc b/crawl-ref/source/place-info.cc index 1e70a2f568..cd3c41d3c1 100644 --- a/crawl-ref/source/place-info.cc +++ b/crawl-ref/source/place-info.cc @@ -75,7 +75,7 @@ const PlaceInfo &PlaceInfo::operator += (const PlaceInfo &other) elapsed_resting += other.elapsed_resting; elapsed_other += other.elapsed_other; - return (*this); + return *this; } const PlaceInfo &PlaceInfo::operator -= (const PlaceInfo &other) @@ -102,7 +102,7 @@ const PlaceInfo &PlaceInfo::operator -= (const PlaceInfo &other) elapsed_resting -= other.elapsed_resting; elapsed_other -= other.elapsed_other; - return (*this); + return *this; } PlaceInfo PlaceInfo::operator + (const PlaceInfo &other) const diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc index ea7a95d218..6c5503b8dd 100644 --- a/crawl-ref/source/player-act.cc +++ b/crawl-ref/source/player-act.cc @@ -48,7 +48,7 @@ bool player::alive() const { // Simplistic, but if the player dies the game is over anyway, so // nobody can ask further questions. - return (!crawl_state.game_is_arena()); + return !crawl_state.game_is_arena(); } bool player::is_summoned(int* _duration, int* summon_type) const diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 0166fb38fd..19380c7f31 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -462,7 +462,7 @@ bool is_feat_dangerous(dungeon_feature_type grid, bool permanently, bool is_map_persistent(void) { - return (!testbits(env.level_flags, LFLAG_NO_MAP)); + return !testbits(env.level_flags, LFLAG_NO_MAP); } bool player_in_hell(void) @@ -2824,7 +2824,7 @@ int burden_change(void) : "You feel heavier in the air."); } - return (you.burden); + return you.burden; } void forget_map(bool rot) @@ -4951,7 +4951,7 @@ std::string describe_contamination(int cont) else if (cont == 1) return "You are very lightly contaminated with residual magic."; else - return (""); + return ""; } // controlled is true if the player actively did something to cause @@ -5881,7 +5881,7 @@ player_save_info& player_save_info::operator=(const player& rhs) // [ds] Perhaps we should move game type to player? saved_game_type = crawl_state.type; - return (*this); + return *this; } bool player_save_info::operator<(const player_save_info& rhs) const @@ -6097,7 +6097,7 @@ int player::shield_bonus() const { const int shield_class = player_shield_class(); if (shield_class <= 0) - return (-100); + return -100; return random2avg(shield_class * 2, 2) / 3 - 1; } @@ -6592,10 +6592,10 @@ int player::res_sticky_flame() const int player::res_holy_energy(const actor *attacker) const { if (undead_or_demonic()) - return (-2); + return -2; if (is_evil()) - return (-1); + return -1; if (is_holy()) return 1; @@ -6883,7 +6883,7 @@ bool player::rot(actor *who, int amount, int immediate, bool quiet) bool player::drain_exp(actor *who, bool quiet, int pow) { - return (::drain_exp()); + return ::drain_exp(); } void player::confuse(actor *who, int str) diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc index 48fc4cfaa0..e108e7d669 100644 --- a/crawl-ref/source/quiver.cc +++ b/crawl-ref/source/quiver.cc @@ -592,7 +592,7 @@ static int _get_pack_slot(const item_def& item) return -1; if (in_inventory(item) && _items_similar(item, you.inv[item.link], false)) - return (item.link); + return item.link; // First try to find the exact same item. for (int i = 0; i < ENDOFPACK; i++) diff --git a/crawl-ref/source/random-var.cc b/crawl-ref/source/random-var.cc index ee207202f4..3cb9814ab0 100644 --- a/crawl-ref/source/random-var.cc +++ b/crawl-ref/source/random-var.cc @@ -31,7 +31,7 @@ const random_var& random_var::operator=(const random_var& other) end = other.end; total = other.total; weights = other.weights; - return (*this); + return *this; } int random_var::weight(int val) const diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc index c3fa9e69c9..ea9423f68f 100644 --- a/crawl-ref/source/ray.cc +++ b/crawl-ref/source/ray.cc @@ -429,7 +429,7 @@ static geom::form _corner_wall(const coord_def &side, const reflect_grid &rg) // diagonal wall through side and -e wall = side + e; } - return (geom::form(wall.y, -wall.x)); + return geom::form(wall.y, -wall.x); } // Bounce a ray that leaves cell (0,0) through a corner. We could @@ -526,7 +526,7 @@ void ray_def::bounce(const reflect_grid &rg) double ray_def::get_degrees() const { - return (geom::degrees(r.dir)); + return geom::degrees(r.dir); } void ray_def::set_degrees(double d) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 031677b1d1..579095ec21 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -511,7 +511,7 @@ std::string get_god_powers(god_type which_god) { // Return early for the special cases. if (which_god == GOD_NO_GOD) - return (""); + return ""; std::string result = getLongDescription(god_name(which_god) + " powers"); return result; @@ -520,7 +520,7 @@ std::string get_god_powers(god_type which_god) std::string get_god_likes(god_type which_god, bool verbose) { if (which_god == GOD_NO_GOD || which_god == GOD_XOM) - return (""); + return ""; std::string text = uppercase_first(god_name(which_god)); std::vector<std::string> likes; @@ -812,7 +812,7 @@ std::string get_god_dislikes(god_type which_god, bool /*verbose*/) { // Return early for the special cases. if (which_god == GOD_NO_GOD || which_god == GOD_XOM) - return (""); + return ""; std::string text; std::vector<std::string> dislikes; // Piety loss @@ -935,7 +935,7 @@ std::string get_god_dislikes(god_type which_god, bool /*verbose*/) } if (dislikes.empty() && really_dislikes.empty()) - return (""); + return ""; if (!dislikes.empty()) { @@ -1179,7 +1179,7 @@ int yred_random_servants(unsigned int threshold, bool force_hostile) const unsigned int servant = random2(threshold); if ((servant + 2) * 2 < threshold && !force_hostile) - return (-1); + return -1; monster_type mon_type = _yred_servants[servant]; int how_many = (mon_type == MONS_FLYING_SKULL) ? 2 + random2(4) @@ -1223,7 +1223,7 @@ static const item_def* _find_missile_launcher(int skill) if (is_range_weapon(item) && range_skill(item) == skill_type(skill)) { - return (&item); + return &item; } } return NULL; @@ -2348,7 +2348,7 @@ std::string god_name(god_type which_god, bool long_name) case GOD_ASHENZARI: return "Ashenzari"; case NUM_GODS: return "Buggy"; } - return (""); + return ""; } std::string god_name_jiyva(bool second_name) @@ -2560,7 +2560,7 @@ void dock_piety(int piety_loss, int penance) int piety_scale(int piety) { if (piety < 0) - return (-piety_scale(-piety)); + return -piety_scale(-piety); if (player_effect_faith()) return (piety + div_rand_round(piety, 3)); @@ -2885,7 +2885,7 @@ static std::string _god_hates_your_god_reaction(god_type god, god_type your_god) { // Non-good gods always hate your current god. if (!is_good_god(god)) - return (""); + return ""; // Zin hates chaotic gods. if (god == GOD_ZIN && is_chaotic_god(your_god)) @@ -2895,7 +2895,7 @@ static std::string _god_hates_your_god_reaction(god_type god, god_type your_god) return " for evil"; } - return (""); + return ""; } void excommunication(god_type new_god) @@ -4094,7 +4094,7 @@ int piety_breakpoint(int i) if (i >= MAX_GOD_ABILITIES || i < 0) return 255; else - return (breakpoints[i]); + return breakpoints[i]; } // Returns true if the Shining One doesn't mind your using unchivalric diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index ce069459e6..05b35ad44e 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -912,7 +912,7 @@ unsigned int item_value(item_def item, bool ident) { const unrandart_entry *entry = get_unrand_entry(item.special); if (entry->value != 0) - return (entry->value); + return entry->value; } int valued = 0; @@ -2162,7 +2162,7 @@ static std::string _shop_type_suffix(shop_type type, const coord_def &where) || type == SHOP_GENERAL_ANTIQUE || type == SHOP_DISTILLERY) { - return (""); + return ""; } const char* suffixnames[] = {"Shoppe", "Boutique", "Emporium", "Shop"}; @@ -2548,14 +2548,14 @@ unsigned int ShoppingList::cull_identical_items(const item_def& item, if (add_item && !on_list) add_thing(item, cost); - return (to_del.size()); + return to_del.size(); } int ShoppingList::size() const { ASSERT(list); - return (list->size()); + return list->size(); } bool ShoppingList::items_are_same(const item_def& item_a, @@ -2904,7 +2904,7 @@ int ShoppingList::find_thing(const item_def &item, return i; } - return (-1); + return -1; } int ShoppingList::find_thing(const std::string &desc, @@ -2925,7 +2925,7 @@ int ShoppingList::find_thing(const std::string &desc, return i; } - return (-1); + return -1; } bool ShoppingList::thing_is_item(const CrawlHashTable& thing) diff --git a/crawl-ref/source/shout.cc b/crawl-ref/source/shout.cc index 3cd2d59c0e..f64e9913f2 100644 --- a/crawl-ref/source/shout.cc +++ b/crawl-ref/source/shout.cc @@ -980,7 +980,7 @@ coord_def noise_grid::noise_perceived_position(actor *act, { const int noise_travel_distance = cells(affected_pos).noise_travel_distance; if (!noise_travel_distance) - return (noise.noise_source); + return noise.noise_source; const int cell_grid_distance = grid_distance(affected_pos, noise.noise_source); @@ -988,7 +988,7 @@ coord_def noise_grid::noise_perceived_position(actor *act, if (cell_grid_distance <= LOS_RADIUS) { if (act->see_cell(noise.noise_source)) - return (noise.noise_source); + return noise.noise_source; } const int extra_distance_covered = diff --git a/crawl-ref/source/showsymb.cc b/crawl-ref/source/showsymb.cc index 80b3c78cce..34cf8315c0 100644 --- a/crawl-ref/source/showsymb.cc +++ b/crawl-ref/source/showsymb.cc @@ -402,7 +402,7 @@ ucs_t get_feat_symbol(dungeon_feature_type feat) ucs_t get_item_symbol(show_item_type it) { - return (get_feature_def(show_type(it)).symbol); + return get_feature_def(show_type(it)).symbol; } glyph get_item_glyph(const item_def *item) diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 9a9fdf38b2..b96f9bfa8b 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -349,7 +349,7 @@ int spell_rarity(spell_type which_spell) const int rarity = _lowest_rarity[which_spell]; if (rarity == 255) - return (-1); + return -1; return rarity; } @@ -1333,7 +1333,7 @@ bool forget_spell_from_book(spell_type spell, const item_def* book) int count_rod_spells(const item_def &item, bool need_id) { if (item.base_type != OBJ_RODS) - return (-1); + return -1; if (need_id && !item_type_known(item)) return 0; @@ -1356,7 +1356,7 @@ int rod_spell(int rod) if (irod.base_type != OBJ_RODS) { canned_msg(MSG_NOTHING_HAPPENS); - return (-1); + return -1; } // ID code got moved to item_use::wield_effects. {due} @@ -1418,7 +1418,7 @@ int rod_spell(int rod) { canned_msg(MSG_NO_ENERGY); crawl_state.zero_turns_taken(); - return (-1); + return -1; } if (irod.plus < mana) @@ -1427,7 +1427,7 @@ int rod_spell(int rod) crawl_state.zero_turns_taken(); // Don't lose a turn for trying to evoke without enough MP - that's // needlessly cruel for an honest error. - return (-1); + return -1; } // All checks passed, we can cast the spell. @@ -1437,7 +1437,7 @@ int rod_spell(int rod) == SPRET_ABORT) { crawl_state.zero_turns_taken(); - return (-1); + return -1; } make_hungry(food, true, true); diff --git a/crawl-ref/source/spl-goditem.cc b/crawl-ref/source/spl-goditem.cc index ddefebfcde..1ef9275fad 100644 --- a/crawl-ref/source/spl-goditem.cc +++ b/crawl-ref/source/spl-goditem.cc @@ -133,14 +133,14 @@ static bool _mons_hostile(const monster* mon) int is_pacifiable(const monster* mon) { if (you.religion != GOD_ELYVILON) - return (-1); + return -1; // I was thinking of jellies when I wrote this, but maybe we shouldn't // exclude zombies and such... (jpeg) if (mons_intel(mon) <= I_PLANT // no self-awareness || mons_is_tentacle(mon->type)) // body part { - return (-1); + return -1; } const mon_holy_type holiness = mon->holiness(); @@ -150,14 +150,14 @@ int is_pacifiable(const monster* mon) && holiness != MH_DEMONIC && holiness != MH_NATURAL) { - return (-1); + return -1; } if (mons_is_stationary(mon)) // not able to leave the level - return (-1); + return -1; if (mon->asleep()) // not aware of what is happening - return (-2); + return -2; return 0; } @@ -197,7 +197,7 @@ static int _can_pacify_monster(const monster* mon, const int healed, if (mon->max_hit_points > factor * ((you.skill(SK_INVOCATIONS, max_healed) + max_healed) / divisor)) { - return (-4); + return -4; } int random_factor = random2((you.skill(SK_INVOCATIONS, healed) + healed) @@ -210,7 +210,7 @@ static int _can_pacify_monster(const monster* mon, const int healed, if (mon->max_hit_points < factor * random_factor) return 1; if (mon->max_hit_points < factor * random_factor * 1.15) - return (-3); + return -3; return 0; } @@ -249,14 +249,14 @@ static int _healing_spell(int healed, int max_healed, bool divine_ability, } if (!spd.isValid) - return (-1); + return -1; if (spd.target == you.pos()) { if (not_self) { mpr("You can only heal others!"); - return (-1); + return -1; } mpr("You are healed."); @@ -308,7 +308,7 @@ static int _healing_spell(int healed, int max_healed, bool divine_ability, } else mpr("You cannot pacify this monster!"); - return (-1); + return -1; } } diff --git a/crawl-ref/source/spl-selfench.cc b/crawl-ref/source/spl-selfench.cc index b7241213a9..a5e2f67b2e 100644 --- a/crawl-ref/source/spl-selfench.cc +++ b/crawl-ref/source/spl-selfench.cc @@ -268,7 +268,7 @@ int cast_selective_amnesia(std::string *pre_msg) if (key_is_escape(keyin)) { canned_msg(MSG_OK); - return (-1); + return -1; } if (keyin == '?' || keyin == '*') diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc index 06208430a3..2d16d7287e 100644 --- a/crawl-ref/source/spl-summoning.cc +++ b/crawl-ref/source/spl-summoning.cc @@ -1733,7 +1733,7 @@ int animate_remains(const coord_def &a, corpse_type class_allowed, *motions_r |= motions; if (number_found == 0) - return (-1); + return -1; if (!success) return 0; diff --git a/crawl-ref/source/spl-transloc.cc b/crawl-ref/source/spl-transloc.cc index c011272f3d..ac14ec1b7c 100644 --- a/crawl-ref/source/spl-transloc.cc +++ b/crawl-ref/source/spl-transloc.cc @@ -75,7 +75,7 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink, crawl_state.cant_cmd_repeat("You can't repeat controlled blinks."); crawl_state.cancel_cmd_again(); crawl_state.cancel_cmd_repeat(); - return (-1); + return -1; } // yes, there is a logic to this ordering {dlb}: @@ -142,7 +142,7 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink, continue; } canned_msg(MSG_OK); - return (-1); // early return {dlb} + return -1; // early return {dlb} } monster* beholder = you.get_beholder(beam.target); diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index d99ea7472e..50d6c4c6eb 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -159,7 +159,7 @@ spell_type spell_by_name(std::string name, bool partial_match) spell_name_map::iterator i = spell_name_cache.find(name); if (i != spell_name_cache.end()) - return (i->second); + return i->second; return SPELL_NO_SPELL; } @@ -244,7 +244,7 @@ int get_spell_slot_by_letter(char letter) const int index = letter_to_index(letter); if (you.spell_letter_table[ index ] == -1) - return (-1); + return -1; return (you.spell_letter_table[index]); } diff --git a/crawl-ref/source/sqldbm.cc b/crawl-ref/source/sqldbm.cc index a059965001..0ff1685493 100644 --- a/crawl-ref/source/sqldbm.cc +++ b/crawl-ref/source/sqldbm.cc @@ -350,7 +350,7 @@ sql_datum &sql_datum::operator = (const sql_datum &d) reset(); init_from(d); } - return (*this); + return *this; } void sql_datum::reset() diff --git a/crawl-ref/source/startup.cc b/crawl-ref/source/startup.cc index 01b7fac9ae..b57b6a736e 100644 --- a/crawl-ref/source/startup.cc +++ b/crawl-ref/source/startup.cc @@ -513,7 +513,7 @@ static int _find_save(const std::vector<player_save_info>& chars, for (int i = 0; i < static_cast<int>(chars.size()); ++i) if (chars[i].name == name) return i; - return (-1); + return -1; } static bool _game_defined(const newgame_def& ng) diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 280febf121..ce993cf015 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -66,7 +66,7 @@ std::string userdef_annotate_item(const char *s, const item_def *item, ann = luaL_checkstring(clua, -1); return ann; #else - return (""); + return ""; #endif } @@ -529,7 +529,7 @@ bool Stash::show_menu(const level_pos &prefix, bool can_travel, std::string Stash::description() const { if (!enabled || items.empty()) - return (""); + return ""; const item_def &item = items[0]; std::string desc = stash_item_name(item); @@ -549,7 +549,7 @@ std::string Stash::description() const std::string Stash::feature_description() const { if (feat == DNGN_FLOOR) - return (""); + return ""; return (::feature_description_at(coord_def(x, y), false)); } @@ -2092,7 +2092,7 @@ ST_ItemIterator::operator bool() const const item_def& ST_ItemIterator::operator *() const { - return (*m_item); + return *m_item; } const item_def* ST_ItemIterator::operator->() const @@ -2128,10 +2128,10 @@ const ST_ItemIterator& ST_ItemIterator::operator ++ () { m_stash_level_it++; if (m_stash_level_it == StashTrack.levels.end()) - return (*this); + return *this; new_level(); - return (*this); + return *this; } m_shop = &(*m_shop_it); @@ -2141,7 +2141,7 @@ const ST_ItemIterator& ST_ItemIterator::operator ++ () m_item = &(item.item); ASSERT(m_item->defined()); m_price = item.price; - return (*this); + return *this; } m_shop_it++; @@ -2156,21 +2156,21 @@ const ST_ItemIterator& ST_ItemIterator::operator ++ () { m_item = &(*m_stash_item_it++); ASSERT(m_item->defined()); - return (*this); + return *this; } m_stash_it++; if (m_stash_it == ls.m_stashes.end()) { ++(*this); - return (*this); + return *this; } m_stash_item_it = m_stash_it->second.items.begin(); ++(*this); } - return (*this); + return *this; } void ST_ItemIterator::new_level() diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h index 91bd45d116..58bc6097b6 100644 --- a/crawl-ref/source/stash.h +++ b/crawl-ref/source/stash.h @@ -211,7 +211,7 @@ struct stash_search_result stash = o.stash; shop = o.shop; matching_items = o.matching_items; - return (*this); + return *this; } bool operator < (const stash_search_result &ssr) const diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc index 0ccdfec63a..4311f53b63 100644 --- a/crawl-ref/source/state.cc +++ b/crawl-ref/source/state.cc @@ -322,7 +322,7 @@ bool game_state::is_god_retribution() const { ASSERT(is_god_acting()); - return (god_act.retribution); + return god_act.retribution; } god_type game_state::which_god_acting() const diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc index 5d9f769853..1896e17521 100644 --- a/crawl-ref/source/store.cc +++ b/crawl-ref/source/store.cc @@ -451,7 +451,7 @@ CrawlStoreValue &CrawlStoreValue::operator = (const CrawlStoreValue &other) break; } - return (*this); + return *this; } /////////////////////////////////// @@ -1076,97 +1076,97 @@ CrawlStoreValue::operator level_pos() const CrawlStoreValue &CrawlStoreValue::operator = (const bool &_val) { get_bool() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const char &_val) { get_byte() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const short &_val) { get_short() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const int &_val) { get_int() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const int64_t &_val) { get_int64() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const float &_val) { get_float() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const std::string &_val) { get_string() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const char* _val) { get_string() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const coord_def &_val) { get_coord() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const CrawlHashTable &_val) { get_table() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const CrawlVector &_val) { get_vector() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const item_def &_val) { get_item() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const level_id &_val) { get_level_id() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const level_pos &_val) { get_level_pos() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const monster& _val) { get_monster() = _val; - return (*this); + return *this; } CrawlStoreValue &CrawlStoreValue::operator = (const dlua_chunk &_val) { get_lua() = _val; - return (*this); + return *this; } /////////////////////////////////////////////////// @@ -1270,12 +1270,12 @@ CrawlHashTable &CrawlHashTable::operator = (const CrawlHashTable &other) if (other.hash_map == NULL) { hash_map = NULL; - return (*this); + return *this; } hash_map = new hash_map_type(*(other.hash_map)); - return (*this); + return *this; } ////////////////////////////// @@ -1433,7 +1433,7 @@ CrawlStoreValue& CrawlHashTable::get_value(const std::string &key) return val; } - return (i->second); + return i->second; } const CrawlStoreValue& CrawlHashTable::get_value(const std::string &key) const @@ -1454,7 +1454,7 @@ const CrawlStoreValue& CrawlHashTable::get_value(const std::string &key) const ASSERT(i->second.type != SV_NONE); ASSERT(!(i->second.flags & SFLAG_UNSET)); - return (i->second); + return i->second; } /////////////////////////// diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index fbff7cb012..a5a9600c78 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -71,7 +71,7 @@ std::string make_file_time(time_t when) loc->tm_min, loc->tm_sec); } - return (""); + return ""; } void set_redraw_status(uint64_t flags) diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index b5f010baf9..8063773b7d 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -864,10 +864,10 @@ static int unmarshallCString(reader &th, char *data, int maxSize) std::string unmarshallString(reader &th, int maxSize) { if (maxSize <= 0) - return (""); + return ""; char *buffer = new char [maxSize]; if (!buffer) - return (""); + return ""; *buffer = 0; const int slen = unmarshallCString(th, buffer, maxSize); ASSERT(slen >= 0 && slen < maxSize); @@ -911,7 +911,7 @@ bool unmarshallBoolean(reader &th) std::string make_date_string(time_t in_date) { if (in_date <= 0) - return (""); + return ""; struct tm *date = TIME_FN(&in_date); diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 5c2d7cd1f0..0c1f9675cb 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -48,7 +48,7 @@ actor* actor_at(const coord_def& c) if (!in_bounds(c)) return NULL; if (c == you.pos()) - return (&you); + return &you; return monster_at(c); } @@ -1544,7 +1544,7 @@ dungeon_feature_type feat_by_desc(std::string desc) feat_desc_map::iterator i = feat_desc_cache.find(desc); if (i != feat_desc_cache.end()) - return (i->second); + return i->second; return DNGN_UNSEEN; } diff --git a/crawl-ref/source/throw.cc b/crawl-ref/source/throw.cc index 6cc6c3c3e5..1484e0a6fd 100644 --- a/crawl-ref/source/throw.cc +++ b/crawl-ref/source/throw.cc @@ -402,23 +402,23 @@ int get_ammo_to_shoot(int item, dist &target, bool teleport) if (fire_warn_if_impossible()) { flush_input_buffer(FLUSH_ON_FAILURE); - return (-1); + return -1; } if (Options.auto_switch && you.m_quiver->get_fire_item() == -1 && _autoswitch_to_ranged()) { - return (-1); + return -1; } if (!_fire_choose_item_and_target(item, target, teleport)) - return (-1); + return -1; std::string warn; if (!_fire_validate_item(item, warn)) { mpr(warn.c_str()); - return (-1); + return -1; } return item; } diff --git a/crawl-ref/source/tilebuf.cc b/crawl-ref/source/tilebuf.cc index de7fe39a25..771b2292fc 100644 --- a/crawl-ref/source/tilebuf.cc +++ b/crawl-ref/source/tilebuf.cc @@ -66,7 +66,7 @@ void VertBuffer::add_primitive(const GLWPrim &rect) unsigned int VertBuffer::size() const { - return (m_vert_buf->size()); + return m_vert_buf->size(); } void VertBuffer::set_tex(const GenericTexture *new_tex) diff --git a/crawl-ref/source/tiledoll.cc b/crawl-ref/source/tiledoll.cc index d237edd754..8e6fdecfae 100644 --- a/crawl-ref/source/tiledoll.cc +++ b/crawl-ref/source/tiledoll.cc @@ -35,7 +35,7 @@ dolls_data::dolls_data(const dolls_data& _orig) const dolls_data& dolls_data::operator=(const dolls_data& other) { memcpy(parts, other.parts, TILEP_PART_MAX * sizeof(tileidx_t)); - return (*this); + return *this; } dolls_data::~dolls_data() diff --git a/crawl-ref/source/tilereg-inv.cc b/crawl-ref/source/tilereg-inv.cc index e36af9f444..df9a6be92e 100644 --- a/crawl-ref/source/tilereg-inv.cc +++ b/crawl-ref/source/tilereg-inv.cc @@ -216,7 +216,7 @@ static bool _can_use_item(const item_def &item, bool equipped) // You can't unwield/fire a wielded cursed weapon/staff // but cursed armour and rings can be unwielded without problems. - return (!_is_true_equipped_item(item)); + return !_is_true_equipped_item(item); } // Mummies can't do anything with food or potions. diff --git a/crawl-ref/source/tilereg-mem.cc b/crawl-ref/source/tilereg-mem.cc index 8203743aef..3ef7aa936b 100644 --- a/crawl-ref/source/tilereg-mem.cc +++ b/crawl-ref/source/tilereg-mem.cc @@ -26,7 +26,7 @@ void MemoriseRegion::activate() int MemoriseRegion::get_max_slots() { - return (m_items.size()); + return m_items.size(); } void MemoriseRegion::draw_tag() diff --git a/crawl-ref/source/tilereg-tab.cc b/crawl-ref/source/tilereg-tab.cc index 8b74a7028b..c98b0ecff2 100644 --- a/crawl-ref/source/tilereg-tab.cc +++ b/crawl-ref/source/tilereg-tab.cc @@ -134,7 +134,7 @@ int TabbedRegion::active_tab() const int TabbedRegion::num_tabs() const { - return (m_tabs.size()); + return m_tabs.size(); } bool TabbedRegion::invalid_index(int idx) const @@ -282,14 +282,14 @@ int TabbedRegion::get_mouseover_tab(MouseEvent &event) const int y = event.py - sy; if (x < 0 || x > ox || y < 0 || y > wy) - return (-1); + return -1; for (int i = 0; i < (int)m_tabs.size(); ++i) { if (y >= m_tabs[i].min_y && y <= m_tabs[i].max_y) return i; } - return (-1); + return -1; } int TabbedRegion::handle_mouse(MouseEvent &event) @@ -335,7 +335,7 @@ bool TabbedRegion::update_tip_text(std::string &tip) { GridRegion *reg = m_tabs[m_mouse_tab].reg; if (reg) - return (reg->update_tab_tip_text(tip, m_mouse_tab == m_active)); + return reg->update_tab_tip_text(tip, m_mouse_tab == m_active); } return (get_tab_region(active_tab())->update_tip_text(tip)); diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 228d8fc430..ba81b95aeb 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -1247,7 +1247,7 @@ void TilesFramework::add_text_tag(text_tag_type type, const monster_info& mon) const coord_def &TilesFramework::get_cursor() const { - return (m_region_tile->get_cursor()); + return m_region_tile->get_cursor(); } void TilesFramework::add_overlay(const coord_def &gc, tileidx_t idx) diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index 567d579267..24787c7536 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -283,7 +283,7 @@ int get_trapping_net(const coord_def& where, bool trapped) && si->sub_type == MI_THROWING_NET && (!trapped || item_is_stationary(*si))) { - return (si->index()); + return si->index(); } } return NON_ITEM; @@ -1138,7 +1138,7 @@ trap_def* find_trap(const coord_def& pos) trap_type get_trap_type(const coord_def& pos) { if (trap_def* ptrap = find_trap(pos)) - return (ptrap->type); + return ptrap->type; return TRAP_UNASSIGNED; } @@ -1374,7 +1374,7 @@ static int damage_or_escape_net(int hold) // If undecided, choose damaging approach (it's quicker). if (damage >= escape) - return (-damage); // negate value + return -damage; // negate value return escape; } diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index edbda15a7e..51f079c8d4 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -200,7 +200,7 @@ static inline bool _is_safe_cloud(const coord_def& c) // We can also safely run through smoke. const cloud_type ctype = env.cloud[cloud].type; - return (!is_damaging_cloud(ctype, true)); + return !is_damaging_cloud(ctype, true); } // Returns an estimate for the time needed to cross this feature. @@ -1892,7 +1892,7 @@ static std::string _get_trans_travel_dest(const travel_target &target, const char *branch = branches[branch_id].abbrevname; if (!branch) - return (""); + return ""; std::ostringstream dest; @@ -1909,7 +1909,7 @@ static std::string _get_trans_travel_dest(const travel_target &target, else if (target.entrance_only) dest << " (entrance)"; - return (dest.str()); + return dest.str(); } // Returns the level on the given branch that's closest to the player's @@ -2090,7 +2090,7 @@ static int _prompt_travel_branch(int prompt_flags, bool* to_entrance) case CONTROL('P'): return _find_parent_branch(curr.branch); case '.': - return (curr.branch); + return curr.branch; case '*': if (waypoint_list || waycount) waypoint_list = !waypoint_list; @@ -2133,7 +2133,7 @@ static int _prompt_travel_branch(int prompt_flags, bool* to_entrance) return ID_CANCEL; } #endif - return (br[i]); + return br[i]; } } @@ -2224,11 +2224,11 @@ static int _travel_depth_keyfilter(int &c) switch (c) { case '<': case '>': case '?': case '$': case '^': - return (-1); + return -1; case '-': case CONTROL('P'): case 'p': c = '-'; // Make uniform. - return (-1); + return -1; default: return 1; } @@ -2559,7 +2559,7 @@ static int _find_transtravel_stair(const level_id &cur, { // Are we in an exclude? If so, bail out. if (is_excluded(stair, li.get_excludes())) - return (-1); + return -1; // If there's no target position on the target level, or we're on the // target, we're home. @@ -3275,7 +3275,7 @@ bool LevelInfo::know_stair(const coord_def &c) const return false; const level_pos &lp = stairs[index].destination; - return (lp.is_valid()); + return lp.is_valid(); } stair_info *LevelInfo::get_stair(const coord_def &pos) @@ -3860,7 +3860,7 @@ runrest::operator int () const const runrest &runrest::operator = (int newrunmode) { runmode = newrunmode; - return (*this); + return *this; } static dungeon_feature_type _base_feat_type(dungeon_feature_type grid) @@ -3989,7 +3989,7 @@ std::string runrest::runmode_name() const default: if (runmode > 0) return pos.origin()? "rest" : "run"; - return (""); + return ""; } } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 233739d546..a4584e5ce7 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -692,7 +692,7 @@ std::string screenshot() ; // ... and from the top for (; y < lines.size(); y++) ss << lines[y] << "\n"; - return (ss.str()); + return ss.str(); } int viewmap_flash_colour() diff --git a/crawl-ref/source/viewgeom.cc b/crawl-ref/source/viewgeom.cc index 1ae15d934e..99dc78ea87 100644 --- a/crawl-ref/source/viewgeom.cc +++ b/crawl-ref/source/viewgeom.cc @@ -260,7 +260,7 @@ const crawl_view_buffer &crawl_view_buffer::operator = (const crawl_view_buffer size_t count = sizeof(m_buffer[0]) * m_size.x * m_size.y; memcpy(m_buffer, rhs.m_buffer, count); } - return (*this); + return *this; } void crawl_view_buffer::clear() diff --git a/crawl-ref/source/viewmap.cc b/crawl-ref/source/viewmap.cc index ad1999e35e..2d399c26d0 100644 --- a/crawl-ref/source/viewmap.cc +++ b/crawl-ref/source/viewmap.cc @@ -685,7 +685,7 @@ static level_pos _stair_dest(const coord_def& p, command_type dir) if (!sinf) return level_pos(); - return (sinf->destination); + return sinf->destination; } // show_map() now centers the known map along x or y. This prevents diff --git a/crawl-ref/source/windowmanager-sdl.cc b/crawl-ref/source/windowmanager-sdl.cc index 6fecdda817..a91838adcc 100644 --- a/crawl-ref/source/windowmanager-sdl.cc +++ b/crawl-ref/source/windowmanager-sdl.cc @@ -315,12 +315,12 @@ int SDLWrapper::init(coord_def *m_windowsz) int SDLWrapper::screen_width() const { - return (video_info->current_w); + return video_info->current_w; } int SDLWrapper::screen_height() const { - return (video_info->current_h); + return video_info->current_h; } int SDLWrapper::desktop_width() const diff --git a/crawl-ref/source/wiz-dgn.cc b/crawl-ref/source/wiz-dgn.cc index 7ae857227a..e329ccda78 100644 --- a/crawl-ref/source/wiz-dgn.cc +++ b/crawl-ref/source/wiz-dgn.cc @@ -417,7 +417,7 @@ static int find_trap_slot() if (env.trap[i].type == TRAP_UNASSIGNED) return i; - return (-1); + return -1; } void debug_make_trap() diff --git a/crawl-ref/source/wiz-fsim.cc b/crawl-ref/source/wiz-fsim.cc index 9fa7653dad..9379a86dc3 100644 --- a/crawl-ref/source/wiz-fsim.cc +++ b/crawl-ref/source/wiz-fsim.cc @@ -107,7 +107,7 @@ static std::string _time_string() ltime->tm_min, ltime->tm_sec); } - return (""); + return ""; } static void _write_version(FILE * o) diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc index 5af08706c7..3c5840231d 100644 --- a/crawl-ref/source/wiz-mon.cc +++ b/crawl-ref/source/wiz-mon.cc @@ -771,7 +771,7 @@ void debug_make_monster_shout(monster* mon) static bool _force_suitable(const monster* mon) { - return (mon->alive()); + return mon->alive(); } void wizard_gain_monster_level(monster* mon) diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index ec90bf4b3d..358bbee457 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -2384,13 +2384,13 @@ static bool _could_wear_eq(equipment_type eq) if (!you_tran_can_wear(eq, true)) return false; - return (!you.slot_item(eq, true)); + return !you.slot_item(eq, true); } static item_def* _tran_get_eq(equipment_type eq) { if (you_tran_can_wear(eq, true)) - return (you.slot_item(eq, true)); + return you.slot_item(eq, true); return NULL; } @@ -3396,7 +3396,7 @@ static bool _allow_xom_banishment() // If Xom is bored, banishment becomes viable earlier. if (_xom_is_bored()) - return (!_will_not_banish()); + return !_will_not_banish(); // Below the minimum experience level, only fake banishment is allowed. if (!_has_min_banishment_level()) |