diff options
| author | simonb <simonb@NetBSD.org> | 2004-03-27 12:44:08 +0000 |
|---|---|---|
| committer | simonb <simonb@NetBSD.org> | 2004-03-27 12:44:08 +0000 |
| commit | abb3201747d6e68345eb06cd659c341f1b791103 (patch) | |
| tree | e8edcfd741f750c0f93a8227f3c1f38b13e6f0c6 /bin | |
| parent | cd6c744984d7c9a792244095b6382572c04b7747 (diff) | |
Wrap some long lines.
Consisently use (void) in front of printf(...);
A few more white-space nits.
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/ps/fmt.c | 4 | ||||
| -rw-r--r-- | bin/ps/keyword.c | 8 | ||||
| -rw-r--r-- | bin/ps/print.c | 36 | ||||
| -rw-r--r-- | bin/ps/ps.c | 7 |
4 files changed, 29 insertions, 26 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c index a081a3e88db..550929d4c66 100644 --- a/bin/ps/fmt.c +++ b/bin/ps/fmt.c @@ -1,4 +1,4 @@ -/* $NetBSD: fmt.c,v 1.19 2004/03/27 12:09:28 simonb Exp $ */ +/* $NetBSD: fmt.c,v 1.20 2004/03/27 12:44:08 simonb Exp $ */ #include <kvm.h> #include <stdio.h> @@ -42,7 +42,7 @@ fmt_puts(char *s, int *leftp) } else *leftp -= len; } - printf("%s", v); + (void)printf("%s", v); } void diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 49446ab5957..6feee0089a5 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -1,4 +1,4 @@ -/* $NetBSD: keyword.c,v 1.37 2004/03/27 11:48:31 simonb Exp $ */ +/* $NetBSD: keyword.c,v 1.38 2004/03/27 12:44:08 simonb Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: keyword.c,v 1.37 2004/03/27 11:48:31 simonb Exp $"); +__RCSID("$NetBSD: keyword.c,v 1.38 2004/03/27 12:44:08 simonb Exp $"); #endif #endif /* not lint */ @@ -212,10 +212,10 @@ showkey(void) i = len; sep = "\n"; } - (void) printf("%s%s", sep, p); + (void)printf("%s%s", sep, p); sep = " "; } - (void) printf("\n"); + (void)printf("\n"); } static void diff --git a/bin/ps/print.c b/bin/ps/print.c index b0e626cedae..14afada0027 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.83 2004/03/27 12:11:55 simonb Exp $ */ +/* $NetBSD: print.c,v 1.84 2004/03/27 12:44:08 simonb Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #else -__RCSID("$NetBSD: print.c,v 1.83 2004/03/27 12:11:55 simonb Exp $"); +__RCSID("$NetBSD: print.c,v 1.84 2004/03/27 12:44:08 simonb Exp $"); #endif #endif /* not lint */ @@ -188,7 +188,7 @@ titlecmp(char *name, char **argv) return (0); /* handle login shells, by skipping the leading - */ - if (title[0] == '-' && !strcmp(name, title+1)) + if (title[0] == '-' && !strcmp(name, title + 1)) return (0); namelen = strlen(name); @@ -221,7 +221,7 @@ doubleprintorsetwidth(VAR *v, double val, int prec, int mode) v->width = fmtlen; } } else { - printf("%*.*f", v->width, prec, val); + (void)printf("%*.*f", v->width, prec, val); } } @@ -243,7 +243,7 @@ intprintorsetwidth(VAR *v, int val, int mode) v->width = fmtlen; } } else - printf("%*d", v->width, val); + (void)printf("%*d", v->width, val); } static void @@ -257,9 +257,9 @@ strprintorsetwidth(VAR *v, const char *str, int mode) v->width = len; } else { if (v->flag & LJUST) - printf("%-*.*s", v->width, v->width, str); + (void)printf("%-*.*s", v->width, v->width, str); else - printf("%*.*s", v->width, v->width, str); + (void)printf("%*.*s", v->width, v->width, str); } } @@ -338,7 +338,7 @@ command(void *arg, VARENT *ve, int mode) } } if (ve->next && left > 0) - printf("%*s", left, ""); + (void)printf("%*s", left, ""); } void @@ -378,7 +378,7 @@ groups(void *arg, VARENT *ve, int mode) } if (ve->next && left > 0) - printf("%*s", left, ""); + (void)printf("%*s", left, ""); } void @@ -417,7 +417,7 @@ groupnames(void *arg, VARENT *ve, int mode) } if (ve->next && left > 0) - printf("%*s", left, ""); + (void)printf("%*s", left, ""); } void @@ -724,9 +724,9 @@ tname(void *arg, VARENT *ve, int mode) v->width = fmtlen; } else { if (noctty) - printf("%-*s-", v->width - 1, ttname); + (void)printf("%-*s-", v->width - 1, ttname); else - printf("%-*s", v->width, ttname); + (void)printf("%-*s", v->width, ttname); } } } @@ -935,8 +935,9 @@ cputime(void *arg, VARENT *ve, int mode) v->width = fmtlen; } } else { - printf("%*ld:%02ld.%02ld", v->width - 6, (long)(secs / SECSPERMIN), - (long)(secs % SECSPERMIN), (long)psecs); + (void)printf("%*ld:%02ld.%02ld", v->width - 6, + (long)(secs / SECSPERMIN), (long)(secs % SECSPERMIN), + (long)psecs); } } @@ -1253,7 +1254,7 @@ pvar(void *arg, VARENT *ve, int mode) return; } - printval((char *)arg + v->off, v, mode); + (void)printval((char *)arg + v->off, v, mode); } void @@ -1282,7 +1283,7 @@ putimeval(void *arg, VARENT *ve, int mode) fmtlen = iwidth(secs) + 6 + 1; else /* hh:mm:ss.ss */ - fmtlen = iwidth((secs+1)/3600) + fmtlen = iwidth((secs + 1) / 3600) + 2 + 1 + 2 + 1 + 2 + 1; if (fmtlen > v->width) v->width = fmtlen; @@ -1303,6 +1304,7 @@ putimeval(void *arg, VARENT *ve, int mode) secs -= m * 60u; h = m / 60u; m -= h * 60u; - (void)printf( "%*u:%.2u:%.2lu.%.2lu", v->width - 9, h, m, secs, usec / 10000u ); + (void)printf( "%*u:%.2u:%.2lu.%.2lu", v->width - 9, h, m, secs, + usec / 10000u ); } } diff --git a/bin/ps/ps.c b/bin/ps/ps.c index b04644f1a17..c6b38de8ec0 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $NetBSD: ps.c,v 1.52 2004/03/27 12:09:28 simonb Exp $ */ +/* $NetBSD: ps.c,v 1.53 2004/03/27 12:44:08 simonb Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: ps.c,v 1.52 2004/03/27 12:09:28 simonb Exp $"); +__RCSID("$NetBSD: ps.c,v 1.53 2004/03/27 12:44:08 simonb Exp $"); #endif #endif /* not lint */ @@ -141,7 +141,8 @@ char jfmt[] = "user pid ppid pgid sess jobc state tt time command"; char lfmt[] = "uid pid ppid cpu pri nice vsz rss wchan state tt time command"; char o1[] = "pid"; char o2[] = "tt state time command"; -char sfmt[] = "uid pid ppid cpu lid nlwp pri nice vsz rss wchan lstate tt time command"; +char sfmt[] = "uid pid ppid cpu lid nlwp pri nice vsz rss wchan lstate tt " + "time command"; char ufmt[] = "user pid %cpu %mem vsz rss tt state start time command"; char vfmt[] = "pid state time sl re pagein vsz rss lim tsiz %cpu %mem command"; |
