From: Michael Wallner Date: Thu, 1 Sep 2005 07:39:27 +0000 (+0000) Subject: - fix static property access (sizeof() vs. sizeof()-1) X-Git-Tag: RELEASE_0_13_0~34 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=b92a90d8c1fe85f2d178fca74b5afdf2265436c9;hp=a83c1c9e69c84c90c314332b544ea1d73cfa2fcf - fix static property access (sizeof() vs. sizeof()-1) --- diff --git a/http_response_object.c b/http_response_object.c index b25da77..ea24fd8 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -909,10 +909,6 @@ PHP_METHOD(HttpResponse, send) * HttpResponse::setCache(true); * HttpResponse::capture(); * // script follows - * // note that you need to call - * HttpResponse::send(); - * // at the end of the script unless - * // you use PHP-5.1 or greater * ?> * */ diff --git a/php_http_std_defs.h b/php_http_std_defs.h index bcd91ac..1d86564 100644 --- a/php_http_std_defs.h +++ b/php_http_std_defs.h @@ -216,12 +216,12 @@ typedef int STATUS; # define putObject(t, o) zend_objects_store_put(o, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) t## _free, NULL TSRMLS_CC); # define OBJ_PROP(o) (o)->zo.properties -# define DCL_STATIC_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n), (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC) -# define DCL_STATIC_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n), (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC) -# define DCL_STATIC_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC) -# define GET_STATIC_PROP_EX(ce, n) zend_std_get_static_property(ce, (#n), sizeof(#n), 0 TSRMLS_CC) -# define UPD_STATIC_PROP_EX(ce, t, n, v) zend_update_static_property_ ##t(ce, #n, sizeof(#n), (v) TSRMLS_CC) -# define SET_STATIC_PROP_EX(ce, n, v) zend_update_static_property(ce, #n, sizeof(#n), v TSRMLS_CC) +# define DCL_STATIC_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC) +# define DCL_STATIC_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC) +# define DCL_STATIC_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC) +# define GET_STATIC_PROP_EX(ce, n) zend_std_get_static_property(ce, (#n), sizeof(#n)-1, 0 TSRMLS_CC) +# define UPD_STATIC_PROP_EX(ce, t, n, v) zend_update_static_property_ ##t(ce, #n, sizeof(#n)-1, (v) TSRMLS_CC) +# define SET_STATIC_PROP_EX(ce, n, v) zend_update_static_property(ce, #n, sizeof(#n)-1, v TSRMLS_CC) # define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC) # define DCL_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC) @@ -233,7 +233,7 @@ typedef int STATUS; # define GET_PROP(o, n) GET_PROP_EX(o, getThis(), n) # define GET_PROP_EX(o, this, n) zend_read_property(o->zo.ce, this, (#n), sizeof(#n)-1, 0 TSRMLS_CC) -# define DCL_CONST(t, n, v) zend_declare_class_constant_ ##t(ce, (n), sizeof(n), (v) TSRMLS_CC) +# define DCL_CONST(t, n, v) zend_declare_class_constant_ ##t(ce, (n), sizeof(n)-1, (v) TSRMLS_CC) # define ACC_PROP_PRIVATE(ce, flags) ((flags & ZEND_ACC_PRIVATE) && (EG(scope) && ce == EG(scope)) # define ACC_PROP_PROTECTED(ce, flags) ((flags & ZEND_ACC_PROTECTED) && (zend_check_protected(ce, EG(scope))))