com php-src: Move missing zend_hash_* macros from php dbg.h to zend_hash.h: Zend/zend_hash.h sapi /phpdbg/phpdbg.h
| From: | Bob Weinand | Date: | Tue, 28 Oct 2014 22:07:36 +0000 |
| Subject: | com php-src: Move missing zend_hash_* macros from php dbg.h to zend_hash.h: Zend/zend_hash.h sapi /phpdbg/phpdbg.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82833@lists.php.net to get a copy of this message | ||
Commit: 47fd168fede896f2e2f6752d7ffef67232b331f4
Author: Bob Weinand <bobwei9@hotmail.com> Tue, 28 Oct 2014 23:07:36 +0100
Parents: 66aead4b5f48e3496582d48474a3f4c3864cfe1d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=47fd168fede896f2e2f6752d7ffef67232b331f4
Log:
Move missing zend_hash_* macros from phpdbg.h to zend_hash.h
Changed paths:
M Zend/zend_hash.h
M sapi/phpdbg/phpdbg.h
Diff:
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 2b9beca..0ed47b4 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -539,6 +539,19 @@ static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht,
zend_u
return zv ? Z_PTR_P(zv) : NULL;
}
+static zend_always_inline void *zend_hash_index_add_mem(HashTable *ht, zend_ulong h, void *pData,
size_t size)
+{
+ zval tmp, *zv;
+
+ ZVAL_PTR(&tmp, NULL);
+ if ((zv = zend_hash_index_add(ht, h, &tmp))) {
+ Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ memcpy(Z_PTR_P(zv), pData, size);
+ return Z_PTR_P(zv);
+ }
+ return NULL;
+}
+
static zend_always_inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData)
{
zval tmp, *zv;
@@ -696,6 +709,11 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable
*ht,
_key = _p->key; \
_val = _z;
+#define ZEND_HASH_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \
+ ZEND_HASH_FOREACH(ht, 0); \
+ _h = _p->h; \
+ _ptr = Z_PTR_P(_z);
+
#define ZEND_HASH_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \
ZEND_HASH_FOREACH(ht, 0); \
_key = _p->key; \
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index 188431c..60d1239 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -70,29 +70,11 @@
# include "TSRM.h"
#endif
-#define ZEND_HASH_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \
- ZEND_HASH_FOREACH(ht, 0); \
- _h = _p->h; \
- _ptr = Z_PTR_P(_z);
-
#undef zend_hash_str_add
#define zend_hash_str_add_tmp(ht, key, len, pData) \
_zend_hash_str_add(ht, key, len, pData ZEND_FILE_LINE_CC)
#define zend_hash_str_add(....) zend_hash_str_add_tmp(__VA_ARGS__)
-static zend_always_inline void *zend_hash_index_add_mem(HashTable *ht, zend_ulong h, void *pData,
size_t size)
-{
- zval tmp, *zv;
-
- ZVAL_PTR(&tmp, NULL);
- if ((zv = zend_hash_index_add(ht, h, &tmp))) {
- Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
- memcpy(Z_PTR_P(zv), pData, size);
- return Z_PTR_P(zv);
- }
- return NULL;
-}
-
#ifdef HAVE_LIBREADLINE
# include <readline/readline.h>
# include <readline/history.h>