Address compiler warnings #10
All checks were successful
BlockStorage/repertory_osx/pipeline/head This commit looks good
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2023-10-30 12:06:07 -05:00
parent c0e720498d
commit e7413fb741
5 changed files with 7 additions and 9 deletions

View File

@ -833,7 +833,7 @@ public:
#ifdef _WIN32 #ifdef _WIN32
this->set_compat_client_id(handle, client_id); this->set_compat_client_id(handle, client_id);
#else #else
this->set_client_id(handle, client_id); this->set_client_id(static_cast<native_handle>(handle), client_id);
#endif #endif
response.encode(handle); response.encode(handle);
} }

View File

@ -28,8 +28,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace macaron { namespace macaron::Base64 {
namespace Base64 {
static std::string Encode(const char *data, const size_t &len) { static std::string Encode(const char *data, const size_t &len) {
static constexpr char sEncodingTable[] = { static constexpr char sEncodingTable[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
@ -135,7 +134,6 @@ static std::string Encode(const char *data, const size_t &len) {
return out; return out;
} }
} // namespace Base64 } // namespace macaron::Base64
} // namespace macaron
#endif /* _MACARON_BASE64_H_ */ #endif /* _MACARON_BASE64_H_ */

View File

@ -143,7 +143,7 @@ template <typename t>
template <typename t> template <typename t>
[[nodiscard]] auto random_between(const t &begin, const t &end) -> t { [[nodiscard]] auto random_between(const t &begin, const t &end) -> t {
srand(static_cast<unsigned int>(get_time_now())); srand(static_cast<unsigned int>(get_time_now()));
return begin + rand() % ((end + 1) - begin); return begin + static_cast<t>(rand()) % ((end + 1) - begin);
} }
template <typename t> template <typename t>

View File

@ -606,7 +606,7 @@ auto remote_server::fuse_read(const char *path, char *buffer,
if (res == 0) { if (res == 0) {
b.resize(read_size); b.resize(read_size);
res = pread64(static_cast<native_handle>(handle), &b[0], read_size, res = pread64(static_cast<native_handle>(handle), &b[0], read_size,
read_offset); static_cast<off_t>(read_offset));
} }
auto ret = ((res < 0) ? -errno : res); auto ret = ((res < 0) ? -errno : res);
@ -895,7 +895,7 @@ auto remote_server::fuse_write(const char *path, const char *buffer,
auto res = has_open_info(static_cast<native_handle>(handle), EBADF); auto res = has_open_info(static_cast<native_handle>(handle), EBADF);
if (res == 0) { if (res == 0) {
res = pwrite64(static_cast<native_handle>(handle), buffer, write_size, res = pwrite64(static_cast<native_handle>(handle), buffer, write_size,
write_offset); static_cast<off_t>(write_offset));
} }
auto ret = ((res < 0) ? -errno : res); auto ret = ((res < 0) ? -errno : res);

View File

@ -491,7 +491,7 @@ void file_manager::open_file::update_background_reader(std::size_t read_chunk) {
if (not reader_thread_ && not stop_requested_) { if (not reader_thread_ && not stop_requested_) {
reader_thread_ = std::make_unique<std::thread>([this]() { reader_thread_ = std::make_unique<std::thread>([this]() {
auto next_chunk = 0u; std::size_t next_chunk{};
while (not stop_requested_) { while (not stop_requested_) {
unique_recur_mutex_lock file_lock(file_mtx_); unique_recur_mutex_lock file_lock(file_mtx_);
if ((fsi_.size == 0u) || read_state_.all()) { if ((fsi_.size == 0u) || read_state_.all()) {