author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年04月22日 22:55:29 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年04月22日 22:55:29 +0200 |
commit | 23dd1088cc608f470c9fdcf7e8f353e9aa96b4ce (patch) | |
tree | 72b40ba0d34ba7524a88afbe4ede7172f16a7fbc | |
parent | 5ac82640e156396074e9884992e972ed74e521f2 (diff) | |
download | gsl-shell-23dd1088cc608f470c9fdcf7e8f353e9aa96b4ce.tar.gz |
-rw-r--r-- | agg-plot/window_registry.cpp | 7 |
diff --git a/agg-plot/window_registry.cpp b/agg-plot/window_registry.cpp index 0ebfa499..c09539bc 100644 --- a/agg-plot/window_registry.cpp +++ b/agg-plot/window_registry.cpp @@ -18,14 +18,11 @@ window_registry_prepare (lua_State *L) int window_index_add(lua_State *L, int index) { - int n; - - if (index < 0) - index = lua_gettop (L) - (index+1); + INDEX_SET_ABS(L, index); lua_getfield (L, LUA_REGISTRYINDEX, registry_tname); - n = lua_objlen (L, -1); + int n = lua_objlen (L, -1); lua_pushvalue (L, index); lua_rawseti (L, -2, n+1); |