From a89c20b95b80e21061ed34289e043616221320fb Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 3 May 2018 07:44:07 +1000 Subject: Backport: Avoid casts. Backport of changeset 6787:b690b9e1e111. --- lexlib/LexAccessor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lexlib/LexAccessor.h') 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(chAttr); if (validLen + (pos - startSeg + 1) >= bufferSize) { // Too big for buffer so send directly - pAccess->SetStyleFor(pos - startSeg + 1, static_cast(chAttr)); + pAccess->SetStyleFor(pos - startSeg + 1, attr); } else { for (Sci_PositionU i = startSeg; i <= pos; i++) { assert((startPosStyling + validLen) < Length()); - styleBuf[validLen++] = static_cast(chAttr); + styleBuf[validLen++] = attr; } } } -- cgit v1.2.3