lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 468fbdbde749d5fe221adebf115f9594067b8da4
parent eb45f8b63166ac06330dbbd2b7c9224e4db9e2ca
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 24 Jun 1998 10:32:39 -0300

details

Diffstat:
Mlstate.h | 10+++++++---
Mlstrlib.c | 8++++----
2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/lstate.h b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 1.9 1998/06/02 20:37:04 roberto Exp roberto $ +** $Id: lstate.h,v 1.10 1998/06/19 16:14:09 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -7,6 +7,8 @@ #ifndef lstate_h #define lstate_h +#include <setjmp.h> + #include "lobject.h" #include "lua.h" @@ -39,9 +41,11 @@ typedef struct { } stringtable; +enum Status {LOCK, HOLD, FREE, COLLECTED}; + struct ref { TObject o; - enum {LOCK, HOLD, FREE, COLLECTED} status; + enum Status status; }; @@ -49,7 +53,7 @@ struct lua_State { /* thread-specific state */ struct Stack stack; /* Lua stack */ struct C_Lua_Stack Cstack; /* C2lua struct */ - void *errorJmp; /* current error recover point */ + jmp_buf *errorJmp; /* current error recover point */ char *Mbuffer; /* global buffer */ char *Mbuffbase; /* current first position of Mbuffer */ int Mbuffsize; /* size of Mbuffer */ diff --git a/lstrlib.c b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.14 1998/05/31 22:20:45 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.15 1998/06/19 16:14:09 roberto Exp roberto $ ** Standard library for strings and pattern-matching ** See Copyright Notice in lua.h */ @@ -302,19 +302,19 @@ static char *match (char *s, char *p, struct Capture *cap) switch (*ep) { case '*': { /* repetition */ char *res; - if (s1 && s1>s && (res = match(s1, p, cap))) + if (s1 && s1>s && ((res=match(s1, p, cap)) != NULL)) return res; p=ep+1; goto init; /* else return match(s, ep+1, cap); */ } case '?': { /* optional */ char *res; - if (s1 && (res = match(s1, ep+1, cap))) + if (s1 && ((res=match(s1, ep+1, cap)) != NULL)) return res; p=ep+1; goto init; /* else return match(s, ep+1, cap); */ } case '-': { /* repetition */ char *res; - if ((res = match(s, ep+1, cap)) != 0) + if ((res = match(s, ep+1, cap)) != NULL) return res; else if (s1 && s1>s) { s = s1;