From eeb14c647b279452c446d4819f084d8d61cae6c5 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 26 May 2016 09:33:08 +0200 Subject: [PATCH] Allow the source to build with C89 * ncurses/menu_type.c: Avoid loop control variable declared inside for --- ncurses/menu_type.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ncurses/menu_type.c b/ncurses/menu_type.c index 3697701..eed93e1 100644 --- a/ncurses/menu_type.c +++ b/ncurses/menu_type.c @@ -352,10 +352,11 @@ gc_free_menu (SCM x) // First, we need make our own store the ITEM *. If free_menu // succeeds, the list of ITEM * provided by menu_items will no // longer be valid. + int i; int len = item_count (gm->menu); ITEM **pitem = menu_items (gm->menu); ITEM **pitem_store = scm_malloc (sizeof (ITEM *) * len); - for (int i = 0; i < len; i ++) + for (i = 0; i < len; i ++) pitem_store[i] = pitem[i]; // Next, we try to free the menu. Note that if the menu freeing @@ -397,7 +398,7 @@ gc_free_menu (SCM x) // If we get this far, the menu is now detached from the menu items. // Decrease the refcount on these items, and maybe free them. - for (int i = 0; i < len; i ++) + for (i = 0; i < len; i ++) { if (!item_decrease_refcount (pitem_store[i])) { -- 2.1.4