new constant LUA_NOOBJECT

This commit is contained in:
Roberto Ierusalimschy 1994-12-16 13:55:04 -02:00
parent fad57bfa00
commit 3365a35243
3 changed files with 9 additions and 9 deletions

6
hash.c
View File

@ -3,7 +3,7 @@
** hash manager for lua ** hash manager for lua
*/ */
char *rcs_hash="$Id: hash.c,v 2.20 1994/11/25 19:27:03 roberto Exp $"; char *rcs_hash="$Id: hash.c,v 2.20 1994/11/28 15:10:51 roberto Exp roberto $";
#include "mem.h" #include "mem.h"
#include "opcode.h" #include "opcode.h"
@ -313,9 +313,9 @@ void lua_next (void)
Hash *t; Hash *t;
lua_Object o = lua_getparam(1); lua_Object o = lua_getparam(1);
lua_Object r = lua_getparam(2); lua_Object r = lua_getparam(2);
if (o == 0 || r == 0) if (o == LUA_NOOBJECT || r == LUA_NOOBJECT)
lua_error ("too few arguments to function `next'"); lua_error ("too few arguments to function `next'");
if (lua_getparam(3) != 0) if (lua_getparam(3) != LUA_NOOBJECT)
lua_error ("too many arguments to function `next'"); lua_error ("too many arguments to function `next'");
if (!lua_istable(o)) if (!lua_istable(o))
lua_error ("first argument of function `next' is not a table"); lua_error ("first argument of function `next' is not a table");

View File

@ -5,7 +5,7 @@
** Also provides some predefined lua functions. ** Also provides some predefined lua functions.
*/ */
char *rcs_inout="$Id: inout.c,v 2.13 1994/11/23 14:32:00 roberto Stab $"; char *rcs_inout="$Id: inout.c,v 2.14 1994/12/13 15:54:21 roberto Exp roberto $";
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -214,7 +214,7 @@ void lua_print (void)
{ {
int i=1; int i=1;
lua_Object obj; lua_Object obj;
while ((obj=lua_getparam (i++)) != 0) while ((obj=lua_getparam (i++)) != LUA_NOOBJECT)
{ {
if (lua_isnumber(obj)) printf("%g\n",lua_getnumber(obj)); if (lua_isnumber(obj)) printf("%g\n",lua_getnumber(obj));
else if (lua_isstring(obj)) printf("%s\n",lua_getstring(obj)); else if (lua_isstring(obj)) printf("%s\n",lua_getstring(obj));
@ -235,7 +235,7 @@ void lua_print (void)
void luaI_type (void) void luaI_type (void)
{ {
lua_Object o = lua_getparam(1); lua_Object o = lua_getparam(1);
if (o == 0) if (o == LUA_NOOBJECT)
lua_error("no parameter to function 'type'"); lua_error("no parameter to function 'type'");
switch (lua_type(o)) switch (lua_type(o))
{ {

View File

@ -3,7 +3,7 @@
** Module to control static tables ** Module to control static tables
*/ */
char *rcs_table="$Id: table.c,v 2.22 1994/11/21 21:41:09 roberto Exp roberto $"; char *rcs_table="$Id: table.c,v 2.23 1994/11/23 14:31:11 roberto Stab roberto $";
#include <string.h> #include <string.h>
@ -226,9 +226,9 @@ static void lua_nextvar (void)
char *varname; char *varname;
TreeNode *next; TreeNode *next;
lua_Object o = lua_getparam(1); lua_Object o = lua_getparam(1);
if (o == 0) if (o == LUA_NOOBJECT)
lua_reportbug("too few arguments to function `nextvar'"); lua_reportbug("too few arguments to function `nextvar'");
if (lua_getparam(2) != NULL) if (lua_getparam(2) != LUA_NOOBJECT)
lua_reportbug("too many arguments to function `nextvar'"); lua_reportbug("too many arguments to function `nextvar'");
if (lua_isnil(o)) if (lua_isnil(o))
varname = NULL; varname = NULL;