Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PVS Studio warnings in 'loguru.hpp' #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions loguru.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Website: www.ilikebigbits.com
* Version 2.0.0 - 2018-09-22 - Split loguru.hpp into loguru.hpp and loguru.cpp
* Version 2.1.0 - 2019-09-23 - Update fmtlib + add option to loguru::init to NOT set main thread name.
* Version 2.2.0 - 2020-07-31 - Replace LOGURU_CATCH_SIGABRT with struct SignalOptions
* 2023-08-13 - fix PVS Studio warnings (change by DOSBox Staging Team)

# Compiling
Just include <loguru.hpp> where you want to use Loguru.
Expand Down Expand Up @@ -727,16 +728,16 @@ namespace loguru
LOGURU_EXPORT
void flush();

template<class T> inline Text format_value(const T&) { return textprintf("N/A"); }
template<> inline Text format_value(const char& v) { return textprintf(LOGURU_FMT(c), v); }
template<> inline Text format_value(const int& v) { return textprintf(LOGURU_FMT(d), v); }
template<> inline Text format_value(const unsigned int& v) { return textprintf(LOGURU_FMT(u), v); }
template<> inline Text format_value(const long& v) { return textprintf(LOGURU_FMT(lu), v); }
template<> inline Text format_value(const unsigned long& v) { return textprintf(LOGURU_FMT(ld), v); }
template<> inline Text format_value(const long long& v) { return textprintf(LOGURU_FMT(llu), v); }
template<> inline Text format_value(const unsigned long long& v) { return textprintf(LOGURU_FMT(lld), v); }
template<> inline Text format_value(const float& v) { return textprintf(LOGURU_FMT(f), v); }
template<> inline Text format_value(const double& v) { return textprintf(LOGURU_FMT(f), v); }
template<class T> inline Text format_value(const T) { return textprintf("N/A"); }
template<> inline Text format_value(const char v) { return textprintf(LOGURU_FMT(c), v); }
template<> inline Text format_value(const int v) { return textprintf(LOGURU_FMT(d), v); }
template<> inline Text format_value(const unsigned int v) { return textprintf(LOGURU_FMT(u), v); }
template<> inline Text format_value(const long v) { return textprintf(LOGURU_FMT(lu), v); }
template<> inline Text format_value(const unsigned long v) { return textprintf(LOGURU_FMT(ld), v); }
template<> inline Text format_value(const long long v) { return textprintf(LOGURU_FMT(llu), v); }
template<> inline Text format_value(const unsigned long long v) { return textprintf(LOGURU_FMT(lld), v); }
template<> inline Text format_value(const float v) { return textprintf(LOGURU_FMT(f), v); }
template<> inline Text format_value(const double v) { return textprintf(LOGURU_FMT(f), v); }

/* Thread names can be set for the benefit of readable logs.
If you do not set the thread name, a hex id will be shown instead.
Expand Down