diff --git a/cmake/config.h.in b/cmake/config.h.in index 13346d1b..c6889c22 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -1,5 +1,6 @@ #pragma once +// NOLINTBEGIN(cppcoreguidelines-macro-to-enum) #cmakedefine DWARFS_HAVE_LIBMAGIC 1 #cmakedefine DWARFS_HAVE_LIBLZ4 1 #cmakedefine DWARFS_HAVE_LIBLZMA 1 @@ -11,3 +12,4 @@ #cmakedefine DWARFS_BUILTIN_MANPAGE 1 #cmakedefine DWARFS_PERFMON_ENABLED 1 #cmakedefine DWARFS_STACKTRACE_ENABLED 1 +// NOLINTEND(cppcoreguidelines-macro-to-enum) diff --git a/include/dwarfs/mmif.h b/include/dwarfs/mmif.h index 3875ee7c..7a93daf1 100644 --- a/include/dwarfs/mmif.h +++ b/include/dwarfs/mmif.h @@ -50,6 +50,7 @@ class mmif : public boost::noncopyable { T const* as(U offset = 0) const { // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) auto raw = static_cast(this->addr()) + offset; + // NOLINTNEXTLINE(bugprone-casting-through-void) return static_cast(static_cast(raw)); } diff --git a/include/dwarfs/writer/internal/progress.h b/include/dwarfs/writer/internal/progress.h index f1583bcf..828f059e 100644 --- a/include/dwarfs/writer/internal/progress.h +++ b/include/dwarfs/writer/internal/progress.h @@ -148,9 +148,11 @@ class progress { std::chrono::steady_clock::time_point const start_; }; + // NOLINTBEGIN(cppcoreguidelines-non-private-member-variables-in-classes) scan_progress similarity; scan_progress categorize; scan_progress hash; + // NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes) private: void add_context(std::shared_ptr const& ctx) const; diff --git a/include/dwarfs/writer/internal/scanner_progress.h b/include/dwarfs/writer/internal/scanner_progress.h index 1d190a1a..8c9380e6 100644 --- a/include/dwarfs/writer/internal/scanner_progress.h +++ b/include/dwarfs/writer/internal/scanner_progress.h @@ -40,7 +40,9 @@ class scanner_progress : public progress::context { status get_status() const override; + // NOLINTBEGIN(cppcoreguidelines-non-private-member-variables-in-classes) std::atomic bytes_processed{0}; + // NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes) private: termcolor const color_; diff --git a/src/compression/flac.cpp b/src/compression/flac.cpp index b28501d6..0c9ef7a9 100644 --- a/src/compression/flac.cpp +++ b/src/compression/flac.cpp @@ -58,6 +58,7 @@ class dwarfs_flac_stream_encoder final : public FLAC::Encoder::Stream { : data_{data} , pos_{data_.size()} {} + // NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays) ::FLAC__StreamEncoderReadStatus read_callback(FLAC__byte buffer[], size_t* bytes) override { ::memcpy(buffer, data_.data() + pos_, *bytes); @@ -75,6 +76,7 @@ class dwarfs_flac_stream_encoder final : public FLAC::Encoder::Stream { pos_ += bytes; return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; } + // NOLINTEND(cppcoreguidelines-avoid-c-arrays) ::FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset) override { @@ -113,6 +115,7 @@ class dwarfs_flac_stream_decoder final : public FLAC::Decoder::Stream { : pcm_sample_padding::Msb, bytes_per_sample_, header_.bits_per_sample().value()} {} + // NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays) ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t* bytes) override { if (pos_ >= data_.size()) { @@ -153,6 +156,7 @@ class dwarfs_flac_stream_decoder final : public FLAC::Decoder::Stream { return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } + // NOLINTEND(cppcoreguidelines-avoid-c-arrays) void error_callback(::FLAC__StreamDecoderErrorStatus status) override { DWARFS_THROW(runtime_error, diff --git a/src/terminal_ansi.cpp b/src/terminal_ansi.cpp index 1204b6c7..67c31024 100644 --- a/src/terminal_ansi.cpp +++ b/src/terminal_ansi.cpp @@ -90,6 +90,7 @@ bool is_fancy_impl() { return true; } size_t width_impl() { struct ::winsize w; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) auto rv = ::ioctl(STDERR_FILENO, TIOCGWINSZ, &w); return rv == 0 ? w.ws_col : default_width; } diff --git a/src/writer/segmenter.cpp b/src/writer/segmenter.cpp index bfaa86ce..1ee4e90d 100644 --- a/src/writer/segmenter.cpp +++ b/src/writer/segmenter.cpp @@ -657,8 +657,10 @@ class segmenter_progress : public progress::context { return st; } + // NOLINTBEGIN(cppcoreguidelines-non-private-member-variables-in-classes) std::atomic current_file{nullptr}; std::atomic bytes_processed{0}; + // NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes) private: std::string const context_;