diff options
author | 2009-07-15 19:29:24 -0400 | |
---|---|---|
committer | 2009-07-15 19:29:24 -0400 | |
commit | e63601aa008c254f76da7bf5e0310788fda3263d (patch) | |
tree | 9e3ecd40844749346ba9802c0e7d0c578b235e71 /src | |
parent | 95a7662f208271ca305844266ff74062d50dff5b (diff) | |
download | textadept-e63601aa008c254f76da7bf5e0310788fda3263d.tar.gz textadept-e63601aa008c254f76da7bf5e0310788fda3263d.zip |
C99 allows 'int' declarations in 'for' statments.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua_interface.c | 10 | ||||
-rw-r--r-- | src/textadept.c | 6 |
2 files changed, 6 insertions, 10 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); diff --git a/src/textadept.c b/src/textadept.c index 88dcca7b..48bbbb54 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -132,8 +132,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, void create_ui() { GList *icon_list = NULL; const char *icons[] = { "16x16", "32x32", "48x48", "64x64", "128x128" }; - int i; - for (i = 0; i < 5; i++) { + for (int i = 0; i < 5; i++) { char *icon_file = g_strconcat(textadept_home, "/core/images/ta_", icons[i], ".png", NULL); GdkPixbuf *pb = gdk_pixbuf_new_from_file(icon_file, NULL); @@ -526,8 +525,7 @@ static OSErr w_ae_open(const AppleEvent *event, AppleEvent *, long) { if (AEGetParamDesc(event, keyDirectObject, typeAEList, &file_list) == noErr) { long count = 0; AECountItems(&file_list, &count); - int i; - for (i = 1; i <= count; i++) { + for (int i = 1; i <= count; i++) { FSRef fsref; AEGetNthPtr(&file_list, i, typeFSRef, NULL, NULL, &fsref, sizeof(FSRef), NULL); |