aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorZufu Liu <unknown>2025-12-18 14:49:28 +1100
committerZufu Liu <unknown>2025-12-18 14:49:28 +1100
commit65de8b15b50c6d365b1eef14daaeb64736430d34 (patch)
treee0c202fd4f0e2f1b49105c5867e77a65fe2cd8ad /src
parent17492194fb5be9fc3c082c11967e8a64db192506 (diff)
downloadscintilla-mirror-65de8b15b50c6d365b1eef14daaeb64736430d34.tar.gz
Convert old style cast into more specific C++ cast.
Replace magic number with symbolic constant. Avoids lint warnings.
Diffstat (limited to 'src')
-rw-r--r--src/Style.cxx6
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_;
}