Skip to content

Commit b4177bd

Browse files
author
Clang Robot
committed
Committing clang-format/clang-tidy changes
1 parent d6f70e1 commit b4177bd

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

src/Displays/DisplaySystem.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class DisplaySystem : public RendererDisplay {
7878
public:
7979
DisplaySystem();
8080
DisplaySystem(DisplaySystem const &) = delete;
81-
virtual ~DisplaySystem() = default;
81+
~DisplaySystem() override = default;
8282

8383
// Constant text-box inset defaults during reading. These should be overridden to sane values in
8484
// subclasses.
@@ -235,11 +235,11 @@ class DisplaySystem : public RendererDisplay {
235235
void drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h,
236236
uint16_t color) override;
237237

238-
inline uint16_t lineHeight(FontHandle font) override {
238+
inline auto lineHeight(FontHandle font) -> uint16_t override {
239239
return font.ptr ? reinterpret_cast<Font *>(font.ptr)->lineHeight() : 0;
240240
}
241241

242-
inline uint16_t getTextWidth(const char *cstr, FontHandle font) override {
242+
inline auto getTextWidth(const char *cstr, FontHandle font) -> uint16_t override {
243243
if (!font.ptr || cstr == nullptr) {
244244
return 0;
245245
}
@@ -261,7 +261,7 @@ class DisplaySystem : public RendererDisplay {
261261
*outHeight = dim.height;
262262
}
263263

264-
virtual auto getSuperscriptCharacter(const char inputChar, FontHandle font) const -> const
264+
[[nodiscard]] auto getSuperscriptCharacter(const char inputChar, FontHandle font) const -> const
265265
char * override {
266266
#if CONFIG_TINYFONT_IBMF
267267
return reinterpret_cast<Font *>(font.ptr)->getSuperscriptCharacter(inputChar);
@@ -272,7 +272,7 @@ class DisplaySystem : public RendererDisplay {
272272
#endif
273273
};
274274

275-
virtual auto getSubscriptCharacter(const char inputChar, FontHandle font) const -> const
275+
[[nodiscard]] auto getSubscriptCharacter(const char inputChar, FontHandle font) const -> const
276276
char * override {
277277
#if CONFIG_TINYFONT_IBMF
278278
return reinterpret_cast<Font *>(font.ptr)->getSubscriptCharacter(inputChar);
@@ -297,7 +297,9 @@ class DisplaySystem : public RendererDisplay {
297297

298298
inline auto drawSingleLineOfText(const char *cstr, int16_t x, int16_t y, bool invert,
299299
FontHandle font) -> int16_t override {
300-
if (!font.ptr || !cstr) return x;
300+
if (!font.ptr || !cstr) {
301+
return x;
302+
}
301303
return static_cast<int16_t>(this->drawSingleLineOfText(std::string(cstr), x, y, invert,
302304
reinterpret_cast<Font *>(font.ptr)));
303305
}

src/Storage/EPubAdditions.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#include "EPubAdditions.hpp"
22

3-
auto HasSummary(std::shared_ptr<EPubFile> epubFile, const std::string_view &spineHref) -> bool {
3+
auto HasSummary(const std::shared_ptr<EPubFile> &epubFile, const std::string_view &spineHref)
4+
-> bool {
45
return epubFile->hasEpubAddition(spineHref, "summary");
56
}
67

78
auto GetSummaryContent(
8-
std::shared_ptr<EPubFile> epubFile, const std::shared_ptr<EPubPlace> &placeInReadable,
9+
const std::shared_ptr<EPubFile> &epubFile, const std::shared_ptr<EPubPlace> &placeInReadable,
910
std::shared_ptr<TxtPlace> &placeInSummary,
1011
const std::shared_ptr<UserReadablePartialChapterSummary> &partialChapterSummary,
1112
bool includeUnread) -> SpiramString {
@@ -105,11 +106,12 @@ auto GetSummaryContent(
105106
return summaryText;
106107
}
107108

108-
auto HasDictionary(std::shared_ptr<EPubFile> epubFile, const std::string_view &spineHref) -> bool {
109+
auto HasDictionary(const std::shared_ptr<EPubFile> &epubFile, const std::string_view &spineHref)
110+
-> bool {
109111
return epubFile->hasEpubAddition(spineHref, "dictionary");
110112
}
111113

112-
auto GetDictionaryContent(std::shared_ptr<EPubFile> epubFile,
114+
auto GetDictionaryContent(const std::shared_ptr<EPubFile> &epubFile,
113115
const std::shared_ptr<EPubPlace> &placeInReadable,
114116
std::shared_ptr<TxtPlace> &placeInDictionary) -> SpiramString {
115117

src/Storage/EPubAdditions.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66

77
#include "Models/UserReadablePartialChapterSummary.hpp"
88

9-
auto HasSummary(std::shared_ptr<EPubFile> epubFile, const std::string_view &spineHref) -> bool;
9+
auto HasSummary(const std::shared_ptr<EPubFile> &epubFile, const std::string_view &spineHref)
10+
-> bool;
1011

1112
auto GetSummaryContent(
12-
std::shared_ptr<EPubFile> epubFile, const std::shared_ptr<EPubPlace> &placeInReadable,
13+
const std::shared_ptr<EPubFile> &epubFile, const std::shared_ptr<EPubPlace> &placeInReadable,
1314
std::shared_ptr<TxtPlace> &placeInSummary,
1415
const std::shared_ptr<UserReadablePartialChapterSummary> &partialChapterSummary,
1516
bool includeUnread) -> SpiramString;
1617

17-
auto HasDictionary(std::shared_ptr<EPubFile> epubFile, const std::string_view &spineHref) -> bool;
18+
auto HasDictionary(const std::shared_ptr<EPubFile> &epubFile, const std::string_view &spineHref)
19+
-> bool;
1820

19-
auto GetDictionaryContent(std::shared_ptr<EPubFile> epubFile,
21+
auto GetDictionaryContent(const std::shared_ptr<EPubFile> &epubFile,
2022
const std::shared_ptr<EPubPlace> &placeInReadable,
2123
std::shared_ptr<TxtPlace> &placeInDictionary) -> SpiramString;

src/Storage/SolDrm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class SolDrm : public EPubDrm {
1616
public:
1717
SolDrm(PreferencesStore &prefs) : prefs_(prefs){};
18-
~SolDrm();
18+
~SolDrm() override;
1919

2020
auto publicKeyPem() -> std::string;
2121
auto parseKeyfile(const uint8_t *data, size_t length)

0 commit comments

Comments
 (0)