Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cwrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@fb.com>2015-07-22 02:04:19 +0300
committersoumith <soumith@fb.com>2015-07-22 02:04:24 +0300
commite8b92dd941fb0bd4447366e20da056059f06e304 (patch)
tree383035f7b43c428444b31ea5a931d12c25f7247b
parent05c0b83b255ecd0252ab9704379db5df4e441bf5 (diff)
c89 fix
-rw-r--r--cinterface.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/cinterface.lua b/cinterface.lua
index a32230b..c6b5c84 100644
--- a/cinterface.lua
+++ b/cinterface.lua
@@ -117,7 +117,8 @@ function CInterface:__addchelpers()
table.insert(txt, '#define _CWRAP_STR_ARG_TYPES_4821726c1947cdf3eebacade98173939')
table.insert(txt, '#include "string.h"')
table.insert(txt, 'static void str_arg_types(lua_State *L, char *buf, int n) {')
- table.insert(txt, ' for (int i = 1; i <= lua_gettop(L); i++) {')
+ table.insert(txt, ' int i;')
+ table.insert(txt, ' for (i = 1; i <= lua_gettop(L); i++) {')
table.insert(txt, ' int l;')
table.insert(txt, ' const char *torch_type = luaT_typename(L, i);')
table.insert(txt, ' if(torch_type && !strncmp(torch_type, "torch.", 6)) torch_type += 6;')