summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-03-29 00:25:09 +0000
committergad <gad@FreeBSD.org>2004-03-29 00:25:09 +0000
commit6e6851b6042610259d6b47884e93fa786e0a1709 (patch)
treef0b5deaab62df32e14a04ca17617d71a65729330 /bin/ps
parent1455cfb15491fdd734d270a5b5623e37794607bf (diff)
downloadFreeBSD-src-6e6851b6042610259d6b47884e93fa786e0a1709.zip
FreeBSD-src-6e6851b6042610259d6b47884e93fa786e0a1709.tar.gz
In the routines I've been working on, sort the variable declartions
so that non-pointers are listed after pointer-type variables. Noticed by: bde
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/ps.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 7806db4..81dd575 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -165,12 +165,12 @@ main(int argc, char *argv[])
struct kinfo_proc *kp;
struct varent *vent;
struct winsize ws;
+ const char *cp, *nlistf, *memf;
+ char *cols;
int all, ch, dropgid, elem, flag, _fmt, i, lineno;
int nentries, nocludge, nkept, nselectors;
int prtheader, showthreads, wflag, what, xkeep, xkeep_implied;
- char *cols;
char errbuf[_POSIX2_LINE_MAX];
- const char *cp, *nlistf, *memf;
(void) setlocale(LC_ALL, "");
/* Set the time to what it is right now. */
@@ -617,9 +617,9 @@ static int
addelem_gid(struct listinfo *inf, const char *elem)
{
struct group *grp;
- intmax_t ltemp;
const char *nameorID;
char *endp;
+ intmax_t ltemp;
if (*elem == '\0' || strlen(elem) >= MAXLOGNAME) {
if (*elem == '\0')
@@ -665,8 +665,8 @@ addelem_gid(struct listinfo *inf, const char *elem)
static int
addelem_pid(struct listinfo *inf, const char *elem)
{
- long tempid;
char *endp;
+ long tempid;
if (*elem == '\0')
tempid = 0L;
@@ -696,9 +696,9 @@ addelem_pid(struct listinfo *inf, const char *elem)
static int
addelem_tty(struct listinfo *inf, const char *elem)
{
- char pathbuf[PATH_MAX];
- struct stat sb;
const char *ttypath;
+ struct stat sb;
+ char pathbuf[PATH_MAX];
if (strcmp(elem, "co") == 0)
ttypath = strdup(_PATH_CONSOLE);
@@ -731,8 +731,8 @@ static int
addelem_uid(struct listinfo *inf, const char *elem)
{
struct passwd *pwd;
- intmax_t ltemp;
char *endp;
+ intmax_t ltemp;
if (*elem == '\0' || strlen(elem) >= MAXLOGNAME) {
if (*elem == '\0')
@@ -777,10 +777,10 @@ addelem_uid(struct listinfo *inf, const char *elem)
static void
add_list(struct listinfo *inf, const char *argp)
{
- char elemcopy[PATH_MAX];
const char *savep;
char *cp, *endp;
int toolong;
+ char elemcopy[PATH_MAX];
while (*argp != '\0') {
while (*argp != '\0' && strchr(W_SEP, *argp) != NULL)
@@ -851,8 +851,8 @@ add_list(struct listinfo *inf, const char *argp)
static void *
expand_list(struct listinfo *inf)
{
- int newmax;
void *newlist;
+ int newmax;
newmax = (inf->maxcount + 1) << 1;
newlist = realloc(inf->ptr, newmax * inf->elemsize);
OpenPOWER on IntegriCloud