-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix construct tag #497
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
Merged
StephanTLavavej
merged 24 commits into
microsoft:master
from
JeanPhilippeKernel:fix-construct-tag
Feb 29, 2020
Merged
Fix construct tag #497
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b0573ef
Update _MSVC_STL_UPDATE value to February 2020
JeanPhilippeKernel 7e5b7b3
Updated macro constants to constexpr variables #270
JeanPhilippeKernel 59b9474
Revert "Updated macro constants to constexpr variables #270"
JeanPhilippeKernel 91167a0
Changed macro constants to constexpr variables #270
JeanPhilippeKernel 44604c6
Merge branch 'master' of https://github.com/microsoft/STL into fix-ma…
JeanPhilippeKernel eecf828
updated variables to _Ugly naming convention
JeanPhilippeKernel c403c18
Update stl/src/xtime.cpp
JeanPhilippeKernel 8551ae8
updated macro change
JeanPhilippeKernel fd3f8e8
removed unecesarry comment
JeanPhilippeKernel 0dfcf9f
Merge branch 'master' of https://github.com/microsoft/STL into fix-ma…
JeanPhilippeKernel bde3b36
clang-format updated
JeanPhilippeKernel e483f6a
removed unnecessary parentheses
JeanPhilippeKernel 1eee336
Update comments.
StephanTLavavej 72c9caa
Merge branch 'master' of https://github.com/microsoft/STL into fix-ma…
JeanPhilippeKernel 8c2e1b2
update tag
JeanPhilippeKernel 71d78c2
Consistently use empty braces to construct tags like _Meow{} (#468)
JeanPhilippeKernel 0f890ba
revert change
JeanPhilippeKernel f4aa09f
fix clang-format for vector and xmemory
JeanPhilippeKernel 102c248
Revert "fix clang-format for vector and xmemory" and re-update files …
JeanPhilippeKernel 3e1903b
update files
JeanPhilippeKernel f51241b
Files revision to apply _INLINE_VAR constexpr convention,
JeanPhilippeKernel 4690500
Fix compiler errors.
StephanTLavavej f8b03b5
Replace more `_LITTLE_FIRST` and `_BIG_FIRST`.
StephanTLavavej 4ae0835
Within stdext::cvt, use _STD qualification.
StephanTLavavej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,9 +21,9 @@ _STL_DISABLE_CLANG_WARNINGS | |
| #pragma warning(disable : 4127) // conditional expression is constant | ||
|
|
||
| _STD_BEGIN | ||
| #define _LITTLE_FIRST 1 | ||
| #define _BIG_FIRST 2 | ||
| #define _BYTES_PER_WORD 4 | ||
| constexpr int _Little_first = 1; | ||
| constexpr int _Big_first = 2; | ||
| constexpr int _Bytes_per_word = 4; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 }; | ||
|
|
||
|
|
@@ -249,13 +249,13 @@ protected: | |
| unsigned short _Ch0; | ||
| unsigned short _Ch1; | ||
|
|
||
| if (*_Pstate == _LITTLE_FIRST) { | ||
| if (*_Pstate == _Little_first) { | ||
| _Ch0 = static_cast<unsigned short>(_Ptr[1] << 8 | _Ptr[0]); | ||
| } else if (*_Pstate == _BIG_FIRST) { | ||
| } else if (*_Pstate == _Big_first) { | ||
| _Ch0 = static_cast<unsigned short>(_Ptr[0] << 8 | _Ptr[1]); | ||
| } else { // no header seen yet, try preferred mode | ||
| constexpr bool _Prefer_LE = (_Mymode & little_endian) != 0; | ||
| constexpr char _Default_endian = _Prefer_LE ? _LITTLE_FIRST : _BIG_FIRST; | ||
| constexpr char _Default_endian = _Prefer_LE ? _Little_first : _Big_first; | ||
|
|
||
| if | ||
| _CONSTEXPR_IF(_Prefer_LE) { | ||
|
|
@@ -293,7 +293,7 @@ protected: | |
| } else if (_Last1 - _Mid1 < 2 * _Bytes_per_word) { | ||
| break; | ||
| } else { // get second word | ||
| if (*_Pstate == _LITTLE_FIRST) { | ||
| if (*_Pstate == _Little_first) { | ||
| _Ch1 = static_cast<unsigned short>(_Ptr[3] << 8 | _Ptr[2]); | ||
| } else { | ||
| _Ch1 = static_cast<unsigned short>(_Ptr[2] << 8 | _Ptr[3]); | ||
|
|
@@ -325,15 +325,15 @@ protected: | |
| _Mid2 = _First2; | ||
|
|
||
| if (*_Pstate == 0) { // determine endianness once, maybe generate header | ||
| *_Pstate = (_Mymode & little_endian) != 0 ? _LITTLE_FIRST : _BIG_FIRST; | ||
| *_Pstate = (_Mymode & little_endian) != 0 ? _Little_first : _Big_first; | ||
| constexpr bool _Generating = (_Mymode & generate_header) != 0; | ||
| if | ||
| _CONSTEXPR_IF(_Generating) { | ||
| if (_Last2 - _Mid2 < 3 * _Bytes_per_word) { | ||
| return _Mybase::partial; // not enough room for all | ||
| } | ||
|
|
||
| if (*_Pstate == _LITTLE_FIRST) { // put header LS byte first | ||
| if (*_Pstate == _Little_first) { // put header LS byte first | ||
| *_Mid2++ = '\xff'; | ||
| *_Mid2++ = '\xfe'; | ||
| } else { // put header MS byte first | ||
|
|
@@ -362,7 +362,7 @@ protected: | |
| _Extra = true; | ||
| } | ||
|
|
||
| if (*_Pstate == _LITTLE_FIRST) { | ||
| if (*_Pstate == _Little_first) { | ||
| if (_Extra) { // put a pair of words LS byte first | ||
| unsigned short _Ch0 = | ||
| static_cast<unsigned short>(0xd800 | static_cast<unsigned short>(_Ch >> 10) - 0x0040); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In
stl/incheaders, we conventionally say_INLINE_VAR constexpr, for example:STL/stl/inc/algorithm
Line 30 in 2bd2bd2
This expands to
inline constexprin C++17 mode, which makes a difference if the constant is ever address-taken (hopefully not for these constants, but we follow the convention anyways).