dmitry                                   Thu, 08 Jul 2010 07:38:59 +0000

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

Log:
Fixed checks for PHP_DEBUG macro

Changed paths:
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c
    U   php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c       2010-07-08 05:53:42 UTC 
(rev 301066)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c       2010-07-08 07:38:59 UTC 
(rev 301067)
@@ -626,7 +626,7 @@
 /* {{{ _mysqlnd_debug */
 PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
 {
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        MYSQLND_DEBUG *dbg = MYSQLND_G(dbg);
        if (!dbg) {
                MYSQLND_G(dbg) = dbg = 
mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
@@ -665,12 +665,12 @@

        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = emalloc(REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -697,12 +697,12 @@
        DBG_ENTER(mysqlnd_pemalloc_name);
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = pemalloc(REAL_SIZE(size), persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -733,12 +733,12 @@
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
        DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = ecalloc(nmemb, REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -765,12 +765,12 @@
        DBG_ENTER(mysqlnd_pecalloc_name);
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = pecalloc(nmemb, REAL_SIZE(size), persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -802,12 +802,12 @@
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
        DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, 
new_size);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = erealloc(REAL_PTR(ptr), REAL_SIZE(new_size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -835,12 +835,12 @@
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
        DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, 
old_size, new_size, persistent);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = perealloc(REAL_PTR(ptr), REAL_SIZE(new_size), persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -919,12 +919,12 @@
        DBG_ENTER(mysqlnd_malloc_name);
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = malloc(REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -950,12 +950,12 @@
        DBG_ENTER(mysqlnd_calloc_name);
        DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, 
PHP_DIR_SEPARATOR) + 1, __zend_lineno);

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = calloc(nmemb, REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;
@@ -983,12 +983,12 @@
        DBG_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
        DBG_INF_FMT("before: %lu", zend_memory_usage(TRUE TSRMLS_CC));

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        /* -1 is also "true" */
        if (*threshold) {
 #endif
                ret = realloc(REAL_PTR(ptr), REAL_SIZE(new_size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
                --*threshold;
        } else if (*threshold == 0) {
                ret = NULL;

Modified: php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c 2010-07-08 05:53:42 UTC (rev 
301066)
+++ php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c 2010-07-08 07:38:59 UTC (rev 
301067)
@@ -185,7 +185,7 @@
        STD_PHP_INI_ENTRY("mysqlnd.log_mask",                           "0",    
PHP_INI_ALL,    OnUpdateLong,   log_mask, zend_mysqlnd_globals, mysqlnd_globals)
        STD_PHP_INI_ENTRY("mysqlnd.mempool_default_size","16000",   
PHP_INI_ALL,        OnUpdateLong,   mempool_default_size,   
zend_mysqlnd_globals,           mysqlnd_globals)

-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        STD_PHP_INI_ENTRY("mysqlnd.debug_emalloc_fail_threshold","-1",   
PHP_INI_SYSTEM,        OnUpdateLong,   debug_emalloc_fail_threshold,   
zend_mysqlnd_globals,           mysqlnd_globals)
        STD_PHP_INI_ENTRY("mysqlnd.debug_ecalloc_fail_threshold","-1",   
PHP_INI_SYSTEM,        OnUpdateLong,   debug_ecalloc_fail_threshold,   
zend_mysqlnd_globals,           mysqlnd_globals)
        STD_PHP_INI_ENTRY("mysqlnd.debug_erealloc_fail_threshold","-1",   
PHP_INI_SYSTEM,       OnUpdateLong,   debug_erealloc_fail_threshold,  
zend_mysqlnd_globals,           mysqlnd_globals)
@@ -222,12 +222,11 @@
 /* }}} */


-#if defined(PHP_DEBUG)
+#if PHP_DEBUG
 /* {{{ PHP_RINIT_FUNCTION
  */
 static PHP_RINIT_FUNCTION(mysqlnd)
 {
-#if defined(PHP_DEBUG)
        if (MYSQLND_G(debug)) {
                MYSQLND_DEBUG *dbg = 
mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
                if (!dbg) {
@@ -236,14 +235,13 @@
                dbg->m->set_mode(dbg, MYSQLND_G(debug));
                MYSQLND_G(dbg) = dbg;
        }
-#endif
        return SUCCESS;
 }
 /* }}} */
 #endif


-#if defined(PHP_DEBUG)
+#if PHP_DEBUG
 /* {{{ PHP_RSHUTDOWN_FUNCTION
  */
 static PHP_RSHUTDOWN_FUNCTION(mysqlnd)
@@ -277,12 +275,12 @@
        mysqlnd_functions,
        PHP_MINIT(mysqlnd),
        PHP_MSHUTDOWN(mysqlnd),
-#if defined(PHP_DEBUG)
+#if PHP_DEBUG
        PHP_RINIT(mysqlnd),
 #else
        NULL,
 #endif
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
        PHP_RSHUTDOWN(mysqlnd),
 #else
        NULL,

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

Reply via email to