diff options
author | Neil <nyamatongwe@gmail.com> | 2018-05-24 09:24:44 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-05-24 09:24:44 +1000 |
commit | bbfd34adc0e800ae2feec487a3c407873bb289e3 (patch) | |
tree | 06e19116e923a7ae0005070e1d9a695e5b212878 /src/PositionCache.h | |
parent | 70c14b70b935ae8b0656df0c8b7c64b481feea18 (diff) | |
download | scintilla-mirror-bbfd34adc0e800ae2feec487a3c407873bb289e3.tar.gz |
Fix warnings. Add const, constexpr, and noexcept. Initialize. Standard methods.
Replace 0 and NULL with nullptr for COM, DirectWrite and least ambiguous cases.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index 512ec13f5..5657b667c 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -10,10 +10,14 @@ namespace Scintilla { -static inline bool IsEOLChar(char ch) { +inline constexpr bool IsEOLChar(int ch) noexcept { return (ch == '\r') || (ch == '\n'); } +inline constexpr bool IsSpaceOrTab(int ch) noexcept { + return ch == ' ' || ch == '\t'; +} + /** * A point in document space. * Uses double for sufficient resolution in large (>20,000,000 line) documents. @@ -122,6 +126,11 @@ struct ScreenLine : public IScreenLine { int tabWidthMinimumPixels; ScreenLine(const LineLayout *ll_, int subLine, const ViewStyle &vs, XYPOSITION width_, int tabWidthMinimumPixels_); + // Deleted so ScreenLine objects can not be copied. + ScreenLine(const ScreenLine &) = delete; + ScreenLine(ScreenLine &&) = delete; + void operator=(const ScreenLine &) = delete; + void operator=(ScreenLine &&) = delete; virtual ~ScreenLine(); std::string_view Text() const override; @@ -274,10 +283,6 @@ public: const char *s, unsigned int len, XYPOSITION *positions, const Document *pdoc); }; -inline bool IsSpaceOrTab(int ch) { - return ch == ' ' || ch == '\t'; -} - } #endif |