Skip to content

Commit 9fbd12f

Browse files
committed
Reduce compiler warnings on x86 builds
1 parent c37c739 commit 9fbd12f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/WinWebDiffLib/WebDiffWindow.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ class CWebDiffWindow : public IWebDiffWindow
795795
{
796796
int oldDiffIndex = m_currentDiffIndex;
797797
++m_currentDiffIndex;
798-
if (m_currentDiffIndex >= m_diffInfos.size())
798+
if (static_cast<size_t>(m_currentDiffIndex) >= m_diffInfos.size())
799799
m_currentDiffIndex = static_cast<int>(m_diffInfos.size()) - 1;
800800
if (oldDiffIndex == m_currentDiffIndex)
801801
return false;
@@ -879,15 +879,15 @@ class CWebDiffWindow : public IWebDiffWindow
879879

880880
bool SelectDiff(int diffIndex) override
881881
{
882-
if (diffIndex < 0 || diffIndex >= m_diffInfos.size())
882+
if (diffIndex < 0 || static_cast<size_t>(diffIndex) >= m_diffInfos.size())
883883
return false;
884884
m_currentDiffIndex = diffIndex;
885885
return SUCCEEDED(selectDiff(diffIndex, nullptr));
886886
}
887887

888888
int GetNextDiffIndex() const override
889889
{
890-
if (m_diffInfos.size() == 0 || m_currentDiffIndex >= m_diffInfos.size() - 1)
890+
if (m_diffInfos.size() == 0 || m_currentDiffIndex >= static_cast<int>(m_diffInfos.size() - 1))
891891
return -1;
892892
return m_currentDiffIndex + 1;
893893
}
@@ -1042,7 +1042,7 @@ class CWebDiffWindow : public IWebDiffWindow
10421042
}
10431043
m_diffInfos = Comparer::compare(m_diffOptions, textSegments);
10441044
Comparer::setNodeIdInDiffInfoList(m_diffInfos, textSegments);
1045-
if (m_currentDiffIndex != -1 && m_currentDiffIndex >= m_diffInfos.size())
1045+
if (m_currentDiffIndex != -1 && static_cast<size_t>(m_currentDiffIndex) >= m_diffInfos.size())
10461046
m_currentDiffIndex = static_cast<int>(m_diffInfos.size() - 1);
10471047
if (m_bShowDifferences)
10481048
{
@@ -1311,7 +1311,7 @@ class CWebDiffWindow : public IWebDiffWindow
13111311

13121312
HRESULT selectDiff(int diffIndex, IWebDiffCallback* callback)
13131313
{
1314-
if (diffIndex < 0 || diffIndex >= m_diffInfos.size())
1314+
if (diffIndex < 0 || static_cast<size_t>(diffIndex) >= m_diffInfos.size())
13151315
return false;
13161316
ComPtr<IWebDiffCallback> callback2(callback);
13171317
std::shared_ptr<std::vector<std::wstring>> jsons(new std::vector<std::wstring>());

0 commit comments

Comments
 (0)