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

View file

@ -71,7 +71,7 @@ extern void _exit();
#endif #endif
#ifndef HAVE___FPENDING #ifndef HAVE___FPENDING
static size_t __fpending(FILE * fp) static size_t __fpending(FILE *fp)
{ {
return (fp->_p - fp->_bf._base); return (fp->_p - fp->_bf._base);
} }
@ -192,7 +192,7 @@ void clean_up(void)
free(shared_networks); free(shared_networks);
} }
int close_stream(FILE * stream) int close_stream(FILE *stream)
{ {
const int some_pending = (__fpending(stream) != 0); const int some_pending = (__fpending(stream) != 0);
const int prev_fail = (ferror(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); 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); fprintf(f, " <%s class=ralign>%.3f</%s>\n", type, fl, type);
} }