Changeset

7538:a3a4ed0d34f4

util.table: Move loop variable to top of function for C89 compatibility
author Kim Alvefur <zash@zash.se>
date Sun, 07 Aug 2016 20:49:50 +0200
parents 7537:a0813737c6fa
children 7539:366964dbddb1
files util-src/table.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util-src/table.c	Sun Aug 07 20:48:37 2016 +0200
+++ b/util-src/table.c	Sun Aug 07 20:49:50 2016 +0200
@@ -7,10 +7,11 @@
 }
 
 static int Lpack(lua_State* L) {
+	int arg;
 	unsigned int n_args = lua_gettop(L);
 	lua_createtable(L, n_args, 1);
 	lua_insert(L, 1);
-	for(int arg = n_args; arg >= 1; arg--) {
+	for(arg = n_args; arg >= 1; arg--) {
 		lua_rawseti(L, 1, arg);
 	}
 	lua_pushinteger(L, n_args);