diff options
author | rodri <rgl@antares-labs.eu> | 2020-08-29 08:12:22 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2020-08-29 08:12:22 +0000 |
commit | 10de10e73d880bd23262f940ad0b1adc1b6eadb2 (patch) | |
tree | a837e328d94adfb3c198b7a98ab04d8d868b7d13 | |
parent | 47259f1ae68868735c7306eac93266e6ed4bc429 (diff) | |
download | ipcalc-10de10e73d880bd23262f940ad0b1adc1b6eadb2.tar.gz ipcalc-10de10e73d880bd23262f940ad0b1adc1b6eadb2.tar.bz2 ipcalc-10de10e73d880bd23262f940ad0b1adc1b6eadb2.zip |
remove unnecessary parentheses.
-rw-r--r-- | main.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; } |