Skip to content
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

Merged
merged 1 commit into from
Dec 30, 2017
Merged

Conversation

Dystopian
Copy link
Contributor

When merged this pull request will:

  • add parentheses to GETVAR and ARR_SELECT macros;
  • remove superfluous parentheses in some scripts.

@@ -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})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ARRAY param [INDEX, DEFAULT])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Just an idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about BWC?

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

@commy2 commy2 added the kind/enhancement Release Notes: **IMPROVED:** label Dec 30, 2017
@commy2 commy2 added this to the 3.13.0 milestone Dec 30, 2017
@commy2 commy2 merged commit 89e1fc2 into acemod:master Dec 30, 2017
@Dystopian Dystopian deleted the add_macro_brackets branch December 30, 2017 18:15
@PabstMirror PabstMirror modified the milestones: 3.13.0, 3.12.1 Dec 31, 2017
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants