-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Two enum
s instead of preprocessor macros
#10617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,11 @@ typedef struct _zend_stack { | |
|
||
#define STACK_BLOCK_SIZE 16 | ||
|
||
typedef enum { | ||
ZEND_STACK_APPLY_TOPDOWN, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks correct in general, just curiosity question : what led you to change the original values ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reviewed all code locations where they are used, also checked the commit which added them (9c754da), and figured these were arbitrary values with no meaning. I also figured that zero (for which there is no macro) isn't a special case, for example by casting to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds fair. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
please - add this to commit message. and pretty please, with sugar on top - write BIG commit messages to explain next guy WHY this is done. You do a lot of good work, but not explain what and why was done. |
||
ZEND_STACK_APPLY_BOTTOMUP, | ||
} zend_stack_apply_direction; | ||
|
||
BEGIN_EXTERN_C() | ||
ZEND_API void zend_stack_init(zend_stack *stack, int size); | ||
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); | |
ZEND_API void *zend_stack_base(const zend_stack *stack); | ||
ZEND_API int zend_stack_count(const zend_stack *stack); | ||
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)); | ||
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg); | ||
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); | ||
ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), bool free_elements); | ||
END_EXTERN_C() | ||
|
||
#define ZEND_STACK_APPLY_TOPDOWN 1 | ||
#define ZEND_STACK_APPLY_BOTTOMUP 2 | ||
|
||
#endif /* ZEND_STACK_H */ |
Uh oh!
There was an error while loading. Please reload this page.