diff options
author | Neil <nyamatongwe@gmail.com> | 2021-09-15 09:39:04 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-09-15 09:39:04 +1000 |
commit | bd26e824df79006bf8f5385e8d604d8fcbc01eae (patch) | |
tree | 264cec6e5eb965a7c7fafaa8e313106275914135 /src | |
parent | d4a5d7d6955982496ba523a439fc98276a28e2d8 (diff) | |
download | scintilla-mirror-bd26e824df79006bf8f5385e8d604d8fcbc01eae.tar.gz |
Avoid some type warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 12 | ||||
-rw-r--r-- | src/ViewStyle.h | 5 |
3 files changed, 7 insertions, 12 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index a17ad4dd8..1559ece96 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7930,7 +7930,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::MultiEdgeAddLine: - vs.AddMultiEdge(wParam, lParam); + vs.AddMultiEdge(static_cast<int>(wParam), ColourRGBA::FromIpRGB(lParam)); InvalidateStyleRedraw(); break; diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 9aab26e0a..8d2421b7a 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -442,14 +442,13 @@ int ViewStyle::ExternalMarginWidth() const noexcept { } int ViewStyle::MarginFromLocation(Point pt) const noexcept { - int margin = -1; - int x = marginInside ? 0 : -fixedColumnWidth; + XYPOSITION x = marginInside ? 0 : -fixedColumnWidth; for (size_t i = 0; i < ms.size(); i++) { if ((pt.x >= x) && (pt.x < x + ms[i].width)) - margin = static_cast<int>(i); + return static_cast<int>(i); x += ms[i].width; } - return margin; + return -1; } bool ViewStyle::ValidStyle(size_t styleIndex) const noexcept { @@ -552,14 +551,13 @@ ColourRGBA ViewStyle::WrapColour() const { } // Insert new edge in sorted order. -void ViewStyle::AddMultiEdge(uptr_t wParam, sptr_t lParam) { - const int column = static_cast<int>(wParam); +void ViewStyle::AddMultiEdge(int column, ColourRGBA colour) { theMultiEdge.insert( std::upper_bound(theMultiEdge.begin(), theMultiEdge.end(), column, [](const EdgeProperties &a, const EdgeProperties &b) { return a.column < b.column; }), - EdgeProperties(column, lParam)); + EdgeProperties(column, colour)); } std::optional<ColourRGBA> ViewStyle::ElementColour(Element element) const { diff --git a/src/ViewStyle.h b/src/ViewStyle.h index f81a52c88..52ec793bc 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -89,9 +89,6 @@ struct EdgeProperties { EdgeProperties(int column_ = 0, ColourRGBA colour_ = ColourRGBA::FromRGB(0)) noexcept : column(column_), colour(colour_) { } - EdgeProperties(Scintilla::uptr_t wParam, Scintilla::sptr_t lParam) noexcept : - column(static_cast<int>(wParam)), colour(ColourRGBA::FromIpRGB(lParam)) { - } }; // This is an old style enum so that its members can be used directly as indices without casting @@ -216,7 +213,7 @@ public: bool WhitespaceBackgroundDrawn() const; ColourRGBA WrapColour() const; - void AddMultiEdge(Scintilla::uptr_t wParam, Scintilla::sptr_t lParam); + void AddMultiEdge(int column, ColourRGBA colour); std::optional<ColourRGBA> ElementColour(Scintilla::Element element) const; bool ElementAllowsTranslucent(Scintilla::Element element) const; |