Skip to content

Commit 59289be

Browse files
committed
Percent: silense compiler warnings
1 parent 0b02543 commit 59289be

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/common/percent.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFPercentageModuleConf
6262

6363
const bool borderAsValue = options->barBorderLeftElapsed.length && options->barBorderRightElapsed.length;
6464

65-
uint32_t blocksPercent = (uint32_t) (percent / 100.0 * options->barWidth + 0.5);
65+
uint8_t blocksPercent = (uint8_t) (percent / 100.0 * options->barWidth + 0.5);
6666
assert(blocksPercent <= options->barWidth);
6767

6868
if(!borderAsValue && options->barBorderLeft.length)
@@ -78,7 +78,7 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFPercentageModuleConf
7878
if(!options->pipe && options->barColorTotal.length > 0)
7979
ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_BLACK "m");
8080

81-
for (uint32_t i = 0; i < options->barWidth; ++i)
81+
for (uint8_t i = 0; i < options->barWidth; ++i)
8282
{
8383
ffStrbufAppend(buffer, borderAsValue && i == 0
8484
? &options->barBorderLeft
@@ -97,7 +97,7 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFPercentageModuleConf
9797

9898
bool autoColorElapsed = ffStrbufIgnCaseEqualS(&options->barColorElapsed, "auto");
9999

100-
for (uint32_t i = 0; i < blocksPercent; ++i)
100+
for (uint8_t i = 0; i < blocksPercent; ++i)
101101
{
102102
if(!options->pipe && options->barColorElapsed.length > 0)
103103
{
@@ -143,7 +143,7 @@ void ffPercentAppendBar(FFstrbuf* buffer, double percent, FFPercentageModuleConf
143143
{
144144
if(!options->pipe && options->barColorTotal.length > 0)
145145
ffStrbufAppendF(buffer, "\e[%sm", options->barColorTotal.chars);
146-
for (uint32_t i = blocksPercent; i < options->barWidth; ++i)
146+
for (uint8_t i = blocksPercent; i < options->barWidth; ++i)
147147
{
148148
ffStrbufAppend(buffer, borderAsValue && i == 0
149149
? &options->barBorderLeft

0 commit comments

Comments
 (0)