-
Notifications
You must be signed in to change notification settings - Fork 736
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
Add parentheses to GETVAR macros #5995
Conversation
@@ -37,7 +37,7 @@ | |||
#define GETGVAR(var1,var2) GETMVAR(GVAR(var1),var2) | |||
#define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3) | |||
|
|||
#define ARR_SELECT(ARRAY,INDEX,DEFAULT) if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT} | |||
#define ARR_SELECT(ARRAY,INDEX,DEFAULT) (if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(ARRAY param [INDEX, DEFAULT])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ Just an idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also remove ARR_SELECT
which only has 1 use:
https://github.com/acemod/ACE3/search?utf8=%E2%9C%93&q=ARR_SELECT&type=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about BWC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACE's macros aren't supposed to be used by others, specially not one this archaic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they are: https://github.com/acemod/arma-project-template/blob/master/addons/main/script_macros.hpp
But this one can safely be removed as it plays no role anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, it can also stay as is. Doesn't have to be removed with this PR. I'm for merging this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will not update it
Add parentheses to GETVAR macros
When merged this pull request will:
GETVAR
andARR_SELECT
macros;