aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-03-25 09:07:00 +1100
committerNeil <nyamatongwe@gmail.com>2020-03-25 09:07:00 +1100
commit9df31197549b77d8a56587775d3b77e3c0b314e4 (patch)
treee6b69ecffd19d2dfa2142908b9141ad643b15574
parentc98b190d47f6adb869305baf6ee8447de79d463e (diff)
downloadscintilla-mirror-9df31197549b77d8a56587775d3b77e3c0b314e4.tar.gz
Replace static_cast with dynamic_cast for better type safety and adherence to
C++ Core Guidelines C.146.
-rw-r--r--src/ScintillaBase.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 055d61f91..9086f2976 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -622,7 +622,7 @@ LexState *ScintillaBase::DocumentLexState() {
if (!pdoc->GetLexInterface()) {
pdoc->SetLexInterface(new LexState(pdoc));
}
- return static_cast<LexState *>(pdoc->GetLexInterface());
+ return dynamic_cast<LexState *>(pdoc->GetLexInterface());
}
void LexState::SetLexerModule(const LexerModule *lex) {