com php-src: Remove superfluous checks of register_internal _class retval: ext/intl/calendar/calendar_class.cpp
ext/intl/dateformat/dateformat_class.c ext/intl/format ter/formatter_class.c ext/intl/msgformat/msgformat_clas s.c
ext/intl/resourcebundle/resourcebundle_class.c ex t/intl/spoofchecker/spoofchecker_class.c

From: Date: Fri, 25 Aug 2017 20:08:59 +0000
Subject: com php-src: Remove superfluous checks of register_internal _class retval: ext/intl/calendar/calendar_class.cpp
ext/intl/dateformat/dateformat_class.c ext/intl/format ter/formatter_class.c ext/intl/msgformat/msgformat_clas s.c
ext/intl/resourcebundle/resourcebundle_class.c ex t/intl/spoofchecker/spoofchecker_class.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99164@lists.php.net to get a copy of this message
Commit: fc7cfe1c0e5b44cce5fe5c9c410e67efe4c0b7e1 Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 25 Aug 2017 22:08:59 +0200 Parents: 1b3111e4f227b629d3071f365b486144856c2c4c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fc7cfe1c0e5b44cce5fe5c9c410e67efe4c0b7e1 Log: Remove superfluous checks of register_internal_class retval Changed paths: M ext/intl/calendar/calendar_class.cpp M ext/intl/dateformat/dateformat_class.c M ext/intl/formatter/formatter_class.c M ext/intl/msgformat/msgformat_class.c M ext/intl/resourcebundle/resourcebundle_class.c M ext/intl/spoofchecker/spoofchecker_class.c Diff: diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index e9c817a..41d8dd4 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -456,12 +456,7 @@ void calendar_register_IntlCalendar_class(void) INIT_CLASS_ENTRY(ce, "IntlCalendar", Calendar_class_functions); ce.create_object = Calendar_object_create; Calendar_ce_ptr = zend_register_internal_class(&ce); - if (!Calendar_ce_ptr) { - //can't happen now without bigger problems before - php_error_docref0(NULL, E_ERROR, - "IntlCalendar: class registration has failed."); - return; - } + memcpy( &Calendar_handlers, zend_get_std_object_handlers(), sizeof Calendar_handlers); Calendar_handlers.offset = XtOffsetOf(Calendar_object, zo); @@ -525,11 +520,5 @@ void calendar_register_IntlCalendar_class(void) INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions); GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce, Calendar_ce_ptr); - if (!GregorianCalendar_ce_ptr) { - //can't happen know without bigger problems before - php_error_docref0(NULL, E_ERROR, - "IntlGregorianCalendar: class registration has failed."); - return; - } } /* }}} */ diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index 3b1345f..572a3b3 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -202,12 +202,5 @@ void dateformat_register_IntlDateFormatter_class( void ) 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 ) - { - zend_error(E_ERROR, "Failed to register IntlDateFormatter class"); - return; - } } /* }}} */ diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c index bf4387b..ef54de9 100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.c @@ -189,13 +189,6 @@ void formatter_register_class( void ) NumberFormatter_handlers.offset = XtOffsetOf(NumberFormatter_object, zo); NumberFormatter_handlers.clone_obj = NumberFormatter_object_clone; NumberFormatter_handlers.free_obj = NumberFormatter_object_free; - - /* Declare 'NumberFormatter' class properties. */ - if( !NumberFormatter_ce_ptr ) - { - zend_error(E_ERROR, "Failed to register NumberFormatter class"); - return; - } } /* }}} */ diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c index 90dac81..954dcfd 100644 --- a/ext/intl/msgformat/msgformat_class.c +++ b/ext/intl/msgformat/msgformat_class.c @@ -157,14 +157,6 @@ void msgformat_register_class( void ) MessageFormatter_handlers.offset = XtOffsetOf(MessageFormatter_object, zo); MessageFormatter_handlers.clone_obj = MessageFormatter_object_clone; MessageFormatter_handlers.free_obj = MessageFormatter_object_free; - - - /* Declare 'MessageFormatter' class properties. */ - if( !MessageFormatter_ce_ptr ) - { - zend_error(E_ERROR, "Failed to register MessageFormatter class"); - return; - } } /* }}} */ diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 47d9bf0..f9d4bb1 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -446,12 +446,6 @@ void resourcebundle_register_class( void ) ResourceBundle_ce_ptr = zend_register_internal_class( &ce ); - if( !ResourceBundle_ce_ptr ) - { - zend_error(E_ERROR, "Failed to register ResourceBundle class"); - return; - } - ResourceBundle_object_handlers = std_object_handlers; ResourceBundle_object_handlers.offset = XtOffsetOf(ResourceBundle_object, zend); ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */ diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c index 5cfc27d..3edb41e 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.c +++ b/ext/intl/spoofchecker/spoofchecker_class.c @@ -141,13 +141,6 @@ void spoofchecker_register_Spoofchecker_class(void) Spoofchecker_handlers.offset = XtOffsetOf(Spoofchecker_object, zo); Spoofchecker_handlers.clone_obj = spoofchecker_clone_obj; Spoofchecker_handlers.free_obj = Spoofchecker_objects_free; - - if (!Spoofchecker_ce_ptr) { - zend_error(E_ERROR, - "Spoofchecker: attempt to create properties " - "on a non-registered class."); - return; - } } /* }}} */

« previous php.cvs (#99164) next »