Re: [PHP4BETA] cvs: /php4/ext/standard parsedate.y

From: Date: Mon, 06 Dec 1999 18:15:22 +0000
Subject: Re: [PHP4BETA] cvs: /php4/ext/standard parsedate.y
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-7542@lists.php.net to get a copy of this message
At 17:45 06/12/1999 , Thies C. Arntzen wrote:
hi, i'm not mr. bison nor mr. flex - but from what i understand we need to do something to make parsedate thread-safe, right?
Not necessarily, if it doesn't use globals, then no. Either way, there's nothing magical about the argument that can be optionally sent to parsedate(). It's not as if changing the prototype to accept a void * pointer automatically makes the code thread safe; In particular, if you have nothing you need to pass in that pointer, you don't need it. Finally, that said, the parsedate parser should be hinting bison to be a pure parser, so that it'd be thread safe. I'll try to mess with it now. Zeev
tc On Mon, 6 Dec 1999, Zeev Suraski wrote:
zeev          Mon Dec  6 10:34:06 1999 EDT
Modified files:
    /php4/ext/standard        parsedate.y
Log: This is no longer needed. Note that we'll always need to undefine YYSTYPE, since the template bison generated .h file defines it if it's not already defined. Index: php4/ext/standard/parsedate.y diff -u php4/ext/standard/parsedate.y:1.10 php4/ext/standard/parsedate.y:1.11
--- php4/ext/standard/parsedate.y:1.10        Mon Dec  6 08:08:16 1999
+++ php4/ext/standard/parsedate.y     Mon Dec  6 10:34:05 1999
@@ -1,5 +1,5 @@ %{ -/* $Revision: 1.10 $ +/* $Revision: 1.11 $ ** ** Originally written by Steven M. Bellovin <smb@research.att.com> while ** at the University of North Carolina at Chapel Hill. Later tweaked by @@ -856,7 +856,7 @@ time_t parsedate(char *p, TIMEINFO *now) {
-     extern int date_parse (YYPARSE_PARAM_ARG);
+     extern int date_parse(void);
     struct tm                *tm, tmbuf;
     TIMEINFO         ti;
     time_t           Start;
@@ -887,7 +887,7 @@
     yyHaveRel = 0;
     yyHaveTime = 0;
-    if (date_parse(YYPARSE_PARAM_ARG) || yyHaveTime > 1 || yyHaveDate > 1)
+    if (date_parse() || yyHaveTime > 1 || yyHaveDate > 1)
      return -1;
     if (yyHaveDate || yyHaveTime) {
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net
Thies C. Arntzen                 "One Big-Mac, Small Fries and a Coke!"
Digital Collections             Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93                              20097 Hamburg / Germany
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.version4 (#7542) next »