diff options
author | Neil <nyamatongwe@gmail.com> | 2022-08-13 18:12:55 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-08-13 18:12:55 +1000 |
commit | 7d2f6bd5280613538c4beafac26a39348992d103 (patch) | |
tree | 3da3b4dc503778ef6ce45da0477bcfdafd127160 /src/EditView.cxx | |
parent | 059594717cb36423733a0fbdee316f436d2e49a0 (diff) | |
download | scintilla-mirror-7d2f6bd5280613538c4beafac26a39348992d103.tar.gz |
Reduce warnings with noexcept, fewer casts, and other minor changes.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index d59f99eb2..a40c6c3b8 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -711,7 +711,7 @@ void EditView::UpdateBidiData(const EditModel &model, const ViewStyle &vstyle, L ll->bidiData->stylesFonts[ll->numCharsInLine].reset(); for (int charsInLine = 0; charsInLine < ll->numCharsInLine; charsInLine++) { - const int charWidth = UTF8DrawBytes(reinterpret_cast<unsigned char *>(&ll->chars[charsInLine]), ll->numCharsInLine - charsInLine); + const int charWidth = UTF8DrawBytes(&ll->chars[charsInLine], ll->numCharsInLine - charsInLine); const Representation *repr = model.reprs.RepresentationFromCharacter(std::string_view(&ll->chars[charsInLine], charWidth)); ll->bidiData->widthReprs[charsInLine] = 0.0f; @@ -1328,7 +1328,7 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS if (FlagSet(model.changeHistoryOption, ChangeHistoryOption::Indicators)) { // Draw editions - const int indexHistory = static_cast<int>(IndicatorNumbers::HistoryRevertedToOriginInsertion); + constexpr int indexHistory = static_cast<int>(IndicatorNumbers::HistoryRevertedToOriginInsertion); { // Draw insertions Sci::Position startPos = posLineStart + lineStart; @@ -1815,7 +1815,9 @@ void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewSt } } -static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll, +namespace { + +void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll, int xStart, PRectangle rcLine, std::optional<ColourRGBA> background, DrawWrapMarkerFn customDrawWrapMarker, bool caretActive) { // default bgnd here.. @@ -1855,7 +1857,7 @@ static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, c // such that, if the caret is inside the main selection, the beginning or end of that selection // is at the end of a text segment. // This function should only be called if iDoc is within the main selection. -static InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditModel &model, const ViewStyle &vsDraw) { +InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditModel &model, const ViewStyle &vsDraw) noexcept { const SelectionPosition &posCaret = model.sel.RangeMain().caret; const bool caretAtStart = posCaret < model.sel.RangeMain().anchor && posCaret.Position() == iDoc; const bool caretAtEnd = posCaret > model.sel.RangeMain().anchor && @@ -1864,6 +1866,8 @@ static InSelection CharacterInCursesSelection(Sci::Position iDoc, const EditMode return (caretAtStart || caretAtEnd) ? InSelection::inNone : InSelection::inMain; } +} + void EditView::DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine, Range lineRange, Sci::Position posLineStart, int xStart, int subLine, std::optional<ColourRGBA> background) const { |