Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.czend_constants.h
| From: | Moriyoshi Koizumi | Date: | Fri, 22 Aug 2003 18:57:01 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.czend_constants.h | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1663@lists.php.net to get a copy of this message | ||
Just out of my quick guess, but can we use a negative value instead of
LONG_MAX to fulfill the requirement?
Moriyoshi
"Ilia Alshanetsky" <iliaa@php.net> wrote:
> iliaa Fri Aug 22 14:50:13 2003 EDT
>
> Modified files:
> /ZendEngine2 zend_constants.h zend_builtin_functions.c
> Log:
> Replace *magic number* with a much nicer define.
>
>
> Index: ZendEngine2/zend_constants.h
> diff -u ZendEngine2/zend_constants.h:1.26 ZendEngine2/zend_constants.h:1.27
> --- ZendEngine2/zend_constants.h:1.26 Tue Jun 10 16:03:24 2003
> +++ ZendEngine2/zend_constants.h Fri Aug 22 14:50:12 2003
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: zend_constants.h,v 1.26 2003/06/10 20:03:24 imajes Exp $ */
> +/* $Id: zend_constants.h,v 1.27 2003/08/22 18:50:12 iliaa Exp $ */
>
> #ifndef ZEND_CONSTANTS_H
> #define ZEND_CONSTANTS_H
> @@ -26,6 +26,8 @@
>
> #define CONST_CS (1<<0) /* Case Sensitive */
> #define CONST_PERSISTENT (1<<1) /* Persistent */
> +
> +#define PHP_USER_CONSTANT LONG_MAX /* a constant defined in user space */
>
> typedef struct _zend_constant {
> zval value;
> Index: ZendEngine2/zend_builtin_functions.c
> diff -u ZendEngine2/zend_builtin_functions.c:1.205 ZendEngine2/zend_builtin_functions.c:1.206
> --- ZendEngine2/zend_builtin_functions.c:1.205 Thu Aug 21 22:08:10 2003
> +++ ZendEngine2/zend_builtin_functions.c Fri Aug 22 14:50:12 2003
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: zend_builtin_functions.c,v 1.205 2003/08/22 02:08:10 iliaa Exp $ */
> +/* $Id: zend_builtin_functions.c,v 1.206 2003/08/22 18:50:12 iliaa Exp $ */
>
> #include "zend.h"
> #include "zend_API.h"
> @@ -509,7 +509,7 @@
> c.flags = case_sensitive; /* non persistent */
> c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
> c.name_len = (*var)->value.str.len+1;
> - c.module_number = 2147483647;
> + c.module_number = PHP_USER_CONSTANT;
> if (zend_register_constant(&c TSRMLS_CC) == SUCCESS) {
> RETURN_TRUE;
> } else {
> @@ -1343,7 +1343,7 @@
> while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) !=
> FAILURE) {
> zval *const_val;
>
> - if (val->module_number == 2147483647) {
> + if (val->module_number == PHP_USER_CONSTANT) {
> module_number = i;
> } else if (val->module_number > i || val->module_number < 0) {
> /* should not happen */
>
>
>
> --
> Zend Engine CVS Mailing List (http://cvs.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>