Fixed warnings

This commit is contained in:
gabime 2024-12-06 12:20:06 +02:00
parent 28ea21b241
commit 9f4492da61
5 changed files with 10 additions and 7 deletions

View File

@ -121,6 +121,7 @@ struct fmt::formatter<spdlog::details::dump_info<T>, char> {
show_ascii = true; show_ascii = true;
} }
break; break;
default:;
} }
++it; ++it;

View File

@ -47,7 +47,7 @@ template <typename Mutex, typename FileNameCalc = hourly_filename_calculator>
class hourly_file_sink final : public base_sink<Mutex> { class hourly_file_sink final : public base_sink<Mutex> {
public: public:
// create hourly file sink which rotates on given time // create hourly file sink which rotates on given time
hourly_file_sink(filename_t base_filename, explicit hourly_file_sink(filename_t base_filename,
bool truncate = false, bool truncate = false,
uint16_t max_files = 0, uint16_t max_files = 0,
const file_event_handlers &event_handlers = {}) const file_event_handlers &event_handlers = {})

View File

@ -21,7 +21,7 @@ template <typename Mutex>
class msvc_sink final : public base_sink<Mutex> { class msvc_sink final : public base_sink<Mutex> {
public: public:
msvc_sink() = default; msvc_sink() = default;
msvc_sink(bool check_debugger_present) explicit msvc_sink(bool check_debugger_present)
: check_debugger_present_{check_debugger_present} {} : check_debugger_present_{check_debugger_present} {}
protected: protected:

View File

@ -29,9 +29,11 @@ void file_helper::open(const filename_t &fname, bool truncate) {
if (event_handlers_.before_open) { if (event_handlers_.before_open) {
event_handlers_.before_open(filename_); event_handlers_.before_open(filename_);
} }
// create containing folder if not exists already.
os::create_dir(os::dir_name(fname));
for (int tries = 0; tries < open_tries_; ++tries) { for (int tries = 0; tries < open_tries_; ++tries) {
// create containing folder if not exists already.
os::create_dir(os::dir_name(fname));
if (truncate) { if (truncate) {
// Truncate by opening-and-closing a tmp file in "wb" mode, always // Truncate by opening-and-closing a tmp file in "wb" mode, always
// opening the actual log-we-write-to in "ab" mode, since that // opening the actual log-we-write-to in "ab" mode, since that

View File

@ -9,7 +9,7 @@
using spdlog::details::file_helper; using spdlog::details::file_helper;
static void write_with_helper(file_helper &helper, size_t howmany) { static void write_with_helper(const file_helper &helper, size_t howmany) {
spdlog::memory_buf_t formatted; spdlog::memory_buf_t formatted;
spdlog::fmt_lib::format_to(std::back_inserter(formatted), "{}", std::string(howmany, '1')); spdlog::fmt_lib::format_to(std::back_inserter(formatted), "{}", std::string(howmany, '1'));
helper.write(formatted); helper.write(formatted);