Compiles with Lua 5.1.4 and Lua 5.2.0-beta, although the makefile needs sorting out to take maybe a version number and also the local paths need removing.

This commit is contained in:
Liam Devine
2011-07-04 23:31:14 +01:00
committed by Sam Roberts
parent a984607f28
commit e15ed19db6
17 changed files with 70 additions and 49 deletions

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include "auxiliar.h"
#include "lua_typeerror.h"
/*=========================================================================*\
* Exported functions
@ -24,7 +25,7 @@ int auxiliar_open(lua_State *L) {
* Creates a new class with given methods
* Methods whose names start with __ are passed directly to the metatable.
\*-------------------------------------------------------------------------*/
void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func) {
void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func) {
luaL_newmetatable(L, classname); /* mt */
/* create __index table to place methods */
lua_pushstring(L, "__index"); /* mt,"__index" */
@ -81,7 +82,7 @@ void auxiliar_add2group(lua_State *L, const char *classname, const char *groupna
\*-------------------------------------------------------------------------*/
int auxiliar_checkboolean(lua_State *L, int objidx) {
if (!lua_isboolean(L, objidx))
luaL_typerror(L, objidx, lua_typename(L, LUA_TBOOLEAN));
luaL_typeerror(L, objidx, lua_typename(L, LUA_TBOOLEAN));
return lua_toboolean(L, objidx);
}