Skip to content

Commit

Permalink
Fix C2664 errors (#15714)
Browse files Browse the repository at this point in the history
## Summary of the Pull Request
Fix C2664 errors under latest compiler.

## References and Relevant Issues
#15309

## Detailed Description of the Pull Request / Additional comments
- Latest compilers are more strict
- Internal background of change:
[DevDiv:1810844](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1810844)

## Validation Steps Performed
- Now successfully builds under VS `17.8.0 Preview 1.0 `
- Still successfully builds under VS `17.6.5`

## PR Checklist
- [x] Closes #15309
- [ ] Tests added/passed
- [ ] Documentation updated
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
- [ ] Schema updated (if necessary)

---------

Co-authored-by: Dan Albrecht <[email protected]>
  • Loading branch information
Dan-Albrecht and Dan Albrecht committed Jul 17, 2023
1 parent e078ddd commit f4bcbfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TabManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ namespace winrt::TerminalApp::implementation
// environment variables, but the user might have set one in
// the settings. Expand those here.

path = { wil::ExpandEnvironmentStringsW<std::wstring>(path.c_str()) };
path = winrt::hstring{ wil::ExpandEnvironmentStringsW<std::wstring>(path.c_str()) };
}

if (!path.empty())
Expand Down
10 changes: 5 additions & 5 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,17 +906,17 @@ namespace winrt::Microsoft::Terminal::Control::implementation
if (HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) == hr ||
HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == hr)
{
message = { fmt::format(std::wstring_view{ RS_(L"PixelShaderNotFound") },
(_focused ? _core.FocusedAppearance() : _core.UnfocusedAppearance()).PixelShaderPath()) };
message = winrt::hstring{ fmt::format(std::wstring_view{ RS_(L"PixelShaderNotFound") },
(_focused ? _core.FocusedAppearance() : _core.UnfocusedAppearance()).PixelShaderPath()) };
}
else if (D2DERR_SHADER_COMPILE_FAILED == hr)
{
message = { fmt::format(std::wstring_view{ RS_(L"PixelShaderCompileFailed") }) };
message = winrt::hstring{ fmt::format(std::wstring_view{ RS_(L"PixelShaderCompileFailed") }) };
}
else
{
message = { fmt::format(std::wstring_view{ RS_(L"UnexpectedRendererError") },
hr) };
message = winrt::hstring{ fmt::format(std::wstring_view{ RS_(L"UnexpectedRendererError") },
hr) };
}

auto noticeArgs = winrt::make<NoticeEventArgs>(NoticeLevel::Warning, std::move(message));
Expand Down

0 comments on commit f4bcbfb

Please sign in to comment.