From 2d45b1a8e26a36a9f85dc49e721c4390ca93dc40 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 20 Feb 2006 22:48:07 +0100 Subject: run Lindent over source to get everything looking about the same --- summary.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'summary.c') diff --git a/summary.c b/summary.c index 2cfe4d6..d2f271b 100644 --- a/summary.c +++ b/summary.c @@ -9,16 +9,16 @@ static struct entry_st { char *name; int count; struct timeval tv; -} * entries = NULL; +} *entries = NULL; static int tot_count = 0; static unsigned long int tot_usecs = 0; -static void -fill_struct(void * key, void * value, void * data) { - struct opt_c_struct * st = (struct opt_c_struct *)value; +static void fill_struct(void *key, void *value, void *data) +{ + struct opt_c_struct *st = (struct opt_c_struct *)value; - entries = realloc(entries, (num_entries+1)*sizeof(struct entry_st)); + entries = realloc(entries, (num_entries + 1) * sizeof(struct entry_st)); if (!entries) { perror("realloc()"); exit(1); @@ -28,14 +28,14 @@ fill_struct(void * key, void * value, void * data) { entries[num_entries].tv = st->tv; tot_count += st->count; - tot_usecs += 1000000*st->tv.tv_sec; + tot_usecs += 1000000 * st->tv.tv_sec; tot_usecs += st->tv.tv_usec; num_entries++; } -static int -compar(const void *a, const void *b) { +static int compar(const void *a, const void *b) +{ struct entry_st *en1, *en2; en1 = (struct entry_st *)a; @@ -48,8 +48,8 @@ compar(const void *a, const void *b) { } } -void -show_summary(void) { +void show_summary(void) +{ int i; num_entries = 0; @@ -60,20 +60,23 @@ show_summary(void) { qsort(entries, num_entries, sizeof(*entries), compar); printf("%% time seconds usecs/call calls function\n"); - printf( "------ ----------- ----------- --------- --------------------\n"); - for(i=0; i