Add 'const' to a few places.

PR:		bin/65803
Submitted by:	Cyrille Lefevre
This commit is contained in:
Garance A Drosehn 2004-06-22 02:06:42 +00:00
parent e4b70e6697
commit db6e0b8b03
2 changed files with 13 additions and 11 deletions

View File

@ -50,7 +50,7 @@ int donlist(void);
void elapsed(KINFO *, VARENT *);
void emulname(KINFO *, VARENT *);
VARENT *find_varentry(VAR *);
const char *fmt_argv(char **, char *, size_t);
const char *fmt_argv(const char **, const char *, size_t);
double getpcpu(const KINFO *);
void kvar(KINFO *, VARENT *);
void label(KINFO *, VARENT *);

View File

@ -51,16 +51,17 @@ __FBSDID("$FreeBSD$");
#include "ps.h"
static char *cmdpart(char *);
static char *shquote(char **);
static const char *cmdpart(const char *);
static const char *shquote(const char **);
static char *
shquote(char **argv)
static const char *
shquote(const char **argv)
{
long arg_max;
static size_t buf_size;
size_t len;
char **p, *dst, *src;
const char **p, *src;
char *dst;
static char *buf = NULL;
if (buf == NULL) {
@ -96,19 +97,20 @@ shquote(char **argv)
return (buf);
}
static char *
cmdpart(char *arg0)
static const char *
cmdpart(const char *arg0)
{
char *cp;
const char *cp;
return ((cp = strrchr(arg0, '/')) != NULL ? cp + 1 : arg0);
}
const char *
fmt_argv(char **argv, char *cmd, size_t maxlen)
fmt_argv(const char **argv, const char *cmd, size_t maxlen)
{
size_t len;
char *ap, *cp;
const char *ap;
char *cp;
if (argv == NULL || argv[0] == NULL) {
if (cmd == NULL)