diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-07-05 12:14:09 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-05 12:14:09 +0200 |
commit | c41419c4f47bbf0737d3fedf58128c835d2c4e3b (patch) | |
tree | 764ae18c107df39fd90af718922036bd245561ca /crawl-ref/source/l_mons.cc | |
parent | b80adef8882143cad34f3c8bcc9a8ccbd4440223 (diff) | |
download | crawl-ref-c41419c4f47bbf0737d3fedf58128c835d2c4e3b.tar.gz crawl-ref-c41419c4f47bbf0737d3fedf58128c835d2c4e3b.zip |
Drop parentheses around scalar values in "return".
Diffstat (limited to 'crawl-ref/source/l_mons.cc')
-rw-r--r-- | crawl-ref/source/l_mons.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/crawl-ref/source/l_mons.cc b/crawl-ref/source/l_mons.cc index cbb089eec8..e47c4c8180 100644 --- a/crawl-ref/source/l_mons.cc +++ b/crawl-ref/source/l_mons.cc @@ -40,7 +40,7 @@ void push_monster(lua_State *ls, monster* mons) { \ lua_pushlightuserdata(ls, mons); \ lua_pushcclosure(ls, l_mons_##closure, 1); \ - return (1); \ + return 1; \ } MDEF(name) @@ -83,7 +83,7 @@ MDEF(entry_name) else lua_pushnil(ls); - return (1); + return 1; } MDEF(x) @@ -118,7 +118,7 @@ LUAFN(l_mons_add_energy) ASSERT_DLUA; monster* mons = clua_get_lightuserdata<monster>(ls, lua_upvalueindex(1)); mons->speed_increment += luaL_checkint(ls, 1); - return (0); + return 0; } MDEFN(add_energy, add_energy) @@ -163,7 +163,7 @@ MDEF(shapeshifter) lua_pushstring(ls, "shapeshifter"); else lua_pushnil(ls); - return (1); + return 1; } MDEF(dancing_weapon) @@ -175,14 +175,14 @@ MDEF(dancing_weapon) else lua_pushnil(ls); - return (1); + return 1; } MDEF(wont_attack) { ASSERT_DLUA; lua_pushboolean(ls, mons->wont_attack()); - return (1); + return 1; } static const char *_monuse_names[] = @@ -200,7 +200,7 @@ MDEF(muse) { if (const monsterentry *me = mons->find_monsterentry()) PLUARET(string, _monuse_to_str(me->gmon_use)); - return (0); + return 0; } static const char *_moneat_names[] = @@ -218,7 +218,7 @@ MDEF(meat) { if (const monsterentry *me = mons->find_monsterentry()) PLUARET(string, _moneat_to_str(me->gmon_eat)); - return (0); + return 0; } static int l_mons_do_dismiss(lua_State *ls) @@ -233,7 +233,7 @@ static int l_mons_do_dismiss(lua_State *ls) mons->flags |= MF_HARD_RESET; monster_die(mons, KILL_DISMISSED, NON_MONSTER); } - return (0); + return 0; } MDEFN(dismiss, do_dismiss) @@ -282,7 +282,7 @@ static int l_mons_do_run_ai(lua_State *ls) monster* mons = clua_get_lightuserdata<monster>(ls, lua_upvalueindex(1)); if (mons->alive()) handle_monster_move(mons); - return (0); + return 0; } MDEFN(run_ai, do_run_ai) @@ -292,7 +292,7 @@ static int l_mons_do_handle_behaviour(lua_State *ls) monster* mons = clua_get_lightuserdata<monster>(ls, lua_upvalueindex(1)); if (mons->alive()) handle_behaviour(mons); - return (0); + return 0; } MDEFN(handle_behaviour, do_handle_behaviour) @@ -306,7 +306,7 @@ static int l_mons_do_random_teleport(lua_State *ls) if (mons->alive()) mons->teleport(true); - return (0); + return 0; } MDEFN(random_teleport, do_random_teleport) @@ -350,7 +350,7 @@ static int l_mons_do_set_prop(lua_State *ls) luaL_argerror(ls, 2, err.c_str()); } - return (0); + return 0; } MDEFN(set_prop, do_set_prop) @@ -373,7 +373,7 @@ static int l_mons_do_get_prop(lua_State *ls) luaL_argerror(ls, 2, err.c_str()); } - return (0); + return 0; } CrawlStoreValue prop = mons->props[prop_name]; @@ -399,7 +399,7 @@ static int l_mons_do_get_prop(lua_State *ls) break; } - return (num_pushed); + return num_pushed; } MDEFN(get_prop, do_get_prop) @@ -415,7 +415,7 @@ static int l_mons_do_has_prop(lua_State *ls) const char *prop_name = luaL_checkstring(ls, 1); lua_pushboolean(ls, mons->props.exists(prop_name)); - return (1); + return 1; } MDEFN(has_prop, do_has_prop) @@ -529,13 +529,13 @@ static int monster_get(lua_State *ls) const char *attr = luaL_checkstring(ls, 2); if (!attr) - return (0); + return 0; for (unsigned i = 0; i < ARRAYSZ(mons_attrs); ++i) if (!strcmp(attr, mons_attrs[i].attribute)) return (mons_attrs[i].accessor(ls, mons, attr)); - return (0); + return 0; } static const char *_monster_behaviour_names[] = { @@ -576,11 +576,11 @@ static int monster_set(lua_State *ls) MonsterWrap *mw = clua_get_userdata< MonsterWrap >(ls, MONS_METATABLE); if (!mw || !mw->mons) - return (0); + return 0; const char *attr = luaL_checkstring(ls, 2); if (!attr) - return (0); + return 0; if (!strcmp(attr, "beh")) { @@ -597,18 +597,18 @@ static int monster_set(lua_State *ls) else if (!strcmp(attr, "targety")) mw->mons->target.y = luaL_checkint(ls, 3); - return (0); + return 0; } static int mons_behaviour(lua_State *ls) { if (lua_gettop(ls) < 1) - return (0); + return 0; if (lua_isnumber(ls, 1)) { lua_pushvalue(ls, 1); - return (1); + return 1; } else if (lua_isstring(ls, 1)) { @@ -616,10 +616,10 @@ static int mons_behaviour(lua_State *ls) if (beh != NUM_BEHAVIOURS) { lua_pushnumber(ls, beh); - return (1); + return 1; } } - return (0); + return 0; } static const struct luaL_reg mons_lib[] = |