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

Make point and tripoint abs functions into methods. #40106

Merged
merged 4 commits into from
May 4, 2020

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

As a minor cleanup, avoid using an essentially reserved keyword "abs" in the global namespace.

Describe the solution

Create point::abs() and tripoint::abs() and use them instead of abs( point ) and abs( tripoint ).

Describe alternatives you've considered

Renaming from abs to something else.
Namespacing the functions.
Ignoring it.

Testing

If it builds it should be fine.

@kevingranade kevingranade requested a review from KorGgenT as a code owner May 3, 2020 20:50
src/point.h Outdated Show resolved Hide resolved
src/point.h Outdated Show resolved Hide resolved
src/point.h Outdated Show resolved Hide resolved
src/point.h Outdated Show resolved Hide resolved
src/point.h Outdated Show resolved Hide resolved
src/point.h Outdated Show resolved Hide resolved
@ZhilkinSerg ZhilkinSerg merged commit 6d444b8 into CleverRaven:master May 4, 2020
@@ -72,6 +72,12 @@ struct point {
return point( x / rhs, y / rhs );
}

#ifndef CATA_NO_STL
inline point abs() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

inline is redundant; definitions inside the class definition are implicitly inline.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gah, the whole mandatory inline thing for non-members keeps tripping me up, will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants