diff options
author | Stanley Sufficool <ssufficool@php.net> | 2014-10-20 21:33:32 -0700 |
---|---|---|
committer | Stanley Sufficool <ssufficool@php.net> | 2014-10-20 21:33:32 -0700 |
commit | 8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch) | |
tree | ed51eb30a2cbc92b102557498fb3e4113da1bb07 /ext/intl/dateformat/dateformat_class.c | |
parent | 9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff) | |
parent | baddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff) | |
download | php-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz |
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits)
Extra comma
Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators
Simplification
zend_get_property_info_quick() cleanup and optimization
initialize lineno before calling compile file file in phar
Use ADDREF instead of DUP, it must be enough.
Removed old irrelevant comment
fixed compilation error
Fix bug #68262: Broken reference across cloned objects
export functions needed for phpdbg
Fixed compilation
Optimized property access handlers. Removed EG(std_property_info).
Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads)
Don't make difference between undefined and unaccessible properies when call __get() and family
Don't make useless CSE
array_pop/array_shift optimization
check for zlib headers as well as lib for mysqlnd
a realpath cache key can be int or float, catching this
News entry for new curl constants
News entry for new curl constants
...
Diffstat (limited to 'ext/intl/dateformat/dateformat_class.c')
-rw-r--r-- | ext/intl/dateformat/dateformat_class.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index 211c87f59f..0d93338ecd 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -35,16 +35,16 @@ static zend_object_handlers IntlDateFormatter_handlers; */ /* {{{ IntlDateFormatter_objects_dtor */ -static void IntlDateFormatter_object_dtor(void *object, zend_object_handle handle TSRMLS_DC ) +static void IntlDateFormatter_object_dtor(zend_object *object TSRMLS_DC ) { - zend_objects_destroy_object( object, handle TSRMLS_CC ); + zend_objects_destroy_object( object TSRMLS_CC ); } /* }}} */ /* {{{ IntlDateFormatter_objects_free */ void IntlDateFormatter_object_free( zend_object *object TSRMLS_DC ) { - IntlDateFormatter_object* dfo = (IntlDateFormatter_object*)object; + IntlDateFormatter_object* dfo = php_intl_dateformatter_fetch_object(object); zend_object_std_dtor( &dfo->zo TSRMLS_CC ); @@ -53,18 +53,15 @@ void IntlDateFormatter_object_free( zend_object *object TSRMLS_DC ) } dateformat_data_free( &dfo->datef_data TSRMLS_CC ); - - efree( dfo ); } /* }}} */ /* {{{ IntlDateFormatter_object_create */ -zend_object_value IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC) +zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC) { - zend_object_value retval; IntlDateFormatter_object* intern; - intern = ecalloc( 1, sizeof(IntlDateFormatter_object) ); + intern = ecalloc( 1, sizeof(IntlDateFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) ); dateformat_data_init( &intern->datef_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); object_properties_init(&intern->zo, ce); @@ -73,31 +70,25 @@ zend_object_value IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC intern->calendar = -1; intern->requested_locale = NULL; - retval.handle = zend_objects_store_put( - intern, - IntlDateFormatter_object_dtor, - (zend_objects_free_object_storage_t)IntlDateFormatter_object_free, - NULL TSRMLS_CC ); - retval.handlers = &IntlDateFormatter_handlers; + intern->zo.handlers = &IntlDateFormatter_handlers; - return retval; + return &intern->zo; } /* }}} */ /* {{{ IntlDateFormatter_object_clone */ -zend_object_value IntlDateFormatter_object_clone(zval *object TSRMLS_DC) +zend_object *IntlDateFormatter_object_clone(zval *object TSRMLS_DC) { - zend_object_value new_obj_val; - zend_object_handle handle = Z_OBJ_HANDLE_P(object); IntlDateFormatter_object *dfo, *new_dfo; + zend_object *new_obj; DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; - new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); - new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); + new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); + new_dfo = php_intl_dateformatter_fetch_object(new_obj); /* clone standard parts */ - zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC); + zend_objects_clone_members(&new_dfo->zo, &dfo->zo TSRMLS_CC); /* clone formatter object */ if (dfo->datef_data.udatf != NULL) { DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo)); @@ -110,7 +101,7 @@ zend_object_value IntlDateFormatter_object_clone(zval *object TSRMLS_DC) } else { zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC); } - return new_obj_val; + return new_obj; } /* }}} */ @@ -208,7 +199,10 @@ void dateformat_register_IntlDateFormatter_class( TSRMLS_D ) memcpy(&IntlDateFormatter_handlers, zend_get_std_object_handlers(), sizeof IntlDateFormatter_handlers); + IntlDateFormatter_handlers.offset = XtOffsetOf(IntlDateFormatter_object, zo); IntlDateFormatter_handlers.clone_obj = IntlDateFormatter_object_clone; + IntlDateFormatter_handlers.dtor_obj = IntlDateFormatter_object_dtor; + IntlDateFormatter_handlers.free_obj = IntlDateFormatter_object_free; /* Declare 'IntlDateFormatter' class properties. */ if( !IntlDateFormatter_ce_ptr ) |