aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-03 20:33:40 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-03 20:33:40 -0200
commit42ef3f938876088a1c28afd3f7e7b25273f1c976 (patch)
treeca00711dbd2a9a31d1dfab95d28d51e5ceca15d2
parent2651afc455a78f5ae778b9fd8a0ee9efffed4998 (diff)
downloadlua-42ef3f938876088a1c28afd3f7e7b25273f1c976.tar.gz
lua-42ef3f938876088a1c28afd3f7e7b25273f1c976.tar.bz2
lua-42ef3f938876088a1c28afd3f7e7b25273f1c976.zip
there is no need of predefined constants.
-rw-r--r--table.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/table.c b/table.c
index 26149d1a..1f7dad0b 100644
--- a/table.c
+++ b/table.c
@@ -3,7 +3,7 @@
3** Module to control static tables 3** Module to control static tables
4*/ 4*/
5 5
6char *rcs_table="$Id: table.c,v 2.8 1994/11/02 20:29:09 roberto Exp roberto $"; 6char *rcs_table="$Id: table.c,v 2.9 1994/11/03 21:48:36 roberto Exp $";
7 7
8#include <stdlib.h> 8#include <stdlib.h>
9#include <string.h> 9#include <string.h>
@@ -54,7 +54,7 @@ static void lua_initsymbol (void)
54 return; 54 return;
55 } 55 }
56 n = lua_findsymbol("type"); 56 n = lua_findsymbol("type");
57 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_type; 57 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_type;
58 n = lua_findsymbol("tonumber"); 58 n = lua_findsymbol("tonumber");
59 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_obj2number; 59 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_obj2number;
60 n = lua_findsymbol("next"); 60 n = lua_findsymbol("next");
@@ -78,20 +78,10 @@ void lua_initconstant (void)
78 lua_maxconstant = BUFFER_BLOCK; 78 lua_maxconstant = BUFFER_BLOCK;
79 lua_constant = (char **) calloc(lua_maxconstant, sizeof(char *)); 79 lua_constant = (char **) calloc(lua_maxconstant, sizeof(char *));
80 if (lua_constant == NULL) 80 if (lua_constant == NULL)
81 { 81 lua_error ("constant table: not enough memory");
82 lua_error ("constant table: not enough memory");
83 return;
84 }
85 lua_findconstant("mark");
86 lua_findconstant("nil");
87 lua_findconstant("number");
88 lua_findconstant("string");
89 lua_findconstant("table");
90 lua_findconstant("function");
91 lua_findconstant("cfunction");
92 lua_findconstant("userdata");
93} 82}
94 83
84
95/* 85/*
96** Given a name, search it at symbol table and return its index. If not 86** Given a name, search it at symbol table and return its index. If not
97** found, allocate it. 87** found, allocate it.