Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/ps Use an enum type for PRINTMODE vs. WIDTHMODE. Compile...
details: https://anonhg.NetBSD.org/src/rev/9a032c24508b
branches: trunk
changeset: 328848:9a032c24508b
user: dholland <dholland%NetBSD.org@localhost>
date: Sun Apr 20 22:48:59 2014 +0000
description:
Use an enum type for PRINTMODE vs. WIDTHMODE. Compiler output diffs have
been checked.
diffstat:
bin/ps/extern.h | 78 +++++++++++++++++++++++-----------------------
bin/ps/print.c | 96 ++++++++++++++++++++++++++++----------------------------
bin/ps/ps.h | 10 +++--
3 files changed, 93 insertions(+), 91 deletions(-)
diffs (truncated from 546 to 300 lines):
diff -r 4c828b1c6aa8 -r 9a032c24508b bin/ps/extern.h
--- a/bin/ps/extern.h Sun Apr 20 22:45:27 2014 +0000
+++ b/bin/ps/extern.h Sun Apr 20 22:48:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.34 2014/01/15 08:07:53 mlelstv Exp $ */
+/* $NetBSD: extern.h,v 1.35 2014/04/20 22:48:59 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -46,54 +46,54 @@
extern VARLIST displaylist;
extern VARLIST sortlist;
-void command(void *, VARENT *, int);
-void cpuid(void *, VARENT *, int);
-void cputime(void *, VARENT *, int);
+void command(void *, VARENT *, enum mode);
+void cpuid(void *, VARENT *, enum mode);
+void cputime(void *, VARENT *, enum mode);
int donlist(void);
int donlist_sysctl(void);
void fmt_puts(char *, int *);
void fmt_putc(int, int *);
-void elapsed(void *, VARENT *, int);
+void elapsed(void *, VARENT *, enum mode);
double getpcpu(const struct kinfo_proc2 *);
double getpmem(const struct kinfo_proc2 *);
-void gname(void *, VARENT *, int);
-void groups(void *, VARENT *, int);
-void groupnames(void *, VARENT *, int);
-void lcputime(void *, VARENT *, int);
-void logname(void *, VARENT *, int);
-void longtname(void *, VARENT *, int);
-void lname(void *, VARENT *, int);
-void lstarted(void *, VARENT *, int);
-void lstate(void *, VARENT *, int);
-void maxrss(void *, VARENT *, int);
+void gname(void *, VARENT *, enum mode);
+void groups(void *, VARENT *, enum mode);
+void groupnames(void *, VARENT *, enum mode);
+void lcputime(void *, VARENT *, enum mode);
+void logname(void *, VARENT *, enum mode);
+void longtname(void *, VARENT *, enum mode);
+void lname(void *, VARENT *, enum mode);
+void lstarted(void *, VARENT *, enum mode);
+void lstate(void *, VARENT *, enum mode);
+void maxrss(void *, VARENT *, enum mode);
void nlisterr(struct nlist *);
-void p_rssize(void *, VARENT *, int);
-void pagein(void *, VARENT *, int);
+void p_rssize(void *, VARENT *, enum mode);
+void pagein(void *, VARENT *, enum mode);
void parsefmt(const char *);
void parsefmt_insert(const char *, VARENT **);
void parsesort(const char *);
VARENT * varlist_find(VARLIST *, const char *);
-void emul(void *, VARENT *, int);
-void pcpu(void *, VARENT *, int);
-void pmem(void *, VARENT *, int);
-void pnice(void *, VARENT *, int);
-void pri(void *, VARENT *, int);
+void emul(void *, VARENT *, enum mode);
+void pcpu(void *, VARENT *, enum mode);
+void pmem(void *, VARENT *, enum mode);
+void pnice(void *, VARENT *, enum mode);
+void pri(void *, VARENT *, enum mode);
void printheader(void);
-void putimeval(void *, VARENT *, int);
-void pvar(void *, VARENT *, int);
-void rgname(void *, VARENT *, int);
-void rssize(void *, VARENT *, int);
-void runame(void *, VARENT *, int);
+void putimeval(void *, VARENT *, enum mode);
+void pvar(void *, VARENT *, enum mode);
+void rgname(void *, VARENT *, enum mode);
+void rssize(void *, VARENT *, enum mode);
+void runame(void *, VARENT *, enum mode);
void showkey(void);
-void started(void *, VARENT *, int);
-void state(void *, VARENT *, int);
-void svgname(void *, VARENT *, int);
-void svuname(void *, VARENT *, int);
-void tdev(void *, VARENT *, int);
-void tname(void *, VARENT *, int);
-void tsize(void *, VARENT *, int);
-void ucomm(void *, VARENT *, int);
-void uname(void *, VARENT *, int);
-void uvar(void *, VARENT *, int);
-void vsize(void *, VARENT *, int);
-void wchan(void *, VARENT *, int);
+void started(void *, VARENT *, enum mode);
+void state(void *, VARENT *, enum mode);
+void svgname(void *, VARENT *, enum mode);
+void svuname(void *, VARENT *, enum mode);
+void tdev(void *, VARENT *, enum mode);
+void tname(void *, VARENT *, enum mode);
+void tsize(void *, VARENT *, enum mode);
+void ucomm(void *, VARENT *, enum mode);
+void uname(void *, VARENT *, enum mode);
+void uvar(void *, VARENT *, enum mode);
+void vsize(void *, VARENT *, enum mode);
+void wchan(void *, VARENT *, enum mode);
diff -r 4c828b1c6aa8 -r 9a032c24508b bin/ps/print.c
--- a/bin/ps/print.c Sun Apr 20 22:45:27 2014 +0000
+++ b/bin/ps/print.c Sun Apr 20 22:48:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.121 2014/01/15 08:07:53 mlelstv Exp $ */
+/* $NetBSD: print.c,v 1.122 2014/04/20 22:48:59 dholland Exp $ */
/*
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-__RCSID("$NetBSD: print.c,v 1.121 2014/01/15 08:07:53 mlelstv Exp $");
+__RCSID("$NetBSD: print.c,v 1.122 2014/04/20 22:48:59 dholland Exp $");
#endif
#endif /* not lint */
@@ -93,12 +93,12 @@
#include "ps.h"
static char *cmdpart(char *);
-static void printval(void *, VAR *, int);
+static void printval(void *, VAR *, enum mode);
static int titlecmp(char *, char **);
-static void doubleprintorsetwidth(VAR *, double, int, int);
-static void intprintorsetwidth(VAR *, int, int);
-static void strprintorsetwidth(VAR *, const char *, int);
+static void doubleprintorsetwidth(VAR *, double, int, enum mode);
+static void intprintorsetwidth(VAR *, int, enum mode);
+static void strprintorsetwidth(VAR *, const char *, enum mode);
static time_t now;
@@ -218,7 +218,7 @@
}
static void
-doubleprintorsetwidth(VAR *v, double val, int prec, int mode)
+doubleprintorsetwidth(VAR *v, double val, int prec, enum mode mode)
{
int fmtlen;
@@ -240,7 +240,7 @@
}
static void
-intprintorsetwidth(VAR *v, int val, int mode)
+intprintorsetwidth(VAR *v, int val, enum mode mode)
{
int fmtlen;
@@ -261,7 +261,7 @@
}
static void
-strprintorsetwidth(VAR *v, const char *str, int mode)
+strprintorsetwidth(VAR *v, const char *str, enum mode mode)
{
int len;
@@ -278,7 +278,7 @@
}
void
-command(void *arg, VARENT *ve, int mode)
+command(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *ki;
VAR *v;
@@ -359,7 +359,7 @@
}
void
-groups(void *arg, VARENT *ve, int mode)
+groups(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *ki;
VAR *v;
@@ -397,7 +397,7 @@
}
void
-groupnames(void *arg, VARENT *ve, int mode)
+groupnames(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *ki;
VAR *v;
@@ -434,7 +434,7 @@
}
void
-ucomm(void *arg, VARENT *ve, int mode)
+ucomm(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -445,7 +445,7 @@
}
void
-emul(void *arg, VARENT *ve, int mode)
+emul(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -456,7 +456,7 @@
}
void
-logname(void *arg, VARENT *ve, int mode)
+logname(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -467,7 +467,7 @@
}
void
-state(void *arg, VARENT *ve, int mode)
+state(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
int flag, is_zombie;
@@ -551,7 +551,7 @@
}
void
-lstate(void *arg, VARENT *ve, int mode)
+lstate(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_lwp *k;
int flag;
@@ -610,7 +610,7 @@
}
void
-pnice(void *arg, VARENT *ve, int mode)
+pnice(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -621,7 +621,7 @@
}
void
-pri(void *arg, VARENT *ve, int mode)
+pri(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_lwp *l;
VAR *v;
@@ -632,7 +632,7 @@
}
void
-uname(void *arg, VARENT *ve, int mode)
+uname(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -643,7 +643,7 @@
}
void
-runame(void *arg, VARENT *ve, int mode)
+runame(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -654,7 +654,7 @@
}
void
-svuname(void *arg, VARENT *ve, int mode)
+svuname(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -665,7 +665,7 @@
}
void
-gname(void *arg, VARENT *ve, int mode)
+gname(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -676,7 +676,7 @@
}
void
-rgname(void *arg, VARENT *ve, int mode)
+rgname(void *arg, VARENT *ve, enum mode mode)
{
struct kinfo_proc2 *k;
VAR *v;
@@ -687,7 +687,7 @@
Home |
Main Index |
Thread Index |
Old Index