From 8987d012144c91af8bddc45119b9c706becf27f7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 24 Jun 2012 05:09:13 +0200 Subject: [PATCH] fix compilation on gcc --- src/bindings/bindings.c | 24 ------------------------ src/gamecode/laws.c | 2 +- src/util/os.c | 22 +++++++++------------- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/src/bindings/bindings.c b/src/bindings/bindings.c index 12480b8a5..b452eb366 100755 --- a/src/bindings/bindings.c +++ b/src/bindings/bindings.c @@ -1006,30 +1006,6 @@ typedef struct event_args { const char *sendertype; } event_args; -static void args_free(void *udata) -{ - free(udata); -} - -static void event_cb(void *sender, const char *event, void *udata) -{ - lua_State *L = (lua_State *) global.vm_state; - event_args *args = (event_args *) udata; - int nargs = 2; - lua_rawgeti(L, LUA_REGISTRYINDEX, args->hfunction); - if (sender && args->sendertype) { - tolua_pushusertype(L, sender, TOLUA_CAST args->sendertype); - } else { - lua_pushnil(L); - } - tolua_pushstring(L, event); - if (args->hargs) { - lua_rawgeti(L, LUA_REGISTRYINDEX, args->hfunction); - ++nargs; - } - lua_pcall(L, nargs, 0, 0); -} - static int tolua_report_unit(lua_State * L) { char buffer[512]; diff --git a/src/gamecode/laws.c b/src/gamecode/laws.c index 82ebc4034..d2485fadc 100755 --- a/src/gamecode/laws.c +++ b/src/gamecode/laws.c @@ -4483,8 +4483,8 @@ void init_processor(void) } p += 10; + add_proc_region(p, do_contact, "Kontaktieren"); add_proc_order(p, K_MAIL, &mail_cmd, 0, "Botschaften"); - add_proc_order(p, K_CONTACT, &contact_cmd, 0, "Kontaktieren"); p += 10; /* all claims must be done before we can USE */ add_proc_region(p, &enter_1, "Betreten (1. Versuch)"); diff --git a/src/util/os.c b/src/util/os.c index 1278e0f7c..c2f947920 100644 --- a/src/util/os.c +++ b/src/util/os.c @@ -2,20 +2,16 @@ #if defined(WIN32) #include -#else /* */ +#else /* WIN32 */ #include -#endif /* */ - int os_mkdir(const char *path, int mode) -{ +#endif /* WIN32 */ +int os_mkdir(const char *path, int mode) +{ #ifdef WIN32 - mode = mode; - return _mkdir(path); - + mode = mode; + return _mkdir(path); #else /* POSIX is our last hope */ - return mkdir(path, (mode_t) mode); - -#endif /* */ -} - - + return mkdir(path, (mode_t) mode); +#endif /* WIN32 */ +}