diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-03-18 09:03:38 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-03-18 09:03:38 -0500 |
commit | 25351c902726ddbb8d14871e0c6f6fdb7ded149e (patch) | |
tree | 9ae4ac561d4eaa0b59dcd835d59f6e1213629ee4 | |
parent | 7bdedb0e496f8e99b232b047ca2fe5562a20785e (diff) | |
download | luancurses-25351c902726ddbb8d14871e0c6f6fdb7ded149e.tar.gz luancurses-25351c902726ddbb8d14871e0c6f6fdb7ded149e.zip |
remove unnecessary temporary variables
-rw-r--r-- | src/curses.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/curses.c b/src/curses.c index 8eb56da..23e07cb 100644 --- a/src/curses.c +++ b/src/curses.c @@ -359,20 +359,19 @@ static int l_addch(lua_State* L) { int is_mv; pos p; - attr_t mode = 0; chtype ch; is_mv = get_pos(L, &p); ch = get_char_enum(luaL_checklstring(L, 1, NULL)); if (lua_istable(L, 2)) { - mode = get_char_attr(L, 2); + ch |= get_char_attr(L, 2); } if (is_mv) { - lua_pushboolean(L, mvaddch(p.y, p.x, ch | mode) == OK); + lua_pushboolean(L, mvaddch(p.y, p.x, ch) == OK); } else { - lua_pushboolean(L, addch(ch | mode) == OK); + lua_pushboolean(L, addch(ch) == OK); } return 1; @@ -382,13 +381,12 @@ static int l_echochar(lua_State* L) { int is_mv; pos p; - attr_t mode = 0; chtype ch; is_mv = get_pos(L, &p); ch = get_char_enum(luaL_checklstring(L, 1, NULL)); if (lua_istable(L, 2)) { - mode = get_char_attr(L, 2); + ch |= get_char_attr(L, 2); } if (is_mv) { @@ -396,13 +394,13 @@ static int l_echochar(lua_State* L) ret = move(p.y, p.x); if (ret == OK) { - ret = echochar(ch | mode); + ret = echochar(ch); } lua_pushboolean(L, ret == OK); } else { - lua_pushboolean(L, echochar(ch | mode) == OK); + lua_pushboolean(L, echochar(ch) == OK); } return 1; @@ -491,20 +489,19 @@ static int l_insch(lua_State* L) { int is_mv; pos p; - attr_t mode = 0; chtype ch; is_mv = get_pos(L, &p); ch = get_char_enum(luaL_checklstring(L, 1, NULL)); if (lua_istable(L, 2)) { - mode = get_char_attr(L, 2); + ch |= get_char_attr(L, 2); } if (is_mv) { - lua_pushboolean(L, mvinsch(p.y, p.x, ch | mode) == OK); + lua_pushboolean(L, mvinsch(p.y, p.x, ch) == OK); } else { - lua_pushboolean(L, insch(ch | mode) == OK); + lua_pushboolean(L, insch(ch) == OK); } return 1; |