summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapmark.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-07-05 12:14:09 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-07-05 12:14:09 +0200
commitc41419c4f47bbf0737d3fedf58128c835d2c4e3b (patch)
tree764ae18c107df39fd90af718922036bd245561ca /crawl-ref/source/mapmark.cc
parentb80adef8882143cad34f3c8bcc9a8ccbd4440223 (diff)
downloadcrawl-ref-c41419c4f47bbf0737d3fedf58128c835d2c4e3b.tar.gz
crawl-ref-c41419c4f47bbf0737d3fedf58128c835d2c4e3b.zip
Drop parentheses around scalar values in "return".
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r--crawl-ref/source/mapmark.cc76
1 files changed, 38 insertions, 38 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc
index cade0020db..c142ec0803 100644
--- a/crawl-ref/source/mapmark.cc
+++ b/crawl-ref/source/mapmark.cc
@@ -91,10 +91,10 @@ map_marker *map_marker::parse_marker(
if (parsers[i])
{
if (map_marker *m = parsers[i](s, ctx))
- return (m);
+ return m;
}
}
- return (NULL);
+ return NULL;
}
////////////////////////////////////////////////////////////////////////////
@@ -134,14 +134,14 @@ map_marker *map_feature_marker::read(reader &inf, map_marker_type)
{
map_marker *mapf = new map_feature_marker();
mapf->read(inf);
- return (mapf);
+ return mapf;
}
map_marker *map_feature_marker::parse(
const std::string &s, const std::string &) throw (std::string)
{
if (s.find("feat:") != 0)
- return (NULL);
+ return NULL;
std::string raw = s;
strip_tag(raw, "feat:", true);
@@ -233,7 +233,7 @@ bool map_lua_marker::get_table() const
}
else
{
- return (false);
+ return false;
}
}
@@ -300,7 +300,7 @@ map_marker *map_lua_marker::read(reader &inf, map_marker_type)
{
map_marker *marker = new map_lua_marker;
marker->read(inf);
- return (marker);
+ return marker;
}
void map_lua_marker::push_fn_args(const char *fn) const
@@ -321,7 +321,7 @@ bool map_lua_marker::callfn(const char *fn, bool warn_err, int args) const
const bool res = dlua.callfn("dlua_marker_method", args, 1);
if (!res && warn_err)
mprf(MSGCH_ERROR, "mlua error: %s", dlua.error.c_str());
- return (res);
+ return res;
}
void map_lua_marker::activate(bool verbose)
@@ -343,7 +343,7 @@ bool map_lua_marker::notify_dgn_event(const dgn_event &e)
dlua.error.c_str());
// Lua error prevents veto if the event is vetoable.
- return (true);
+ return true;
}
bool accepted = true;
@@ -352,7 +352,7 @@ bool map_lua_marker::notify_dgn_event(const dgn_event &e)
if (lua_isboolean(dlua, -1))
accepted = lua_toboolean(dlua, -1);
- return (accepted);
+ return accepted;
}
std::string map_lua_marker::call_str_fn(const char *fn) const
@@ -364,7 +364,7 @@ std::string map_lua_marker::call_str_fn(const char *fn) const
std::string result;
if (lua_isstring(dlua, -1))
result = lua_tostring(dlua, -1);
- return (result);
+ return result;
}
std::string map_lua_marker::debug_describe() const
@@ -387,7 +387,7 @@ std::string map_lua_marker::property(const std::string &pname) const
std::string result;
if (lua_isstring(dlua, -1))
result = lua_tostring(dlua, -1);
- return (result);
+ return result;
}
std::string map_lua_marker::debug_to_string() const
@@ -406,7 +406,7 @@ std::string map_lua_marker::debug_to_string() const
result = lua_tostring(dlua, -1);
else
result = "table_to_string() returned nothing";
- return (result);
+ return result;
}
map_marker *map_lua_marker::parse(
@@ -423,7 +423,7 @@ map_marker *map_lua_marker::parse(
mapdef_marker = false;
}
else
- return (NULL);
+ return NULL;
map_lua_marker *mark = new map_lua_marker(raw, ctx, mapdef_marker);
if (!mark->initialised)
@@ -432,7 +432,7 @@ map_marker *map_lua_marker::parse(
throw make_stringf("Unable to initialise Lua marker from '%s'",
raw.c_str());
}
- return (mark);
+ return mark;
}
//////////////////////////////////////////////////////////////////////////
@@ -460,13 +460,13 @@ map_marker *map_corruption_marker::read(reader &in, map_marker_type)
{
map_corruption_marker *mc = new map_corruption_marker();
mc->read(in);
- return (mc);
+ return mc;
}
map_marker *map_corruption_marker::clone() const
{
map_corruption_marker *mark = new map_corruption_marker(pos, duration);
- return (mark);
+ return mark;
}
std::string map_corruption_marker::debug_describe() const
@@ -534,7 +534,7 @@ std::string map_wiz_props_marker::set_property(const std::string &key,
{
std::string old_val = properties[key];
properties[key] = val;
- return (old_val);
+ return old_val;
}
map_marker *map_wiz_props_marker::clone() const
@@ -546,7 +546,7 @@ map_marker *map_wiz_props_marker::read(reader &inf, map_marker_type)
{
map_marker *mapf = new map_wiz_props_marker();
mapf->read(inf);
- return (mapf);
+ return mapf;
}
map_marker *map_wiz_props_marker::parse(
@@ -589,14 +589,14 @@ map_marker *map_tomb_marker::read(reader &in, map_marker_type)
{
map_tomb_marker *mc = new map_tomb_marker();
mc->read(in);
- return (mc);
+ return mc;
}
map_marker *map_tomb_marker::clone() const
{
map_tomb_marker *mark = new map_tomb_marker(pos, duration,
source, target);
- return (mark);
+ return mark;
}
std::string map_tomb_marker::debug_describe() const
@@ -646,14 +646,14 @@ map_marker *map_malign_gateway_marker::read(reader &in, map_marker_type)
{
map_malign_gateway_marker *mc = new map_malign_gateway_marker();
mc->read(in);
- return (mc);
+ return mc;
}
map_marker *map_malign_gateway_marker::clone() const
{
map_malign_gateway_marker *mark = new map_malign_gateway_marker(pos,
duration, is_player, summoner_string, behaviour, god, power);
- return (mark);
+ return mark;
}
std::string map_malign_gateway_marker::debug_describe() const
@@ -700,14 +700,14 @@ map_marker *map_phoenix_marker::read(reader &in, map_marker_type)
{
map_phoenix_marker *mc = new map_phoenix_marker();
mc->read(in);
- return (mc);
+ return mc;
}
map_marker *map_phoenix_marker::clone() const
{
map_phoenix_marker *mark = new map_phoenix_marker(pos, duration, mon_num,
behaviour, attitude, god, corpse_pos);
- return (mark);
+ return mark;
}
std::string map_phoenix_marker::debug_describe() const
@@ -752,7 +752,7 @@ map_marker *map_position_marker::read(reader &inf, map_marker_type)
{
map_marker *mapf = new map_position_marker();
mapf->read(inf);
- return (mapf);
+ return mapf;
}
std::string map_position_marker::debug_describe() const
@@ -898,7 +898,7 @@ map_marker *map_markers::find(const coord_def &c, map_marker_type type)
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 (NULL);
+ return NULL;
}
map_marker *map_markers::find(map_marker_type type)
@@ -909,7 +909,7 @@ map_marker *map_markers::find(map_marker_type type)
if (type == MAT_ANY || i->second->get_type() == type)
return (i->second);
}
- return (NULL);
+ return NULL;
}
void map_markers::move(const coord_def &from, const coord_def &to)
@@ -951,7 +951,7 @@ std::vector<map_marker*> map_markers::get_all(map_marker_type mat)
if (mat == MAT_ANY || i->second->get_type() == mat)
rmarkers.push_back(i->second);
}
- return (rmarkers);
+ return rmarkers;
}
std::vector<map_marker*> map_markers::get_all(const std::string &key,
@@ -969,7 +969,7 @@ std::vector<map_marker*> map_markers::get_all(const std::string &key,
rmarkers.push_back(marker);
}
- return (rmarkers);
+ return rmarkers;
}
std::vector<map_marker*> map_markers::get_markers_at(const coord_def &c)
@@ -979,7 +979,7 @@ std::vector<map_marker*> map_markers::get_markers_at(const coord_def &c)
std::vector<map_marker*> rmarkers;
for (dgn_marker_map::const_iterator i = els.first; i != els.second; ++i)
rmarkers.push_back(i->second);
- return (rmarkers);
+ return rmarkers;
}
std::string map_markers::property_at(const coord_def &c, map_marker_type type,
@@ -991,7 +991,7 @@ std::string map_markers::property_at(const coord_def &c, map_marker_type type,
{
const std::string prop = i->second->property(key);
if (!prop.empty())
- return (prop);
+ return prop;
}
return ("");
}
@@ -1064,10 +1064,10 @@ bool feature_marker_at(const coord_def &pos, dungeon_feature_type feat)
if (mark->get_type() == MAT_FEATURE
&& dynamic_cast<map_feature_marker*>(mark)->feat == feat)
{
- return (true);
+ return true;
}
}
- return (false);
+ return false;
}
coord_def find_marker_position_by_prop(const std::string &prop,
@@ -1078,7 +1078,7 @@ coord_def find_marker_position_by_prop(const std::string &prop,
if (markers.empty())
{
const coord_def nowhere(-1, -1);
- return (nowhere);
+ return nowhere;
}
return markers[0];
}
@@ -1097,10 +1097,10 @@ std::vector<coord_def> find_marker_positions_by_prop(
{
marker_positions.push_back(*i);
if (maxresults && marker_positions.size() >= maxresults)
- return (marker_positions);
+ return marker_positions;
}
}
- return (marker_positions);
+ return marker_positions;
}
std::vector<map_marker*> find_markers_by_prop(
@@ -1120,11 +1120,11 @@ std::vector<map_marker*> find_markers_by_prop(
{
markers.push_back(markers_here[i]);
if (maxresults && markers.size() >= maxresults)
- return (markers);
+ return markers;
}
}
}
- return (markers);
+ return markers;
}
///////////////////////////////////////////////////////////////////