diff options
author | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-04-06 09:55:08 -0300 |
---|---|---|
committer | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-04-06 09:55:08 -0300 |
commit | 662e2fa5ccf1dfa0ebea571d6785009442ba3011 (patch) | |
tree | a9d83be65def573840b1edf774e9f2400a69b5d3 /table.c | |
parent | 540dc65bcd16cd8ee2d6d2983036968ea388502b (diff) | |
download | lua-662e2fa5ccf1dfa0ebea571d6785009442ba3011.tar.gz lua-662e2fa5ccf1dfa0ebea571d6785009442ba3011.tar.bz2 lua-662e2fa5ccf1dfa0ebea571d6785009442ba3011.zip |
Modificaco para reservar espaco do byte para marcar constantes
pre-definidas.
Diffstat (limited to 'table.c')
-rw-r--r-- | table.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Module to control static tables | 3 | ** Module to control static tables |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_table="$Id: table.c,v 1.2 1993/12/22 21:15:16 roberto Exp celes $"; | 6 | char *rcs_table="$Id: table.c,v 1.3 1994/03/28 15:15:59 celes Exp celes $"; |
7 | 7 | ||
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <string.h> | 9 | #include <string.h> |
@@ -52,10 +52,18 @@ static struct List *searchlist=&o0; | |||
52 | #define MAXCONSTANT 256 | 52 | #define MAXCONSTANT 256 |
53 | #endif | 53 | #endif |
54 | /* pre-defined constants need garbage collection extra byte */ | 54 | /* pre-defined constants need garbage collection extra byte */ |
55 | static char *constantbuffer[MAXCONSTANT] = {" mark"+1," nil"+1, | 55 | static char tm[] = " mark"; |
56 | " number"+1, " string"+1, | 56 | static char ti[] = " nil"; |
57 | " table"+1, " function"+1, | 57 | static char tn[] = " number"; |
58 | " cfunction"+1, " userdata"+1 | 58 | static char ts[] = " string"; |
59 | static char tt[] = " table"; | ||
60 | static char tf[] = " function"; | ||
61 | static char tc[] = " cfunction"; | ||
62 | static char tu[] = " userdata"; | ||
63 | static char *constantbuffer[MAXCONSTANT] = {tm+1, ti+1, | ||
64 | tn+1, ts+1, | ||
65 | tt+1, tf+1, | ||
66 | tc+1, tu+1 | ||
59 | }; | 67 | }; |
60 | char **lua_constant = constantbuffer; | 68 | char **lua_constant = constantbuffer; |
61 | Word lua_nconstant=T_USERDATA+1; | 69 | Word lua_nconstant=T_USERDATA+1; |