diff --git a/Attributes.h b/Attributes.h index 379a186..9fe9571 100644 --- a/Attributes.h +++ b/Attributes.h @@ -312,7 +312,8 @@ interface IAttributeSource //{ // return HRESULT_FROM_WIN32(ERROR_UNMAPPED_SUBSTITUTION_STRING); //} - values.reset(byteValues.reinterpret_as()); + auto a = byteValues.reinterpret_as(); + values.reset(a); return S_OK; } @@ -329,7 +330,8 @@ interface IAttributeSource if (SUCCEEDED(GetValueData(id, OUT actualType, OUT byteValues))) { - values.reset(byteValues.reinterpret_as()); + auto a = byteValues.reinterpret_as(); + values.reset(a); } // // todo::: restore once you figure out enums! || !Attribute::AreCompatibleTypes(desiredType, actualType)) //if (!Attribute::AreCompatibleTypes(desiredType, actualType)) diff --git a/Attributes.ixx b/Attributes.ixx index fba624d..4bd6205 100644 --- a/Attributes.ixx +++ b/Attributes.ixx @@ -64,7 +64,7 @@ char16_t const* Attribute::GetPredefinedValue(uint32_t valueIndex, GetPredefined } else { - auto& newBuffer = std::to_wstring(predefinedValue.integerValue); + auto newBuffer = std::to_wstring(predefinedValue.integerValue); auto& recastBuffer = reinterpret_cast(newBuffer); buffer = recastBuffer; } @@ -149,7 +149,7 @@ HRESULT Attribute::ParseString( { HRESULT hr = HRESULT_FROM_WIN32(ERROR_UNMAPPED_SUBSTITUTION_STRING); - if (stringValue == '\0') + if (stringValue == nullptr) return hr; static_assert(Attribute::TypeTotal == 13, "Update this switch statement."); @@ -253,7 +253,7 @@ HRESULT Attribute::MapValueToName(_Out_ uint32_t enumValue, _Out_ std::u16string // Otherwise look for a numeric value, confirming that numeric value is // actually in the enumeration set. - auto& newString = std::to_wstring(enumValue); + auto newString = std::to_wstring(enumValue); auto& recastString = reinterpret_cast(newString); std::swap(stringValue, recastString); diff --git a/Common.FastVector.h b/Common.FastVector.h index 7877e61..b345a34 100644 --- a/Common.FastVector.h +++ b/Common.FastVector.h @@ -6,7 +6,8 @@ #pragma warning(push) #pragma warning(disable:4127) // Conditional expression is constant. VS can't tell that certain compound conditionals of template parameters aren't always constant when the tempalate parameter is true. -#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0 +// Disable for Visual Studio 2019 +#if 0 // defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0 // For std::uninitialized_copy and std::uninitialized_move. #define FASTVECTOR_MAKE_UNCHECKED stdext::make_unchecked_array_iterator #else diff --git a/DrawableObject.ixx b/DrawableObject.ixx index 4993b75..d21dd2b 100644 --- a/DrawableObject.ixx +++ b/DrawableObject.ixx @@ -1557,7 +1557,11 @@ HRESULT DrawableObjectGdiTextOut::Draw( if (!glyphs.empty() || !attributeSource.GetString(DrawableObjectAttributeGlyphs).empty()) { - text.reset(glyphs.reinterpret_as()); + // Assign to a temporary to work around bogus error. + // message : A non-const reference may only be bound to an lvalue + // There's utterly no reason why you shouldn't be able to pass a temporary as mutable in the language. -_- + auto a = glyphs.reinterpret_as(); + text.reset(a); textOutFlags |= ETO_GLYPH_INDEX; // todo::: Pass glyph advances if non-empty. ETO_PDY } @@ -2089,7 +2093,8 @@ HRESULT CachedDWriteGlyphRun::Update( // leaving the others as zeroes. if (glyphOffsetFloats.size() >= glyphs.size() * 2U) { - glyphOffsets.reset(glyphOffsetFloats.reinterpret_as()); + auto a = glyphOffsetFloats.reinterpret_as(); + glyphOffsets.reset(a); } else { @@ -3370,7 +3375,8 @@ HRESULT DrawableObjectGdiPlusDrawDriverString::Draw( if (glyphs.empty() && attributeSource.GetString(DrawableObjectAttributeGlyphs).empty()) { drawDriverStringFlags |= Gdiplus::DriverStringOptionsCmapLookup; - glyphs.reset(text.reinterpret_as()); + auto a = text.reinterpret_as(); + glyphs.reset(a); // todo::: Convert and pass glyph advances if non-empty. } diff --git a/MainWindow.ixx b/MainWindow.ixx index 2795ac5..cf7dbe0 100644 --- a/MainWindow.ixx +++ b/MainWindow.ixx @@ -481,7 +481,7 @@ INT_PTR MainWindow::InitializeMainDialog() // but they also ignore the Edit_SetCueBannerText call, meaning we can't // just call GetCueBannerText in the subclassed function. So store it as // a window property instead. - SetProp(attributeValuesEdit, L"CueBannerText", L""); + SetProp(attributeValuesEdit, L"CueBannerText", const_cast(L"")); auto attributesEdit = GetWindowFromId(hwnd_, IdcAttributesFilterEdit); Edit_SetCueBannerText(attributesEdit, L""); @@ -1100,7 +1100,7 @@ void MainWindow::InitializeDefaultDrawableObjects() //////////////////// // Initialize with typical APIs. - char16_t* const functionNames[] = { + char16_t const* const functionNames[] = { u"D2D DrawTextLayout", u"IDWriteBitmapRenderTarget IDWriteTextLayout", u"User32 DrawText", diff --git a/TextLayoutSampler.vcxproj b/TextLayoutSampler.vcxproj index c5e0799..5cb9304 100644 --- a/TextLayoutSampler.vcxproj +++ b/TextLayoutSampler.vcxproj @@ -63,7 +63,7 @@ Use precomp.h - /module:search $(IntDir) + /ifcSearchDir $(IntDir) @@ -73,7 +73,7 @@ - _DEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions) + _DEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions) MultiThreadedDebugDLL Disabled @@ -89,7 +89,7 @@ - _DEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions) + _DEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions) MultiThreadedDebugDLL Disabled @@ -103,7 +103,7 @@ - NDEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions) + NDEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions) MultiThreaded @@ -125,7 +125,7 @@ - NDEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions) + NDEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions) MultiThreaded