diff options
author | 2009-07-15 19:29:24 -0400 | |
---|---|---|
committer | 2009-07-15 19:29:24 -0400 | |
commit | e63601aa008c254f76da7bf5e0310788fda3263d (patch) | |
tree | 9e3ecd40844749346ba9802c0e7d0c578b235e71 /src/lua_interface.c | |
parent | 95a7662f208271ca305844266ff74062d50dff5b (diff) | |
download | textadept-e63601aa008c254f76da7bf5e0310788fda3263d.tar.gz textadept-e63601aa008c254f76da7bf5e0310788fda3263d.zip |
C99 allows 'int' declarations in 'for' statments.
Diffstat (limited to 'src/lua_interface.c')
-rw-r--r-- | src/lua_interface.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c index 0ae9ad23..24a08c23 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -73,8 +73,7 @@ int l_init(int argc, char **argv, int reinit) { if (!reinit) { lua = lua_open(); lua_newtable(lua); - int i; - for (i = 0; i < argc; i++) { + for (int i = 0; i < argc; i++) { lua_pushstring(lua, argv[i]); lua_rawseti(lua, -2, i); } @@ -1040,8 +1039,7 @@ static int l_pm_mt_newindex(lua_State *lua) { luaL_argcheck(lua, path, 3, "bad path"); int *indices = gtk_tree_path_get_indices(path); GtkTreePath *ipath = gtk_tree_path_new_from_indices(indices[0], -1); - int i; - for (i = 1; i < gtk_tree_path_get_depth(path); i++) + for (int i = 1; i < gtk_tree_path_get_depth(path); i++) if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(pm_view), ipath) || gtk_tree_view_expand_row(GTK_TREE_VIEW(pm_view), ipath, FALSE)) gtk_tree_path_append_index(ipath, indices[i]); @@ -1235,9 +1233,9 @@ static int l_cf_view_goto_buffer(lua_State *lua) { static int l_cf_ta_dialog(lua_State *lua) { GCDialogType type = gcocoadialog_type(luaL_checkstring(lua, 1)); - int i, argc = lua_gettop(lua) - 1; + int argc = lua_gettop(lua) - 1; const char *argv[argc]; - for (i = 0; i < argc; i++) argv[i] = luaL_checkstring(lua, i + 2); + for (int i = 0; i < argc; i++) argv[i] = luaL_checkstring(lua, i + 2); char *out = gcocoadialog(type, argc, argv); lua_pushstring(lua, out); free(out); |