Skip to content

Commit 3509587

Browse files
Fix some warnings for Loguru
Co-Authored-By: Andrew Randrianasulu <40185805+randrianasulu@users.noreply.github.com>
1 parent a178d12 commit 3509587

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- dyharlan
2525
- roytam1
2626
- mrpapersonic
27+
- Randrianasulu
2728

2829
## Testing
2930

thirdparty/loguru/loguru.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ namespace loguru
436436

437437
Text textprintf(const char* format, ...)
438438
{
439-
va_list vlist;
439+
va_list vlist = nullptr;
440440
va_start(vlist, format);
441441
auto result = vtextprintf(format, vlist);
442442
va_end(vlist);
@@ -1105,7 +1105,7 @@ namespace loguru
11051105
long thread_id;
11061106
(void)thr_self(&thread_id);
11071107
#elif LOGURU_PTHREADS
1108-
uint64_t thread_id = pthread_self();
1108+
uint64_t thread_id = (uint64_t)pthread_self();
11091109
#else
11101110
// This ID does not correllate to anything we can get from the OS,
11111111
// so this is the worst way to get the ID.
@@ -1514,7 +1514,7 @@ namespace loguru
15141514
#else
15151515
void log(Verbosity verbosity, const char* file, unsigned line, const char* format, ...)
15161516
{
1517-
va_list vlist;
1517+
va_list vlist = nullptr;
15181518
va_start(vlist, format);
15191519
vlog(verbosity, file, line, format, vlist);
15201520
va_end(vlist);
@@ -1528,7 +1528,7 @@ namespace loguru
15281528

15291529
void raw_log(Verbosity verbosity, const char* file, unsigned line, const char* format, ...)
15301530
{
1531-
va_list vlist;
1531+
va_list vlist = nullptr;
15321532
va_start(vlist, format);
15331533
auto buff = vtextprintf(format, vlist);
15341534
auto message = Message{verbosity, file, line, "", "", "", buff.c_str()};
@@ -1559,7 +1559,7 @@ namespace loguru
15591559
LogScopeRAII::LogScopeRAII(Verbosity verbosity, const char* file, unsigned line, const char* format, ...) :
15601560
_verbosity(verbosity), _file(file), _line(line)
15611561
{
1562-
va_list vlist;
1562+
va_list vlist = nullptr;
15631563
va_start(vlist, format);
15641564
this->Init(format, vlist);
15651565
va_end(vlist);
@@ -1628,7 +1628,7 @@ namespace loguru
16281628
#else
16291629
void log_and_abort(int stack_trace_skip, const char* expr, const char* file, unsigned line, const char* format, ...)
16301630
{
1631-
va_list vlist;
1631+
va_list vlist = nullptr;
16321632
va_start(vlist, format);
16331633
auto buff = vtextprintf(format, vlist);
16341634
log_to_everywhere(stack_trace_skip + 1, Verbosity_FATAL, file, line, expr, buff.c_str());
@@ -1669,7 +1669,7 @@ namespace loguru
16691669

16701670
std::string strprintf(const char* format, ...)
16711671
{
1672-
va_list vlist;
1672+
va_list vlist = nullptr;
16731673
va_start(vlist, format);
16741674
auto result = vstrprintf(format, vlist);
16751675
va_end(vlist);

0 commit comments

Comments
 (0)