[prev in list] [next in list] [prev in thread] [next in thread]
List: php-cvs
Subject: [PHP-CVS] =?utf-8?q?svn:_/php/php-src/_branches/PHP=5F5=5F4/ext/standard/php=5Fvar.h_trunk/ext/stand
From: Dmitry_Stogov <dmitry () php ! net>
Date: 2011-11-28 13:01:28
Message-ID: svn-dmitry-1322485288-320103-1960121392 () svn ! php ! net
[Download RAW message or body]
dmitry Mon, 28 Nov 2011 13:01:28 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=320103
Log:
Added implicit type casting to allow reusage of macros in C++ extensions (Yoram)
Changed paths:
U php/php-src/branches/PHP_5_4/ext/standard/php_var.h
U php/php-src/trunk/ext/standard/php_var.h
Modified: php/php-src/branches/PHP_5_4/ext/standard/php_var.h
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/php_var.h 2011-11-28 12:55:56 UTC (rev \
320102)
+++ php/php-src/branches/PHP_5_4/ext/standard/php_var.h 2011-11-28 13:01:28 UTC (rev \
320103) @@ -59,11 +59,11 @@
ALLOC_HASHTABLE(var_hash_ptr); \
zend_hash_init((var_hash_ptr), 10, NULL, NULL, 0); \
if (!BG(serialize_lock)) { \
- BG(serialize).var_hash = (var_hash_ptr); \
+ BG(serialize).var_hash = (void *)(var_hash_ptr); \
BG(serialize).level = 1; \
} \
} else { \
- (var_hash_ptr) = BG(serialize).var_hash; \
+ (var_hash_ptr) = (php_serialize_data_t)BG(serialize).var_hash; \
++BG(serialize).level; \
} \
} while(0)
@@ -76,8 +76,8 @@
FREE_HASHTABLE(var_hash_ptr); \
} else { \
if (!--BG(serialize).level) { \
- zend_hash_destroy(BG(serialize).var_hash); \
- FREE_HASHTABLE(BG(serialize).var_hash); \
+ zend_hash_destroy((php_serialize_data_t)BG(serialize).var_hash); \
+ FREE_HASHTABLE((php_serialize_data_t)BG(serialize).var_hash); \
BG(serialize).var_hash = NULL; \
} \
} \
@@ -87,13 +87,13 @@
do { \
/* fprintf(stderr, "UNSERIALIZE_INIT == lock: %u, level: %u\n", \
BG(serialize_lock), BG(unserialize).level); */ \ if (BG(serialize_lock) || \
!BG(unserialize).level) { \
- (var_hash_ptr) = ecalloc(1, sizeof(struct php_unserialize_data)); \
+ (var_hash_ptr) = (php_unserialize_data_t)ecalloc(1, sizeof(struct \
php_unserialize_data)); \ if (!BG(serialize_lock)) { \
- BG(unserialize).var_hash = (var_hash_ptr); \
+ BG(unserialize).var_hash = (void *)(var_hash_ptr); \
BG(unserialize).level = 1; \
} \
} else { \
- (var_hash_ptr) = BG(unserialize).var_hash; \
+ (var_hash_ptr) = (php_serialize_data_t)BG(unserialize).var_hash; \
++BG(unserialize).level; \
} \
} while (0)
Modified: php/php-src/trunk/ext/standard/php_var.h
===================================================================
--- php/php-src/trunk/ext/standard/php_var.h 2011-11-28 12:55:56 UTC (rev 320102)
+++ php/php-src/trunk/ext/standard/php_var.h 2011-11-28 13:01:28 UTC (rev 320103)
@@ -59,11 +59,11 @@
ALLOC_HASHTABLE(var_hash_ptr); \
zend_hash_init((var_hash_ptr), 10, NULL, NULL, 0); \
if (!BG(serialize_lock)) { \
- BG(serialize).var_hash = (var_hash_ptr); \
+ BG(serialize).var_hash = (void *)(var_hash_ptr); \
BG(serialize).level = 1; \
} \
} else { \
- (var_hash_ptr) = BG(serialize).var_hash; \
+ (var_hash_ptr) = (php_serialize_data_t)BG(serialize).var_hash; \
++BG(serialize).level; \
} \
} while(0)
@@ -76,8 +76,8 @@
FREE_HASHTABLE(var_hash_ptr); \
} else { \
if (!--BG(serialize).level) { \
- zend_hash_destroy(BG(serialize).var_hash); \
- FREE_HASHTABLE(BG(serialize).var_hash); \
+ zend_hash_destroy((php_serialize_data_t)BG(serialize).var_hash); \
+ FREE_HASHTABLE((php_serialize_data_t)BG(serialize).var_hash); \
BG(serialize).var_hash = NULL; \
} \
} \
@@ -87,13 +87,13 @@
do { \
/* fprintf(stderr, "UNSERIALIZE_INIT == lock: %u, level: %u\n", \
BG(serialize_lock), BG(unserialize).level); */ \ if (BG(serialize_lock) || \
!BG(unserialize).level) { \
- (var_hash_ptr) = ecalloc(1, sizeof(struct php_unserialize_data)); \
+ (var_hash_ptr) = (php_unserialize_data_t)ecalloc(1, sizeof(struct \
php_unserialize_data)); \ if (!BG(serialize_lock)) { \
- BG(unserialize).var_hash = (var_hash_ptr); \
+ BG(unserialize).var_hash = (void *)(var_hash_ptr); \
BG(unserialize).level = 1; \
} \
} else { \
- (var_hash_ptr) = BG(unserialize).var_hash; \
+ (var_hash_ptr) = (php_serialize_data_t)BG(unserialize).var_hash; \
++BG(unserialize).level; \
} \
} while (0)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic