maint: coding style fixes

Remove unnecessary type casting, move .gitignore file contents to
right location, reindent to use Linux coding style, fix few type
mismatches, clean up to help & version output and hint compiler
call to these functions will end program.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-07-08 20:49:49 +02:00
parent 68c2d7b8cc
commit 76915512b2
10 changed files with 148 additions and 189 deletions

View file

@ -56,11 +56,11 @@ int intcomp(const void *x, const void *y)
int rangecomp(const void *r1, const void *r2)
{
if ((((struct range_t *) r1)->first_ip) <
(((struct range_t *) r2)->first_ip))
if ((((struct range_t *)r1)->first_ip) <
(((struct range_t *)r2)->first_ip))
return -1;
else if ((((struct range_t *) r2)->first_ip) <
(((struct range_t *) r1)->first_ip))
else if ((((struct range_t *)r2)->first_ip) <
(((struct range_t *)r1)->first_ip))
return 1;
else
return 0;
@ -84,8 +84,8 @@ unsigned long int ret_max(struct range_t r)
unsigned long int ret_percent(struct range_t r)
{
float f;
f = (float) r.count / (r.last_ip - r.first_ip - 1);
return ((unsigned long int) (f * 100000));
f = (float)r.count / (r.last_ip - r.first_ip - 1);
return ((unsigned long int)(f * 100000));
}
unsigned long int ret_touched(struct range_t r)
@ -101,8 +101,8 @@ unsigned long int ret_tc(struct range_t r)
unsigned long int ret_tcperc(struct range_t r)
{
float f;
f = (float) (r.count + r.touched) / (r.last_ip - r.first_ip - 1);
return ((unsigned long int) (f * 10000));
f = (float)(r.count + r.touched) / (r.last_ip - r.first_ip - 1);
return ((unsigned long int)(f * 10000));
}
void field_selector(char c)