From fc987674dd92a50687d970b02e072fff19391175 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sat, 23 Jan 2016 16:07:02 +0100 Subject: all: Code style fixes --- src/printf-utils.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/printf-utils.c') 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); } -- cgit v1.2.3