]> granicus.if.org Git - php/commitdiff
Align comments in xslt.c
authorSterling Hughes <sterling@php.net>
Sun, 9 Dec 2001 01:18:20 +0000 (01:18 +0000)
committerSterling Hughes <sterling@php.net>
Sun, 9 Dec 2001 01:18:20 +0000 (01:18 +0000)
First try at fixing funny resource free'ing problems with objects, don't
perform a zval seperation when we're directly saving a pointer to the SAX
or Scheme handlers

ext/xslt/sablot.c
ext/xslt/xslt.c

index c97b636afafc8b681c9a6ddb4ed70c5ace2ebaed..05b4c486ac95c952857b6694b405dddc550e1f78 100644 (file)
@@ -233,9 +233,6 @@ PHP_FUNCTION(xslt_set_sax_handlers)
             zend_hash_get_current_data(sax_handlers, (void **) &handler) == SUCCESS;
                 zend_hash_move_forward(sax_handlers)) {
 
-               /* Allocate the handler */
-               SEPARATE_ZVAL(handler);
-
                key_type = zend_hash_get_current_key(sax_handlers, &string_key, &num_key, 0);
                if (key_type == HASH_KEY_IS_LONG) {
                        convert_to_string_ex(handler);
@@ -246,18 +243,21 @@ PHP_FUNCTION(xslt_set_sax_handlers)
 
                /* Document handlers (document start, document end) */
                if (strcasecmp(string_key, "document") == 0) {
+                       SEPERATE_ZVAL(handler);
                        register_sax_handler_pair(&XSLT_SAX(handle).doc_start, 
                                                  &XSLT_SAX(handle).doc_end, 
                                                  handler);
                }
                /* Element handlers, start of an element, and end of an element */
                else if (strcasecmp(string_key, "element") == 0) {
+                       SEPERATE_ZVAL(handler);
                        register_sax_handler_pair(&XSLT_SAX(handle).element_start, 
                                                  &XSLT_SAX(handle).element_end, 
                                                  handler);
                }
                /* Namespace handlers, start of a namespace, end of a namespace */
                else if (strcasecmp(string_key, "namespace") == 0) {
+                       SEPERATE_ZVAL(handler);
                        register_sax_handler_pair(&XSLT_SAX(handle).namespace_start, 
                                                  &XSLT_SAX(handle).namespace_end, 
                                                  handler);
@@ -318,8 +318,6 @@ PHP_FUNCTION(xslt_set_scheme_handlers)
             zend_hash_get_current_data(scheme_handlers, (void **) &handler) == SUCCESS;
             zend_hash_move_forward(scheme_handlers)) {
 
-               SEPARATE_ZVAL(handler);
-
                key_type = zend_hash_get_current_key(scheme_handlers, &string_key, &num_key, 0);
                if (key_type == HASH_KEY_IS_LONG) {
                        php_error(E_NOTICE, "Numerical key %d (with value %s) being ignored in xslt_set_scheme_handlers()",
index 3e65d1fe88ae3650e2d413ddda1dad262afea8d6..e4025717aee2927758f265b6f57ca6222199b2d8 100644 (file)
@@ -217,9 +217,9 @@ extern void xslt_call_function(char *name,
                                zval **user_args, 
                                zval **retval)
 {
-       zval   ***argv;   /* Argument container, maps around for call_user_function_ex() */
-       int       error;  /* Error container */
-       int       idx;    /* Idx, when looping through and free'ing the arguments */
+       zval   ***argv;      /* Argument container, maps around for call_user_function_ex() */
+       int       error;     /* Error container */
+       int       idx;       /* Idx, when looping through and free'ing the arguments */
        TSRMLS_FETCH();      /* For TS mode, fetch the executor globals */
 
        argv = emalloc(argc * sizeof(zval **));