Skip to content

Commit

Permalink
Fix several LogPrint related variadic warnings from linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Mar 27, 2022
1 parent 0863ea3 commit bf63795
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
11 changes: 8 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3263,21 +3263,26 @@ void PrintBlockTree() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
// print split or gap
if (nCol > nPrevCol)
{
for (int i = 0; i < nCol-1; i++)
for (int i = 0; i < nCol-1; i++) {
LogPrintf("| ");
}

LogPrintf("|\\");
}
else if (nCol < nPrevCol)
{
for (int i = 0; i < nCol; i++)
for (int i = 0; i < nCol; i++) {
LogPrintf("| ");
}

LogPrintf("|");
}
nPrevCol = nCol;

// print columns
for (int i = 0; i < nCol; i++)
for (int i = 0; i < nCol; i++) {
LogPrintf("| ");
}

// print item
CBlock block;
Expand Down
5 changes: 3 additions & 2 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,8 @@ void SplitCoinStakeOutput(CBlock &blocknew, int64_t &nReward, bool &fEnableStake

if (dSumAllocation + iterSideStake->second > 1.0)
{
LogPrintf("WARN: SplitCoinStakeOutput: allocation percentage over 100\%, ending sidestake allocations.");
LogPrintf("WARN: SplitCoinStakeOutput: allocation percentage over 100 percent, "
"ending sidestake allocations.");
break;
}

Expand Down Expand Up @@ -1327,7 +1328,7 @@ SideStakeAlloc GetSideStakingStatusAndAlloc()
dSumAllocation += dAllocation;
if (dSumAllocation > 1.0)
{
LogPrintf("WARN: %s: allocation percentage over 100\%, ending sidestake allocations.", __func__);
LogPrintf("WARN: %s: allocation percentage over 100 percent, ending sidestake allocations.", __func__);
break;
}

Expand Down
8 changes: 4 additions & 4 deletions src/util/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int64_t MilliTimer::GetStartTime(const std::string& label)
internal_timer = timer_map.at(label);
}
catch (std::out_of_range&) {
LogPrintf("WARNING: %s: Timer with specified label does not exist. Returning zero start time.");
LogPrintf("WARNING: %s: Timer with specified label does not exist. Returning zero start time.", __func__);
}

return internal_timer.start_time;
Expand Down Expand Up @@ -291,7 +291,7 @@ const MilliTimer::timer MilliTimer::GetTimes(const std::string& log_string, cons
}
catch (std::out_of_range&)
{
LogPrintf("WARNING: %s: Timer with specified label does not exist. Returning zeroed timer.");
LogPrintf("WARNING: %s: Timer with specified label does not exist. Returning zeroed timer.", __func__);
timer = {};
return timer;
}
Expand All @@ -300,8 +300,8 @@ const MilliTimer::timer MilliTimer::GetTimes(const std::string& log_string, cons
// minimize lock time.
if (internal_timer.log)
{
LogPrintf("timer %s: %s: elapsed time: %" PRId64 " ms, time since last check: %" PRId64 " ms.",
label, log_string, timer.elapsed_time, timer.time_since_last_check);
LogPrintf("INFO: %s: timer %s: %s: elapsed time: %" PRId64 " ms, time since last check: %" PRId64 " ms.",
__func__, label, log_string, timer.elapsed_time, timer.time_since_last_check);
}

return timer;
Expand Down

0 comments on commit bf63795

Please sign in to comment.