Skip to content

Commit

Permalink
Get rid of casts of pointers-to-const to pointers-to-nonconst.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuguy committed Apr 24, 2002
1 parent b2cfabc commit 2fd1118
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions nfsfh.h
@@ -1,4 +1,4 @@
/* @(#) $Header: /tcpdump/master/tcpdump/nfsfh.h,v 1.12 2001-09-17 21:57:52 fenner Exp $ (LBL) */
/* @(#) $Header: /tcpdump/master/tcpdump/nfsfh.h,v 1.13 2002-04-24 06:27:05 guy Exp $ (LBL) */

/*
* Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
Expand Down Expand Up @@ -65,4 +65,4 @@ typedef struct {
#define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\
dev_eq(a.Fsid_dev, b.Fsid_dev))

extern void Parse_fh(caddr_t *, int, my_fsid *, ino_t *, const char **, const char **, int);
extern void Parse_fh(const unsigned char *, int, my_fsid *, ino_t *, const char **, const char **, int);
10 changes: 5 additions & 5 deletions parsenfsfh.c
Expand Up @@ -42,7 +42,7 @@

#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.23 2001-09-17 21:57:53 fenner Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.24 2002-04-24 06:27:06 guy Exp $ (LBL)";
#endif

#ifdef HAVE_CONFIG_H
Expand Down Expand Up @@ -108,19 +108,19 @@ static const char rcsid[] =
((lsb) + ((e)<<8) + ((d)<<16) + ((c)<<24))
#endif

static int is_UCX(unsigned char *);
static int is_UCX(const unsigned char *);

void
Parse_fh(fh, len, fsidp, inop, osnamep, fsnamep, ourself)
register caddr_t *fh;
register const unsigned char *fh;
int len;
my_fsid *fsidp;
ino_t *inop;
const char **osnamep; /* if non-NULL, return OS name here */
const char **fsnamep; /* if non-NULL, return server fs name here (for VMS) */
int ourself; /* true if file handle was generated on this host */
{
register unsigned char *fhp = (unsigned char *)fh;
register const unsigned char *fhp = fh;
u_int32_t temp;
int fhtype = FHT_UNKNOWN;
int i;
Expand Down Expand Up @@ -436,7 +436,7 @@ int ourself; /* true if file handle was generated on this host */
*/
static int
is_UCX(fhp)
unsigned char *fhp;
const unsigned char *fhp;
{
register int i;
int seen_null = 0;
Expand Down
13 changes: 7 additions & 6 deletions print-nfs.c
Expand Up @@ -21,7 +21,7 @@

#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.90 2002-02-18 08:56:45 itojun Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.91 2002-04-24 06:27:06 guy Exp $ (LBL)";
#endif

#ifdef HAVE_CONFIG_H
Expand Down Expand Up @@ -756,9 +756,10 @@ nfs_printfh(register const u_int32_t *dp, const u_int len)
{
my_fsid fsid;
ino_t ino;
char *sfsname = NULL;
const char *sfsname = NULL;
char *spacep;

Parse_fh((caddr_t*)dp, len, &fsid, &ino, NULL, (const char **)&sfsname, 0);
Parse_fh((const u_char *)dp, len, &fsid, &ino, NULL, &sfsname, 0);

if (sfsname) {
/* file system ID is ASCII, not numeric, for this server OS */
Expand All @@ -768,9 +769,9 @@ nfs_printfh(register const u_int32_t *dp, const u_int len)
strncpy(temp, sfsname, NFSX_V3FHMAX);
temp[sizeof(temp) - 1] = '\0';
/* Remove trailing spaces */
sfsname = strchr(temp, ' ');
if (sfsname)
*sfsname = 0;
spacep = strchr(temp, ' ');
if (spacep)
*spacep = '\0';

(void)printf(" fh %s/", temp);
} else {
Expand Down

0 comments on commit 2fd1118

Please sign in to comment.