Merge pull request #4 from CismonX/dev

merge changes
This commit is contained in:
CismonX 2019-06-12 11:27:48 +08:00 committed by GitHub
commit 394fdbf5f0
3 changed files with 9 additions and 9 deletions

3
.gitattributes vendored
View File

@ -1 +1,2 @@
*.h linguist-language=C *.h linguist-language=C
stubs/* linguist-documentation

View File

@ -7,7 +7,6 @@ php:
- 7.1 - 7.1
- 7.2 - 7.2
- 7.3 - 7.3
- nightly
script: script:
- phpize - phpize

View File

@ -21,14 +21,14 @@
#define CMP_G COLLECTIONS_G(cmp) #define CMP_G COLLECTIONS_G(cmp)
#define Z_COLLECTION_P(val) (Z_OBJ_P(val)->properties) #define Z_COLLECTION_P(val) (Z_OBJ_P(val)->properties)
#define THIS_COLLECTION Z_COLLECTION_P(getThis()) #define THIS_COLLECTION Z_COLLECTION_P(&EX(This))
#define PAIR_FIRST(obj) OBJ_PROP_NUM(obj, 0) #define PAIR_FIRST(obj) OBJ_PROP_NUM(obj, 0)
#define PAIR_SECOND(obj) OBJ_PROP_NUM(obj, 1) #define PAIR_SECOND(obj) OBJ_PROP_NUM(obj, 1)
#define IS_COLLECTION(val) \ #define IS_COLLECTION(val) \
Z_TYPE(val) == IS_OBJECT && Z_OBJCE(val) == collections_collection_ce (Z_TYPE(val) == IS_OBJECT && Z_OBJCE(val) == collections_collection_ce)
#define IS_PAIR(val) \ #define IS_PAIR(val) \
Z_TYPE(val) == IS_OBJECT && Z_OBJCE(val) == collections_pair_ce (Z_TYPE(val) == IS_OBJECT && Z_OBJCE(val) == collections_pair_ce)
#define SEPARATE_COLLECTION(ht, obj) \ #define SEPARATE_COLLECTION(ht, obj) \
if (GC_REFCOUNT(ht) > 1) { \ if (GC_REFCOUNT(ht) > 1) { \
@ -36,7 +36,7 @@
ht = Z_OBJ_P(obj)->properties = zend_array_dup(ht); \ ht = Z_OBJ_P(obj)->properties = zend_array_dup(ht); \
} }
#define SEPARATE_CURRENT_COLLECTION(ht) \ #define SEPARATE_CURRENT_COLLECTION(ht) \
SEPARATE_COLLECTION(ht, getThis()) SEPARATE_COLLECTION(ht, &EX(This))
#define INIT_FCI(fci, num_args) \ #define INIT_FCI(fci, num_args) \
zval params[num_args], retval; \ zval params[num_args], retval; \
@ -1270,7 +1270,7 @@ PHP_METHOD(Collection, copyOfRange)
PHP_METHOD(Collection, count) PHP_METHOD(Collection, count)
{ {
zend_long count; zend_long count;
collection_count_elements(getThis(), &count); collection_count_elements(&EX(This), &count);
RETVAL_LONG(count); RETVAL_LONG(count);
} }
@ -2324,7 +2324,7 @@ PHP_METHOD(Collection, onEach)
CALLBACK_KEYVAL_INVOKE(params, bucket); CALLBACK_KEYVAL_INVOKE(params, bucket);
zval_ptr_dtor(&retval); zval_ptr_dtor(&retval);
ZEND_HASH_FOREACH_END(); ZEND_HASH_FOREACH_END();
RETVAL_ZVAL(getThis(), 1, 0); RETVAL_ZVAL(&EX(This), 1, 0);
} }
PHP_METHOD(Collection, partition) PHP_METHOD(Collection, partition)
@ -3422,7 +3422,7 @@ PHP_METHOD(Pair, __construct)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
Z_TRY_ADDREF_P(first); Z_TRY_ADDREF_P(first);
Z_TRY_ADDREF_P(second); Z_TRY_ADDREF_P(second);
zend_object* current = Z_OBJ_P(getThis()); zend_object* current = Z_OBJ_P(&EX(This));
pair_update_first(current, first); pair_update_first(current, first);
pair_update_second(current, second); pair_update_second(current, second);
} }