Skip to content

Commit

Permalink
Fixed static analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianPanov committed Nov 8, 2024
1 parent 3694179 commit 637f0b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lwlog/src/details/os/time_point_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace lwlog::details::os
minute = m_now.wMinute;
second = m_now.wSecond;

hour = datetime::handle_timezone<LocalTimePolicy>(m_now.wHour);
hour = datetime::handle_timezone<LocalTimePolicy>(static_cast<std::uint8_t>(m_now.wHour));

::FILETIME now_ft;
::GetSystemTimePreciseAsFileTime(&now_ft);
Expand Down Expand Up @@ -51,7 +51,7 @@ namespace lwlog::details::os
minute = static_cast<std::uint8_t>(details.tm_min);
second = static_cast<std::uint8_t>(details.tm_sec);

hour = datetime::handle_timezone<LocalTimePolicy>(details.tm_hour);
hour = datetime::handle_timezone<LocalTimePolicy>(static_cast<std::uint8_t>(details.tm_hour));

const auto nanoseconds_since_unix_epoch{
std::chrono::duration_cast<std::chrono::nanoseconds>(m_now.time_since_epoch()).count() };
Expand Down
5 changes: 1 addition & 4 deletions lwlog/src/policy/log_policy_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ namespace lwlog
backend.shutdown.store(false, std::memory_order_relaxed);
backend.worker_thread = std::thread([&backend]()
{
while (true)
while (!backend.shutdown.load(std::memory_order_relaxed) || !backend.queue.is_empty())
{
if (backend.shutdown.load(std::memory_order_relaxed)
&& backend.queue.is_empty()) break;

if (!backend.queue.is_empty())
{
const auto& item{ backend.queue.dequeue() };
Expand Down

0 comments on commit 637f0b0

Please sign in to comment.