aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index d6ae32736..f31d1291f 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -874,7 +874,7 @@ void ScintillaWin::CreateRenderTarget() {
const RECT rc = GetClientRect(hw);
const int integralDeviceScaleFactor = GetFirstIntegralMultipleDeviceScaleFactor();
- const FLOAT dpiTarget = dpiDefault * integralDeviceScaleFactor;
+ const FLOAT dpiTarget = dpiDefault * static_cast<float>(integralDeviceScaleFactor);
const D2D1_RENDER_TARGET_PROPERTIES drtp = D2D1::RenderTargetProperties(
D2D1_RENDER_TARGET_TYPE_DEFAULT,
@@ -1009,7 +1009,7 @@ void ScintillaWin::DisplayCursor(Window::Cursor c) {
c = static_cast<Window::Cursor>(cursorMode);
}
if (c == Window::Cursor::reverseArrow) {
- ::SetCursor(reverseArrowCursor.Load(static_cast<UINT>(dpi * deviceScaleFactor)));
+ ::SetCursor(reverseArrowCursor.Load(static_cast<UINT>(static_cast<float>(dpi) * deviceScaleFactor)));
} else {
wMain.SetCursor(c);
}
@@ -2809,11 +2809,11 @@ constexpr int minTrailByte = 0x30;
// CreateFoldMap creates a fold map by calling platform APIs so will differ between platforms.
void CreateFoldMap(int codePage, FoldMap *foldingMap) {
- for (int byte1 = highByteFirst; byte1 <= highByteLast; byte1++) {
- const char ch1 = byte1 & 0xFF; // & 0xFF avoids warnings but has no real effect.
+ for (unsigned char byte1 = highByteLast; byte1 >= highByteFirst; byte1--) {
+ const char ch1 = byte1;
if (DBCSIsLeadByte(codePage, ch1)) {
- for (int byte2 = minTrailByte; byte2 <= highByteLast; byte2++) {
- const char ch2 = byte2 & 0xFF;
+ for (unsigned char byte2 = highByteLast; byte2 >= minTrailByte; byte2--) {
+ const char ch2 = byte2;
if (DBCSIsTrailByte(codePage, ch2)) {
const DBCSPair pair{ ch1, ch2 };
const uint16_t index = DBCSIndex(ch1, ch2);
@@ -3426,8 +3426,8 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) {
return 0;
// No selection asks IME to fill target fields with its own value.
- const int tgWlen = rc->dwTargetStrLen;
- const int tgWstart = rc->dwTargetStrOffset / sizeof(wchar_t);
+ const size_t tgWlen = rc->dwTargetStrLen;
+ const size_t tgWstart = rc->dwTargetStrOffset / sizeof(wchar_t);
std::string tgCompStart = StringEncode(rcFeed.substr(0, tgWstart), codePage);
std::string tgComp = StringEncode(rcFeed.substr(tgWstart, tgWlen), codePage);
@@ -3945,7 +3945,7 @@ void ScintillaWin::CTPaint(HWND hWnd) {
// Create a Direct2D render target.
- const FLOAT dpiTarget = dpiDefault * scaleFactor;
+ const FLOAT dpiTarget = dpiDefault * static_cast<float>(scaleFactor);
const D2D1_RENDER_TARGET_PROPERTIES drtp = D2D1::RenderTargetProperties(
D2D1_RENDER_TARGET_TYPE_DEFAULT,