]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Get rid of casts of pointers-to-const to pointers-to-nonconst.
authorguy <guy>
Wed, 24 Apr 2002 06:27:05 +0000 (06:27 +0000)
committerguy <guy>
Wed, 24 Apr 2002 06:27:05 +0000 (06:27 +0000)
nfsfh.h
parsenfsfh.c
print-nfs.c

diff --git a/nfsfh.h b/nfsfh.h
index db87af4ef3d30811ffa4a125106f643849ab9689..0bca424a2d0be6e9fd220a45b7a379756ca1205c 100644 (file)
--- a/nfsfh.h
+++ b/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,
@@ -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);
index eb1313ff77d428339d557add0c104f6fc17b3205..57e396816bc75f8d2f62aabd8386be608e1b154a 100644 (file)
@@ -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
@@ -108,11 +108,11 @@ 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;
@@ -120,7 +120,7 @@ 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;
@@ -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;
index b2acbc967d8a7c71e05694f0fd6f47dcc5b5434e..c295fd7a8f7a79653747012a61cf49c19d700c4e 100644 (file)
@@ -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
@@ -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 */
@@ -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 {