From 3e7c9e7e4ddc4c59ec50301227e473fb4049a1d1 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Mon, 31 Jan 2022 20:09:58 +1100 Subject: Place CaseFolderDBCS in unnamed namespace to avoid one definition rule warnings (ctuOneDefinitionRuleViolation) from Cppcheck. --- gtk/ScintillaGTK.cxx | 4 ++++ qt/ScintillaEditBase/ScintillaQt.cpp | 3 +++ win32/ScintillaWin.cxx | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 5c6161cc2..77a18e442 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1187,6 +1187,8 @@ const char *ScintillaGTK::CharacterSetID() const { return ::CharacterSetID(vs.styles[STYLE_DEFAULT].characterSet); } +namespace { + class CaseFolderDBCS : public CaseFolderTable { const char *charSet; public: @@ -1218,6 +1220,8 @@ public: } }; +} + std::unique_ptr ScintillaGTK::CaseFolderForEncoding() { if (pdoc->dbcsCodePage == SC_CP_UTF8) { return std::make_unique(); diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index 622868dec..d2635668e 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -551,6 +551,7 @@ QByteArray ScintillaQt::BytesForDocument(const QString &text) const } } +namespace { class CaseFolderDBCS : public CaseFolderTable { QTextCodec *codec; @@ -578,6 +579,8 @@ public: } }; +} + std::unique_ptr ScintillaQt::CaseFolderForEncoding() { if (pdoc->dbcsCodePage == SC_CP_UTF8) { diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 681f0b42b..471adea7c 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2393,6 +2393,8 @@ void ScintillaWin::NotifyDoubleClick(Point pt, KeyMod modifiers) { MAKELPARAM(pt.x, pt.y)); } +namespace { + class CaseFolderDBCS : public CaseFolderTable { // Allocate the expandable storage here so that it does not need to be reallocated // for each call to Fold. @@ -2452,6 +2454,8 @@ public: } }; +} + std::unique_ptr ScintillaWin::CaseFolderForEncoding() { const UINT cpDest = CodePageOfDocument(); if (cpDest == CpUtf8) { -- cgit v1.2.3