summaryrefslogtreecommitdiffstats
path: root/src/printf-utils.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2016-01-23 16:07:02 +0100
committerPali Rohár <pali.rohar@gmail.com>2016-01-23 16:07:02 +0100
commitfc987674dd92a50687d970b02e072fff19391175 (patch)
tree2f7e08559553d6cf3270830ea370abd1a69b08f9 /src/printf-utils.c
parent62fa041f865cb3593e07b2caa514b61e266e851e (diff)
download0xFFFF-fc987674dd92a50687d970b02e072fff19391175.tar.bz2
all: Code style fixes
Diffstat (limited to 'src/printf-utils.c')
-rw-r--r--src/printf-utils.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/printf-utils.c b/src/printf-utils.c
index 3520d0b..d43c063 100644
--- a/src/printf-utils.c
+++ b/src/printf-utils.c
@@ -39,20 +39,20 @@ void printf_progressbar(unsigned long long part, unsigned long long total) {
int tmp, cols = 80;
/* percentage calculation */
- pc = total==0?100:(int)(part*100/total);
- (pc<0)?pc=0:(pc>100)?pc=100:0;
+ pc = total == 0 ? 100 : (int)(part*100/total);
+ ( pc < 0 ) ? pc = 0 : ( pc > 100 ) ? pc = 100 : 0;
PRINTF_BACK();
PRINTF_ADD("\x1b[K %3d%% [", pc);
- if (columns)
+ if ( columns )
cols = atoi(columns);
- if (cols > 115)
+ if ( cols > 115 )
cols = 115;
cols-=15;
- for(tmp=cols*pc/100;tmp;tmp--) PRINTF_ADD("#");
- for(tmp=cols-(cols*pc/100);tmp;tmp--) PRINTF_ADD("-");
+ for ( tmp = cols*pc/100; tmp; tmp-- ) PRINTF_ADD("#");
+ for ( tmp = cols-(cols*pc/100); tmp; tmp-- ) PRINTF_ADD("-");
PRINTF_ADD("]");
- if (part == total) PRINTF_END();
+ if ( part == total ) PRINTF_END();
fflush(stdout);
}