From 6b404431aa7adea24120894d59daeebc5cbe9727 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 7 Jan 2008 16:13:14 +0000 Subject: ps: fix build breakage from vda's recent commit *: whitespace fixes --- procps/ps.c | 96 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'procps/ps.c') diff --git a/procps/ps.c b/procps/ps.c index 6a6a9e6d6..a46e92a8b 100644 --- a/procps/ps.c +++ b/procps/ps.c @@ -66,60 +66,60 @@ struct globals { /* for ELF executables, notes are pushed before environment and args */ static ptrdiff_t find_elf_note(ptrdiff_t findme) { - ptrdiff_t *ep = (ptrdiff_t *) environ; - - while (*ep++); - while (*ep) { - if (ep[0] == findme) { - return ep[1]; - } - ep += 2; - } - return -1; + ptrdiff_t *ep = (ptrdiff_t *) environ; + + while (*ep++); + while (*ep) { + if (ep[0] == findme) { + return ep[1]; + } + ep += 2; + } + return -1; } #if ENABLE_FEATURE_PS_UNUSUAL_SYSTEMS static unsigned get_HZ_by_waiting(void) { - struct timeval tv1, tv2; - unsigned t1, t2, r, hz; - unsigned cnt = cnt; /* for compiler */ - int diff; - - r = 0; - - /* Wait for times() to reach new tick */ - t1 = times(NULL); - do { - t2 = times(NULL); - } while (t2 == t1); - gettimeofday(&tv2, NULL); - - do { - t1 = t2; - tv1.tv_usec = tv2.tv_usec; - - /* Wait exactly one times() tick */ - do { - t2 = times(NULL); - } while (t2 == t1); - gettimeofday(&tv2, NULL); - - /* Calculate ticks per sec, rounding up to even */ - diff = tv2.tv_usec - tv1.tv_usec; - if (diff <= 0) diff += 1000000; - hz = 1000000u / (unsigned)diff; - hz = (hz+1) & ~1; + struct timeval tv1, tv2; + unsigned t1, t2, r, hz; + unsigned cnt = cnt; /* for compiler */ + int diff; + + r = 0; + + /* Wait for times() to reach new tick */ + t1 = times(NULL); + do { + t2 = times(NULL); + } while (t2 == t1); + gettimeofday(&tv2, NULL); + + do { + t1 = t2; + tv1.tv_usec = tv2.tv_usec; + + /* Wait exactly one times() tick */ + do { + t2 = times(NULL); + } while (t2 == t1); + gettimeofday(&tv2, NULL); + + /* Calculate ticks per sec, rounding up to even */ + diff = tv2.tv_usec - tv1.tv_usec; + if (diff <= 0) diff += 1000000; + hz = 1000000u / (unsigned)diff; + hz = (hz+1) & ~1; /* Count how many same hz values we saw */ - if (r != hz) { - r = hz; - cnt = 0; - } - cnt++; - } while (cnt < 3); /* exit if saw 3 same values */ - - return r; + if (r != hz) { + r = hz; + cnt = 0; + } + cnt++; + } while (cnt < 3); /* exit if saw 3 same values */ + + return r; } #else static inline unsigned get_HZ_by_waiting(void) @@ -190,7 +190,7 @@ static void put_lu(char *buf, int size, unsigned long u) char buf5[5]; /* see http://en.wikipedia.org/wiki/Tera */ - smart_ulltoa4( (u, buf5, " mgtpezy"); + smart_ulltoa4(u, buf5, " mgtpezy"); buf5[5] = '\0'; sprintf(buf, "%.*s", size, buf5); } -- cgit v1.2.3