From f9521fd0e42320f9e8963b4577eaca30d0ce1ea9 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Mon, 1 Jul 2019 08:22:39 +1000 Subject: Bug [#2115]. Fix undefined behaviour of shifting signed 1 by 31. --- src/MarginView.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 13d55730f..aaa83373f 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -268,7 +268,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, const bool firstSubLine = visibleLine == firstVisibleLine; const bool lastSubLine = visibleLine == lastVisibleLine; - int marks = model.pdoc->GetMark(lineDoc); + unsigned int marks = model.pdoc->GetMark(lineDoc); if (!firstSubLine) marks = 0; @@ -285,7 +285,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, if (levelNum < levelNextNum) { if (model.pcs->GetExpanded(lineDoc)) { if (levelNum == SC_FOLDLEVELBASE) - marks |= 1 << SC_MARKNUM_FOLDEROPEN; + marks |= 1U << SC_MARKNUM_FOLDEROPEN; else marks |= 1 << folderOpenMid; } else { -- cgit v1.2.3