From ce3922cff1a771235907fc9d62847a79bba0807d Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 13 Jan 2024 18:53:19 +0200 Subject: [PATCH] Fix some typos --- include/spdlog/async.h | 3 +-- include/spdlog/async_logger.h | 2 +- include/spdlog/details/circular_q.h | 2 +- include/spdlog/sinks/stdout_sinks.h | 2 +- src/common.cpp | 2 +- src/details/os.cpp | 2 +- src/sinks/stdout_sinks.cpp | 4 ++-- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/spdlog/async.h b/include/spdlog/async.h index b4bdf6c9..eb200618 100644 --- a/include/spdlog/async.h +++ b/include/spdlog/async.h @@ -37,8 +37,7 @@ struct async_factory_impl { static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) { auto ®istry_inst = details::registry::instance(); - // create global thread pool if not already exists.. - + // create global thread pool if not already exists auto &mutex = registry_inst.tp_mutex(); std::lock_guard tp_lock(mutex); auto tp = registry_inst.get_tp(); diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 70b23641..591d3cfc 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -21,7 +21,7 @@ namespace spdlog { // Async overflow policy - block by default. enum class async_overflow_policy { block, // Block until message can be enqueued - overrun_oldest, // Discard oldest message in the queue if full when trying to + overrun_oldest, // Discard the oldest message in the queue if full when trying to // add new item. discard_new // Discard new message if the queue is full when trying to add new item. }; diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 4fbb2eea..f858a48b 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -32,7 +32,7 @@ public: circular_q &operator=(const circular_q &) = default; // move cannot be default, - // since we need to reset head_, tail_, etc to zero in the moved object + // since we need to reset head_, tail_, etc. to zero in the moved object circular_q(circular_q &&other) noexcept { copy_moveable(std::move(other)); } circular_q &operator=(circular_q &&other) noexcept { diff --git a/include/spdlog/sinks/stdout_sinks.h b/include/spdlog/sinks/stdout_sinks.h index 680f343b..0d6325f5 100644 --- a/include/spdlog/sinks/stdout_sinks.h +++ b/include/spdlog/sinks/stdout_sinks.h @@ -36,7 +36,7 @@ private: void flush_() override; #ifdef _WIN32 HANDLE handle_; -#endif // WIN32 +#endif // _WIN32 }; template diff --git a/src/common.cpp b/src/common.cpp index 2d789765..1a7c24ad 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -12,7 +12,7 @@ spdlog::level level_from_str(const std::string &name) noexcept { auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); if (it != std::end(level_string_views)) return static_cast(std::distance(std::begin(level_string_views), it)); - // check also for "warn" and "err" before giving up.. + // check also for "warn" and "err" before giving up if (name == "warn") { return spdlog::level::warn; } diff --git a/src/details/os.cpp b/src/details/os.cpp index 6e014d34..b44864df 100644 --- a/src/details/os.cpp +++ b/src/details/os.cpp @@ -56,7 +56,7 @@ #include // for thr_self #endif -#endif // unix +#endif // _WIN32 #if defined __APPLE__ #include diff --git a/src/sinks/stdout_sinks.cpp b/src/sinks/stdout_sinks.cpp index 99333b5c..9bb6ab55 100644 --- a/src/sinks/stdout_sinks.cpp +++ b/src/sinks/stdout_sinks.cpp @@ -40,7 +40,7 @@ stdout_sink_base::stdout_sink_base(FILE *file) if (handle_ == INVALID_HANDLE_VALUE && file != stdout && file != stderr) { throw_spdlog_ex("spdlog::stdout_sink_base: _get_osfhandle() failed", errno); } -#endif // WIN32 +#endif // _WIN32 } template @@ -62,7 +62,7 @@ void stdout_sink_base::sink_it_(const details::log_msg &msg) { memory_buf_t formatted; base_sink::formatter_->format(msg, formatted); ::fwrite(formatted.data(), sizeof(char), formatted.size(), file_); -#endif // WIN32 +#endif // _WIN32 ::fflush(file_); // flush every line to terminal }