diff options
author | Neil <nyamatongwe@gmail.com> | 2018-05-03 07:44:07 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-05-03 07:44:07 +1000 |
commit | a89c20b95b80e21061ed34289e043616221320fb (patch) | |
tree | fb59505f5df4e582bbb9fe9ab384bb8e2ed7c5d7 /lexlib/LexAccessor.h | |
parent | 62ac2fcca76ba15f69ad050b9959088100481096 (diff) | |
download | scintilla-mirror-a89c20b95b80e21061ed34289e043616221320fb.tar.gz |
Backport: Avoid casts.
Backport of changeset 6787:b690b9e1e111.
Diffstat (limited to 'lexlib/LexAccessor.h')
-rw-r--r-- | lexlib/LexAccessor.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 48097e279..822c81dfb 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -170,13 +170,14 @@ public: if (validLen + (pos - startSeg + 1) >= bufferSize) Flush(); + char attr = static_cast<char>(chAttr); if (validLen + (pos - startSeg + 1) >= bufferSize) { // Too big for buffer so send directly - pAccess->SetStyleFor(pos - startSeg + 1, static_cast<char>(chAttr)); + pAccess->SetStyleFor(pos - startSeg + 1, attr); } else { for (Sci_PositionU i = startSeg; i <= pos; i++) { assert((startPosStyling + validLen) < Length()); - styleBuf[validLen++] = static_cast<char>(chAttr); + styleBuf[validLen++] = attr; } } } |