From bf8b9e613e754e29410e54f9199daa89c11fd686 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 8 Mar 2023 19:34:41 +0100 Subject: [PATCH] Fix x86 build error --- .../FindCharsInRange/FindCharsInRange.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp index fa32f488e..f1a4f819c 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp +++ b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp @@ -127,10 +127,10 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned char endRange, intptr_t startPos, bool direction, bool wrap) { - int64_t totalSize = (*_ppEditView)->getCurrentDocLen(); + size_t totalSize = (*_ppEditView)->getCurrentDocLen(); if (startPos == -1) startPos = direction == dirDown ? 0 : totalSize - 1; - if (startPos > totalSize) + if (startPos > static_cast(totalSize)) return false; char *content = new char[totalSize + 1]; @@ -140,12 +140,12 @@ bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned cha size_t found = 0; for (int64_t i = startPos - (direction == dirDown ? 0 : 1); - (direction == dirDown) ? i < totalSize : i >= 0 ; + (direction == dirDown) ? i < static_cast(totalSize) : i >= 0 ; (direction == dirDown) ? (++i) : (--i)) { if (static_cast(content[i]) >= beginRange && static_cast(content[i]) <= endRange) { - found = i; + found = static_cast(i); isFound = true; break; } @@ -156,12 +156,12 @@ bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned cha if (wrap) { for (int64_t i = (direction == dirDown ? 0: totalSize - 1); - (direction == dirDown) ? i < totalSize : i >= 0 ; + (direction == dirDown) ? i < static_cast(totalSize) : i >= 0 ; (direction == dirDown) ? (++i) : (--i)) { if (static_cast(content[i]) >= beginRange && static_cast(content[i]) <= endRange) { - found = i; + found = static_cast(i); isFound = true; break; }