davidw          Sun Oct  7 21:47:36 2007 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysqlnd        mysqlnd_alloc.c mysqlnd_palloc.c mysqlnd_ps.c 
                                mysqlnd_result.c 
  Log:
  Fix build for mysqlnd
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_alloc.c?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_alloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_alloc.c:1.1.2.1 
php-src/ext/mysqlnd/mysqlnd_alloc.c:1.1.2.2
--- php-src/ext/mysqlnd/mysqlnd_alloc.c:1.1.2.1 Fri Oct  5 21:23:56 2007
+++ php-src/ext/mysqlnd/mysqlnd_alloc.c Sun Oct  7 21:47:36 2007
@@ -19,7 +19,7 @@
 
 */
 
-/* $Id: mysqlnd_alloc.c,v 1.1.2.1 2007/10/05 21:23:56 andrey Exp $ */
+/* $Id: mysqlnd_alloc.c,v 1.1.2.2 2007/10/07 21:47:36 davidw Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_priv.h"
@@ -174,7 +174,7 @@
 
 void mysqlnd_alloc_zval_ptr_dtor(zval **zv, MYSQLND_ZVAL_CACHE * const cache)
 {
-       if (!cache || ZVAL_REFCOUNT(*zv) > 1 || cache->max_items == 
cache->free_items) {
+       if (!cache || Z_REFCOUNT_PP(zv) > 1 || cache->max_items == 
cache->free_items) {
 #ifndef MYSQLND_SILENT
                php_printf("[mysqlnd_alloc_zval_ptr_dtor %p]1 last_added-1=%p 
*zv=%p\n", cache->free_list->last_added, *zv);
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_palloc.c?r1=1.2.2.2&r2=1.2.2.3&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_palloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_palloc.c:1.2.2.2 
php-src/ext/mysqlnd/mysqlnd_palloc.c:1.2.2.3
--- php-src/ext/mysqlnd/mysqlnd_palloc.c:1.2.2.2        Fri Oct  5 21:23:56 2007
+++ php-src/ext/mysqlnd/mysqlnd_palloc.c        Sun Oct  7 21:47:36 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_palloc.c,v 1.2.2.2 2007/10/05 21:23:56 andrey Exp $ */
+/* $Id: mysqlnd_palloc.c,v 1.2.2.3 2007/10/07 21:47:36 davidw Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_priv.h"
@@ -76,7 +76,7 @@
                INIT_PZVAL(&(ret->block[i].zv));
                ZVAL_NULL(&(ret->block[i].zv));
                /* Assure it will never be freed before MSHUTDOWN */
-               ZVAL_ADDREF(&(ret->block[i].zv));
+               Z_ADDREF_P(&(ret->block[i].zv));
                /* 2. Add to the free list  */
                *(--ret->free_list.last_added) = &(ret->block[i]);
        }
@@ -328,7 +328,7 @@
        } else {
                /* This will set the refcount to 1, increase it, to keep the 
variable */
                INIT_PZVAL(&((mysqlnd_zval *) ret)->zv);
-               ZVAL_ADDREF(&(((mysqlnd_zval *)ret)->zv));
+               Z_ADDREF_P(&(((mysqlnd_zval *)ret)->zv));
        }
 
        DBG_INF_FMT("allocated=%d ret=%p", *allocated, ret);
@@ -347,7 +347,7 @@
                                thd_cache,
                                thd_cache->parent? 
thd_cache->parent->block:NULL,
                                thd_cache->parent? 
thd_cache->parent->last_in_block:NULL,
-                               *zv, ZVAL_REFCOUNT(*zv), type);
+                               *zv, Z_REFCOUNT_PP(zv), type);
        *copy_ctor_called = FALSE;
        /* Check whether cache is used and the zval is from the cache */
        if (!thd_cache || !(cache = thd_cache->parent) || ((char *)*zv < (char 
*)thd_cache->parent->block ||
@@ -359,7 +359,7 @@
                */
                if (type == MYSQLND_RES_PS_BUF || type == MYSQLND_RES_PS_UNBUF) 
{
                        ; /* do nothing, zval_ptr_dtor will do the job*/
-               } else if (ZVAL_REFCOUNT(*zv) > 1) {
+               } else if (Z_REFCOUNT_PP(zv) > 1) {
                        /*
                          Not a prepared statement, then we have to
                          call copy_ctor and then zval_ptr_dtor()
@@ -388,8 +388,8 @@
        }
 
        /* The zval is from our cache */
-       /* refcount is always > 1, because we call ZVAL_ADDREF(). Thus test 
refcount > 2 */
-       if (ZVAL_REFCOUNT(*zv) > 2) {
+       /* refcount is always > 1, because we call Z_ADDREF_P(). Thus test 
refcount > 2 */
+       if (Z_REFCOUNT_PP(zv) > 2) {
                /*
                  Because the zval is first element in mysqlnd_zval structure, 
then we can
                  do upcasting from zval to mysqlnd_zval here. Because we know 
that this
@@ -435,7 +435,7 @@
                ++cache->put_hits;
                ++cache->free_items;
                ((mysqlnd_zval *)*zv)->point_type = MYSQLND_POINTS_FREE;
-               ZVAL_DELREF(*zv);       /* Make it 1 */
+               Z_DELREF_PP(zv);        /* Make it 1 */
                ZVAL_NULL(*zv);
 #ifdef ZTS
                memset(&((mysqlnd_zval *)*zv)->thread_id, 0, sizeof(THREAD_T));
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_ps.c?r1=1.3.2.2&r2=1.3.2.3&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_ps.c
diff -u php-src/ext/mysqlnd/mysqlnd_ps.c:1.3.2.2 
php-src/ext/mysqlnd/mysqlnd_ps.c:1.3.2.3
--- php-src/ext/mysqlnd/mysqlnd_ps.c:1.3.2.2    Fri Oct  5 21:23:56 2007
+++ php-src/ext/mysqlnd/mysqlnd_ps.c    Sun Oct  7 21:47:36 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_ps.c,v 1.3.2.2 2007/10/05 21:23:56 andrey Exp $ */
+/* $Id: mysqlnd_ps.c,v 1.3.2.3 2007/10/07 21:47:36 davidw Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_wireprotocol.h"
@@ -1149,7 +1149,7 @@
                        DBG_INF_FMT("%d is of type %d", i, 
stmt->param_bind[i].type);
                        if (stmt->param_bind[i].type != MYSQL_TYPE_LONG_BLOB) {
                                /* Prevent from freeing */
-                               ZVAL_ADDREF(stmt->param_bind[i].zv);
+                               Z_ADDREF_P(stmt->param_bind[i].zv);
                                /* Don't update is_ref, or we will leak during 
conversion */
                        } else {
                                stmt->param_bind[i].zv = NULL;
@@ -1197,7 +1197,7 @@
                stmt->result_bind = result_bind;
                for (i = 0; i < stmt->field_count; i++) {
                        /* Prevent from freeing */
-                       ZVAL_ADDREF(stmt->result_bind[i].zv);           
+                       Z_ADDREF_P(stmt->result_bind[i].zv);            
                        /*
                          Don't update is_ref !!! it's not our job
                          Otherwise either 009.phpt or 
mysqli_stmt_bind_result.phpt
@@ -1494,12 +1494,12 @@
        for (i = 0; i < stmt->field_count; i++) {
                /* Let's try with no cache */
                if (stmt->result_bind[i].bound == TRUE) {
-                       DBG_INF_FMT("%d has refcount=%u", i, 
ZVAL_REFCOUNT(stmt->result_bind[i].zv));
+                       DBG_INF_FMT("%d has refcount=%u", i, 
Z_REFCOUNT_P(stmt->result_bind[i].zv));
                        /*
                          We have to separate the actual zval value of the bound
                          variable from our allocated zvals or we will face 
double-free
                        */
-                       if (ZVAL_REFCOUNT(stmt->result_bind[i].zv) > 1) {
+                       if (Z_REFCOUNT_P(stmt->result_bind[i].zv) > 1) {
 #ifdef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
                                zval_copy_ctor(stmt->result_bind[i].zv);
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_result.c?r1=1.4.2.2&r2=1.4.2.3&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_result.c
diff -u php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.2 
php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.3
--- php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.2        Fri Oct  5 21:23:56 2007
+++ php-src/ext/mysqlnd/mysqlnd_result.c        Sun Oct  7 21:47:36 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_result.c,v 1.4.2.2 2007/10/05 21:23:56 andrey Exp $ */
+/* $Id: mysqlnd_result.c,v 1.4.2.3 2007/10/07 21:47:36 davidw Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_wireprotocol.h"
@@ -539,10 +539,10 @@
                                }
 
                                /* Forbid ZE to free it, we will clean it */
-                               ZVAL_ADDREF(data);
+                               Z_ADDREF_P(data);
 
                                if ((flags & MYSQLND_FETCH_BOTH) == 
MYSQLND_FETCH_BOTH) {
-                                       ZVAL_ADDREF(data);
+                                       Z_ADDREF_P(data);
                                }
                                if (flags & MYSQLND_FETCH_NUM) {
                                        zend_hash_next_index_insert(row_ht, 
&data, sizeof(zval *), NULL);
@@ -671,10 +671,10 @@
                          Let us later know what to do with this zval. If 
ref_count > 1, we will just
                          decrease it, otherwise free it. zval_ptr_dtor() make 
this very easy job.
                        */
-                       ZVAL_ADDREF(data);
+                       Z_ADDREF_P(data);
                        
                        if ((flags & MYSQLND_FETCH_BOTH) == MYSQLND_FETCH_BOTH) 
{
-                               ZVAL_ADDREF(data);
+                               Z_ADDREF_P(data);
                        }
                        if (flags & MYSQLND_FETCH_NUM) {
                                zend_hash_next_index_insert(Z_ARRVAL_P(row), 
&data, sizeof(zval *), NULL);
@@ -1138,7 +1138,7 @@
 
        *return_value = **entry;
        zval_copy_ctor(return_value);
-       ZVAL_REFCOUNT(return_value) = 1;
+       Z_SET_REFCOUNT_P(return_value, 1);
        zval_dtor(&row);
 
        DBG_VOID_RETURN;

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

Reply via email to