diff --git a/include/drives/remote/remote_server_base.hpp b/include/drives/remote/remote_server_base.hpp index 3deb9b12..a2ca2ce3 100644 --- a/include/drives/remote/remote_server_base.hpp +++ b/include/drives/remote/remote_server_base.hpp @@ -833,7 +833,7 @@ public: #ifdef _WIN32 this->set_compat_client_id(handle, client_id); #else - this->set_client_id(handle, client_id); + this->set_client_id(static_cast(handle), client_id); #endif response.encode(handle); } diff --git a/include/utils/Base64.hpp b/include/utils/Base64.hpp index f099ce69..045c6c15 100644 --- a/include/utils/Base64.hpp +++ b/include/utils/Base64.hpp @@ -28,8 +28,7 @@ #include #include -namespace macaron { -namespace Base64 { +namespace macaron::Base64 { static std::string Encode(const char *data, const size_t &len) { static constexpr char sEncodingTable[] = { '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; } -} // namespace Base64 -} // namespace macaron +} // namespace macaron::Base64 #endif /* _MACARON_BASE64_H_ */ diff --git a/include/utils/utils.hpp b/include/utils/utils.hpp index 09951206..016cf20a 100644 --- a/include/utils/utils.hpp +++ b/include/utils/utils.hpp @@ -143,7 +143,7 @@ template template [[nodiscard]] auto random_between(const t &begin, const t &end) -> t { srand(static_cast(get_time_now())); - return begin + rand() % ((end + 1) - begin); + return begin + static_cast(rand()) % ((end + 1) - begin); } template diff --git a/src/drives/fuse/remotefuse/remote_server.cpp b/src/drives/fuse/remotefuse/remote_server.cpp index 5f64a473..0a70bc14 100644 --- a/src/drives/fuse/remotefuse/remote_server.cpp +++ b/src/drives/fuse/remotefuse/remote_server.cpp @@ -606,7 +606,7 @@ auto remote_server::fuse_read(const char *path, char *buffer, if (res == 0) { b.resize(read_size); res = pread64(static_cast(handle), &b[0], read_size, - read_offset); + static_cast(read_offset)); } 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(handle), EBADF); if (res == 0) { res = pwrite64(static_cast(handle), buffer, write_size, - write_offset); + static_cast(write_offset)); } auto ret = ((res < 0) ? -errno : res); diff --git a/src/file_manager/file_manager_open_file.cpp b/src/file_manager/file_manager_open_file.cpp index d2a485d1..7dd78e5e 100644 --- a/src/file_manager/file_manager_open_file.cpp +++ b/src/file_manager/file_manager_open_file.cpp @@ -491,7 +491,7 @@ void file_manager::open_file::update_background_reader(std::size_t read_chunk) { if (not reader_thread_ && not stop_requested_) { reader_thread_ = std::make_unique([this]() { - auto next_chunk = 0u; + std::size_t next_chunk{}; while (not stop_requested_) { unique_recur_mutex_lock file_lock(file_mtx_); if ((fsi_.size == 0u) || read_state_.all()) {