From 1c8972e1aa4c6629f1525fce5c9ab256448236aa Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 15 Oct 2023 13:18:03 -0700 Subject: [PATCH 1/7] Comments: Drop extra space. --- stl/inc/system_error | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/system_error b/stl/inc/system_error index dbd47b05a82..54448654f9a 100644 --- a/stl/inc/system_error +++ b/stl/inc/system_error @@ -676,7 +676,7 @@ _NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { static _Constexpr_immortalize_impl<_Ty> _Static; return _Static._Storage; } -#else // ^^^ !defined(_M_CEE) / defined(_M_CEE), TRANSITION, VSO-1153256 vvv +#else // ^^^ !defined(_M_CEE) / defined(_M_CEE), TRANSITION, VSO-1153256 vvv template _NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { // return reference to a memcpy'd default-initialized _Ty From c939db39995be1d3bab14170b9497373740b7600 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 15 Oct 2023 13:26:37 -0700 Subject: [PATCH 2/7] Comments: Add them to `#endif`. --- stl/src/stdthrow.cpp | 2 +- stl/src/xgetwctype.cpp | 2 +- stl/src/xlock.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stl/src/stdthrow.cpp b/stl/src/stdthrow.cpp index a07cfa6b2b3..efa5312e56a 100644 --- a/stl/src/stdthrow.cpp +++ b/stl/src/stdthrow.cpp @@ -18,5 +18,5 @@ _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Debug_message( const unsigned short* message, const unsigned short* file, unsigned int line) { // report error and die _Debug_message(reinterpret_cast(message), reinterpret_cast(file), line); } -#endif +#endif // ^^^ defined(_DEBUG) ^^^ _STD_END diff --git a/stl/src/xgetwctype.cpp b/stl/src/xgetwctype.cpp index 3e8c6b591dc..8b9341cba5a 100644 --- a/stl/src/xgetwctype.cpp +++ b/stl/src/xgetwctype.cpp @@ -36,6 +36,6 @@ _CRTIMP2_PURE const unsigned short* __CLRCALL_PURE_OR_CDECL _Getwctypes( return reinterpret_cast( _Getwctypes(reinterpret_cast(_First), reinterpret_cast(_Last), _Dest, _Ctype)); } -#endif +#endif // ^^^ defined(MRTDLL) ^^^ _END_EXTERN_C_UNLESS_PURE diff --git a/stl/src/xlock.cpp b/stl/src/xlock.cpp index 30fe16dc95b..92903a10a4b 100644 --- a/stl/src/xlock.cpp +++ b/stl/src/xlock.cpp @@ -39,7 +39,7 @@ __thiscall _Init_locks::~_Init_locks() noexcept { // clean up locks } } -#endif +#endif // ^^^ !defined(MRTDLL) ^^^ void __cdecl _Init_locks::_Init_locks_ctor(_Init_locks*) noexcept { // initialize locks if (InterlockedIncrement(&init) == 0) { @@ -85,7 +85,7 @@ __thiscall _Lockit::~_Lockit() noexcept { // unlock the mutex } } -#endif +#endif // ^^^ !defined(MRTDLL) ^^^ void __cdecl _Lockit::_Lockit_ctor(_Lockit*) noexcept { // lock default mutex _Mtxlock(&mtx[0]); From e1e5173f0169d1e42c94d5f6df1831e050964544 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 15 Oct 2023 13:48:48 -0700 Subject: [PATCH 3/7] Comments: Drop "TRANSITION, requires expression support". We use `_Resettable_pointer` twice; requires-expressions would be more verbose. --- stl/inc/memory | 1 - 1 file changed, 1 deletion(-) diff --git a/stl/inc/memory b/stl/inc/memory index caf9636b4ac..dfd7512fec4 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -4137,7 +4137,6 @@ struct _Pointer_of_or_helper<_Ty, _Uty> { template using _Pointer_of_or = _Pointer_of_or_helper<_Ty, _Uty>::type; -// TRANSITION, requires expression support template concept _Resettable_pointer = requires(_SmartPtr& _Smart_ptr, _Pointer _Ptr, _ArgsT&&... _Args) { _Smart_ptr.reset(static_cast<_Sp>(_Ptr), _STD forward<_ArgsT>(_Args)...); From f9c9337553f3453a57c419be5a256ecf5c7c5030 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 20 Oct 2023 17:14:41 -0700 Subject: [PATCH 4/7] Comments: Fix capitalization typo. --- stl/src/ppltasks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/src/ppltasks.cpp b/stl/src/ppltasks.cpp index c0bbdad466a..5a08a51e98b 100644 --- a/stl/src/ppltasks.cpp +++ b/stl/src/ppltasks.cpp @@ -56,7 +56,7 @@ namespace Concurrency { /// _CRTIMP2 size_t __cdecl CaptureCallstack(void** stackData, size_t skipFrames, size_t captureFrames) { size_t capturedFrames = 0; - // RtlCaptureSTackBackTrace is not available in MSDK, so we only call it under Desktop or _DEBUG MSDK. + // RtlCaptureStackBackTrace is not available in MSDK, so we only call it under Desktop or _DEBUG MSDK. // For MSDK unsupported version, we will return zero frame number. #if !defined(_CRT_APP) || defined(_DEBUG) capturedFrames = RtlCaptureStackBackTrace( From 588b2e9689cb7aacdb4df470c087c928a242d019 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 20 Oct 2023 17:45:18 -0700 Subject: [PATCH 5/7] Comments: Strengthen comment about ole32.dll. See GH 3607 - we can't depend on ole32.dll anywhere. --- stl/src/ppltasks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/src/ppltasks.cpp b/stl/src/ppltasks.cpp index 5a08a51e98b..51d1e71affa 100644 --- a/stl/src/ppltasks.cpp +++ b/stl/src/ppltasks.cpp @@ -21,7 +21,7 @@ #include #endif -// This IID is exported by ole32.dll; we cannot depend on ole32.dll on OneCore. +// This IID is exported by ole32.dll; we cannot depend on ole32.dll. static GUID const Local_IID_ICallbackWithNoReentrancyToApplicationSTA = { 0x0A299774, 0x3E4E, 0xFC42, {0x1D, 0x9D, 0x72, 0xCE, 0xE1, 0x05, 0xCA, 0x57}}; From a0f83fc99f7b20ed03a535bdaebb4cb9ea45775f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 15 Oct 2023 13:16:16 -0700 Subject: [PATCH 6/7] String literals: Space before wrapping. --- stl/inc/xstring | 16 ++++++++-------- stl/inc/xutility | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stl/inc/xstring b/stl/inc/xstring index ce879cf28ad..fe3f8efda2a 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -1856,8 +1856,8 @@ public: #if _ITERATOR_DEBUG_LEVEL >= 1 _STL_VERIFY(_Ptr, "cannot dereference value-initialized string iterator"); const auto _Mycont = static_cast(this->_Getcont()); - _STL_VERIFY(_Mycont, "cannot dereference string iterator because the iterator was" - " invalidated (e.g. reallocation occurred, or the string was destroyed)"); + _STL_VERIFY(_Mycont, "cannot dereference string iterator because the iterator was " + "invalidated (e.g. reallocation occurred, or the string was destroyed)"); const auto _Contptr = _Mycont->_Myptr(); const auto _Rawptr = _Unfancy(_Ptr); _STL_VERIFY(_Contptr <= _Rawptr && _Rawptr < _Contptr + _Mycont->_Mysize, @@ -1876,8 +1876,8 @@ public: #if _ITERATOR_DEBUG_LEVEL >= 1 _STL_VERIFY(_Ptr, "cannot increment value-initialized string iterator"); const auto _Mycont = static_cast(this->_Getcont()); - _STL_VERIFY(_Mycont, "cannot increment string iterator because the iterator was" - " invalidated (e.g. reallocation occurred, or the string was destroyed)"); + _STL_VERIFY(_Mycont, "cannot increment string iterator because the iterator was " + "invalidated (e.g. reallocation occurred, or the string was destroyed)"); _STL_VERIFY(_Unfancy(_Ptr) < _Mycont->_Myptr() + _Mycont->_Mysize, "cannot increment string iterator past end"); #endif // _ITERATOR_DEBUG_LEVEL >= 1 @@ -1895,8 +1895,8 @@ public: #if _ITERATOR_DEBUG_LEVEL >= 1 _STL_VERIFY(_Ptr, "cannot decrement value-initialized string iterator"); const auto _Mycont = static_cast(this->_Getcont()); - _STL_VERIFY(_Mycont, "cannot decrement string iterator because the iterator was" - " invalidated (e.g. reallocation occurred, or the string was destroyed)"); + _STL_VERIFY(_Mycont, "cannot decrement string iterator because the iterator was " + "invalidated (e.g. reallocation occurred, or the string was destroyed)"); _STL_VERIFY(_Mycont->_Myptr() < _Unfancy(_Ptr), "cannot decrement string iterator before begin"); #endif // _ITERATOR_DEBUG_LEVEL >= 1 @@ -1918,8 +1918,8 @@ public: _STL_ASSERT(_Ptr, "cannot seek value-initialized string iterator"); const auto _Mycont = static_cast(this->_Getcont()); - _STL_ASSERT(_Mycont, "cannot seek string iterator because the iterator was" - " invalidated (e.g. reallocation occurred, or the string was destroyed)"); + _STL_ASSERT(_Mycont, "cannot seek string iterator because the iterator was " + "invalidated (e.g. reallocation occurred, or the string was destroyed)"); const auto _Contptr = _Mycont->_Myptr(); const auto _Rawptr = _Unfancy(_Ptr); diff --git a/stl/inc/xutility b/stl/inc/xutility index aa972c04e5a..91d9a2ee7dc 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -5848,8 +5848,8 @@ namespace ranges { if constexpr (_Is_sized) { return _RANGES next(_STD move(_First), _Last); } else { - _STL_ASSERT(false, "Tried to find a value in a range with unreachable sentinel" - " that cannot be represented by the range's value type"); + _STL_ASSERT(false, "Tried to find a value in a range with unreachable sentinel " + "that cannot be represented by the range's value type"); } } From c2f79e03f2e931c34eb17f5af5c5dbc7fa28169c Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 15 Oct 2023 13:17:11 -0700 Subject: [PATCH 7/7] String literals: Unwrap. --- stl/inc/xstring | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/xstring b/stl/inc/xstring index fe3f8efda2a..b2912de8526 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -2012,8 +2012,8 @@ public: _CONSTEXPR20 void _Compat(const _String_const_iterator& _Right) const noexcept { // test for compatible iterator pair #if _ITERATOR_DEBUG_LEVEL >= 1 - _STL_VERIFY(this->_Getcont() == _Right._Getcont(), "string iterators incompatible (e.g." - " point to different string instances)"); + _STL_VERIFY(this->_Getcont() == _Right._Getcont(), + "string iterators incompatible (e.g. point to different string instances)"); #else // ^^^ _ITERATOR_DEBUG_LEVEL >= 1 / _ITERATOR_DEBUG_LEVEL == 0 vvv (void) _Right; #endif // ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^