fixed Twig C extension

This commit is contained in:
Fabien Potencier
2012-02-28 23:09:42 +01:00
parent 8274e84d4e
commit 741b11c618
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -1,5 +1,6 @@
* 1.7.0-DEV * 1.7.0-DEV
* fixed Twig C extension
* removed the creation of Twig_Markup instances when not needed * removed the creation of Twig_Markup instances when not needed
* added a way to set the default global timezone for dates * added a way to set the default global timezone for dates
* fixed the slice filter on strings when the length is not specified * fixed the slice filter on strings when the length is not specified
+4 -4
View File
@@ -531,7 +531,7 @@ int TWIG_CALL_ZZ(zval *object, char *method, zval *arg1, zval *arg2 TSRMLS_DC)
# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0 # define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
#endif #endif
void TWIG_NEW(zval *object, char *class, zval *arg0 TSRMLS_DC, zval *arg1 TSRMLS_DC) void TWIG_NEW(zval *object, char *class, zval *arg0, zval *arg1 TSRMLS_DC)
{ {
zend_class_entry **pce; zend_class_entry **pce;
@@ -544,7 +544,7 @@ void TWIG_NEW(zval *object, char *class, zval *arg0 TSRMLS_DC, zval *arg1 TSRMLS
Z_SET_REFCOUNT_P(object, 1); Z_SET_REFCOUNT_P(object, 1);
Z_UNSET_ISREF_P(object); Z_UNSET_ISREF_P(object);
TWIG_CALL_ZZ(object, "__construct", arg0 TSRMLS_CC, arg1 TSRMLS_CC); TWIG_CALL_ZZ(object, "__construct", arg0, arg1 TSRMLS_CC);
} }
static int twig_add_array_key_to_string(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) static int twig_add_array_key_to_string(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
@@ -1001,8 +1001,8 @@ PHP_FUNCTION(twig_template_get_attributes)
} }
*/ */
if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) { if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) {
zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset" TSRMLS_CC, NULL TSRMLS_CC); zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC);
TWIG_NEW(return_value, "Twig_Markup", ret TSRMLS_CC, charset TSRMLS_CC); TWIG_NEW(return_value, "Twig_Markup", ret, charset TSRMLS_CC);
zval_ptr_dtor(&charset); zval_ptr_dtor(&charset);
if (ret) { if (ret) {
zval_ptr_dtor(&ret); zval_ptr_dtor(&ret);