style: fix few indentation issues

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-07-17 17:55:40 +02:00
parent b3e02ce0ba
commit 6817d234ca
3 changed files with 17 additions and 16 deletions

View file

@ -72,7 +72,7 @@ int parse_leases(void)
struct stat lease_file_stats;
struct macaddr_t *macaddr_p = NULL;
int sw_active_lease = 0;
struct leases_t * lease;
struct leases_t *lease;
num_touches = num_leases = num_backups = 0;
@ -130,20 +130,20 @@ int parse_leases(void)
if ((lease = find_lease(htonl(inp.s_addr))) != NULL) {
delete_lease(lease);
}
add_lease(htonl(inp.s_addr),ACTIVE);
add_lease(htonl(inp.s_addr), ACTIVE);
sw_active_lease = 1;
} else if (xstrstr(line, " binding state free", 20)) {
/* remove old entry, if exists */
if ((lease = find_lease(htonl(inp.s_addr))) != NULL) {
delete_lease(lease);
}
add_lease(htonl(inp.s_addr),FREE);
add_lease(htonl(inp.s_addr), FREE);
} else if (xstrstr(line, " binding state backup", 22)) {
/* remove old entry, if exists */
if ((lease = find_lease(htonl(inp.s_addr))) != NULL) {
delete_lease(lease);
}
add_lease(htonl(inp.s_addr),BACKUP);
add_lease(htonl(inp.s_addr), BACKUP);
}
if ((macaddr != NULL)
@ -151,12 +151,13 @@ int parse_leases(void)
&& (xstrstr(line, " hardware ethernet", 19))) {
nth_field(3, macstring, line);
if (macstring) {
macstring[17] = '\0';
macaddr_p->ethernet = safe_strdup(macstring);
macaddr_p->ip = safe_strdup(ipstring);
macaddr_p->next = safe_malloc(sizeof(struct macaddr_t));
macaddr_p = macaddr_p->next;
macaddr_p->next = NULL;
macstring[17] = '\0';
macaddr_p->ethernet = safe_strdup(macstring);
macaddr_p->ip = safe_strdup(ipstring);
macaddr_p->next =
safe_malloc(sizeof(struct macaddr_t));
macaddr_p = macaddr_p->next;
macaddr_p->next = NULL;
}
}
}

View file

@ -71,7 +71,7 @@ extern void _exit();
#endif
#ifndef HAVE___FPENDING
static size_t __fpending(FILE * fp)
static size_t __fpending(FILE *fp)
{
return (fp->_p - fp->_bf._base);
}
@ -110,12 +110,12 @@ int
/* two spaces are very common in lease file, after them
* nearly everything differs */
if (a[2] != b[2]) {
return false;
return false;
}
/* " binding state " == 16 chars, this will skip right
* to first difering line. */
* to first difering line. */
if (17 < len && a[17] != b[17]) {
return false;
return false;
}
/* looking good, double check the whole thing... */
for (i = 0; a[i] != '\0' && b[i] != '\0'; i++) {
@ -192,7 +192,7 @@ void clean_up(void)
free(shared_networks);
}
int close_stream(FILE * stream)
int close_stream(FILE *stream)
{
const int some_pending = (__fpending(stream) != 0);
const int prev_fail = (ferror(stream) != 0);

View file

@ -426,7 +426,7 @@ static void output_long(FILE *restrict f, char const *restrict type,
fprintf(f, " <%s class=ralign>%lu</%s>\n", type, unlong, type);
}
static void output_float(FILE * f, char const *restrict type, float fl)
static void output_float(FILE *f, char const *restrict type, float fl)
{
fprintf(f, " <%s class=ralign>%.3f</%s>\n", type, fl, type);
}