Changed macro constants to constexpr variables #270#487
Changed macro constants to constexpr variables #270#487StephanTLavavej merged 13 commits intomicrosoft:masterfrom
Conversation
This reverts commit 7e5b7b3.
BillyONeal
left a comment
There was a problem hiding this comment.
Perhaps we should make them less SHOUTY given that they're no longer macros?
|
hmm yeah I've been think about that too. |
|
Existing stuff seems to be |
|
Correct, it would have to be |
|
oh okay :) I see , let me apply that then |
Co-Authored-By: Casey Carter <cartec69@gmail.com>
|
are unused, there is some reason to keep them in the file ? |
StephanTLavavej
left a comment
There was a problem hiding this comment.
This looks good. I observe that there are several more files with macro constants that could be cleaned up (found by regex-searching for #define \w+\s+\w+ within stl/src/*.cpp in VSCode):
Lines 29 to 33 in 30031d3
Lines 270 to 272 in 30031d3
Line 10 in 30031d3
Line 33 in 30031d3
Line 14 in 30031d3
Line 12 in 30031d3
Lines 13 to 15 in 30031d3
Line 17 in 30031d3
Line 17 in 30031d3
Lines 14 to 16 in 30031d3
Lines 13 to 15 in 30031d3
Lines 14 to 16 in 30031d3
After rereading #270, I realize that I had quoted xtime.cpp intending it to be a non-exhaustive example of the files that needed to be cleaned up, but I didn't actually say that many files were affected. Oops!
If you'd like us to merge this PR as-is, we can certainly do so, and keep #270 open. If you want to extend these changes to more files, we can continue reviewing this PR. Just let us know! :-)
Great catch! If they're unused, they should definitely be eliminated. (We've changed this file over many years, so it's possible they were used at some point, and we missed these bits.) |
I think we should leave the ones in here alone because that constant needs to match how that's declared in CLR headers. |
|
Oh so, we can continue reviewing this PR, I'll extend these changes to more files. |
perfect, so I'll remove them |
|
Given @BillyONeal's explanation, I agree that leaving |
StephanTLavavej
left a comment
There was a problem hiding this comment.
Looks good, just found some parentheses that are no longer needed 🎉
StephanTLavavej
left a comment
There was a problem hiding this comment.
Looks great - I’ll port this to the Microsoft-internal repo and run a build and test pass. (We’re looking forward to when we finish migrating the build and tests to GitHub 😹)
|
Awesome !!! it's a pleasure for me ! =D |
|
While double-checking the Microsoft-internal port, I noticed a few more comments that needed to be updated. I think I found them all, so I went ahead and pushed a change to your branch. Running the build and tests now. (To find the comments, I used |
|
Thanks for modernizing this code! |
Description
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Uglyas perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft (including any cited standards), other WG21 papers
(excluding reference implementations outside of proposed standard wording),
and LWG issues as reference material. If they were derived from a project
that's already listed in NOTICE.txt, that's fine, but please mention it.
If they were derived from any other project (including Boost and libc++,
which are not yet listed in NOTICE.txt), you must mention it here,
so we can determine whether the license is compatible and what else needs
to be done.