From be982c88fdebb146c3bbc8bac08dbaf86d274f6f Mon Sep 17 00:00:00 2001 From: albert <> Date: Tue, 26 Nov 2002 00:11:35 +0000 Subject: [PATCH] c99 fixes --- w.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/w.c b/w.c index 136257f8..2634fa29 100644 --- a/w.c +++ b/w.c @@ -45,7 +45,7 @@ typedef struct utmp utmp_t; * on the right if necessary. */ static void print_host(const char *restrict host, int len) { - char *last; + const char *last; int width = 0; /* FIXME: there should really be a way to configure this... */ @@ -121,11 +121,11 @@ static void print_logintime(time_t logt, FILE* fout) { * for the "best" process to report as "(w)hat" the user for that login * session is doing currently. This the essential core of 'w'. */ -static proc_t *getproc(const utmp_t *restrict const u, const char *restrict const tty, const unsigned long long *restrict jcpu, const int *restrict found_utpid) { +static const proc_t *getproc(const utmp_t *restrict const u, const char *restrict const tty, unsigned long long *restrict const jcpu, int *restrict const found_utpid) { int line; proc_t **pptr = procs; - proc_t *best = NULL; - proc_t *secondbest = NULL; + const proc_t *best = NULL; + const proc_t *secondbest = NULL; unsigned uid = ~0U; if(!ignoreuser){ @@ -170,7 +170,7 @@ static void showinfo(utmp_t *u, int formtype, int maxcmd, int from) { unsigned i; char uname[USERSZ + 1] = "", tty[5 + sizeof u->ut_line + 1] = "/dev/"; - proc_t *best; + const proc_t *best; for (i=0; i < sizeof(u->ut_line); i++) /* clean up tty if garbled */ if (isalnum(u->ut_line[i]) || (u->ut_line[i]=='/'))