Skip to content

Commit 2d47d13

Browse files
committed
Zend/zend_stack: convert ZEND_STACK_APPLY_* macros to enum
1 parent f4bfb9c commit 2d47d13

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Zend/zend_stack.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function
119119
}
120120

121121

122-
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg)
122+
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, zend_stack_apply_direction type, int (*apply_function)(void *element, void *arg), void *arg)
123123
{
124124
int i;
125125

Zend/zend_stack.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ typedef struct _zend_stack {
2828

2929
#define STACK_BLOCK_SIZE 16
3030

31+
typedef enum {
32+
ZEND_STACK_APPLY_TOPDOWN,
33+
ZEND_STACK_APPLY_BOTTOMUP,
34+
} zend_stack_apply_direction;
35+
3136
BEGIN_EXTERN_C()
3237
ZEND_API void zend_stack_init(zend_stack *stack, int size);
3338
ZEND_API int zend_stack_push(zend_stack *stack, const void *element);
@@ -39,11 +44,8 @@ ZEND_API void zend_stack_destroy(zend_stack *stack);
3944
ZEND_API void *zend_stack_base(const zend_stack *stack);
4045
ZEND_API int zend_stack_count(const zend_stack *stack);
4146
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
42-
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
47+
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, zend_stack_apply_direction type, int (*apply_function)(void *element, void *arg), void *arg);
4348
ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), bool free_elements);
4449
END_EXTERN_C()
4550

46-
#define ZEND_STACK_APPLY_TOPDOWN 1
47-
#define ZEND_STACK_APPLY_BOTTOMUP 2
48-
4951
#endif /* ZEND_STACK_H */

0 commit comments

Comments
 (0)