Skip to content

Commit 203f871

Browse files
committed
fix linter remarks
Signed-off-by: Paul Gannay <paul.gannay@cea.fr>
1 parent e5be948 commit 203f871

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/ddc/print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void print_dim_name(
6767

6868
} // namespace detail
6969

70-
PrinterOptions set_print_options(PrinterOptions const options)
70+
PrinterOptions set_print_options(PrinterOptions options)
7171
{
7272
ddc::detail::ChunkPrinter& printer = ddc::detail::ChunkPrinter::get_instance();
7373

src/ddc/print.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ struct ChunkPrinter
5252

5353
ChunkPrinter(ChunkPrinter&) = delete;
5454
ChunkPrinter(ChunkPrinter&&) = delete;
55+
ChunkPrinter operator=(ChunkPrinter&&) = delete;
56+
ChunkPrinter& operator=(ChunkPrinter& other) = delete;
57+
58+
~ChunkPrinter() = default;
5559

5660
private:
57-
ChunkPrinter() {}
61+
ChunkPrinter() = default;
5862

5963
/**
6064
* Print the spaces needed to align value to os
@@ -342,7 +346,7 @@ void print_dim_name(std::ostream& os, DiscreteVector<Dims...> const& dd)
342346
* option is invalid if m_edgeitems >= (m_threshold / 2), in this case the
343347
* format isn't changed.
344348
*/
345-
PrinterOptions set_print_options(PrinterOptions const options = PrinterOptions());
349+
PrinterOptions set_print_options(PrinterOptions options = PrinterOptions());
346350

347351
/**
348352
* Return the currently used format options
@@ -434,7 +438,7 @@ std::ostream& print_full(
434438
ddc::detail::ChunkPrinter& printer = ddc::detail::ChunkPrinter::get_instance();
435439
std::scoped_lock const lock(printer.m_global_lock);
436440

437-
PrinterOptions old_options
441+
const PrinterOptions old_options
438442
= set_print_options({.threshold = std::numeric_limits<size_t>::max(), .edgeitems = 1});
439443

440444
print_type_info(os, chunk_span);

tests/print.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void TestPrintFull()
226226
{
227227
// Very restrictive options
228228
ddc::set_print_options({.threshold = 3, .edgeitems = 1});
229-
ddc::PrinterOptions options = ddc::get_print_options();
229+
const ddc::PrinterOptions options = ddc::get_print_options();
230230

231231
unsigned const dim0 = 6;
232232
unsigned const dim1 = 6;
@@ -391,7 +391,7 @@ template <typename ElementType>
391391
void TestPrintCheckCheckIncorrectOptions()
392392
{
393393
// Reset options
394-
ddc::PrinterOptions defaultOptions = ddc::set_print_options();
394+
const ddc::PrinterOptions defaultOptions = ddc::set_print_options();
395395
ddc::PrinterOptions newOptions;
396396

397397
// Test obviously wrong options

0 commit comments

Comments
 (0)