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

Fix C++ warnings #1843

Closed
wants to merge 1 commit into from
Closed

Fix C++ warnings #1843

wants to merge 1 commit into from

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented May 30, 2022

Fixes

  • Rewrote operations to align more literally with the function's intentions
  • Clarify what happens in support.cpp

@AZero13 AZero13 force-pushed the cpp-cleanup branch 30 times, most recently from a04c547 to 254d71c Compare June 3, 2022 15:36
@AZero13 AZero13 requested review from tian-lt and mingxwa and removed request for tian-lt and mingxwa August 31, 2022 14:38
@AZero13 AZero13 force-pushed the cpp-cleanup branch 4 times, most recently from c74b411 to ecba254 Compare September 5, 2022 17:23
@AraHaan
Copy link

AraHaan commented Sep 6, 2022

A link to what I think about the warning fixes: microsoft/STL#3079 (comment)

@AZero13
Copy link
Contributor Author

AZero13 commented Sep 15, 2022

A lot of these changes are modernizations. Every single refactoring has been thoroughly tested and there is no behavioral change outside of some functions being changed to an equivalent form.

@AraHaan
Copy link

AraHaan commented Sep 16, 2022

Can you please stop rebasing and pushing? Microsoft usually do squash merging anyway so your rebases are moot.

@AZero13 AZero13 force-pushed the cpp-cleanup branch 4 times, most recently from cb51232 to 774c672 Compare September 21, 2022 14:18
@AZero13 AZero13 requested review from mingxwa and tian-lt and removed request for tian-lt and mingxwa September 21, 2022 14:29
Check for exactly 1 before using the singular noun, rather than check for greater than 1, just in case somehow the variable being evaluated ends up as 0

In addition, should this code ever be refactored in such a way that the check to 0 is changed, this will ensure the end result does not change. In addition, it is naturally immediately apparent to the developers what is going on, potentially enhancing maintainability.

Additionally, make bitwise operations more obvious in their intentions.

Fix unused parameters in functions by using [[maybe_unused]]
@mcooley
Copy link
Member

mcooley commented Sep 22, 2022

Thanks for all the work you've put into this PR! Unfortunately, this change is too big for us to review. The feedback you received in the microsoft/STL repo (microsoft/STL#3079 (comment)) is good advice here in microsoft/calculator too. We would be happy to take many of these changes, but please break them into smaller PRs with good descriptions.

@mcooley mcooley closed this Sep 22, 2022
@AraHaan
Copy link

AraHaan commented Sep 23, 2022

Also consider forgetting how to rebase and force push as it's only ever needed ONLY if you accidentally push credentials onto github like API tokens (to quickly remove them) but then again, they will instantly become invalidated if they are github ones.

That should be the ONLY reason to force push, other than for merge conflicts (unless Microsoft says otherwise which they keep telling you to not do it).

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.

5 participants