aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-08-29 08:12:22 +0000
committerrodri <rgl@antares-labs.eu>2020-08-29 08:12:22 +0000
commit10de10e73d880bd23262f940ad0b1adc1b6eadb2 (patch)
treea837e328d94adfb3c198b7a98ab04d8d868b7d13
parent47259f1ae68868735c7306eac93266e6ed4bc429 (diff)
downloadipcalc-10de10e73d880bd23262f940ad0b1adc1b6eadb2.tar.gz
ipcalc-10de10e73d880bd23262f940ad0b1adc1b6eadb2.tar.bz2
ipcalc-10de10e73d880bd23262f940ad0b1adc1b6eadb2.zip
remove unnecessary parentheses.
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 953ef45..1653e97 100644
--- a/main.c
+++ b/main.c
@@ -19,10 +19,10 @@ printip(u32int addr)
{
uchar ip4[4];
- ip4[0] = (addr>>24)&0xff;
- ip4[1] = (addr>>16)&0xff;
- ip4[2] = (addr>>8)&0xff;
- ip4[3] = addr&0xff;
+ ip4[0] = addr>>24 & 0xff;
+ ip4[1] = addr>>16 & 0xff;
+ ip4[2] = addr>>8 & 0xff;
+ ip4[3] = addr & 0xff;
print("%d.%d.%d.%d\n", ip4[0], ip4[1], ip4[2], ip4[3]);
}
@@ -44,7 +44,7 @@ countones(u32int addr)
{
int cnt, shift;
- for(cnt = 0, shift = 31; cnt < 32 && (addr&(1<<shift)) != 0; cnt++, shift--)
+ for(cnt = 0, shift = 31; cnt < 32 && (addr & 1<<shift) != 0; cnt++, shift--)
;
return cnt;
}