Skip to content

Commit 9d42df9

Browse files
committed
[[maybe_unused]]
1 parent 7d1c519 commit 9d42df9

19 files changed

Lines changed: 130 additions & 206 deletions

src/odr/file.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ std::vector<FileType> DecodedFile::list_file_types(const std::string &path,
7474
}
7575

7676
std::string_view DecodedFile::mimetype(const std::string &path,
77-
Logger &logger) {
78-
(void)logger;
77+
[[maybe_unused]] Logger &logger) {
7978
return internal::magic::mimetype(path);
8079
}
8180

src/odr/internal/abstract/document.hpp

Lines changed: 29 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -125,118 +125,95 @@ class ElementAdapter {
125125
const DocumentPath &path) const = 0;
126126

127127
[[nodiscard]] virtual const TextRootAdapter *
128-
text_root_adapter(ElementIdentifier element_id) const {
129-
(void)element_id;
128+
text_root_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
130129
return nullptr;
131130
}
132131
[[nodiscard]] virtual const SlideAdapter *
133-
slide_adapter(ElementIdentifier element_id) const {
134-
(void)element_id;
132+
slide_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
135133
return nullptr;
136134
}
137135
[[nodiscard]] virtual const PageAdapter *
138-
page_adapter(ElementIdentifier element_id) const {
139-
(void)element_id;
136+
page_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
140137
return nullptr;
141138
}
142139
[[nodiscard]] virtual const SheetAdapter *
143-
sheet_adapter(ElementIdentifier element_id) const {
144-
(void)element_id;
140+
sheet_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
145141
return nullptr;
146142
}
147-
[[nodiscard]] virtual const SheetCellAdapter *
148-
sheet_cell_adapter(ElementIdentifier element_id) const {
149-
(void)element_id;
143+
[[nodiscard]] virtual const SheetCellAdapter *sheet_cell_adapter(
144+
[[maybe_unused]] const ElementIdentifier element_id) const {
150145
return nullptr;
151146
}
152-
[[nodiscard]] virtual const MasterPageAdapter *
153-
master_page_adapter(ElementIdentifier element_id) const {
154-
(void)element_id;
147+
[[nodiscard]] virtual const MasterPageAdapter *master_page_adapter(
148+
[[maybe_unused]] const ElementIdentifier element_id) const {
155149
return nullptr;
156150
}
157-
[[nodiscard]] virtual const LineBreakAdapter *
158-
line_break_adapter(ElementIdentifier element_id) const {
159-
(void)element_id;
151+
[[nodiscard]] virtual const LineBreakAdapter *line_break_adapter(
152+
[[maybe_unused]] const ElementIdentifier element_id) const {
160153
return nullptr;
161154
}
162155
[[nodiscard]] virtual const ParagraphAdapter *
163-
paragraph_adapter(ElementIdentifier element_id) const {
164-
(void)element_id;
156+
paragraph_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
165157
return nullptr;
166158
}
167159
[[nodiscard]] virtual const SpanAdapter *
168-
span_adapter(ElementIdentifier element_id) const {
169-
(void)element_id;
160+
span_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
170161
return nullptr;
171162
}
172163
[[nodiscard]] virtual const TextAdapter *
173-
text_adapter(ElementIdentifier element_id) const {
174-
(void)element_id;
164+
text_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
175165
return nullptr;
176166
}
177167
[[nodiscard]] virtual const LinkAdapter *
178-
link_adapter(ElementIdentifier element_id) const {
179-
(void)element_id;
168+
link_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
180169
return nullptr;
181170
}
182171
[[nodiscard]] virtual const BookmarkAdapter *
183-
bookmark_adapter(ElementIdentifier element_id) const {
184-
(void)element_id;
172+
bookmark_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
185173
return nullptr;
186174
}
187175
[[nodiscard]] virtual const ListItemAdapter *
188-
list_item_adapter(ElementIdentifier element_id) const {
189-
(void)element_id;
176+
list_item_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
190177
return nullptr;
191178
}
192179
[[nodiscard]] virtual const TableAdapter *
193-
table_adapter(ElementIdentifier element_id) const {
194-
(void)element_id;
180+
table_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
195181
return nullptr;
196182
}
197-
[[nodiscard]] virtual const TableColumnAdapter *
198-
table_column_adapter(ElementIdentifier element_id) const {
199-
(void)element_id;
183+
[[nodiscard]] virtual const TableColumnAdapter *table_column_adapter(
184+
[[maybe_unused]] const ElementIdentifier element_id) const {
200185
return nullptr;
201186
}
202187
[[nodiscard]] virtual const TableRowAdapter *
203-
table_row_adapter(ElementIdentifier element_id) const {
204-
(void)element_id;
188+
table_row_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
205189
return nullptr;
206190
}
207-
[[nodiscard]] virtual const TableCellAdapter *
208-
table_cell_adapter(ElementIdentifier element_id) const {
209-
(void)element_id;
191+
[[nodiscard]] virtual const TableCellAdapter *table_cell_adapter(
192+
[[maybe_unused]] const ElementIdentifier element_id) const {
210193
return nullptr;
211194
}
212195
[[nodiscard]] virtual const FrameAdapter *
213-
frame_adapter(ElementIdentifier element_id) const {
214-
(void)element_id;
196+
frame_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
215197
return nullptr;
216198
}
217199
[[nodiscard]] virtual const RectAdapter *
218-
rect_adapter(ElementIdentifier element_id) const {
219-
(void)element_id;
200+
rect_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
220201
return nullptr;
221202
}
222203
[[nodiscard]] virtual const LineAdapter *
223-
line_adapter(ElementIdentifier element_id) const {
224-
(void)element_id;
204+
line_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
225205
return nullptr;
226206
}
227207
[[nodiscard]] virtual const CircleAdapter *
228-
circle_adapter(ElementIdentifier element_id) const {
229-
(void)element_id;
208+
circle_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
230209
return nullptr;
231210
}
232-
[[nodiscard]] virtual const CustomShapeAdapter *
233-
custom_shape_adapter(ElementIdentifier element_id) const {
234-
(void)element_id;
211+
[[nodiscard]] virtual const CustomShapeAdapter *custom_shape_adapter(
212+
[[maybe_unused]] const ElementIdentifier element_id) const {
235213
return nullptr;
236214
}
237215
[[nodiscard]] virtual const ImageAdapter *
238-
image_adapter(ElementIdentifier element_id) const {
239-
(void)element_id;
216+
image_adapter([[maybe_unused]] const ElementIdentifier element_id) const {
240217
return nullptr;
241218
}
242219
};

src/odr/internal/abstract/file.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ class DecodedFile {
4747
return EncryptionState::not_encrypted;
4848
}
4949
[[nodiscard]] virtual std::shared_ptr<DecodedFile>
50-
decrypt(const std::string &password) const {
51-
(void)password;
50+
decrypt([[maybe_unused]] const std::string &password) const {
5251
return nullptr;
5352
}
5453

src/odr/internal/cfb/cfb_archive.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ std::shared_ptr<abstract::Filesystem> CfbArchive::as_filesystem() const {
3131
return filesystem;
3232
}
3333

34-
void CfbArchive::save(std::ostream &out) const {
35-
(void)out;
34+
void CfbArchive::save([[maybe_unused]] std::ostream &out) const {
3635
throw UnsupportedOperation();
3736
}
3837

src/odr/internal/html/pdf2htmlex_wrapper.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ namespace {
2323

2424
pdf2htmlEX::Param create_params(PDFDoc &pdf_doc, const HtmlConfig &config,
2525
const std::string &cache_path) {
26-
(void)config;
27-
2826
pdf2htmlEX::Param param;
2927

3028
// pages
@@ -299,9 +297,10 @@ class HtmlServiceImpl final : public HtmlService {
299297

300298
namespace odr::internal {
301299

302-
odr::HtmlService html::create_poppler_pdf_service(
303-
const PopplerPdfFile &pdf_file, const std::string &cache_path,
304-
HtmlConfig config, std::shared_ptr<Logger> logger) {
300+
HtmlService html::create_poppler_pdf_service(const PopplerPdfFile &pdf_file,
301+
const std::string &cache_path,
302+
HtmlConfig config,
303+
std::shared_ptr<Logger> logger) {
305304
PDFDoc &pdf_doc = pdf_file.pdf_doc();
306305

307306
auto html_renderer_param = std::make_shared<pdf2htmlEX::Param>(

src/odr/internal/html/pdf2htmlex_wrapper.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class PopplerPdfFile;
1616

1717
namespace odr::internal::html {
1818

19-
odr::HtmlService create_poppler_pdf_service(const PopplerPdfFile &pdf_file,
20-
const std::string &cache_path,
21-
HtmlConfig config,
22-
std::shared_ptr<Logger> logger);
19+
HtmlService create_poppler_pdf_service(const PopplerPdfFile &pdf_file,
20+
const std::string &cache_path,
21+
HtmlConfig config,
22+
std::shared_ptr<Logger> logger);
2323

2424
} // namespace odr::internal::html

src/odr/internal/html/text_file.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,10 @@ class HtmlServiceImpl final : public HtmlService {
130130

131131
namespace odr::internal {
132132

133-
odr::HtmlService html::create_text_service(const TextFile &text_file,
134-
const std::string &cache_path,
135-
HtmlConfig config,
136-
std::shared_ptr<Logger> logger) {
137-
(void)cache_path;
138-
133+
odr::HtmlService
134+
html::create_text_service(const TextFile &text_file,
135+
[[maybe_unused]] const std::string &cache_path,
136+
HtmlConfig config, std::shared_ptr<Logger> logger) {
139137
return odr::HtmlService(std::make_unique<HtmlServiceImpl>(
140138
text_file, std::move(config), std::move(logger)));
141139
}

src/odr/internal/json/json_util.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ namespace odr::internal {
66

77
void json::check_json_file(std::istream &in) {
88
// TODO limit check size
9-
const auto json = nlohmann::json::parse(in);
10-
(void)json;
9+
std::ignore = nlohmann::json::parse(in);
1110
// TODO check if that even works
1211
}
1312

src/odr/internal/odf/odf_document.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,12 @@ class ElementAdapter final : public abstract::ElementAdapter,
181181
return m_registry->element_at(element_id).next_sibling_id;
182182
}
183183

184-
[[nodiscard]] bool
185-
element_is_unique(const ElementIdentifier element_id) const override {
186-
(void)element_id;
184+
[[nodiscard]] bool element_is_unique(
185+
[[maybe_unused]] const ElementIdentifier element_id) const override {
187186
return true;
188187
}
189-
[[nodiscard]] bool
190-
element_is_self_locatable(const ElementIdentifier element_id) const override {
191-
(void)element_id;
188+
[[nodiscard]] bool element_is_self_locatable(
189+
[[maybe_unused]] const ElementIdentifier element_id) const override {
192190
return true;
193191
}
194192
[[nodiscard]] bool
@@ -322,8 +320,7 @@ class ElementAdapter final : public abstract::ElementAdapter,
322320
return {};
323321
}
324322
[[nodiscard]] ElementIdentifier text_root_first_master_page(
325-
const ElementIdentifier element_id) const override {
326-
(void)element_id;
323+
[[maybe_unused]] const ElementIdentifier element_id) const override {
327324
return m_document->style_registry().first_master_page();
328325
}
329326

src/odr/internal/oldms/oldms_file.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ EncryptionState LegacyMicrosoftFile::encryption_state() const noexcept {
9090
return EncryptionState::unknown;
9191
}
9292

93-
std::shared_ptr<abstract::DecodedFile>
94-
LegacyMicrosoftFile::decrypt(const std::string &password) const {
95-
(void)password;
93+
std::shared_ptr<abstract::DecodedFile> LegacyMicrosoftFile::decrypt(
94+
[[maybe_unused]] const std::string &password) const {
9695
throw UnsupportedOperation(
9796
"odrcore does not support decryption of legacy Microsoft files");
9897
}

0 commit comments

Comments
 (0)