diff --git a/src/Calculator/Controls/CalculationResult.cpp b/src/Calculator/Controls/CalculationResult.cpp index 8896617f..90563752 100644 --- a/src/Calculator/Controls/CalculationResult.cpp +++ b/src/Calculator/Controls/CalculationResult.cpp @@ -118,17 +118,17 @@ void CalculationResult::OnTextContainerLayoutUpdated(Object^ /*sender*/, Object^ } } -void CalculationResult::TextContainerSizeChanged(Object^ sender, SizeChangedEventArgs^ /*e*/) +void CalculationResult::TextContainerSizeChanged(Object^ /*sender*/, SizeChangedEventArgs^ /*e*/) { UpdateTextState(); } -void CalculationResult::OnIsActivePropertyChanged(bool /*oldValue*/, bool newValue) +void CalculationResult::OnIsActivePropertyChanged(bool /*oldValue*/, bool /*newValue */) { UpdateVisualState(); } -void CalculationResult::OnAccentColorPropertyChanged(Brush^ oldValue, Brush^ newValue) +void CalculationResult::OnAccentColorPropertyChanged(Brush^ /*oldValue*/, Brush^ /*newValue*/) { // Force the "Active" transition to happen again if (IsActive) diff --git a/src/Calculator/Views/Calculator.xaml.cpp b/src/Calculator/Views/Calculator.xaml.cpp index d8ae99c9..10858a30 100644 --- a/src/Calculator/Views/Calculator.xaml.cpp +++ b/src/Calculator/Views/Calculator.xaml.cpp @@ -277,7 +277,7 @@ void Calculator::OnLayoutStateChanged(_In_ Object^ sender, _In_ Object^ e) UpdatePanelViewState(); } -void Calculator::OnIsStandardPropertyChanged(bool /*oldValue*/, bool newValue) +void Calculator::OnIsStandardPropertyChanged(bool /*oldValue*/, bool /*newValue*/) { UpdateViewState(); UpdatePanelViewState(); diff --git a/src/Calculator/Views/DateCalculator.xaml.cpp b/src/Calculator/Views/DateCalculator.xaml.cpp index 0df8cd3e..42fdf915 100644 --- a/src/Calculator/Views/DateCalculator.xaml.cpp +++ b/src/Calculator/Views/DateCalculator.xaml.cpp @@ -102,7 +102,7 @@ void DateCalculator::FromDate_DateChanged(_In_ CalendarDatePicker^ sender, _In_ { auto dateCalcViewModel = safe_cast(this->DataContext); dateCalcViewModel->FromDate = e->NewDate->Value; - TraceLogger::GetInstance().LogDateDifferenceModeUsed(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread())); + TraceLogger::GetInstance().LogDateDifferenceModeUsed(); } else { @@ -116,7 +116,7 @@ void DateCalculator::ToDate_DateChanged(_In_ CalendarDatePicker^ sender, _In_ Ca { auto dateCalcViewModel = safe_cast(this->DataContext); dateCalcViewModel->ToDate = e->NewDate->Value; - TraceLogger::GetInstance().LogDateDifferenceModeUsed(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread())); + TraceLogger::GetInstance().LogDateDifferenceModeUsed(); } else { diff --git a/src/CalculatorUnitTests/CalcInputTest.cpp b/src/CalculatorUnitTests/CalcInputTest.cpp index 8d6f630b..551fbd71 100644 --- a/src/CalculatorUnitTests/CalcInputTest.cpp +++ b/src/CalculatorUnitTests/CalcInputTest.cpp @@ -31,18 +31,18 @@ namespace CalculatorUnitTests m_calcInput.TryBeginExponent(); m_calcInput.TryAddDigit(3, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"-1.2e+3", m_calcInput.ToString(10, false), L"Verify input is correct."); + VERIFY_ARE_EQUAL(L"-1.2e+3", m_calcInput.ToString(10), L"Verify input is correct."); m_calcInput.Clear(); - ::Logger::WriteMessage(m_calcInput.ToString(10, false).c_str()); - VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10, false), L"Verify input is 0 after clear."); + ::Logger::WriteMessage(m_calcInput.ToString(10).c_str()); + VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify input is 0 after clear."); } TEST_METHOD(TryToggleSignZero) { VERIFY_IS_TRUE(m_calcInput.TryToggleSign(false, L"999"), L"Verify toggling 0 succeeds."); - VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10, false), L"Verify toggling 0 does not create -0."); + VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify toggling 0 does not create -0."); } TEST_METHOD(TryToggleSignExponent) { @@ -50,23 +50,23 @@ namespace CalculatorUnitTests m_calcInput.TryBeginExponent(); m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 32); VERIFY_IS_TRUE(m_calcInput.TryToggleSign(false, L"999"), L"Verify toggling exponent sign succeeds."); - VERIFY_ARE_EQUAL(L"1.e-2", m_calcInput.ToString(10, false), L"Verify toggling exponent sign does not toggle base sign."); + VERIFY_ARE_EQUAL(L"1.e-2", m_calcInput.ToString(10), L"Verify toggling exponent sign does not toggle base sign."); VERIFY_IS_TRUE(m_calcInput.TryToggleSign(false, L"999"), L"Verify toggling exponent sign succeeds."); - VERIFY_ARE_EQUAL(L"1.e+2", m_calcInput.ToString(10, false), L"Verify toggling negative exponent sign does not toggle base sign."); + VERIFY_ARE_EQUAL(L"1.e+2", m_calcInput.ToString(10), L"Verify toggling negative exponent sign does not toggle base sign."); } TEST_METHOD(TryToggleSignBase) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); VERIFY_IS_TRUE(m_calcInput.TryToggleSign(false, L"999"), L"Verify toggling base sign succeeds."); - VERIFY_ARE_EQUAL(L"-1", m_calcInput.ToString(10, false), L"Verify toggling base sign creates negative base."); + VERIFY_ARE_EQUAL(L"-1", m_calcInput.ToString(10), L"Verify toggling base sign creates negative base."); VERIFY_IS_TRUE(m_calcInput.TryToggleSign(false, L"999"), L"Verify toggling base sign succeeds."); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, false), L"Verify toggling negative base sign creates positive base."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify toggling negative base sign creates positive base."); } TEST_METHOD(TryToggleSignBaseIntegerMode) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); VERIFY_IS_TRUE(m_calcInput.TryToggleSign(true, L"999"), L"Verify toggling base sign in integer mode succeeds."); - VERIFY_ARE_EQUAL(L"-1", m_calcInput.ToString(10, false), L"Verify toggling base sign creates negative base."); + VERIFY_ARE_EQUAL(L"-1", m_calcInput.ToString(10), L"Verify toggling base sign creates negative base."); } TEST_METHOD(TryToggleSignRollover) { @@ -75,7 +75,7 @@ namespace CalculatorUnitTests VERIFY_IS_TRUE(m_calcInput.TryToggleSign(true, L"127"), L"Verify toggling base sign in integer mode succeeds."); m_calcInput.TryAddDigit(8, 10, false, L"999", 64, 32); VERIFY_IS_FALSE(m_calcInput.TryToggleSign(true, L"127"), L"Verify toggling base sign in integer mode fails on rollover."); - VERIFY_ARE_EQUAL(L"-128", m_calcInput.ToString(10, false), L"Verify toggling base sign on rollover does not change value."); + VERIFY_ARE_EQUAL(L"-128", m_calcInput.ToString(10), L"Verify toggling base sign on rollover does not change value."); } TEST_METHOD(TryAddDigitLeadingZeroes) @@ -83,26 +83,26 @@ namespace CalculatorUnitTests VERIFY_IS_TRUE(m_calcInput.TryAddDigit(0, 10, false, L"999", 64, 32), L"Verify TryAddDigit succeeds."); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(0, 10, false, L"999", 64, 32), L"Verify TryAddDigit succeeds."); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(0, 10, false, L"999", 64, 32), L"Verify TryAddDigit succeeds."); - VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10, false), L"Verify leading zeros are ignored."); + VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify leading zeros are ignored."); } TEST_METHOD(TryAddDigitMaxCount) { VERIFY_IS_TRUE(m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32), L"Verify TryAddDigit for base with length < maxDigits succeeds."); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, false), L"Verify adding digit for base with length < maxDigits succeeded."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify adding digit for base with length < maxDigits succeeded."); VERIFY_IS_FALSE(m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 1), L"Verify TryAddDigit for base with length > maxDigits fails."); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, false), L"Verify digit for base was not added."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify digit for base was not added."); m_calcInput.TryBeginExponent(); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32), L"Verify TryAddDigit for exponent with length < maxDigits succeeds."); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 32), L"Verify TryAddDigit for exponent with length < maxDigits succeeds."); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(3, 10, false, L"999", 64, 32), L"Verify TryAddDigit for exponent with length < maxDigits succeeds."); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(4, 10, false, L"999", 64, 32), L"Verify TryAddDigit for exponent with length < maxDigits succeeds."); VERIFY_IS_FALSE(m_calcInput.TryAddDigit(5, 10, false, L"999", 64, 32), L"Verify TryAddDigit for exponent with length > maxDigits fails."); - VERIFY_ARE_EQUAL(L"1.e+1234", m_calcInput.ToString(10, false), L"Verify adding digits for exponent with length < maxDigits succeeded."); + VERIFY_ARE_EQUAL(L"1.e+1234", m_calcInput.ToString(10), L"Verify adding digits for exponent with length < maxDigits succeeded."); m_calcInput.Clear(); m_calcInput.TryAddDecimalPt(); VERIFY_IS_TRUE(m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 1), L"Verify decimal point and leading zero does not count toward maxDigits."); - VERIFY_ARE_EQUAL(L"0.1", m_calcInput.ToString(10, false), L"Verify input value checking dec pt and leading zero impact on maxDigits."); + VERIFY_ARE_EQUAL(L"0.1", m_calcInput.ToString(10), L"Verify input value checking dec pt and leading zero impact on maxDigits."); } TEST_METHOD(TryAddDigitValues) { @@ -181,7 +181,7 @@ namespace CalculatorUnitTests VERIFY_IS_FALSE(m_calcInput.HasDecimalPt(), L"Verify input has no decimal point."); VERIFY_IS_TRUE(m_calcInput.TryAddDecimalPt(), L"Verify adding decimal to empty input."); VERIFY_IS_TRUE(m_calcInput.HasDecimalPt(), L"Verify input has decimal point."); - VERIFY_ARE_EQUAL(L"0.", m_calcInput.ToString(10, false), L"Verify decimal on empty input."); + VERIFY_ARE_EQUAL(L"0.", m_calcInput.ToString(10), L"Verify decimal on empty input."); } TEST_METHOD(TryAddDecimalPointTwice) { @@ -202,7 +202,7 @@ namespace CalculatorUnitTests { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); VERIFY_IS_TRUE(m_calcInput.TryBeginExponent(), L"Verify adding exponent succeeds on input without exponent."); - VERIFY_ARE_EQUAL(L"1.e+0", m_calcInput.ToString(10, false), L"Verify exponent present."); + VERIFY_ARE_EQUAL(L"1.e+0", m_calcInput.ToString(10), L"Verify exponent present."); } TEST_METHOD(TryBeginExponentWithExponent) { @@ -214,31 +214,31 @@ namespace CalculatorUnitTests TEST_METHOD(BackspaceZero) { m_calcInput.Backspace(); - VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10, false), L"Verify backspace on 0 is still 0."); + VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify backspace on 0 is still 0."); } TEST_METHOD(BackspaceSingleChar) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, false), L"Verify input before backspace."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify input before backspace."); m_calcInput.Backspace(); - VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10, false), L"Verify input after backspace."); + VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify input after backspace."); } TEST_METHOD(BackspaceMultiChar) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"12", m_calcInput.ToString(10, false), L"Verify input before backspace."); + VERIFY_ARE_EQUAL(L"12", m_calcInput.ToString(10), L"Verify input before backspace."); m_calcInput.Backspace(); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, false), L"Verify input after backspace."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify input after backspace."); } TEST_METHOD(BackspaceDecimal) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); m_calcInput.TryAddDecimalPt(); - VERIFY_ARE_EQUAL(L"1.", m_calcInput.ToString(10, false), L"Verify input before backspace."); + VERIFY_ARE_EQUAL(L"1.", m_calcInput.ToString(10), L"Verify input before backspace."); VERIFY_IS_TRUE(m_calcInput.HasDecimalPt(), L"Verify input has decimal point."); m_calcInput.Backspace(); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, false), L"Verify input after backspace."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify input after backspace."); VERIFY_IS_FALSE(m_calcInput.HasDecimalPt(), L"Verify decimal point was removed."); } TEST_METHOD(BackspaceMultiCharDecimal) @@ -247,47 +247,47 @@ namespace CalculatorUnitTests m_calcInput.TryAddDecimalPt(); m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 32); m_calcInput.TryAddDigit(3, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"1.23", m_calcInput.ToString(10, false), L"Verify input before backspace."); + VERIFY_ARE_EQUAL(L"1.23", m_calcInput.ToString(10), L"Verify input before backspace."); m_calcInput.Backspace(); - VERIFY_ARE_EQUAL(L"1.2", m_calcInput.ToString(10, false), L"Verify input after backspace."); + VERIFY_ARE_EQUAL(L"1.2", m_calcInput.ToString(10), L"Verify input after backspace."); } TEST_METHOD(SetDecimalSymbol) { m_calcInput.TryAddDecimalPt(); - VERIFY_ARE_EQUAL(L"0.", m_calcInput.ToString(10, false), L"Verify default decimal point."); + VERIFY_ARE_EQUAL(L"0.", m_calcInput.ToString(10), L"Verify default decimal point."); m_calcInput.SetDecimalSymbol(L','); - VERIFY_ARE_EQUAL(L"0,", m_calcInput.ToString(10, false), L"Verify new decimal point."); + VERIFY_ARE_EQUAL(L"0,", m_calcInput.ToString(10), L"Verify new decimal point."); } TEST_METHOD(ToStringEmpty) { - VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10, false), L"Verify ToString of empty value."); + VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify ToString of empty value."); } TEST_METHOD(ToStringNegative) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); m_calcInput.TryToggleSign(false, L"999"); - VERIFY_ARE_EQUAL(L"-1", m_calcInput.ToString(10, false), L"Verify ToString of negative value."); + VERIFY_ARE_EQUAL(L"-1", m_calcInput.ToString(10), L"Verify ToString of negative value."); } TEST_METHOD(ToStringExponentBase10) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); m_calcInput.TryBeginExponent(); - VERIFY_ARE_EQUAL(L"1.e+0", m_calcInput.ToString(10, false), L"Verify ToString of empty base10 exponent."); + VERIFY_ARE_EQUAL(L"1.e+0", m_calcInput.ToString(10), L"Verify ToString of empty base10 exponent."); } TEST_METHOD(ToStringExponentBase8) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); m_calcInput.TryBeginExponent(); - VERIFY_ARE_EQUAL(L"1.^+0", m_calcInput.ToString(8, false), L"Verify ToString of empty base8 exponent."); + VERIFY_ARE_EQUAL(L"1.^+0", m_calcInput.ToString(8), L"Verify ToString of empty base8 exponent."); } TEST_METHOD(ToStringExponentNegative) { m_calcInput.TryAddDigit(1, 8, false, L"999", 64, 32); m_calcInput.TryBeginExponent(); m_calcInput.TryToggleSign(false, L"999"); - VERIFY_ARE_EQUAL(L"1.e-0", m_calcInput.ToString(10, false), L"Verify ToString of empty negative exponent."); + VERIFY_ARE_EQUAL(L"1.e-0", m_calcInput.ToString(10), L"Verify ToString of empty negative exponent."); } TEST_METHOD(ToStringExponentPositive) { @@ -296,12 +296,12 @@ namespace CalculatorUnitTests m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 32); m_calcInput.TryAddDigit(3, 10, false, L"999", 64, 32); m_calcInput.TryAddDigit(4, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"1.e+234", m_calcInput.ToString(10, false), L"Verify ToString of exponent with value."); + VERIFY_ARE_EQUAL(L"1.e+234", m_calcInput.ToString(10), L"Verify ToString of exponent with value."); } TEST_METHOD(ToStringInteger) { m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10, true), L"Verify ToString of integer value hides decimal."); + VERIFY_ARE_EQUAL(L"1", m_calcInput.ToString(10), L"Verify ToString of integer value hides decimal."); } TEST_METHOD(ToStringBaseTooLong) { @@ -311,7 +311,7 @@ namespace CalculatorUnitTests maxStr += L"1"; m_calcInput.TryAddDigit(1, 10, false, maxStr, 64, 100); } - auto result = m_calcInput.ToString(10, false); + auto result = m_calcInput.ToString(10); VERIFY_IS_TRUE(result.empty(), L"Verify ToString of base value that is too large yields empty string."); } TEST_METHOD(ToStringExponentTooLong) @@ -328,7 +328,7 @@ namespace CalculatorUnitTests exponentCapped = true; } } - auto result = m_calcInput.ToString(10, false); + auto result = m_calcInput.ToString(10); // TryAddDigit caps the exponent length to C_EXP_MAX_DIGITS = 4, so ToString() succeeds. // If that cap is removed, ToString() should return an empty string. @@ -347,7 +347,7 @@ namespace CalculatorUnitTests m_calcInput.TryAddDigit(1, 10, false, L"999", 64, 32); m_calcInput.TryAddDigit(2, 10, false, L"999", 64, 32); m_calcInput.TryAddDigit(3, 10, false, L"999", 64, 32); - VERIFY_ARE_EQUAL(L"123", m_calcInput.ToString(10, false), L"Verify input before conversion to rational."); + VERIFY_ARE_EQUAL(L"123", m_calcInput.ToString(10), L"Verify input before conversion to rational."); auto rat = m_calcInput.ToRational(10, false); VERIFY_ARE_EQUAL(1, rat.P().Mantissa().size(), L"Verify digit count of rational."); diff --git a/src/CalculatorUnitTests/CalculatorManagerTest.cpp b/src/CalculatorUnitTests/CalculatorManagerTest.cpp index 37ceb429..cdf8a6f2 100644 --- a/src/CalculatorUnitTests/CalculatorManagerTest.cpp +++ b/src/CalculatorUnitTests/CalculatorManagerTest.cpp @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" @@ -40,7 +40,7 @@ namespace CalculatorManagerTest { m_isError = isError; } - void SetExpressionDisplay(_Inout_ std::shared_ptr>> const &tokens, _Inout_ std::shared_ptr>> const &commands) + void SetExpressionDisplay(_Inout_ std::shared_ptr>> const &tokens, _Inout_ std::shared_ptr>> const & /*commands*/) { m_expression.clear(); unsigned int nTokens = 0; @@ -79,7 +79,7 @@ namespace CalculatorManagerTest return m_isError; } - void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) + void OnHistoryItemAdded(_In_ unsigned int /*addedItemIndex */) { } @@ -98,7 +98,7 @@ namespace CalculatorManagerTest m_binaryOperatorReceivedCallCount++; } - void MemoryItemChanged(unsigned int indexOfMemory) + void MemoryItemChanged(unsigned int /*indexOfMemory*/) { } diff --git a/src/CalculatorUnitTests/CalculatorUnitTests.vcxproj b/src/CalculatorUnitTests/CalculatorUnitTests.vcxproj index f7e40b2c..d199044c 100644 --- a/src/CalculatorUnitTests/CalculatorUnitTests.vcxproj +++ b/src/CalculatorUnitTests/CalculatorUnitTests.vcxproj @@ -137,6 +137,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -144,6 +146,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -151,6 +155,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -158,6 +164,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -165,6 +173,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -172,6 +182,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -179,6 +191,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true @@ -186,6 +200,8 @@ /bigobj /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions) 4453;28204 $(SolutionDir);$(SolutionDir)CalcManager;$(SolutionDir)CalcViewModel;%(AdditionalIncludeDirectories) + Level4 + true diff --git a/src/CalculatorUnitTests/CurrencyConverterUnitTests.cpp b/src/CalculatorUnitTests/CurrencyConverterUnitTests.cpp index ab7fa7e6..9eb289ca 100644 --- a/src/CalculatorUnitTests/CurrencyConverterUnitTests.cpp +++ b/src/CalculatorUnitTests/CurrencyConverterUnitTests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" @@ -74,15 +74,15 @@ public: m_task_completion_event{ tce } {} - void CurrencyDataLoadFinished(bool didLoad) override + void CurrencyDataLoadFinished(bool /*didLoad*/) override { m_task_completion_event.set(); } - void CurrencySymbolsCallback(_In_ const wstring& fromSymbol, _In_ const wstring& toSymbol) override {} - void CurrencyRatiosCallback(_In_ const wstring& ratioEquality, _In_ const wstring& accRatioEquality) override {} - void CurrencyTimestampCallback(_In_ const std::wstring& timestamp, bool isWeekOldData) override {} - void NetworkBehaviorChanged(_In_ int newBehavior) override {} + void CurrencySymbolsCallback(_In_ const wstring& /*fromSymbol*/, _In_ const wstring& /*toSymbol*/) override {} + void CurrencyRatiosCallback(_In_ const wstring& /*ratioEquality*/, _In_ const wstring& /*accRatioEquality*/) override {} + void CurrencyTimestampCallback(_In_ const std::wstring& /*timestamp*/, bool /*isWeekOldData*/) override {} + void NetworkBehaviorChanged(_In_ int /*newBehavior*/) override {} private: Concurrency::task_completion_event m_task_completion_event; diff --git a/src/CalculatorUnitTests/HistoryTests.cpp b/src/CalculatorUnitTests/HistoryTests.cpp index 8036ec15..a22ae83a 100644 --- a/src/CalculatorUnitTests/HistoryTests.cpp +++ b/src/CalculatorUnitTests/HistoryTests.cpp @@ -42,7 +42,7 @@ namespace CalculatorFunctionalTests HistoryViewModel^ m_historyViewModel; StandardCalculatorViewModel^ m_standardViewModel; - void Initialize(unsigned int windowId = 0) + void Initialize(unsigned int /*windowId*/ = 0) { m_standardViewModel = ref new StandardCalculatorViewModel(); m_standardViewModel->IsStandard = true; @@ -50,7 +50,7 @@ namespace CalculatorFunctionalTests m_historyViewModel->SetCalculatorDisplay(m_standardViewModel->m_calculatorDisplay); } - void Cleanup(unsigned int windowId = 0) + void Cleanup(unsigned int /*windowId*/ = 0) { m_standardViewModel->m_standardCalculatorManager.SendCommand(Command::ModeBasic); m_historyViewModel->OnClearCommand(nullptr); @@ -100,7 +100,6 @@ namespace CalculatorFunctionalTests void AddMaxHistoryItems(unsigned int windowId = 0) { Initialize(windowId); - int initialSize = m_historyViewModel->ItemSize; m_standardViewModel->m_standardCalculatorManager.SendCommand(Command::Command1); m_standardViewModel->m_standardCalculatorManager.SendCommand(Command::CommandADD); m_standardViewModel->m_standardCalculatorManager.SendCommand(Command::Command1); diff --git a/src/CalculatorUnitTests/UnitConverterTest.cpp b/src/CalculatorUnitTests/UnitConverterTest.cpp index ef6601db..91902e98 100644 --- a/src/CalculatorUnitTests/UnitConverterTest.cpp +++ b/src/CalculatorUnitTests/UnitConverterTest.cpp @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" @@ -116,7 +116,7 @@ namespace UnitConverterUnitTests return m_ratioMaps[u]; } - bool SupportsCategory(const Category& target) + bool SupportsCategory(const Category& /*target*/) { return true; } diff --git a/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.cpp b/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.cpp index e9e7817e..7a36cd1e 100644 --- a/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.cpp +++ b/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" @@ -234,7 +234,7 @@ namespace CalculatorUnitTests return wstring(L""); } - void UnitConverterMock::DeSerialize(const wstring& serializedData) + void UnitConverterMock::DeSerialize(const wstring& /*serializedData*/) { m_deSerializeCallCount++; } @@ -244,7 +244,7 @@ namespace CalculatorUnitTests return L"TEST"; }; - void UnitConverterMock::RestoreUserPreferences(_In_ const std::wstring& userPreferences) + void UnitConverterMock::RestoreUserPreferences(_In_ const std::wstring& /*userPreferences*/) { }; diff --git a/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.h b/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.h index d56e22ad..1e1b57c8 100644 --- a/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.h +++ b/src/CalculatorUnitTests/UnitConverterViewModelUnitTests.h @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" @@ -41,7 +41,7 @@ namespace CalculatorUnitTests void RestoreUserPreferences(_In_ const std::wstring& userPreferences) override; void SendCommand(UCM::Command command) override; void SetViewModelCallback(const std::shared_ptr& newCallback) override; - void SetViewModelCurrencyCallback(_In_ const std::shared_ptr& newCallback) override {} + void SetViewModelCurrencyCallback(_In_ const std::shared_ptr& /*newCallback*/) override {} concurrency::task> RefreshCurrencyRatios() override { co_return std::make_pair(L"", L"");