From: Gurusamy Sarathy Date: Wed, 8 Dec 1999 02:02:33 +0000 (+0000) Subject: use SAVEINT() rather than SAVEDESTRUCTOR() for saving PL_expect etc. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bebdddfcca3c4bc8bb36ffcdf9e008f3b39772bf;p=p5sagit%2Fp5-mst-13.2.git use SAVEINT() rather than SAVEDESTRUCTOR() for saving PL_expect etc. p4raw-id: //depot/perl@4664 --- diff --git a/toke.c b/toke.c index a1704dc..9f3f3a1 100644 --- a/toke.c +++ b/toke.c @@ -28,8 +28,6 @@ static char ident_too_long[] = "Identifier too long"; static void restore_rsfp(pTHXo_ void *f); -static void restore_expect(pTHXo_ void *e); -static void restore_lex_expect(pTHXo_ void *e); #define UTF (PL_hints & HINT_UTF8) /* @@ -380,8 +378,8 @@ Perl_lex_start(pTHX_ SV *line) SAVEI32(PL_lex_defer); SAVEI32(PL_sublex_info.sub_inwhat); SAVESPTR(PL_lex_repl); - SAVEDESTRUCTOR_X(restore_expect, PL_tokenbuf + PL_expect); /* encode as pointer */ - SAVEDESTRUCTOR_X(restore_lex_expect, PL_tokenbuf + PL_lex_expect); + SAVEINT(PL_expect); + SAVEINT(PL_lex_expect); PL_lex_state = LEX_NORMAL; PL_lex_defer = 0; @@ -7034,29 +7032,3 @@ restore_rsfp(pTHXo_ void *f) PerlIO_close(PL_rsfp); PL_rsfp = fp; } - -/* - * restore_expect - * Restores the state of PL_expect when the lexing that begun with a - * start_lex() call has ended. - */ - -static void -restore_expect(pTHXo_ void *e) -{ - /* a safe way to store a small integer in a pointer */ - PL_expect = (expectation)((char *)e - PL_tokenbuf); -} - -/* - * restore_lex_expect - * Restores the state of PL_lex_expect when the lexing that begun with a - * start_lex() call has ended. - */ - -static void -restore_lex_expect(pTHXo_ void *e) -{ - /* a safe way to store a small integer in a pointer */ - PL_lex_expect = (expectation)((char *)e - PL_tokenbuf); -}