From 9f043e801733b0a5019c4e6e2a72abaf9ad7c5b0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 9 Jan 1998 13:09:53 -0200 Subject: luaL_arg_check now is inlined --- lauxlib.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index 922bc5d2..6de9c2bf 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.6 1997/12/17 20:48:58 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.8 1998/01/09 15:06:07 roberto Exp $ ** Auxiliar functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -8,25 +8,27 @@ #include #include +/* Please Notice: This file uses only the oficial API of Lua +** Any function declared here could be written as an application +** function. With care, these functions can be used by other libraries. +*/ #include "lauxlib.h" #include "lua.h" #include "luadebug.h" -void luaL_arg_check (int cond, int numarg, char *extramsg) +void luaL_argerror (int numarg, char *extramsg) { - if (!cond) { - char *funcname; - lua_getobjname(lua_stackedfunction(0), &funcname); - if (funcname == NULL) - funcname = "???"; - if (extramsg == NULL) - luaL_verror("bad argument #%d to function `%.50s'", numarg, funcname); - else - luaL_verror("bad argument #%d to function `%.50s' (%.100s)", - numarg, funcname, extramsg); - } + char *funcname; + lua_getobjname(lua_stackedfunction(0), &funcname); + if (funcname == NULL) + funcname = "???"; + if (extramsg == NULL) + luaL_verror("bad argument #%d to function `%.50s'", numarg, funcname); + else + luaL_verror("bad argument #%d to function `%.50s' (%.100s)", + numarg, funcname, extramsg); } char *luaL_check_string (int numArg) -- cgit v1.2.3-55-g6feb