dmitry                                   Mon, 05 Mar 2012 12:47:25 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=323908

Log:
Fixed module numbering

Changed paths:
    U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
    U   php/php-src/branches/PHP_5_4/Zend/zend_API.c
    U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-03-05 12:21:39 UTC 
(rev 323907)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-03-05 12:47:25 UTC 
(rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 /* this function doesn't check for too many parameters */
@@ -2184,7 +2183,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-       return ++module_count;
+       return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_4/Zend/zend_API.c
===================================================================
--- php/php-src/branches/PHP_5_4/Zend/zend_API.c        2012-03-05 12:21:39 UTC 
(rev 323907)
+++ php/php-src/branches/PHP_5_4/Zend/zend_API.c        2012-03-05 12:47:25 UTC 
(rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 static zend_module_entry **module_request_startup_handlers;
@@ -2381,7 +2380,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-       return ++module_count;
+       return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */


Modified: php/php-src/trunk/Zend/zend_API.c
===================================================================
--- php/php-src/trunk/Zend/zend_API.c   2012-03-05 12:21:39 UTC (rev 323907)
+++ php/php-src/trunk/Zend/zend_API.c   2012-03-05 12:47:25 UTC (rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 static zend_module_entry **module_request_startup_handlers;
@@ -2381,7 +2380,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-       return ++module_count;
+       return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to