summaryrefslogtreecommitdiffstats
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
parent62fa041f865cb3593e07b2caa514b61e266e851e (diff)
download0xFFFF-fc987674dd92a50687d970b02e072fff19391175.tar.bz2
all: Code style fixes
-rw-r--r--src/cal.c4
-rw-r--r--src/cold-flash.c4
-rw-r--r--src/main.c10
-rw-r--r--src/operations.c2
-rw-r--r--src/printf-utils.c14
5 files changed, 17 insertions, 17 deletions
diff --git a/src/cal.c b/src/cal.c
index 102ffab..60a2de1 100644
--- a/src/cal.c
+++ b/src/cal.c
@@ -224,10 +224,10 @@ static int64_t find_section(void *start, uint64_t count, int want_index, const c
memcpy(sectname, hdr->name, sizeof(hdr->name));
if ( want_index == INDEX_LAST ) {
- if ((int)hdr->index <= previous_index)
+ if ( (int)hdr->index <= previous_index )
goto next;
} else {
- if (want_index >= 0 && want_index != hdr->index)
+ if ( want_index >= 0 && want_index != hdr->index )
goto next;
}
diff --git a/src/cold-flash.c b/src/cold-flash.c
index 4f01457..89b055a 100644
--- a/src/cold-flash.c
+++ b/src/cold-flash.c
@@ -49,7 +49,7 @@ static void crc32_gentab(void) {
for ( j = 8; j > 0; j-- ) {
- if (crc & 1)
+ if ( crc & 1 )
crc = (crc >> 1) ^ poly;
else
crc >>= 1;
@@ -316,7 +316,7 @@ static int ping_timeout(libusb_device_handle * udev) {
}
- if (pong)
+ if ( pong )
return 0;
else
return -1;
diff --git a/src/main.c b/src/main.c
index cea36f7..e658f06 100644
--- a/src/main.c
+++ b/src/main.c
@@ -168,7 +168,7 @@ static void parse_image_arg(char * arg, struct image_list ** image_first) {
}
layout_file = strchr(arg, '%');
- if (layout_file)
+ if ( layout_file )
*(layout_file++) = 0;
type = NULL;
@@ -178,16 +178,16 @@ static void parse_image_arg(char * arg, struct image_list ** image_first) {
layout = NULL;
file = strrchr(arg, ':');
- if (file) {
+ if ( file ) {
*(file++) = 0;
type = strrchr(arg, ':');
- if (type) {
+ if ( type ) {
*(type++) = 0;
version = strrchr(arg, ':');
- if (version) {
+ if ( version ) {
*(version++) = 0;
hwrevs = strchr(arg, ':');
- if (hwrevs)
+ if ( hwrevs )
*(hwrevs++) = 0;
device = arg;
} else {
diff --git a/src/operations.c b/src/operations.c
index 2d26ad5..8773b95 100644
--- a/src/operations.c
+++ b/src/operations.c
@@ -82,7 +82,7 @@ struct device_info * dev_detect(void) {
}
clean:
- if (usb)
+ if ( usb )
usb_close_device(usb);
free(dev);
return NULL;
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);
}