CVS update: php3

From: Date: Tue, 01 Sep 1998 15:54:03 +0000
Subject: CVS update: php3
Groups: php.dev 
Request: Send a blank email to php-dev+get-711@lists.php.net to get a copy of this message
Date: Tuesday September 1, 1998 @ 11:54 Author: zeev Update of /repository/php3 In directory asf:/u2/tmp/cvs-serv26117 Modified Files: ChangeLog token_cache.c Log Message: Generalizations & optimizations for token_cache.c Should fix bug #703 Index: php3/ChangeLog diff -c php3/ChangeLog:1.469 php3/ChangeLog:1.470 *** php3/ChangeLog:1.469 Tue Sep 1 09:28:53 1998 --- php3/ChangeLog Tue Sep 1 11:54:01 1998 *************** *** 1,6 **** --- 1,9 ---- PHP 3.0 CHANGE LOG ChangeLog ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Version 3.0.4 + - Generalized some internal functions in order to better support calling + user-level functions from C code. Fixes a few sporadic problems related + to constructors inside eval() and more. - Fixed an endless loop in explode(), strstr() and strpos() in case of an invalid empty delimiter. - rand() now accepts two optional arguments, which denote the requested range Index: php3/token_cache.c diff -c php3/token_cache.c:1.87 php3/token_cache.c:1.88 *** php3/token_cache.c:1.87 Tue Jul 28 18:00:05 1998 --- php3/token_cache.c Tue Sep 1 11:54:02 1998 *************** *** 29,35 **** */ ! /* $Id: token_cache.c,v 1.87 1998/07/28 22:00:05 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 29,35 ---- */ ! /* $Id: token_cache.c,v 1.88 1998/09/01 15:54:02 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 200,212 **** /* switch tokens between start to middle-1, and middle+1 to end */ int tc_switch(TokenCacheManager *tcm, int start, int end, int middle) { ! TokenCache *tc = &tcm->token_caches[start / MAX_TOKENS_PER_CACHE]; Token *temp_tokens, middle_token; int first_chunk, second_chunk, i; ! start -= (tcm->active)*MAX_TOKENS_PER_CACHE; ! end -= (tcm->active)*MAX_TOKENS_PER_CACHE; ! middle -= (tcm->active)*MAX_TOKENS_PER_CACHE; if (start < 0 || end >= tc->count || middle < start || middle > end) { return FAILURE; --- 200,214 ---- /* switch tokens between start to middle-1, and middle+1 to end */ int tc_switch(TokenCacheManager *tcm, int start, int end, int middle) { ! int active = start/MAX_TOKENS_PER_CACHE; ! TokenCache *tc = &tcm->token_caches[active]; Token *temp_tokens, middle_token; int first_chunk, second_chunk, i; ! ! start %= MAX_TOKENS_PER_CACHE; ! end %= MAX_TOKENS_PER_CACHE; ! middle %= MAX_TOKENS_PER_CACHE; if (start < 0 || end >= tc->count || middle < start || middle > end) { return FAILURE; *************** *** 237,243 **** tc->tokens[start + second_chunk] = middle_token; for (i = start; i <= end; i++) { ! tc->tokens[i].phplval.offset = (tcm->active) * MAX_TOKENS_PER_CACHE + i; } return SUCCESS; } --- 239,245 ---- tc->tokens[start + second_chunk] = middle_token; for (i = start; i <= end; i++) { ! tc->tokens[i].phplval.offset = active * MAX_TOKENS_PER_CACHE + i; } return SUCCESS; } *************** *** 245,253 **** inline int tc_set_token(TokenCacheManager *tcm, int offset, int type) { ! TokenCache *tc = &tcm->token_caches[offset / MAX_TOKENS_PER_CACHE]; ! offset -= tcm->active * MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } --- 247,255 ---- inline int tc_set_token(TokenCacheManager *tcm, int offset, int type) { ! TokenCache *tc = &tcm->token_caches[offset/MAX_TOKENS_PER_CACHE]; ! offset %= MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } *************** *** 259,267 **** inline int tc_get_token(TokenCacheManager *tcm, int offset) { ! TokenCache *tc = &tcm->token_caches[offset / MAX_TOKENS_PER_CACHE]; ! offset -= tcm->active * MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } --- 261,269 ---- inline int tc_get_token(TokenCacheManager *tcm, int offset) { ! TokenCache *tc = &tcm->token_caches[offset/MAX_TOKENS_PER_CACHE]; ! offset %= MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } *************** *** 279,285 **** { TokenCache *tc = &tcm->token_caches[offset / MAX_TOKENS_PER_CACHE]; ! offset -= tcm->active * MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } --- 281,287 ---- { TokenCache *tc = &tcm->token_caches[offset / MAX_TOKENS_PER_CACHE]; ! offset %= MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } *************** *** 293,299 **** { TokenCache *tc = &tcm->token_caches[offset / MAX_TOKENS_PER_CACHE]; ! offset -= tcm->active * MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } --- 295,301 ---- { TokenCache *tc = &tcm->token_caches[offset / MAX_TOKENS_PER_CACHE]; ! offset %= MAX_TOKENS_PER_CACHE; if (offset < 0 || offset >= tc->count) { return FAILURE; } -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#711) next »