mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Build with /w4
This commit is contained in:
parent
84941c698e
commit
335d510339
21 changed files with 104 additions and 68 deletions
|
@ -261,7 +261,7 @@ void CalcInput::SetDecimalSymbol(wchar_t decSymbol)
|
|||
}
|
||||
}
|
||||
|
||||
wstring CalcInput::ToString(uint32_t radix, bool isIntegerMode)
|
||||
wstring CalcInput::ToString(uint32_t radix)
|
||||
{
|
||||
// In theory both the base and exponent could be C_NUM_MAX_DIGITS long.
|
||||
wstringstream resStream;
|
||||
|
|
|
@ -227,7 +227,7 @@ void CHistoryCollector::AddUnaryOpToHistory(int nOpCode, bool fInv, ANGLE_TYPE a
|
|||
{
|
||||
angleOpCode = CalculationManager::Command::CommandRAD;
|
||||
}
|
||||
if (angletype == ANGLE_GRAD)
|
||||
else // (angletype == ANGLE_GRAD)
|
||||
{
|
||||
angleOpCode = CalculationManager::Command::CommandGRAD;
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ void CHistoryCollector::UpdateHistoryExpression(uint32_t radix, int32_t precisio
|
|||
std::shared_ptr<COpndCommand> opndCommand = std::static_pointer_cast<COpndCommand>(expCommand);
|
||||
if (opndCommand != nullptr)
|
||||
{
|
||||
token.first = opndCommand->GetString(radix, precision, m_decimalSymbol);
|
||||
token.first = opndCommand->GetString(radix, precision);
|
||||
IFT(m_spTokens->SetAt(i, token));
|
||||
opndCommand->SetCommands(GetOperandCommandsFromString(token.first));
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ void CCalcEngine::DisplayNum(void)
|
|||
if (m_bRecord)
|
||||
{
|
||||
// Display the string and return.
|
||||
m_numberString = m_input.ToString(m_radix, m_fIntegerMode);
|
||||
m_numberString = m_input.ToString(m_radix);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
class CalcException : std::exception
|
||||
class CalcException : public std::exception
|
||||
{
|
||||
public:
|
||||
CalcException(HRESULT hr)
|
||||
|
|
|
@ -155,6 +155,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -169,6 +171,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -183,6 +187,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -197,6 +203,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -212,6 +220,8 @@
|
|||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -226,6 +236,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -240,6 +252,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -254,6 +268,8 @@
|
|||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zm250 /await /std:c++17 /permissive- /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -136,9 +136,6 @@
|
|||
<ClInclude Include="Header Files\History.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Header Files\scimath.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UnitConverter.h" />
|
||||
<ClInclude Include="CalculatorHistory.h" />
|
||||
<ClInclude Include="CalculatorManager.h" />
|
||||
|
|
|
@ -287,7 +287,7 @@ const wstring & COpndCommand::GetToken(wchar_t decimalSymbol)
|
|||
return m_token;
|
||||
}
|
||||
|
||||
wstring COpndCommand::GetString(uint32_t radix, int32_t precision, wchar_t decimalSymbol)
|
||||
wstring COpndCommand::GetString(uint32_t radix, int32_t precision)
|
||||
{
|
||||
wstring result{};
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
const std::wstring & GetToken(wchar_t decimalSymbol);
|
||||
CalculationManager::CommandType GetCommandType() const;
|
||||
void Accept(_In_ ISerializeCommandVisitor &commandVisitor);
|
||||
std::wstring GetString(uint32_t radix, int32_t precision, wchar_t decimalSymbol);
|
||||
std::wstring GetString(uint32_t radix, int32_t precision);
|
||||
|
||||
private:
|
||||
std::shared_ptr<CalculatorVector<int>> m_commands;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace CalcEngine
|
|||
bool IsEmpty() { return value.empty(); }
|
||||
|
||||
bool IsNegative() { return m_isNegative; }
|
||||
void IsNegative(bool value) { m_isNegative = value; }
|
||||
void IsNegative(bool isNegative) { m_isNegative = isNegative; }
|
||||
|
||||
std::wstring value;
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace CalcEngine
|
|||
bool TryBeginExponent();
|
||||
void Backspace();
|
||||
void SetDecimalSymbol(wchar_t decSymbol);
|
||||
std::wstring ToString(uint32_t radix, bool isIntegerMode);
|
||||
std::wstring ToString(uint32_t radix);
|
||||
Rational ToRational(uint32_t radix, int32_t precision);
|
||||
|
||||
private:
|
||||
|
|
|
@ -566,7 +566,7 @@ wchar_t NormalizeCharDigit(wchar_t c, uint32_t radix)
|
|||
// is in the range where this is not ambiguous.
|
||||
if (size_t{ radix } >= DIGITS.find(L'A') && size_t { radix } <= DIGITS.find(L'Z'))
|
||||
{
|
||||
return toupper(c);
|
||||
return towupper(c);
|
||||
}
|
||||
|
||||
return c;
|
||||
|
@ -1057,10 +1057,6 @@ wstring NumberToString(_Inout_ PNUMBER& pnum, int format, uint32_t radix, int32_
|
|||
length = precision;
|
||||
}
|
||||
|
||||
// 2 for signs, 1 for 'e'(or leading zero), 1 for dp, 1 for null and
|
||||
// 10 for maximum exponent size.
|
||||
int cchNum = (precision + 16);
|
||||
|
||||
// If there is a chance a round has to occur, round.
|
||||
// - if number is zero no rounding
|
||||
// - if number of digits is less than the maximum output no rounding
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace std;
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void gcdrat( PRAT *pa, uint32_t radix, int32_t precision)
|
||||
void gcdrat( PRAT *pa, int32_t precision)
|
||||
|
||||
{
|
||||
PNUMBER pgcd= nullptr;
|
||||
|
|
|
@ -424,7 +424,7 @@ extern void divrat( _Inout_ PRAT *pa, _In_ PRAT b, int32_t precision);
|
|||
extern void fracrat( _Inout_ PRAT *pa , uint32_t radix, int32_t precision);
|
||||
extern void factrat( _Inout_ PRAT *pa, uint32_t radix, int32_t precision);
|
||||
extern void modrat( _Inout_ PRAT *pa, _In_ PRAT b );
|
||||
extern void gcdrat( _Inout_ PRAT *pa, uint32_t radix, int32_t precision);
|
||||
extern void gcdrat( _Inout_ PRAT *pa, int32_t precision);
|
||||
extern void intrat( _Inout_ PRAT *px, uint32_t radix, int32_t precision);
|
||||
extern void mulnum( _Inout_ PNUMBER *pa, _In_ PNUMBER b, uint32_t radix);
|
||||
extern void mulnumx( _Inout_ PNUMBER *pa, _In_ PNUMBER b );
|
||||
|
|
|
@ -154,6 +154,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -172,6 +174,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -190,6 +194,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -208,6 +214,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -226,6 +234,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -244,6 +254,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -262,6 +274,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -280,6 +294,8 @@
|
|||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -15,7 +15,6 @@ using namespace Windows::Foundation;
|
|||
using namespace Windows::System;
|
||||
using namespace Windows::ApplicationModel::DataTransfer;
|
||||
|
||||
size_t maxOperandLength;
|
||||
unsigned long long maxOperandNumber;
|
||||
|
||||
String^ CopyPasteManager::supportedFormats[] =
|
||||
|
@ -533,7 +532,7 @@ size_t CopyPasteManager::ProgrammerOperandLength(const wstring& operand, int num
|
|||
suffixes.insert(suffixes.end(), uintSuffixes.begin(), uintSuffixes.end());
|
||||
|
||||
wstring operandUpper = operand;
|
||||
transform(operandUpper.begin(), operandUpper.end(), operandUpper.begin(), toupper);
|
||||
transform(operandUpper.begin(), operandUpper.end(), operandUpper.begin(), towupper);
|
||||
|
||||
// Detect if there is a suffix and subtract its length
|
||||
// Check suffixes first to allow e.g. "0b" to result in length 1 (value 0), rather than length 0 (no value).
|
||||
|
|
|
@ -43,7 +43,6 @@ static multimap<int, multimap<MyVirtualKey, WeakReference>> s_VirtualKeyControlS
|
|||
static multimap<int, multimap<MyVirtualKey, WeakReference>> s_VirtualKeyInverseChordsForButtons;
|
||||
static multimap<int, multimap<MyVirtualKey, WeakReference>> s_VirtualKeyControlInverseChordsForButtons;
|
||||
|
||||
static const TimeSpan c_lightUpTime = { 500000 }; // Quarter of a second
|
||||
static multimap<int, bool> s_ShiftKeyPressed;
|
||||
static multimap<int, bool> s_ControlKeyPressed;
|
||||
static multimap<int, bool> s_ShiftButtonChecked;
|
||||
|
@ -83,11 +82,13 @@ namespace CalculatorApp
|
|||
// The button will go into the visual Pressed state with this call
|
||||
VisualStateManager::GoToState(button, "Pressed", true);
|
||||
|
||||
// This timer will fire after c_lightUpTime and make the button
|
||||
// This timer will fire after lightUpTime and make the button
|
||||
// go back to the normal state.
|
||||
// This timer will only fire once after which it will be destroyed
|
||||
auto timer = ref new DispatcherTimer();
|
||||
timer->Interval = c_lightUpTime;
|
||||
TimeSpan lightUpTime{};
|
||||
lightUpTime.Duration = 500000L; // Half second (in 100-ns units)
|
||||
timer->Interval = lightUpTime;
|
||||
|
||||
WeakReference timerWeakReference(timer);
|
||||
WeakReference buttonWeakReference(button);
|
||||
|
@ -579,9 +580,9 @@ void KeyboardShortcutManager::OnKeyDownHandler(CoreWindow^ sender, KeyEventArgs^
|
|||
// Writer lock for the static maps
|
||||
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
|
||||
|
||||
auto currentControlKeyPressed = s_ControlKeyPressed.find(viewId);
|
||||
auto currControlKeyPressed = s_ControlKeyPressed.find(viewId);
|
||||
|
||||
if (currentControlKeyPressed != s_ControlKeyPressed.end())
|
||||
if (currControlKeyPressed != s_ControlKeyPressed.end())
|
||||
{
|
||||
s_ControlKeyPressed.erase(viewId);
|
||||
s_ControlKeyPressed.insert(std::make_pair(viewId, true));
|
||||
|
@ -593,9 +594,9 @@ void KeyboardShortcutManager::OnKeyDownHandler(CoreWindow^ sender, KeyEventArgs^
|
|||
// Writer lock for the static maps
|
||||
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
|
||||
|
||||
auto currentShiftKeyPressed = s_ShiftKeyPressed.find(viewId);
|
||||
auto currShiftKeyPressed = s_ShiftKeyPressed.find(viewId);
|
||||
|
||||
if (currentShiftKeyPressed != s_ShiftKeyPressed.end())
|
||||
if (currShiftKeyPressed != s_ShiftKeyPressed.end())
|
||||
{
|
||||
s_ShiftKeyPressed.erase(viewId);
|
||||
s_ShiftKeyPressed.insert(std::make_pair(viewId, true));
|
||||
|
@ -636,7 +637,7 @@ void KeyboardShortcutManager::OnKeyUpHandler(CoreWindow^ sender, KeyEventArgs^ a
|
|||
int viewId = Utils::GetWindowId();
|
||||
auto key = args->VirtualKey;
|
||||
|
||||
if (args->VirtualKey == VirtualKey::Shift)
|
||||
if (key == VirtualKey::Shift)
|
||||
{
|
||||
// Writer lock for the static maps
|
||||
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
|
||||
|
@ -649,14 +650,14 @@ void KeyboardShortcutManager::OnKeyUpHandler(CoreWindow^ sender, KeyEventArgs^ a
|
|||
s_ShiftKeyPressed.insert(std::make_pair(viewId, false));
|
||||
}
|
||||
}
|
||||
else if (args->VirtualKey == VirtualKey::Control)
|
||||
else if (key == VirtualKey::Control)
|
||||
{
|
||||
// Writer lock for the static maps
|
||||
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
|
||||
|
||||
auto currentControlKeyPressed = s_ControlKeyPressed.find(viewId);
|
||||
auto currControlKeyPressed = s_ControlKeyPressed.find(viewId);
|
||||
|
||||
if (currentControlKeyPressed != s_ControlKeyPressed.end())
|
||||
if (currControlKeyPressed != s_ControlKeyPressed.end())
|
||||
{
|
||||
s_ControlKeyPressed.erase(viewId);
|
||||
s_ControlKeyPressed.insert(std::make_pair(viewId, false));
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace CalculatorApp
|
|||
|
||||
Platform::String^ GetEnglishValueFromLocalizedDigits(const std::wstring& localizedString) const
|
||||
{
|
||||
if (m_resolvedName == L"en-US")
|
||||
if (!wcscmp(m_resolvedName, L"en-US"))
|
||||
{
|
||||
return ref new Platform::String(localizedString.c_str());
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace CalculatorApp
|
|||
}
|
||||
#pragma endregion
|
||||
|
||||
void TraceLogger::InsertIntoMemoryMap(int windowId, bool isStandard, bool isScientific, bool isProgrammer)
|
||||
void TraceLogger::InsertIntoMemoryMap(int windowId, bool isScientific, bool isProgrammer)
|
||||
{
|
||||
// Writer lock for the static resources
|
||||
reader_writer_lock::scoped_lock lock(s_traceLoggerLock);
|
||||
|
@ -182,7 +182,7 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
void TraceLogger::UpdateMemoryMap(int windowId, int memoryPosition, bool isStandard, bool isScientific, bool isProgrammer)
|
||||
void TraceLogger::UpdateMemoryMap(int windowId, int memoryPosition, bool isScientific, bool isProgrammer)
|
||||
{
|
||||
// Writer lock for the static resources
|
||||
reader_writer_lock::scoped_lock lock(s_traceLoggerLock);
|
||||
|
@ -867,7 +867,7 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
void TraceLogger::LogDateDifferenceModeUsed(int windowId)
|
||||
void TraceLogger::LogDateDifferenceModeUsed()
|
||||
{
|
||||
if (!m_dateDiffUsageLoggedInSession)
|
||||
{
|
||||
|
|
|
@ -53,8 +53,8 @@ namespace CalculatorApp
|
|||
void LogModeChangeBegin(CalculatorApp::Common::ViewMode, CalculatorApp::Common::ViewMode, int);
|
||||
void LogModeChangeEnd(CalculatorApp::Common::ViewMode, int) const;
|
||||
void LogClearHistory() const;
|
||||
void InsertIntoMemoryMap(int, bool, bool, bool);
|
||||
void UpdateMemoryMap(int, int, bool, bool, bool);
|
||||
void InsertIntoMemoryMap(int, bool, bool);
|
||||
void UpdateMemoryMap(int, int, bool, bool);
|
||||
void DeleteFromMemoryMap(int, int);
|
||||
void LogMemoryUsed(int, unsigned int, bool, bool, bool, unsigned int) const;
|
||||
void LogMultipleMemoryUsed(unsigned int, unsigned int) const;
|
||||
|
@ -91,7 +91,7 @@ namespace CalculatorApp
|
|||
void LogCoreWindowWasNull() const;
|
||||
|
||||
// Trace methods for Date Calculator usage
|
||||
void LogDateDifferenceModeUsed(int windowId);
|
||||
void LogDateDifferenceModeUsed();
|
||||
void LogDateAddSubtractModeUsed(int windowId, bool isAddMode);
|
||||
void LogDateClippedTimeDifferenceFound(winrt::Windows::Globalization::Calendar const& today, winrt::Windows::Foundation::DateTime const& clippedTime) const;
|
||||
|
||||
|
|
|
@ -291,7 +291,6 @@ void HistoryViewModel::SaveHistory()
|
|||
// this serializes a history item into a base64 encoded string
|
||||
Platform::String^ HistoryViewModel::SerializeHistoryItem(_In_ std::shared_ptr<CalculationManager::HISTORYITEM> const &item)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
DataWriter^ writer = ref new DataWriter();
|
||||
auto expr = item->historyItemVector.expression;
|
||||
auto result = item->historyItemVector.result;
|
||||
|
|
|
@ -178,7 +178,6 @@ String^ StandardCalculatorViewModel::CalculateNarratorDisplayValue(_In_ wstring
|
|||
String^ StandardCalculatorViewModel::GetNarratorStringReadRawNumbers(_In_ String^ localizedDisplayValue)
|
||||
{
|
||||
wstringstream wss;
|
||||
RADIX_TYPE radix = static_cast<RADIX_TYPE>(CurrentRadixType);
|
||||
auto& locSettings = LocalizationSettings::GetInstance();
|
||||
|
||||
// Insert a space after each digit in the string, to force Narrator to read them as separate numbers.
|
||||
|
@ -426,50 +425,50 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
|
|||
displayExpressionToken->CommandIndex = 0;
|
||||
}
|
||||
|
||||
wchar_t ch;
|
||||
wchar_t ch = 0;
|
||||
if ((cmdenum >= Command::Command0) && (cmdenum <= Command::Command9))
|
||||
{
|
||||
switch (cmdenum)
|
||||
{
|
||||
case Command::Command0:
|
||||
ch = '0';
|
||||
ch = L'0';
|
||||
break;
|
||||
case Command::Command1:
|
||||
ch = '1';
|
||||
ch = L'1';
|
||||
break;
|
||||
case Command::Command2:
|
||||
ch = '2';
|
||||
ch = L'2';
|
||||
break;
|
||||
case Command::Command3:
|
||||
ch = '3';
|
||||
ch = L'3';
|
||||
break;
|
||||
case Command::Command4:
|
||||
ch = '4';
|
||||
ch = L'4';
|
||||
break;
|
||||
case Command::Command5:
|
||||
ch = '5';
|
||||
ch = L'5';
|
||||
break;
|
||||
case Command::Command6:
|
||||
ch = '6';
|
||||
ch = L'6';
|
||||
break;
|
||||
case Command::Command7:
|
||||
ch = '7';
|
||||
ch = L'7';
|
||||
break;
|
||||
case Command::Command8:
|
||||
ch = '8';
|
||||
ch = L'8';
|
||||
break;
|
||||
case Command::Command9:
|
||||
ch = '9';
|
||||
ch = L'9';
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (cmdenum == Command::CommandPNT)
|
||||
{
|
||||
ch = '.';
|
||||
ch = L'.';
|
||||
}
|
||||
else if (cmdenum == Command::CommandBACK)
|
||||
{
|
||||
ch = 'x';
|
||||
ch = L'x';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -486,7 +485,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
|
|||
{
|
||||
//Clear older text;
|
||||
m_selectedExpressionLastData = L"";
|
||||
if (ch == 'x')
|
||||
if (ch == L'x')
|
||||
{
|
||||
temp = L'\0';
|
||||
commandIndex = 0;
|
||||
|
@ -501,7 +500,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (ch == 'x')
|
||||
if (ch == L'x')
|
||||
{
|
||||
if (commandIndex == 0)
|
||||
{
|
||||
|
@ -518,7 +517,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
|
|||
}
|
||||
temp[i++] = data[j];
|
||||
}
|
||||
temp[i] = '\0';
|
||||
temp[i] = L'\0';
|
||||
commandIndex -= 1;
|
||||
}
|
||||
else
|
||||
|
@ -537,7 +536,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
|
|||
}
|
||||
temp[i] = data[j++];
|
||||
}
|
||||
temp[i] = '\0';
|
||||
temp[i] = L'\0';
|
||||
commandIndex += 1;
|
||||
}
|
||||
}
|
||||
|
@ -567,7 +566,6 @@ void StandardCalculatorViewModel::OnButtonPressed(Object^ parameter)
|
|||
m_feedbackForButtonPress = CalculatorButtonPressedEventArgs::GetAuditoryFeedbackFromCommandParameter(parameter);
|
||||
NumbersAndOperatorsEnum numOpEnum = CalculatorButtonPressedEventArgs::GetOperationFromCommandParameter(parameter);
|
||||
Command cmdenum = ConvertToOperatorsEnum(numOpEnum);
|
||||
bool isOperator = IsOperator(cmdenum);
|
||||
|
||||
TraceLogger::GetInstance().UpdateFunctionUsage((int)numOpEnum);
|
||||
|
||||
|
@ -748,7 +746,6 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
|
|||
bool isFirstLegalChar = true;
|
||||
m_standardCalculatorManager.SendCommand(Command::CommandCENTR);
|
||||
bool sendNegate = false;
|
||||
bool processedExp = false;
|
||||
bool processedDigit = false;
|
||||
bool sentEquals = false;
|
||||
bool isPreviousOperator = false;
|
||||
|
@ -1016,7 +1013,7 @@ void StandardCalculatorViewModel::OnMemoryButtonPressed()
|
|||
m_standardCalculatorManager.MemorizeNumber();
|
||||
|
||||
int windowId = Utils::GetWindowId();
|
||||
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer);
|
||||
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsScientific, IsProgrammer);
|
||||
|
||||
String^ announcement = LocalizationStringUtil::GetLocalizedNarratorAnnouncement(
|
||||
CalculatorResourceKeys::MemorySave,
|
||||
|
@ -1069,11 +1066,11 @@ void StandardCalculatorViewModel::OnMemoryAdd(Object^ memoryItemPosition)
|
|||
if (MemorizedNumbers->Size > 0)
|
||||
{
|
||||
TraceLogger::GetInstance().LogMemoryUsed(windowId, boxedPosition->Value, IsStandard, IsScientific, IsProgrammer, MemorizedNumbers->Size);
|
||||
TraceLogger::GetInstance().UpdateMemoryMap(windowId, boxedPosition->Value, IsStandard, IsScientific, IsProgrammer);
|
||||
TraceLogger::GetInstance().UpdateMemoryMap(windowId, boxedPosition->Value, IsScientific, IsProgrammer);
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer);
|
||||
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsScientific, IsProgrammer);
|
||||
}
|
||||
m_standardCalculatorManager.MemorizedNumberAdd(boxedPosition->Value);
|
||||
}
|
||||
|
@ -1090,11 +1087,11 @@ void StandardCalculatorViewModel::OnMemorySubtract(Object^ memoryItemPosition)
|
|||
if (MemorizedNumbers->Size > 0)
|
||||
{
|
||||
TraceLogger::GetInstance().LogMemoryUsed(windowId, boxedPosition->Value, IsStandard, IsScientific, IsProgrammer, MemorizedNumbers->Size);
|
||||
TraceLogger::GetInstance().UpdateMemoryMap(windowId, boxedPosition->Value, IsStandard, IsScientific, IsProgrammer);
|
||||
TraceLogger::GetInstance().UpdateMemoryMap(windowId, boxedPosition->Value, IsScientific, IsProgrammer);
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer);
|
||||
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsScientific, IsProgrammer);
|
||||
}
|
||||
m_standardCalculatorManager.MemorizedNumberSubtract(boxedPosition->Value);
|
||||
}
|
||||
|
@ -1371,7 +1368,6 @@ ANGLE_TYPE GetAngleTypeFromCommand(Command command)
|
|||
void StandardCalculatorViewModel::SaveEditedCommand(_In_ unsigned int tokenPosition, _In_ Command command)
|
||||
{
|
||||
pair<wstring, int> token;
|
||||
bool fNegative = false;
|
||||
bool handleOperand = false;
|
||||
int nOpCode = static_cast<int>(command);
|
||||
wstring updatedToken = L"";
|
||||
|
|
|
@ -141,6 +141,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
|
@ -148,6 +150,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
|
@ -155,6 +159,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_ARM)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
@ -165,6 +171,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_ARM)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
@ -175,6 +183,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
@ -182,6 +192,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_x86)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
@ -192,6 +204,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -199,6 +213,8 @@
|
|||
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_x64)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue