diff options
| author | Zufu Liu <unknown> | 2025-12-18 14:49:28 +1100 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2025-12-18 14:49:28 +1100 |
| commit | 65de8b15b50c6d365b1eef14daaeb64736430d34 (patch) | |
| tree | e0c202fd4f0e2f1b49105c5867e77a65fe2cd8ad | |
| parent | 17492194fb5be9fc3c082c11967e8a64db192506 (diff) | |
| download | scintilla-mirror-65de8b15b50c6d365b1eef14daaeb64736430d34.tar.gz | |
Convert old style cast into more specific C++ cast.
Replace magic number with symbolic constant.
Avoids lint warnings.
| -rw-r--r-- | src/Style.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Style.cxx b/src/Style.cxx index 2c78c5241..a080f452e 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -62,7 +62,9 @@ int DefaultFontSize() noexcept { try { return Platform::DefaultFontSize(); } catch (...) { - return 10; + // Should never happen + constexpr int sensibleFontSize = 10; + return sensibleFontSize; } } @@ -83,5 +85,5 @@ Style::Style(const char *fontName_) noexcept : void Style::Copy(std::shared_ptr<Font> font_, const FontMeasurements &fm_) noexcept { font = std::move(font_); - (FontMeasurements &)(*this) = fm_; + static_cast<FontMeasurements &>(*this) = fm_; } |
