Skip to content

Commit

Permalink
for clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Oct 8, 2023
1 parent 8af53a4 commit 4e40730
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion include/limestone/api/datastore.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class datastore {
/**
* @brief name of a file to record durable epoch
*/
static constexpr const std::string_view epoch_file_name = "epoch"; // NOLINT
static constexpr const std::string_view epoch_file_name = "epoch"; // LINT

enum class state : std::int64_t {
not_ready = 0,
Expand Down
18 changes: 9 additions & 9 deletions src/limestone/datastore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ datastore::datastore(configuration const& conf) : location_(conf.data_locations_
const bool result_mkdir = boost::filesystem::create_directory(location_, error);
if (!result_mkdir || error) {
LOG_LP(ERROR) << "fail to create directory: result_mkdir: " << result_mkdir << ", error_code: " << error << ", path: " << location_;
throw std::runtime_error("fail to create the log_location directory"); //NOLINT
throw std::runtime_error("fail to create the log_location directory"); // LINT
}
} else {
BOOST_FOREACH(const boost::filesystem::path& p, std::make_pair(boost::filesystem::directory_iterator(location_), boost::filesystem::directory_iterator())) {
Expand All @@ -55,12 +55,12 @@ datastore::datastore(configuration const& conf) : location_(conf.data_locations_
epoch_file_path_ = location_ / boost::filesystem::path(std::string(epoch_file_name));
const bool result = boost::filesystem::exists(epoch_file_path_, error);
if (!result || error) {
FILE* strm = fopen(epoch_file_path_.c_str(), "a"); // NOLINT
FILE* strm = fopen(epoch_file_path_.c_str(), "a"); // LINT

Check warning on line 58 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

initializing non-owner 'FILE *' (aka '_IO_FILE *') with a newly created 'gsl::owner<>'
if (!strm) {
LOG_LP(ERROR) << "does not have write permission for the log_location directory, path: " << location_;
throw std::runtime_error("does not have write permission for the log_location directory"); //NOLINT
throw std::runtime_error("does not have write permission for the log_location directory"); // LINT
}
fclose(strm); // NOLINT TODO: error check
fclose(strm); // LINT TODO: error check

Check warning on line 63 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used

Check warning on line 63 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

calling legacy resource function without passing a 'gsl::owner<>'
add_file(epoch_file_path_);
}

Expand Down Expand Up @@ -143,14 +143,14 @@ void datastore::update_min_epoch_id(bool from_switch_epoch) noexcept {
if (epoch_id_recorded_.compare_exchange_strong(old_epoch_id, to_be_epoch)) {
std::lock_guard<std::mutex> lock(mtx_epoch_file_);

FILE* strm = fopen(epoch_file_path_.c_str(), "a"); // NOLINT TODO: error check
FILE* strm = fopen(epoch_file_path_.c_str(), "a"); // LINT TODO: error check

Check warning on line 146 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

initializing non-owner 'FILE *' (aka '_IO_FILE *') with a newly created 'gsl::owner<>'
log_entry::durable_epoch(strm, static_cast<epoch_id_type>(epoch_id_informed_.load()));
fflush(strm); // NOLINT TODO: error check
fflush(strm); // LINT TODO: error check

Check warning on line 148 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
if (int rc = fsync(fileno(strm)); rc != 0) {
LOG_LP(ERROR) << "fsync failed, errno = " << errno;
std::abort();
}
fclose(strm); // NOLINT TODO: error check
fclose(strm); // LINT TODO: error check

Check warning on line 153 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used

Check warning on line 153 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

calling legacy resource function without passing a 'gsl::owner<>'
break;
}
}
Expand Down Expand Up @@ -200,7 +200,7 @@ backup& datastore::begin_backup() {
return *backup_;
}

std::unique_ptr<backup_detail> datastore::begin_backup(backup_type btype) { // NOLINT(readability-function-cognitive-complexity)
std::unique_ptr<backup_detail> datastore::begin_backup(backup_type btype) { // LINT(readability-function-cognitive-complexity)

Check warning on line 203 in src/limestone/datastore.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

readability-function-cognitive-complexity

function 'begin_backup' has cognitive complexity of 28 (threshold 25)
rotate_log_files();

// LOG-0: all files are log file, so all files are selected in both standard/transaction mode.
Expand Down Expand Up @@ -329,7 +329,7 @@ void datastore::rotate_epoch_file() {
strm.open(epoch_file_path_, std::ios_base::out | std::ios_base::app | std::ios_base::binary);
if(!strm || !strm.is_open() || strm.bad() || strm.fail()){
LOG_LP(ERROR) << "does not have write permission for the log_location directory, path: " << location_;
throw std::runtime_error("does not have write permission for the log_location directory"); //NOLINT
throw std::runtime_error("does not have write permission for the log_location directory"); // LINT
}
strm.close();
}
Expand Down
14 changes: 7 additions & 7 deletions src/limestone/datastore_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ epoch_id_type datastore::last_durable_epoch_in_dir() noexcept {

[[maybe_unused]]
static void store_bswap64_value(void *dest, const void *src) {
auto* p64_dest = reinterpret_cast<std::uint64_t*>(dest); // NOLINT
auto* p64_src = reinterpret_cast<const std::uint64_t*>(src); // NOLINT
auto* p64_dest = reinterpret_cast<std::uint64_t*>(dest); // LINT

Check warning on line 80 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-pro-type-reinterpret-cast

do not use reinterpret_cast
auto* p64_src = reinterpret_cast<const std::uint64_t*>(src); // LINT

Check warning on line 81 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-pro-type-reinterpret-cast

do not use reinterpret_cast
*p64_dest = __bswap_64(*p64_src);
}

Expand All @@ -92,7 +92,7 @@ static int comp_twisted_key(const std::string_view& a, const std::string_view& b
return std::memcmp(b.data(), a.data(), write_version_size);
}

void datastore::create_snapshot() noexcept { // NOLINT(readability-function-cognitive-complexity)
void datastore::create_snapshot() noexcept { // LINT(readability-function-cognitive-complexity)

Check warning on line 95 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

readability-function-cognitive-complexity

function 'create_snapshot' has cognitive complexity of 40 (threshold 25)
auto& from_dir = location_;
#if defined SORT_METHOD_PUT_ONLY
auto sortdb = std::make_unique<sortdb_wrapper>(from_dir, comp_twisted_key);
Expand Down Expand Up @@ -129,7 +129,7 @@ void datastore::create_snapshot() noexcept { // NOLINT(readability-function-cog
// key_sid: storage_id[8] key[*], value_etc: epoch[8]LE minor_version[8]LE value[*], type: type[1]
// db_key: epoch[8]BE minor_version[8]BE storage_id[8] key[*], db_value: type[1] value[*]
std::string db_key(write_version_size + e.key_sid().size(), '\0');
store_bswap64_value(&db_key[0], &e.value_etc()[0]); // NOLINT(readability-container-data-pointer)
store_bswap64_value(&db_key[0], &e.value_etc()[0]); // LINT(readability-container-data-pointer)

Check warning on line 132 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

readability-container-data-pointer

'data' should be used for accessing the data pointer instead of taking the address of the 0-th element

Check warning on line 132 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

readability-container-data-pointer

'data' should be used for accessing the data pointer instead of taking the address of the 0-th element
store_bswap64_value(&db_key[8], &e.value_etc()[8]);
std::memcpy(&db_key[write_version_size], e.key_sid().data(), e.key_sid().size());
std::string db_value(1, static_cast<char>(e.type()));
Expand Down Expand Up @@ -214,12 +214,12 @@ void datastore::create_snapshot() noexcept { // NOLINT(readability-function-cog

boost::filesystem::path snapshot_file = sub_dir / boost::filesystem::path(std::string(snapshot::file_name_));
VLOG_LP(log_info) << "generating snapshot file: " << snapshot_file;
FILE* ostrm = fopen(snapshot_file.c_str(), "w"); // NOLINT
FILE* ostrm = fopen(snapshot_file.c_str(), "w"); // LINT

Check warning on line 217 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

initializing non-owner 'FILE *' (aka '_IO_FILE *') with a newly created 'gsl::owner<>'
if (!ostrm) {
LOG_LP(ERROR) << "cannot create snapshot file (" << snapshot_file << ")";
std::abort();
}
setvbuf(ostrm, nullptr, _IOFBF, 1024L * 1024L); // NOLINT TODO: error check
setvbuf(ostrm, nullptr, _IOFBF, 1024L * 1024L); // LINT TODO: error check

Check warning on line 222 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
static_assert(sizeof(log_entry::entry_type) == 1);
#if defined SORT_METHOD_PUT_ONLY
sortdb->each([&ostrm, last_key = std::string{}](std::string_view db_key, std::string_view db_value) mutable {
Expand Down Expand Up @@ -264,7 +264,7 @@ void datastore::create_snapshot() noexcept { // NOLINT(readability-function-cog
}
});
#endif
fclose(ostrm); // NOLINT TODO: error check
fclose(ostrm); // LINT TODO: error check

Check warning on line 267 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used

Check warning on line 267 in src/limestone/datastore_snapshot.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

calling legacy resource function without passing a 'gsl::owner<>'
}

} // namespace limestone::api
8 changes: 4 additions & 4 deletions src/limestone/log_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ void log_channel::begin_session() noexcept {
} while (current_epoch_id_.load() != envelope_.epoch_id_switched_.load());

auto log_file = file_path();
strm_ = fopen(log_file.c_str(), "a"); // NOLINT TODO: error check
setvbuf(strm_, nullptr, _IOFBF, 1024L * 1024L); // NOLINT TODO: error check
strm_ = fopen(log_file.c_str(), "a"); // LINT TODO: error check

Check warning on line 47 in src/limestone/log_channel.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

assigning newly created 'gsl::owner<>' to non-owner 'FILE *' (aka '_IO_FILE *')
setvbuf(strm_, nullptr, _IOFBF, 1024L * 1024L); // LINT TODO: error check

Check warning on line 48 in src/limestone/log_channel.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
if (!registered_) {
envelope_.add_file(log_file);
registered_ = true;
Expand All @@ -54,15 +54,15 @@ void log_channel::begin_session() noexcept {
}

void log_channel::end_session() noexcept {
fflush(strm_); // NOLINT TODO: error check
fflush(strm_); // LINT TODO: error check

Check warning on line 57 in src/limestone/log_channel.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
if (int rc = fsync(fileno(strm_)); rc != 0) {
LOG_LP(ERROR) << "fsync failed, errno = " << errno;
std::abort();
}
finished_epoch_id_.store(current_epoch_id_.load());
current_epoch_id_.store(UINT64_MAX);
envelope_.update_min_epoch_id();
fclose(strm_); // NOLINT TODO: error check
fclose(strm_); // LINT TODO: error check

Check warning on line 65 in src/limestone/log_channel.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used

Check warning on line 65 in src/limestone/log_channel.cpp

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

calling legacy resource function without passing a 'gsl::owner<>'
}

void log_channel::abort_session([[maybe_unused]] status status_code, [[maybe_unused]] const std::string& message) noexcept {
Expand Down
52 changes: 26 additions & 26 deletions src/limestone/log_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,47 +88,47 @@ class log_entry {
write_uint8(strm, static_cast<std::uint8_t>(type));

std::size_t key_len = key.length();
assert(key_len <= UINT32_MAX); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
assert(key_len <= UINT32_MAX); // LINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
write_uint32(strm, static_cast<std::uint32_t>(key_len));

std::size_t value_len = value.length();
assert(value_len <= UINT32_MAX); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
assert(value_len <= UINT32_MAX); // LINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
write_uint32(strm, static_cast<std::uint32_t>(value_len));

write_uint64(strm, static_cast<std::uint64_t>(storage_id));
fwrite(key.data(), static_cast<std::streamsize>(key_len), 1, strm); // NOLINT TODO: check error
fwrite(key.data(), static_cast<std::streamsize>(key_len), 1, strm); // LINT TODO: check error

Check warning on line 99 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used

write_uint64(strm, static_cast<std::uint64_t>(write_version.epoch_number_));
write_uint64(strm, static_cast<std::uint64_t>(write_version.minor_write_version_));
fwrite(value.data(), static_cast<std::streamsize>(value_len), 1, strm); // NOLINT TODO: check error
fwrite(value.data(), static_cast<std::streamsize>(value_len), 1, strm); // LINT TODO: check error

Check warning on line 103 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
}

static void write(FILE* strm, std::string_view key_sid, std::string_view value_etc) {
entry_type type = entry_type::normal_entry;
write_uint8(strm, static_cast<std::uint8_t>(type));

std::size_t key_len = key_sid.length() - sizeof(storage_id_type);
assert(key_len <= UINT32_MAX); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
assert(key_len <= UINT32_MAX); // LINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
write_uint32(strm, static_cast<std::uint32_t>(key_len));

std::size_t value_len = value_etc.length() - (sizeof(epoch_id_type) + sizeof(std::uint64_t));
assert(value_len <= UINT32_MAX); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
assert(value_len <= UINT32_MAX); // LINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
write_uint32(strm, static_cast<std::uint32_t>(value_len));

fwrite(key_sid.data(), static_cast<std::streamsize>(key_sid.length()), 1, strm); // NOLINT TODO: check error
fwrite(value_etc.data(), static_cast<std::streamsize>(value_etc.length()), 1, strm); // NOLINT TODO: check error
fwrite(key_sid.data(), static_cast<std::streamsize>(key_sid.length()), 1, strm); // LINT TODO: check error

Check warning on line 118 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fwrite(value_etc.data(), static_cast<std::streamsize>(value_etc.length()), 1, strm); // LINT TODO: check error

Check warning on line 119 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
}

static void write_remove(FILE* strm, storage_id_type storage_id, std::string_view key, write_version_type write_version) {
entry_type type = entry_type::remove_entry;
write_uint8(strm, static_cast<std::uint8_t>(type));

std::size_t key_len = key.length();
assert(key_len <= UINT32_MAX); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
assert(key_len <= UINT32_MAX); // LINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
write_uint32(strm, static_cast<std::uint32_t>(key_len));

write_uint64(strm, static_cast<std::uint64_t>(storage_id));
fwrite(key.data(), static_cast<std::streamsize>(key_len), 1, strm); // NOLINT TODO: check error
fwrite(key.data(), static_cast<std::streamsize>(key_len), 1, strm); // LINT TODO: check error

Check warning on line 131 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used

write_uint64(strm, static_cast<std::uint64_t>(write_version.epoch_number_));
write_uint64(strm, static_cast<std::uint64_t>(write_version.minor_write_version_));
Expand All @@ -139,11 +139,11 @@ class log_entry {
write_uint8(strm, static_cast<std::uint8_t>(type));

std::size_t key_len = key_sid.length() - sizeof(storage_id_type);
assert(key_len <= UINT32_MAX); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
assert(key_len <= UINT32_MAX); // LINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
write_uint32(strm, static_cast<std::uint32_t>(key_len));

fwrite(key_sid.data(), static_cast<std::streamsize>(key_sid.length()), 1, strm); // NOLINT TODO: check error
fwrite(value_etc.data(), static_cast<std::streamsize>(value_etc.length()), 1, strm); // NOLINT TODO: check error
fwrite(key_sid.data(), static_cast<std::streamsize>(key_sid.length()), 1, strm); // LINT TODO: check error

Check warning on line 145 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fwrite(value_etc.data(), static_cast<std::streamsize>(value_etc.length()), 1, strm); // LINT TODO: check error

Check warning on line 146 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
}

// for reader
Expand Down Expand Up @@ -236,13 +236,13 @@ class log_entry {
char one_char_{};

static void write_uint8(FILE* out, const std::uint8_t value) {
fputc(value, out); // NOLINT TODO: check error
fputc(value, out); // LINT TODO: check error

Check warning on line 239 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
}
static void write_uint32(FILE* out, const std::uint32_t value) {
fputc(static_cast<int>((value>>0U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>8U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>16U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>24U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>0U)&0xFFU), out); // LINT TODO: check error

Check warning on line 242 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>8U)&0xFFU), out); // LINT TODO: check error

Check warning on line 243 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>16U)&0xFFU), out); // LINT TODO: check error

Check warning on line 244 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>24U)&0xFFU), out); // LINT TODO: check error

Check warning on line 245 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
}
static std::uint32_t read_uint32(std::istream& in) {
std::uint32_t value = (static_cast<std::uint8_t>(in.get())&0xFFU);
Expand All @@ -252,14 +252,14 @@ class log_entry {
return value;
}
static void write_uint64(FILE* out, const std::uint64_t value) {
fputc(static_cast<int>((value>>0U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>8U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>16U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>24U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>32U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>40U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>48U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>56U)&0xFFU), out); // NOLINT TODO: check error
fputc(static_cast<int>((value>>0U)&0xFFU), out); // LINT TODO: check error

Check warning on line 255 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>8U)&0xFFU), out); // LINT TODO: check error

Check warning on line 256 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>16U)&0xFFU), out); // LINT TODO: check error

Check warning on line 257 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>24U)&0xFFU), out); // LINT TODO: check error

Check warning on line 258 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>32U)&0xFFU), out); // LINT TODO: check error

Check warning on line 259 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>40U)&0xFFU), out); // LINT TODO: check error

Check warning on line 260 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>48U)&0xFFU), out); // LINT TODO: check error

Check warning on line 261 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
fputc(static_cast<int>((value>>56U)&0xFFU), out); // LINT TODO: check error

Check warning on line 262 in src/limestone/log_entry.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cert-err33-c

the value returned by this function should be used
}
static std::uint64_t read_uint64(std::istream& in) {
std::uint64_t value_l = (static_cast<std::uint8_t>(in.get())&0xFFU);
Expand Down
4 changes: 2 additions & 2 deletions src/limestone/logging_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ constexpr auto location_prefix(const std::string_view sv) {
}

template<size_t N, size_t M>
constexpr auto location_prefix(const char (&prettyname)[N], const char (&funcname)[M]) { // NOLINT
const std::string_view sv = find_fullname(prettyname, funcname); // NOLINT
constexpr auto location_prefix(const char (&prettyname)[N], const char (&funcname)[M]) { // LINT

Check warning on line 88 in src/limestone/logging_helper.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays

do not declare C-style arrays, use std::array<> instead

Check warning on line 88 in src/limestone/logging_helper.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays

do not declare C-style arrays, use std::array<> instead
const std::string_view sv = find_fullname(prettyname, funcname); // LINT

Check warning on line 89 in src/limestone/logging_helper.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-pro-bounds-array-to-pointer-decay

do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead

Check warning on line 89 in src/limestone/logging_helper.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-pro-bounds-array-to-pointer-decay

do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead
return location_prefix<std::max(N, M)>(sv);
}

Expand Down
4 changes: 2 additions & 2 deletions src/limestone/sortdb_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ class sortdb_wrapper {
}

void each(const std::function<void(std::string_view, std::string_view)>& fun) {
Iterator* it = sortdb_->NewIterator(ReadOptions()); // NOLINT (typical usage of API)
Iterator* it = sortdb_->NewIterator(ReadOptions()); // LINT (typical usage of API)
for (it->SeekToFirst(); it->Valid(); it->Next()) {
Slice key = it->key();
Slice value = it->value();
fun(std::string_view(key.data(), key.size()), std::string_view(value.data(), value.size()));
}
delete it; // NOLINT (typical usage of API)
delete it; // LINT (typical usage of API)

Check warning on line 98 in src/limestone/sortdb_wrapper.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-owning-memory

deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead
}

private:
Expand Down

0 comments on commit 4e40730

Please sign in to comment.