Module Name: src Committed By: lneto Date: Sat Jul 19 17:14:40 UTC 2014
Modified Files: src/sys/modules/lua: lua.c luavar.h src/sys/modules/luapmf: luapmf.c src/sys/modules/luasystm: luasystm.c src/sys/sys: lua.h Log Message: lua(4): using lua_CFunction To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/modules/lua/lua.c cvs rdiff -u -r1.1 -r1.2 src/sys/modules/lua/luavar.h cvs rdiff -u -r1.3 -r1.4 src/sys/modules/luapmf/luapmf.c cvs rdiff -u -r1.2 -r1.3 src/sys/modules/luasystm/luasystm.c cvs rdiff -u -r1.4 -r1.5 src/sys/sys/lua.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/modules/lua/lua.c diff -u src/sys/modules/lua/lua.c:1.9 src/sys/modules/lua/lua.c:1.10 --- src/sys/modules/lua/lua.c:1.9 Sat Jul 19 17:13:22 2014 +++ src/sys/modules/lua/lua.c Sat Jul 19 17:14:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: lua.c,v 1.9 2014/07/19 17:13:22 lneto Exp $ */ +/* $NetBSD: lua.c,v 1.10 2014/07/19 17:14:40 lneto Exp $ */ /* * Copyright (c) 2014 by Lourival Vieira Neto <ln...@netbsd.org>. @@ -588,7 +588,7 @@ lua_maxcount(lua_State *L, lua_Debug *d) } int -lua_mod_register(const char *name, int (*open)(void *)) +lua_mod_register(const char *name, lua_CFunction open) { struct lua_module *m; Index: src/sys/modules/lua/luavar.h diff -u src/sys/modules/lua/luavar.h:1.1 src/sys/modules/lua/luavar.h:1.2 --- src/sys/modules/lua/luavar.h:1.1 Wed Oct 16 19:44:57 2013 +++ src/sys/modules/lua/luavar.h Sat Jul 19 17:14:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: luavar.h,v 1.1 2013/10/16 19:44:57 mbalmer Exp $ */ +/* $NetBSD: luavar.h,v 1.2 2014/07/19 17:14:40 lneto Exp $ */ /* * Copyright (c) 2011, Marc Balmer <mbal...@netbsd.org>. @@ -31,9 +31,11 @@ #ifndef _LUA_VAR_ #define _LUA_VAR_ +#include <lua.h> + struct lua_module { char mod_name[LUA_MAX_MODNAME]; - int (*open)(void *); + lua_CFunction open; int refcount; LIST_ENTRY(lua_module) mod_next; }; Index: src/sys/modules/luapmf/luapmf.c diff -u src/sys/modules/luapmf/luapmf.c:1.3 src/sys/modules/luapmf/luapmf.c:1.4 --- src/sys/modules/luapmf/luapmf.c:1.3 Mon Dec 16 23:35:48 2013 +++ src/sys/modules/luapmf/luapmf.c Sat Jul 19 17:14:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: luapmf.c,v 1.3 2013/12/16 23:35:48 lneto Exp $ */ +/* $NetBSD: luapmf.c,v 1.4 2014/07/19 17:14:40 lneto Exp $ */ /* * Copyright (c) 2011, 2013 Marc Balmer <mbal...@netbsd.org>. @@ -82,9 +82,8 @@ get_platform(lua_State *L) } static int -luaopen_pmf(void *ls) +luaopen_pmf(lua_State *L) { - lua_State *L = (lua_State *)ls; const luaL_Reg pmf_lib[ ] = { { "system_shutdown", system_shutdown }, { "set_platform", set_platform }, Index: src/sys/modules/luasystm/luasystm.c diff -u src/sys/modules/luasystm/luasystm.c:1.2 src/sys/modules/luasystm/luasystm.c:1.3 --- src/sys/modules/luasystm/luasystm.c:1.2 Mon Mar 24 20:21:02 2014 +++ src/sys/modules/luasystm/luasystm.c Sat Jul 19 17:14:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: luasystm.c,v 1.2 2014/03/24 20:21:02 christos Exp $ */ +/* $NetBSD: luasystm.c,v 1.3 2014/07/19 17:14:40 lneto Exp $ */ /* * Copyright (c) 2011, 2013 Marc Balmer <mbal...@netbsd.org>. @@ -159,9 +159,8 @@ systm_panic(lua_State *L) /* mutexes */ static int -luaopen_systm(void *ls) +luaopen_systm(lua_State *L) { - lua_State *L = (lua_State *)ls; const luaL_Reg systm_lib[ ] = { { "print", print }, { "print_nolog", print_nolog }, Index: src/sys/sys/lua.h diff -u src/sys/sys/lua.h:1.4 src/sys/sys/lua.h:1.5 --- src/sys/sys/lua.h:1.4 Sat Jul 19 17:13:22 2014 +++ src/sys/sys/lua.h Sat Jul 19 17:14:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: lua.h,v 1.4 2014/07/19 17:13:22 lneto Exp $ */ +/* $NetBSD: lua.h,v 1.5 2014/07/19 17:14:40 lneto Exp $ */ /* * Copyright (c) 2014 by Lourival Vieira Neto <ln...@netbsd.org>. @@ -80,7 +80,7 @@ struct lua_load { #define LUALOAD _IOWR('l', 4, struct lua_load) #ifdef _KERNEL -extern int lua_mod_register(const char *, int (*)(void *)); +extern int lua_mod_register(const char *, lua_CFunction); extern int lua_mod_unregister(const char *); typedef struct _klua_State {