Don't cast the pointer past to memset
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Wed, 21 Oct 2009 16:34:30 +0000 (17:34 +0100)
committerDerrick Brashear <shadow|account-1000005@unknown>
Wed, 21 Oct 2009 18:34:12 +0000 (11:34 -0700)
memset() takes a void * as it's first argument. Don't explicitly cast
what we're passing in to (char *), as this may mask other errors.

Reviewed-on: http://gerrit.openafs.org/701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

82 files changed:
src/WINNT/afsd/afskfw.c
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_volume.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb_ioctl.c
src/WINNT/aklog/aklog.c
src/WINNT/netidmgr_plugin/afsfuncs.c
src/afs/AIX/osi_file.c
src/afs/DARWIN/osi_file.c
src/afs/HPUX/osi_file.c
src/afs/HPUX/osi_vnodeops.c
src/afs/IRIX/osi_file.c
src/afs/IRIX/osi_groups.c
src/afs/IRIX/osi_inode.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_vnodeops.c
src/afs/LINUX24/osi_file.c
src/afs/LINUX24/osi_vnodeops.c
src/afs/SOLARIS/osi_file.c
src/afs/afs_buffer.c
src/afs/afs_cbqueue.c
src/afs/afs_cell.c
src/afs/afs_conn.c
src/afs/afs_daemons.c
src/afs/afs_dcache.c
src/afs/afs_exporter.c
src/afs/afs_init.c
src/afs/afs_nfsclnt.c
src/afs/afs_osidnlc.c
src/afs/afs_pag_cred.c
src/afs/afs_pioctl.c
src/afs/afs_segments.c
src/afs/afs_server.c
src/afs/afs_stat.c
src/afs/afs_user.c
src/afs/afs_vcache.c
src/afs/afs_volume.c
src/afsmonitor/afsmonitor.c
src/aklog/aklog_main.c
src/bozo/bnode.c
src/bu_utils/fms.c
src/des/strng_to_key.c
src/kauth/user_nt.c
src/libadmin/vos/vsprocs.c
src/lwp/lwp.c
src/lwp/preempt.c
src/lwp/test/selsubs.c
src/ptserver/db_verify.c
src/ptserver/map.c
src/ptserver/ubik.c
src/rx/rx.c
src/rx/rx_packet.c
src/rxgen/rpc_parse.c
src/rxkad/ticket5.c
src/sgistuff/rcmd.c
src/tsm41/aix_aklog.c
src/venus/afsio.c
src/venus/fstrace.c
src/venus/kdump.c
src/vfsck/dir.c
src/vfsck/inode.c
src/vfsck/pass1.c
src/vfsck/pass1b.c
src/vfsck/pass2.c
src/vfsck/pass3.c
src/vfsck/pass4.c
src/vfsck/pass5.c
src/vfsck/setup.c
src/vfsck/utilities.c
src/viced/fsprobe.c
src/viced/host.c
src/viced/physio.c
src/viced/viced.c
src/vlserver/cnvldb.c
src/vlserver/vldb_check.c
src/vlserver/vlutils.c
src/vol/partition.c
src/vol/volume.c
src/volser/dumpstuff.c
src/volser/volprocs.c
src/volser/vos.c
src/volser/vsprocs.c

index 052afea..3c2ad42 100644 (file)
@@ -2873,7 +2873,7 @@ KFW_AFS_klog(
         if (code) goto skip_krb5_init;
     }
 
-    memset((char *)&increds, 0, sizeof(increds));
+    memset(&increds, 0, sizeof(increds));
 
     code = pkrb5_cc_get_principal(ctx, cc, &client_principal);
     if (code) {
index c70c12a..a5cbd56 100644 (file)
@@ -153,7 +153,7 @@ void cm_InitConn(void)
 
 void cm_InitReq(cm_req_t *reqp)
 {
-       memset((char *)reqp, 0, sizeof(cm_req_t));
+       memset(reqp, 0, sizeof(cm_req_t));
        reqp->startTime = GetTickCount();
 }
 
index 538448c..f14ef43 100644 (file)
@@ -382,11 +382,11 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
                     ListAddrByAttributes attrs;
                     afsUUID uuid;
 
-                    memset((char *)&attrs, 0, sizeof(attrs));
+                    memset(&attrs, 0, sizeof(attrs));
                     attrs.Mask = VLADDR_UUID;
                     attrs.uuid = uvldbEntry.serverNumber[i];
-                    memset((char *)&uuid, 0, sizeof(uuid));
-                    memset((char *)&addrs, 0, sizeof(addrs));
+                    memset(&uuid, 0, sizeof(uuid));
+                    memset(&addrs, 0, sizeof(addrs));
 
                     do {
                         struct rx_connection *rxconnp;
index d89401b..21dd0e3 100644 (file)
@@ -2950,7 +2950,7 @@ void smb_SendPacket(smb_vc_t *vcp, smb_packet_t *inp)
         localNCB = 1;
     }
  
-    memset((char *)ncbp, 0, sizeof(NCB));
+    memset(ncbp, 0, sizeof(NCB));
 
     extra = 2 * (*inp->wctp);  /* space used by parms, in bytes */
     tp = inp->wctp + 1+ extra; /* points to count of data bytes */
@@ -3683,7 +3683,7 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
 
   send1:
     ncbp = outp->ncbp;
-    memset((char *)ncbp, 0, sizeof(NCB));
+    memset(ncbp, 0, sizeof(NCB));
 
     ncbp->ncb_length = (unsigned short) finalCount;
     ncbp->ncb_lsn = (unsigned char) vcp->lsn;
@@ -10590,7 +10590,7 @@ void smb_Shutdown(void)
     smbShutdownFlag = 1;
 
     /* Hang up all sessions */
-    memset((char *)ncbp, 0, sizeof(NCB));
+    memset(ncbp, 0, sizeof(NCB));
     for (i = 1; i < numSessions; i++)
     {
         if (dead_sessions[i])
@@ -10628,7 +10628,7 @@ void smb_Shutdown(void)
     }                                                                            
 
     /* Delete Netbios name */
-    memset((char *)ncbp, 0, sizeof(NCB));
+    memset(ncbp, 0, sizeof(NCB));
     for (i = 0; i < lana_list.length; i++) {
         if (lana_list.lana[i] == LANA_INVALID) continue;
         ncbp->ncb_command = NCBDELNAME;
index 6492f2c..b11268a 100644 (file)
@@ -496,7 +496,7 @@ smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
     }
 
     ncbp = outp->ncbp;
-    memset((char *)ncbp, 0, sizeof(NCB));
+    memset(ncbp, 0, sizeof(NCB));
 
     ncbp->ncb_length = (unsigned short) leftToCopy;
     ncbp->ncb_lsn = (unsigned char) vcp->lsn;
index b41f029..3242af1 100644 (file)
@@ -440,7 +440,7 @@ static int get_v5cred(krb5_context context,
         client_principal = 0;
     }
 
-    memset((char *)&increds, 0, sizeof(increds));
+    memset(&increds, 0, sizeof(increds));
 
     if ((r = krb5_build_principal(context, &increds.server,
                                   (int)strlen(realm), realm,
index a6bf66d..93f8df3 100644 (file)
@@ -847,7 +847,7 @@ afs_klog(khm_handle identity,
         if (!(r = khm_krb5_initialize(identity, &context, &k5cc))) {
             int i;
 
-            memset((char *)&increds, 0, sizeof(increds));
+            memset(&increds, 0, sizeof(increds));
 
             pkrb5_cc_get_principal(context, k5cc, &client_principal);
             i = krb5_princ_realm(context, client_principal)->length;
index afc09bc..c249158 100644 (file)
@@ -38,7 +38,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
index c40d2fe..70294fa 100644 (file)
@@ -148,7 +148,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        afs_osi_cred.cr_ref++;
        afs_osi_cred.cr_ngroups = 1;
        afs_osicred_initialized = 1;
index fba2125..5c944e3 100644 (file)
@@ -38,7 +38,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
index d94c7ff..a478fbc 100644 (file)
@@ -2300,7 +2300,7 @@ afsHash(int nbuckets)
        osi_Panic("afs: cannot create SEMA Hashtable\n");
 
     /* initialize the hash table and associated locks */
-    memset((char *)hashTable, 0, sizeOfHashTable * sizeof(Bucket));
+    memset(hashTable, 0, sizeOfHashTable * sizeof(Bucket));
     for (i = 0; i < sizeOfHashTable; i++)
        hashLockInit(hashTable[i].lock);
     hashLockInit(afsHashLock);
@@ -2366,7 +2366,7 @@ afsHashInsertFind(KEY key)
        osi_Panic("afs: SEMA Hashtable cannot create new entry\n");
     /* create new entry */
     ptr->key = key;
-    memset((char *)&ptr->element, 0, sizeof(ptr->element));
+    memset(&ptr->element, 0, sizeof(ptr->element));
     ptr->refCnt = 1;           /* this guy */
 
     /* insert new entry in bucket */
index 9756df8..23cc447 100644 (file)
@@ -51,7 +51,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
index b2ee069..d028c20 100644 (file)
@@ -84,7 +84,7 @@ fixup_pags(int **credpp, int ngroups, gid_t * gidset, int old_afs_pag,
        return EINVAL;          /* sorry */
 
     cr = crdup(OSI_GET_CURRENT_CRED());        /* we will replace all the groups. */
-    memset((char *)&cr->cr_groups, 0, ngroups_max * sizeof(gid_t));
+    memset(&cr->cr_groups, 0, ngroups_max * sizeof(gid_t));
 
     /* Now cobble the new groups list together. */
     new = 0;
index 0be5c15..0319b33 100644 (file)
@@ -410,7 +410,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
            }
        } else
            createdDir = 1;
-       memset((char *)&dattr, 0, sizeof(dattr));
+       memset(&dattr, 0, sizeof(dattr));
        dattr.atd_version = AFS_XFS_ATD_VERS;
        dattr.atd_volume = rw_vno;
        AFS_VOP_ATTR_SET(dvp, AFS_XFS_DATTR, (char *)&dattr,
@@ -432,7 +432,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
        return code;
     }
 
-    memset((char *)&attrs, 0, sizeof(attrs));
+    memset(&attrs, 0, sizeof(attrs));
     attrs.at_pino = vattr.va_nodeid;
     VN_RELE(dvp);
 
@@ -1105,7 +1105,7 @@ afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo, int datap,
     }
 
     if (!code) {
-       memset((char *)&data, 0, sizeof(data));
+       memset(&data, 0, sizeof(data));
        data.ili_info.inodeNumber = inode;
        data.ili_info.byteCount = vattr.va_size;
        data.ili_info.linkCount = (vattr.va_mode & AFS_XFS_MODE_LINK_MASK);
index 1487091..1cb05d2 100644 (file)
@@ -78,7 +78,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
index 516ce63..ee05352 100644 (file)
@@ -470,7 +470,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
     struct AFS_FLOCK flock;
     
     /* Convert to a lock format afs_lockctl understands. */
-    memset((char *)&flock, 0, sizeof(flock));
+    memset(&flock, 0, sizeof(flock));
     flock.l_type = flp->fl_type;
     flock.l_pid = flp->fl_pid;
     flock.l_whence = 0;
@@ -533,7 +533,7 @@ afs_linux_flock(struct file *fp, int cmd, struct file_lock *flp) {
     cred_t *credp = crref();
     struct AFS_FLOCK flock;
     /* Convert to a lock format afs_lockctl understands. */
-    memset((char *)&flock, 0, sizeof(flock));
+    memset(&flock, 0, sizeof(flock));
     flock.l_type = flp->fl_type;
     flock.l_pid = flp->fl_pid;
     flock.l_whence = 0;
index 3bd1768..af86989 100644 (file)
@@ -85,7 +85,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
@@ -119,7 +119,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
index 2945554..625db17 100644 (file)
@@ -526,7 +526,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
 #endif
     
     /* Convert to a lock format afs_lockctl understands. */
-    memset((char *)&flock, 0, sizeof(flock));
+    memset(&flock, 0, sizeof(flock));
     flock.l_type = flp->fl_type;
     flock.l_pid = flp->fl_pid;
     flock.l_whence = 0;
@@ -612,7 +612,7 @@ afs_linux_flock(struct file *fp, int cmd, struct file_lock *flp) {
     cred_t *credp = crref();
     struct AFS_FLOCK flock;
     /* Convert to a lock format afs_lockctl understands. */
-    memset((char *)&flock, 0, sizeof(flock));
+    memset(&flock, 0, sizeof(flock));
     flock.l_type = flp->fl_type;
     flock.l_pid = flp->fl_pid;
     flock.l_whence = 0;
index 799a4e7..e484790 100644 (file)
@@ -266,7 +266,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     }
     if (!afs_osicred_initialized) {
        /* valid for alpha_osf, SunOS, Ultrix */
-       memset((char *)&afs_osi_cred, 0, sizeof(afs_ucred_t));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
index 58d9fce..075f328 100644 (file)
@@ -594,6 +594,6 @@ shutdown_bufferpackage(void)
        timecounter = 1;
        for (i = 0; i < PHSIZE; i++)
            phTable[i] = 0;
-       memset((char *)&afs_bufferLock, 0, sizeof(afs_lock_t));
+       memset(&afs_bufferLock, 0, sizeof(afs_lock_t));
     }
 }
index 6086b7d..ac93157 100644 (file)
@@ -358,7 +358,7 @@ afs_InitCBQueue(int doLockInit)
 {
     register int i;
 
-    memset((char *)cbHashT, 0, CBHTSIZE * sizeof(struct bucket));
+    memset(cbHashT, 0, CBHTSIZE * sizeof(struct bucket));
     for (i = 0; i < CBHTSIZE; i++) {
        QInit(&(cbHashT[i].head));
        /* Lock_Init(&(cbHashT[i].lock)); only if you want lots of locks, which 
index 6c153c7..f44cb2f 100644 (file)
@@ -918,7 +918,7 @@ afs_NewCell(char *acellName, afs_int32 * acellHosts, int aflags,
        aflags &= ~CNoSUID;
     } else {
        tc = (struct cell *)afs_osi_Alloc(sizeof(struct cell));
-       memset((char *)tc, 0, sizeof(*tc));
+       memset(tc, 0, sizeof(*tc));
        tc->cellName = afs_strdup(acellName);
        tc->fsport = AFS_FSPORT;
        tc->vlport = AFS_VLPORT;
@@ -975,7 +975,7 @@ afs_NewCell(char *acellName, afs_int32 * acellHosts, int aflags,
     tc->states |= aflags;
     tc->timeout = timeout;
     
-    memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
+    memset(tc->cellHosts, 0, sizeof(tc->cellHosts));
     for (i = 0; i < MAXCELLHOSTS; i++) {
        /* Get server for each host and link this cell in.*/    
        struct server *ts;
index 8ed207a..3bc2300 100644 (file)
@@ -199,7 +199,7 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
         */
        UpgradeSToWLock(&afs_xconn, 37);
        tc = (struct afs_conn *)afs_osi_Alloc(sizeof(struct afs_conn));
-       memset((char *)tc, 0, sizeof(struct afs_conn));
+       memset(tc, 0, sizeof(struct afs_conn));
 
        tc->user = tu;
        tc->port = aport;
index b9247fb..ff2fd17 100644 (file)
@@ -966,7 +966,7 @@ afs_BackgroundDaemon(void)
     /* initialize subsystem */
     if (brsInit == 0) {
        LOCK_INIT(&afs_xbrs, "afs_xbrs");
-       memset((char *)afs_brs, 0, sizeof(afs_brs));
+       memset(afs_brs, 0, sizeof(afs_brs));
        brsInit = 1;
 #if defined (AFS_SGI_ENV) && defined(AFS_SGI_SHORTSTACK)
        /*
@@ -1055,8 +1055,8 @@ shutdown_daemons(void)
     if (afs_cold_shutdown) {
        afs_brsDaemons = brsInit = 0;
        rxepoch_checked = afs_nbrs = 0;
-       memset((char *)afs_brs, 0, sizeof(afs_brs));
-       memset((char *)&afs_xbrs, 0, sizeof(afs_lock_t));
+       memset(afs_brs, 0, sizeof(afs_brs));
+       memset(&afs_xbrs, 0, sizeof(afs_lock_t));
        afs_brsWaiters = 0;
 #ifdef AFS_AIX41_ENV
        lock_free(&afs_asyncbuf_lock);
index 8f2c590..8a5782e 100644 (file)
@@ -3065,20 +3065,20 @@ afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, int aflags)
     /* Allocate and zero the pointer array to the dcache entries */
     afs_indexTable = (struct dcache **)
        afs_osi_Alloc(sizeof(struct dcache *) * afiles);
-    memset((char *)afs_indexTable, 0, sizeof(struct dcache *) * afiles);
+    memset(afs_indexTable, 0, sizeof(struct dcache *) * afiles);
     afs_indexTimes =
        (afs_hyper_t *) afs_osi_Alloc(afiles * sizeof(afs_hyper_t));
-    memset((char *)afs_indexTimes, 0, afiles * sizeof(afs_hyper_t));
+    memset(afs_indexTimes, 0, afiles * sizeof(afs_hyper_t));
     afs_indexUnique =
        (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_uint32));
-    memset((char *)afs_indexUnique, 0, afiles * sizeof(afs_uint32));
+    memset(afs_indexUnique, 0, afiles * sizeof(afs_uint32));
     afs_indexFlags = (u_char *) afs_osi_Alloc(afiles * sizeof(u_char));
-    memset((char *)afs_indexFlags, 0, afiles * sizeof(char));
+    memset(afs_indexFlags, 0, afiles * sizeof(char));
 
     /* Allocate and thread the struct dcache entries themselves */
     tdp = afs_Initial_freeDSList =
        (struct dcache *)afs_osi_Alloc(aDentries * sizeof(struct dcache));
-    memset((char *)tdp, 0, aDentries * sizeof(struct dcache));
+    memset(tdp, 0, aDentries * sizeof(struct dcache));
 #ifdef KERNEL_HAVE_PIN
     pin((char *)afs_indexTable, sizeof(struct dcache *) * afiles);     /* XXX */
     pin((char *)afs_indexTimes, sizeof(afs_hyper_t) * afiles); /* XXX */
index 96ff3d8..29be153 100644 (file)
@@ -36,7 +36,7 @@ exporter_add(afs_int32 size, struct exporterops *ops, afs_int32 state,
     }
     length = (size ? size : sizeof(struct afs_exporter));
     ex = (struct afs_exporter *)afs_osi_Alloc(length);
-    memset((char *)ex, 0, length);
+    memset(ex, 0, length);
     MObtainWriteLock(&afs_xexp, 308);
     for (op = root_exported; op; op = op->exp_next) {
        if (!op->exp_next)
index 6954adf..abe5e96 100644 (file)
@@ -700,8 +700,8 @@ shutdown_cache(void)
        cacheInfoModTime = 0;
 
        afs_fsfragsize = 1023;
-       memset((char *)&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf));
-       memset((char *)&cacheDev, 0, sizeof(struct osi_dev));
+       memset(&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf));
+       memset(&cacheDev, 0, sizeof(struct osi_dev));
        osi_dnlc_shutdown();
     }
 }                              /*shutdown_cache */
@@ -842,7 +842,7 @@ shutdown_AFS(void)
        afs_FVIndex = -1;
        afs_server = (struct rx_service *)0;
        AFS_RWLOCK_INIT(&afs_xconn, "afs_xconn");
-       memset((char *)&afs_rootFid, 0, sizeof(struct VenusFid));
+       memset(&afs_rootFid, 0, sizeof(struct VenusFid));
        AFS_RWLOCK_INIT(&afs_xuser, "afs_xuser");
        AFS_RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
        AFS_RWLOCK_INIT(&afs_xserver, "afs_xserver");
index 1febbbf..94b7623 100644 (file)
@@ -77,7 +77,7 @@ afs_GetNfsClientPag(register afs_int32 uid, register afs_int32 host)
        }
     }
     np = (struct nfsclientpag *)afs_osi_Alloc(sizeof(struct nfsclientpag));
-    memset((char *)np, 0, sizeof(struct nfsclientpag));
+    memset(np, 0, sizeof(struct nfsclientpag));
     /* Copy the necessary afs_exporter fields */
     memcpy((char *)np, (char *)afs_nfsexporter, sizeof(struct afs_exporter));
     np->next = afs_nfspags[i];
index daae410..5a5b8fe 100644 (file)
@@ -516,8 +516,8 @@ osi_dnlc_purge(void)
            nameCache[i].dirp = nameCache[i].vp = NULL;
     } else {                   /* did get the lock */
        ncfreelist = NULL;
-       memset((char *)nameCache, 0, sizeof(struct nc) * NCSIZE);
-       memset((char *)nameHash, 0, sizeof(struct nc *) * NHSIZE);
+       memset(nameCache, 0, sizeof(struct nc) * NCSIZE);
+       memset(nameHash, 0, sizeof(struct nc *) * NHSIZE);
        for (i = 0; i < NCSIZE; i++) {
            nameCache[i].next = ncfreelist;
            ncfreelist = &nameCache[i];
@@ -545,13 +545,13 @@ osi_dnlc_init(void)
     int i;
 
     Lock_Init(&afs_xdnlc);
-    memset((char *)&dnlcstats, 0, sizeof(dnlcstats));
-    memset((char *)dnlctracetable, 0, sizeof(dnlctracetable));
+    memset(&dnlcstats, 0, sizeof(dnlcstats));
+    memset(dnlctracetable, 0, sizeof(dnlctracetable));
     dnlct = 0;
     ObtainWriteLock(&afs_xdnlc, 223);
     ncfreelist = NULL;
-    memset((char *)nameCache, 0, sizeof(struct nc) * NCSIZE);
-    memset((char *)nameHash, 0, sizeof(struct nc *) * NHSIZE);
+    memset(nameCache, 0, sizeof(struct nc) * NCSIZE);
+    memset(nameHash, 0, sizeof(struct nc *) * NHSIZE);
     for (i = 0; i < NCSIZE; i++) {
        nameCache[i].next = ncfreelist;
        ncfreelist = &nameCache[i];
index cfe4fa7..b4223f9 100644 (file)
@@ -107,7 +107,7 @@ int afspag_PUnlog(char *ain, afs_int32 ainSize, afs_ucred_t **acred)
            tu->vid = UNDEFVID;
            tu->states &= ~UHasTokens;
            /* security is not having to say you're sorry */
-           memset((char *)&tu->ct, 0, sizeof(struct ClearToken));
+           memset(&tu->ct, 0, sizeof(struct ClearToken));
 #ifdef UKERNEL
            /* set the expire times to 0, causes
             * afs_GCUserData to remove this entry
index e465dcb..15140d3 100644 (file)
@@ -2052,7 +2052,7 @@ DECL_PIOCTL(PUnlog)
            tu->vid = UNDEFVID;
            tu->states &= ~UHasTokens;
            /* security is not having to say you're sorry */
-           memset((char *)&tu->ct, 0, sizeof(struct ClearToken));
+           memset(&tu->ct, 0, sizeof(struct ClearToken));
            tu->refCount++;
            ReleaseWriteLock(&afs_xuser);
            /* We have to drop the lock over the call to afs_ResetUserConns, since
@@ -2510,7 +2510,7 @@ DECL_PIOCTL(PGetCacheSize)
        return EINVAL;
     }
     
-    memset((char *)results, 0, sizeof(results));
+    memset(results, 0, sizeof(results));
     results[0] = afs_cacheBlocks;
     results[1] = afs_blocksUsed;
     results[2] = afs_cacheFiles;
@@ -3903,7 +3903,7 @@ crget(void)
 {
     cred_t *cr;
     cr = crdup(get_current_cred());
-    memset((char *)cr, 0, sizeof(cred_t));
+    memset(cr, 0, sizeof(cred_t));
 #if CELL || CELL_PREPARE
     cr->cr_id = -1;
 #endif
@@ -4798,7 +4798,7 @@ DECL_PIOCTL(PNFSNukeCreds)
                tu->vid = UNDEFVID;
                tu->states &= ~UHasTokens;
                /* security is not having to say you're sorry */
-               memset((char *)&tu->ct, 0, sizeof(struct ClearToken));
+               memset(&tu->ct, 0, sizeof(struct ClearToken));
                tu->refCount++;
                ReleaseWriteLock(&afs_xuser);
                afs_ResetUserConns(tu);
index 1f11051..2f1ba0c 100644 (file)
@@ -238,7 +238,7 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
     minj = 0;
 
     do {
-       memset((char *)dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *));
+       memset(dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *));
        high = 0;
        moredata = FALSE;
 
@@ -339,7 +339,7 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
 
        do {
            moredata = FALSE;
-           memset((char *)dcList, 0,
+           memset(dcList, 0,
                   NCHUNKSATONCE * sizeof(struct dcache *));
 
            /* overkill, but it gets the lock in case GetDSlot needs it */
index af54c69..66b9813 100644 (file)
@@ -381,25 +381,25 @@ afs_CountServers(void)
     afs_stats_cmperf.fs_UpDown[0].sumOfRecordAges = 0;
     afs_stats_cmperf.fs_UpDown[0].ageOfYoungestRecord = 0;
     afs_stats_cmperf.fs_UpDown[0].ageOfOldestRecord = 0;
-    memset((char *)afs_stats_cmperf.fs_UpDown[0].downIncidents, 0,
+    memset(afs_stats_cmperf.fs_UpDown[0].downIncidents, 0,
           AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
 
     afs_stats_cmperf.fs_UpDown[1].sumOfRecordAges = 0;
     afs_stats_cmperf.fs_UpDown[1].ageOfYoungestRecord = 0;
     afs_stats_cmperf.fs_UpDown[1].ageOfOldestRecord = 0;
-    memset((char *)afs_stats_cmperf.fs_UpDown[1].downIncidents, 0,
+    memset(afs_stats_cmperf.fs_UpDown[1].downIncidents, 0,
           AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
 
     afs_stats_cmperf.vl_UpDown[0].sumOfRecordAges = 0;
     afs_stats_cmperf.vl_UpDown[0].ageOfYoungestRecord = 0;
     afs_stats_cmperf.vl_UpDown[0].ageOfOldestRecord = 0;
-    memset((char *)afs_stats_cmperf.vl_UpDown[0].downIncidents, 0,
+    memset(afs_stats_cmperf.vl_UpDown[0].downIncidents, 0,
           AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
 
     afs_stats_cmperf.vl_UpDown[1].sumOfRecordAges = 0;
     afs_stats_cmperf.vl_UpDown[1].ageOfYoungestRecord = 0;
     afs_stats_cmperf.vl_UpDown[1].ageOfOldestRecord = 0;
-    memset((char *)afs_stats_cmperf.vl_UpDown[1].downIncidents, 0,
+    memset(afs_stats_cmperf.vl_UpDown[1].downIncidents, 0,
           AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
 
     /*
@@ -1686,7 +1686,7 @@ struct server *afs_GetServer(afs_uint32 * aserverp, afs_int32 nservers,
        if (!newts)
            panic("malloc of server struct");
        afs_totalServers++;
-       memset((char *)newts, 0, sizeof(struct server));
+       memset(newts, 0, sizeof(struct server));
 
        /* Add the server struct to the afs_servers[] hash chain */
        srvhash =
@@ -1731,7 +1731,7 @@ struct server *afs_GetServer(afs_uint32 * aserverp, afs_int32 nservers,
            if (!newsa)
                panic("malloc of srvAddr struct");
            afs_totalSrvAddrs++;
-           memset((char *)newsa, 0, sizeof(struct srvAddr));
+           memset(newsa, 0, sizeof(struct srvAddr));
 
            /* Add the new srvAddr to the afs_srvAddrs[] hash chain */
            newsa->next_bkt = afs_srvAddrs[iphash];
@@ -1781,7 +1781,7 @@ struct server *afs_GetServer(afs_uint32 * aserverp, afs_int32 nservers,
                    (struct server *)afs_osi_Alloc(sizeof(struct server));
                if (!orphts)
                    panic("malloc of lo server struct");
-               memset((char *)orphts, 0, sizeof(struct server));
+               memset(orphts, 0, sizeof(struct server));
                afs_totalServers++;
 
                /* Add the orphaned server to the afs_servers[] hash chain.
index 32d36c4..6663567 100644 (file)
@@ -46,9 +46,9 @@ afs_InitStats(void)
     /*
      * First step is to zero everything out.
      */
-    memset((char *)(&afs_cmstats), 0, sizeof(struct afs_CMStats));
-    memset((char *)(&afs_stats_cmperf), 0, sizeof(struct afs_stats_CMPerf));
-    memset((char *)(&afs_stats_cmfullperf), 0,
+    memset((&afs_cmstats), 0, sizeof(struct afs_CMStats));
+    memset((&afs_stats_cmperf), 0, sizeof(struct afs_stats_CMPerf));
+    memset((&afs_stats_cmfullperf), 0,
           sizeof(struct afs_stats_CMFullPerf));
 
     /*
index f6ccf1c..bad9926 100644 (file)
@@ -479,7 +479,7 @@ afs_GetUser(register afs_int32 auid, afs_int32 acell, afs_int32 locktype)
 #ifndef AFS_NOSTATS
     afs_stats_cmfullperf.authent.PAGCreations++;
 #endif /* AFS_NOSTATS */
-    memset((char *)tu, 0, sizeof(struct unixuser));
+    memset(tu, 0, sizeof(struct unixuser));
     tu->next = afs_users[i];
     afs_users[i] = tu;
     if (RmtUser) {
index 2c353fd..be467b3 100644 (file)
@@ -988,11 +988,11 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp)
     { 
        afs_uint32 slot;
         slot = tvc->diskSlot;
-       memset((char *)tvc, 0, sizeof(struct vcache));
+       memset(tvc, 0, sizeof(struct vcache));
        tvc->diskSlot = slot;
     }
 #else
-    memset((char *)tvc, 0, sizeof(struct vcache));
+    memset(tvc, 0, sizeof(struct vcache));
 #endif
 
 #else
@@ -1152,7 +1152,7 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp)
     /* Don't forget to free the gnode space */
     tvc->v.v_gnode = gnodepnt =
        (struct gnode *)osi_AllocSmallSpace(sizeof(struct gnode));
-    memset((char *)gnodepnt, 0, sizeof(struct gnode));
+    memset(gnodepnt, 0, sizeof(struct gnode));
 #endif
 #ifdef AFS_SGI64_ENV
     memset((void *)&(tvc->vc_bhv_desc), 0, sizeof(tvc->vc_bhv_desc));
@@ -1240,7 +1240,7 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp)
 #endif /* AFS_SGI_ENV */
     tvc->dchint = NULL;
     osi_dnlc_purgedp(tvc);     /* this may be overkill */
-    memset((char *)&(tvc->callsort), 0, sizeof(struct afs_q));
+    memset(&(tvc->callsort), 0, sizeof(struct afs_q));
     tvc->slocks = NULL;
     tvc->f.states &=~ CVInit;
     afs_osi_Wakeup(&tvc->f.states);
@@ -3239,7 +3239,7 @@ afs_vcacheInit(int astatSize)
 #if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
     /* Allocate and thread the struct vcache entries */
     tvp = (struct vcache *)afs_osi_Alloc(astatSize * sizeof(struct vcache));
-    memset((char *)tvp, 0, sizeof(struct vcache) * astatSize);
+    memset(tvp, 0, sizeof(struct vcache) * astatSize);
 
     Initial_freeVCList = tvp;
     freeVCList = &(tvp[0]);
index 247a045..82ca46d 100644 (file)
@@ -534,7 +534,7 @@ afs_SetupVolume(afs_int32 volid, char *aname, void *ve, struct cell *tcell,
        struct fvolume *tf = 0;
 
        tv = afs_GetVolSlot();
-       memset((char *)tv, 0, sizeof(struct volume));
+       memset(tv, 0, sizeof(struct volume));
        tv->cell = tcell->cellNum;
        AFS_RWLOCK_INIT(&tv->lock, "volume lock");
        tv->next = afs_volumes[i];      /* thread into list */
@@ -1062,11 +1062,11 @@ InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, int acell,
                ListAddrByAttributes attrs;
                afsUUID uuid;
 
-               memset((char *)&attrs, 0, sizeof(attrs));
+               memset(&attrs, 0, sizeof(attrs));
                attrs.Mask = VLADDR_UUID;
                attrs.uuid = ve->serverNumber[i];
-               memset((char *)&uuid, 0, sizeof(uuid));
-               memset((char *)&addrs, 0, sizeof(addrs));
+               memset(&uuid, 0, sizeof(uuid));
+               memset(&addrs, 0, sizeof(addrs));
                do {
                    tconn =
                        afs_ConnByMHosts(tcell->cellHosts, tcell->vlport,
index 39846cd..a8ce63e 100644 (file)
@@ -2255,7 +2255,7 @@ save_FS_data_forDisplay(struct xstat_fs_ProbeResults *a_fsResults)
        for (i = 0; i < numFS; i++) {
            curr_fsDataP->probeOK = 0;
            curr_fsDataP->ovfCount = 0;
-           memset((char *)curr_fsDataP->data, 0, numBytes);
+           memset(curr_fsDataP->data, 0, numBytes);
            curr_fsDataP++;
        }
 
@@ -3067,7 +3067,7 @@ save_CM_data_forDisplay(struct xstat_cm_ProbeResults *a_cmResults)
        for (i = 0; i < numCM; i++) {
            curr_cmDataP->probeOK = 0;
            curr_cmDataP->ovfCount = 0;
-           memset((char *)curr_cmDataP->data, 0, numBytes);
+           memset(curr_cmDataP->data, 0, numBytes);
            curr_cmDataP++;
        }
 
index 54278f2..147db90 100644 (file)
@@ -335,7 +335,7 @@ static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *loc
     struct afsconf_dir *configdir;
 
     memset(local_cell, 0, sizeof(local_cell));
-    memset((char *)cellconfig, 0, sizeof(*cellconfig));
+    memset(cellconfig, 0, sizeof(*cellconfig));
 
     if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
        fprintf(stderr, 
@@ -1870,7 +1870,7 @@ static krb5_error_code get_credv5(krb5_context context,
               ? "/" : "", inst ? inst : "", realm);
     }
     
-    memset((char *)&increds, 0, sizeof(increds));
+    memset(&increds, 0, sizeof(increds));
 /* ANL - instance may be ptr to a null string. Pass null then */
     if ((r = krb5_build_principal(context, &increds.server,
                                  strlen(realm), realm,
index f770e1d..5e020f3 100644 (file)
@@ -846,7 +846,7 @@ bnode_Init(void)
                             "bnode-manager", &bproc_pid);
     if (code)
        return code;
-    memset((char *)&newaction, 0, sizeof(newaction));
+    memset(&newaction, 0, sizeof(newaction));
     newaction.sa_handler = bnode_Int;
     code = sigaction(SIGCHLD, &newaction, NULL);
     if (code)
index 8939e06..74fc60b 100644 (file)
@@ -59,7 +59,7 @@ main(int argc, char **argv)
     struct sigaction intaction, oldaction;
     struct cmd_syndesc *cptr;
 
-    memset((char *)&intaction, 0, sizeof(intaction));
+    memset(&intaction, 0, sizeof(intaction));
     intaction.sa_handler = quitFms;
 
     sigaction(SIGINT, &intaction, &oldaction);
index 61fdf60..93233b4 100644 (file)
@@ -111,7 +111,7 @@ des_string_to_key(char *str, register des_cblock * key)
     des_key_sched(cblockptr_to_cblock(key), key_sked);
     des_cbc_cksum(charptr_to_cblockptr(in_str), key, length, key_sked, key);
     /* erase key_sked */
-    memset((char *)key_sked, 0, sizeof(key_sked));
+    memset(key_sked, 0, sizeof(key_sked));
 
     /* now fix up key parity again */
     des_fixup_key_parity(cblockptr_to_cblock(key));
index 5dbeecc..3988eb0 100644 (file)
@@ -716,7 +716,7 @@ send_to_kdc(pkt, rpkt)
     struct sockaddr_in to;
     int timeAvail, timePerIter, numIters;
 
-    memset((char *)&to, 0, sizeof(to));
+    memset(&to, 0, sizeof(to));
     if ((f = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
        if (krb_debug)
            fprintf(stderr, "%s: Can't open socket\n", prog);
index b9647e7..9fe0cd1 100644 (file)
@@ -1484,8 +1484,8 @@ UV_ReleaseVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol,
     int releasecount = 0;
     struct volser_status volstatus;
 
-    memset((char *)remembertime, 0, sizeof(remembertime));
-    memset((char *)&results, 0, sizeof(results));
+    memset(remembertime, 0, sizeof(remembertime));
+    memset(&results, 0, sizeof(results));
 
     tst =
        ubik_VL_SetLock(cellHandle->vos, 0, afromvol, RWVOL,
index 0fe7514..3230241 100644 (file)
@@ -1355,7 +1355,7 @@ lwp_alloc_process(char *name, pthread_startroutine_t ep, pthread_addr_t arg)
 {
     PROCESS lp;
     assert(lp = (PROCESS) malloc(sizeof(*lp)));
-    memset((char *)lp, 0, sizeof(*lp));
+    memset(lp, 0, sizeof(*lp));
     if (!name) {
        char temp[100];
        static procnum;
index 9875679..1a8f54f 100644 (file)
@@ -92,7 +92,7 @@ PRE_InitPreempt(struct timeval *slice)
     }
 
 #if HAVE_SIGACTION && defined(SA_SIGINFO)
-    memset((char *)&action, 0, sizeof(action));
+    memset(&action, 0, sizeof(action));
     action.sa_sigaction = AlarmHandler;
     action.sa_flags = SA_SIGINFO;
 
@@ -100,7 +100,7 @@ PRE_InitPreempt(struct timeval *slice)
        || (setitimer(ITIMER_REAL, &itv, NULL) == -1))
        return (LWP_ESYSTEM);
 #else
-    memset((char *)&vec, 0, sizeof(vec));
+    memset(&vec, 0, sizeof(vec));
     vec.sv_handler = AlarmHandler;
     vec.sv_mask = vec.sv_onstack = 0;
 
@@ -128,7 +128,7 @@ PRE_EndPreempt()
     itv.it_value.tv_sec = itv.it_value.tv_usec = 0;
 
 #if HAVE_SIGACTION && defined(SA_SIGINFO)
-    memset((char *)&action, 0, sizeof(action));
+    memset(&action, 0, sizeof(action));
     action.sa_handler = SIG_DFL;
 
     if ((setitimer(ITIMER_REAL, &itv, NULL) == -1)
@@ -136,7 +136,7 @@ PRE_EndPreempt()
        return (LWP_ESYSTEM);
 
 #else
-    memset((char *)&vec, 0, sizeof(vec));
+    memset(&vec, 0, sizeof(vec));
     vec.sv_handler = SIG_DFL;
     vec.sv_mask = vec.sv_onstack = 0;
 
index 2cba547..0304c8b 100644 (file)
@@ -39,7 +39,7 @@ fd_set *
 IOMGR_AllocFDSet(void)
 {
     fd_set *tmp = (fd_set *) malloc(sizeof(fd_set));
-    memset((char *)tmp, 0, sizeof(fd_set));
+    memset(tmp, 0, sizeof(fd_set));
     return tmp;
 }
 
index 80ee467..abedd48 100644 (file)
@@ -1510,7 +1510,7 @@ void
 zeromap(struct idused *idmap)
 {
     while (idmap) {
-       memset((char *)idmap->idcount, 0, sizeof idmap->idcount);
+       memset(idmap->idcount, 0, sizeof idmap->idcount);
        idmap = idmap->idnext;
     }
 }
@@ -1535,7 +1535,7 @@ inccount(struct idused **idmapp, int id)
            perror("idmap");
            exit(1);
        }
-       memset((char *)idmap, 0, sizeof idmap);
+       memset(idmap, 0, sizeof idmap);
        idmap->idstart = id & ~(IDCOUNT - 1);
        idmap->idnext = *idmapp;
        *idmapp = idmap;
index 6d11048..b28a479 100644 (file)
@@ -160,7 +160,7 @@ add_map(struct map *parm, int node)
            return 0;
        }
        map->m_page = page;
-       memset((char *) map->m_data, 0, sizeof map->m_data);
+       memset( map->m_data, 0, sizeof map->m_data);
        if (NEGMAP(parm)) {
            int i;
            for (i = 0; i < MDATA; ++i)
@@ -715,7 +715,7 @@ read_map(int (*f) (void *), char *arg)
                    free_map((struct map *)result);
                return 0;
            }
-           memset((char *) map->m_data, 0, sizeof map->m_data);
+           memset( map->m_data, 0, sizeof map->m_data);
            map->m_page = page;
            map->m_next = 0;
            *mp = map;
index 4cec9f6..80c3147 100644 (file)
@@ -160,7 +160,7 @@ ubik_Read(struct ubik_trans *tt, void *buf, afs_int32 len)
        return (1);
     }
     if (status < len)
-       memset((char *)buf + status, 0, len - status);
+       memset(buf + status, 0, len - status);
     return (0);
 }
 
index d06e676..84da17e 100755 (executable)
@@ -491,7 +491,7 @@ rx_InitHost(u_int host, u_int port)
     rxi_nCalls = 0;
     rx_connDeadTime = 12;
     rx_tranquil = 0;           /* reset flag */
-    memset((char *)&rx_stats, 0, sizeof(struct rx_statistics));
+    memset(&rx_stats, 0, sizeof(struct rx_statistics));
     htable = (char *)
        osi_Alloc(rx_hashTableSize * sizeof(struct rx_connection *));
     PIN(htable, rx_hashTableSize * sizeof(struct rx_connection *));    /* XXXXX */
index de386db..b35f4e1 100644 (file)
@@ -543,7 +543,7 @@ rxi_MorePackets(int apackets)
     osi_Assert(p);
 
     PIN(p, getme);             /* XXXXX */
-    memset((char *)p, 0, getme);
+    memset(p, 0, getme);
     RX_TS_INFO_GET(rx_ts_info);
 
     RX_TS_FPQ_LOCAL_ALLOC(rx_ts_info,apackets);
@@ -597,7 +597,7 @@ rxi_MorePackets(int apackets)
     osi_Assert(p);
 
     PIN(p, getme);             /* XXXXX */
-    memset((char *)p, 0, getme);
+    memset(p, 0, getme);
     NETPRI;
     MUTEX_ENTER(&rx_freePktQ_lock);
 
@@ -636,7 +636,7 @@ rxi_MorePacketsTSFPQ(int apackets, int flush_global, int num_keep_local)
     p = (struct rx_packet *)osi_Alloc(getme);
 
     PIN(p, getme);             /* XXXXX */
-    memset((char *)p, 0, getme);
+    memset(p, 0, getme);
     RX_TS_INFO_GET(rx_ts_info);
 
     RX_TS_FPQ_LOCAL_ALLOC(rx_ts_info,apackets);
@@ -701,7 +701,7 @@ rxi_MorePacketsNoLock(int apackets)
             osi_Assert(apackets > 0);
         }
     } while(p == NULL);
-    memset((char *)p, 0, getme);
+    memset(p, 0, getme);
 
 #ifdef RX_ENABLE_TSFPQ
     RX_TS_INFO_GET(rx_ts_info);
@@ -1449,7 +1449,7 @@ rxi_ReadPacket(osi_socket socket, struct rx_packet *p, afs_uint32 * host,
     savelen = p->wirevec[p->niovecs - 1].iov_len;
     p->wirevec[p->niovecs - 1].iov_len += RX_EXTRABUFFERSIZE;
 
-    memset((char *)&msg, 0, sizeof(msg));
+    memset(&msg, 0, sizeof(msg));
     msg.msg_name = (char *)&from;
     msg.msg_namelen = sizeof(struct sockaddr_in);
     msg.msg_iov = p->wirevec;
@@ -1806,7 +1806,7 @@ rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
            struct rx_debugStats tstat;
 
            /* get basic stats */
-           memset((char *)&tstat, 0, sizeof(tstat));   /* make sure spares are zero */
+           memset(&tstat, 0, sizeof(tstat));   /* make sure spares are zero */
            tstat.version = RX_DEBUGI_VERSION;
 #ifndef        RX_ENABLE_LOCKS
            tstat.waitingForPackets = rx_waitingForPackets;
@@ -1852,7 +1852,7 @@ rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
            if (tl > 0)
                return ap;
 
-           memset((char *)&tconn, 0, sizeof(tconn));   /* make sure spares are zero */
+           memset(&tconn, 0, sizeof(tconn));   /* make sure spares are zero */
            /* get N'th (maybe) "interesting" connection info */
            for (i = 0; i < rx_hashTableSize; i++) {
 #if !defined(KERNEL)
@@ -1959,7 +1959,7 @@ rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
            if (tl > 0)
                return ap;
 
-           memset((char *)&tpeer, 0, sizeof(tpeer));
+           memset(&tpeer, 0, sizeof(tpeer));
            for (i = 0; i < rx_hashTableSize; i++) {
 #if !defined(KERNEL)
                /* the time complexity of the algorithm used here
@@ -2599,7 +2599,7 @@ rxi_EncodePacketHeader(struct rx_packet *p)
 {
     afs_uint32 *buf = (afs_uint32 *) (p->wirevec[0].iov_base); /* MTUXXX */
 
-    memset((char *)buf, 0, RX_HEADER_SIZE);
+    memset(buf, 0, RX_HEADER_SIZE);
     *buf++ = htonl(p->header.epoch);
     *buf++ = htonl(p->header.cid);
     *buf++ = htonl(p->header.callNumber);
index d4c24da..46772a6 100644 (file)
@@ -159,7 +159,7 @@ get_definition(void)
     token tok;
 
     defp = ALLOC(definition);
-    memset((char *)defp, 0, sizeof(definition));
+    memset(defp, 0, sizeof(definition));
     get_token(&tok);
     switch (tok.kind) {
     case TOK_STRUCT:
@@ -878,7 +878,7 @@ analyze_ProcParams(definition * defp, token * tokp)
     do {
        get_token(tokp);
        Proc_list = ALLOC(proc1_list);
-       memset((char *)Proc_list, 0, sizeof(proc1_list));
+       memset(Proc_list, 0, sizeof(proc1_list));
        Proc_list->pl.param_flag = 0;
        switch (tokp->kind) {
        case TOK_IN:
@@ -900,7 +900,7 @@ analyze_ProcParams(definition * defp, token * tokp)
        *Proc_listp = Proc_list;
        Proc_listp = &Proc_list->next;
        decls = ALLOC(decl_list);
-       memset((char *)decls, 0, sizeof(decl_list));
+       memset(decls, 0, sizeof(decl_list));
     if (tokp->kind != TOK_RPAREN)
         decls->decl = dec;
        *tailp = decls;
index da90081..c8e95f4 100644 (file)
@@ -480,7 +480,7 @@ krb5_des_decrypt(struct ktc_encryptionKey *key, int etype, void *in,
     des_cbc_encrypt(in, out, insz, s, &ivec, 0);
 
     memcpy(cksum, (char *)out + CONFOUNDERSZ, cksumsz);
-    memset((char *)out + CONFOUNDERSZ, 0, cksumsz);
+    memset(out + CONFOUNDERSZ, 0, cksumsz);
 
     if (cksum_func)
        ret = (*cksum_func) (out, insz, cksum, cksumsz, key);
index acb76a2..ea8fa72 100644 (file)
@@ -106,7 +106,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
     struct hostent *hp;
     fd_set reads;
 
-    memset((char *)someSignals, 0, sizeof(someSignals));
+    memset(someSignals, 0, sizeof(someSignals));
     someSignals[0] = 1 << (SIGURG - 1);
     sigBlock = *((sigset_t *) someSignals);
 
index 92d6001..b6fba8a 100644 (file)
@@ -206,7 +206,7 @@ static krb5_error_code get_credv5(krb5_context context, char *user,
     static krb5_principal client_principal = 0;
     char *str;
     
-    memset((char *)&increds, 0, sizeof(increds));
+    memset(&increds, 0, sizeof(increds));
     /* instance may be ptr to a null string. Pass null then */
     if ((r = krb5_build_principal(context, &increds.server,
                                  strlen(realm), realm,
@@ -287,7 +287,7 @@ static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *loc
     struct afsconf_dir *configdir;
     
     memset(local_cell, 0, sizeof(local_cell));
-    memset((char *)cellconfig, 0, sizeof(*cellconfig));
+    memset(cellconfig, 0, sizeof(*cellconfig));
     
     if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
        return AFSCONF_NODB;
index 6161c38..8d2cd8f 100644 (file)
@@ -816,7 +816,7 @@ get_file_cell(char *fn, char **cellp, afs_int32 hosts[MAXHOSTS], AFSFid *Fid,
     int j;
     afs_int32 *Tmpafs_int32;
 
-    memset((char *) Status, 0, sizeof(struct AFSFetchStatus));
+    memset( Status, 0, sizeof(struct AFSFetchStatus));
     memset(buf, 0, sizeof(buf));
     status.in_size = 0;
     status.out_size = sizeof(buf);
index 4f46bf1..6f438f9 100644 (file)
@@ -689,7 +689,7 @@ icl_DumpKernel(FILE *outFilep, char *setname)
            if (dummy > bufferSize)     /* find biggest log */
                bufferSize = dummy;
            lip = (struct logInfo *)malloc(sizeof(struct logInfo));
-           memset((char *)lip, 0, sizeof(*lip));
+           memset(lip, 0, sizeof(*lip));
            lip->nextp = allInfo;
            allInfo = lip;
            lip->name = (char *)malloc(strlen(tname) + 1);
@@ -707,7 +707,7 @@ icl_DumpKernel(FILE *outFilep, char *setname)
            if (dummy > bufferSize)     /* find biggest log */
                bufferSize = dummy;
            lip = (struct logInfo *)malloc(sizeof(struct logInfo));
-           memset((char *)lip, 0, sizeof(*lip));
+           memset(lip, 0, sizeof(*lip));
            lip->nextp = allInfo;
            allInfo = lip;
            lip->name = (char *)malloc(strlen(tname) + 1);
@@ -1662,7 +1662,7 @@ GetBulkSetInfo(void)
            exit(1);
        }
     }
-    memset((char *)setInfo, 0, infoSize);
+    memset(setInfo, 0, infoSize);
 
     return setInfo;
 }
@@ -1684,7 +1684,7 @@ GetBulkLogInfo(void)
        }
     }
 
-    memset((char *)logInfo, 0, infoSize);
+    memset(logInfo, 0, infoSize);
     return logInfo;
 }
 
index cbc7be3..b3e1c56 100644 (file)
@@ -1423,7 +1423,7 @@ print_servers(int pnt)
     int chainCount[NSERVERS];
 
     if (pnt) {
-       memset((char *)chainCount, 0, sizeof(chainCount));
+       memset(chainCount, 0, sizeof(chainCount));
        printf("\n\nPrinting 'afs_servers' structures...\n");
     }
     findsym("afs_servers", &symoff);
@@ -1461,7 +1461,7 @@ print_servers(int pnt)
 
     /* Verify against afs_totalServers. */
     if (pnt) {
-       memset((char *)chainCount, 0, sizeof(chainCount));
+       memset(chainCount, 0, sizeof(chainCount));
        if (findsym("afs_totalServers", &symoff)) {
            kread(kmem, symoff, (char *)&afs_totalServers, sizeof(afs_int32));
            if (afs_totalServers != nServers) {
index 5594593..40a5b83 100644 (file)
@@ -119,7 +119,7 @@ descend(parentino, inumber)
     register struct dinode *dp;
     struct inodesc curino;
 
-    memset((char *)&curino, 0, sizeof(struct inodesc));
+    memset(&curino, 0, sizeof(struct inodesc));
     if (statemap[inumber] != DSTATE)
        errexit("BAD INODE %d TO DESCEND", statemap[inumber]);
 #if defined(ACLS) && defined(AFS_HPUX_ENV)
@@ -403,7 +403,7 @@ linkup(orphan, parentdir)
     char tempname[BUFSIZ];
     extern int pass4check();
 
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     dp = ginode(orphan);
     lostdir = (dp->di_mode & IFMT) == IFDIR;
     pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
@@ -526,7 +526,7 @@ makeentry(parent, ino, name)
     if (parent < ROOTINO || parent >= maxino || ino < ROOTINO
        || ino >= maxino)
        return (0);
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = DATA;
     idesc.id_func = mkentry;
     idesc.id_number = parent;
index 460bf19..204314d 100644 (file)
@@ -609,7 +609,7 @@ freeino(ino)
     extern int pass4check();
     struct dinode *dp;
 
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = ADDR;
     idesc.id_func = pass4check;
     idesc.id_number = ino;
index 5de5b8b..f154885 100644 (file)
@@ -96,7 +96,7 @@ pass1()
     /*
      * Find all allocated blocks.
      */
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = ADDR;
     idesc.id_func = pass1check;
     inumber = 0;
index dfd48e1..dd47106 100644 (file)
@@ -73,7 +73,7 @@ pass1b()
     struct inodesc idesc;
     ino_t inumber;
 
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = ADDR;
     idesc.id_func = pass1bcheck;
     duphead = duplist;
index 47e6c48..a2fe452 100644 (file)
@@ -86,7 +86,7 @@ pass2()
     register struct dinode *dp;
     struct inodesc rootdesc;
 
-    memset((char *)&rootdesc, 0, sizeof(struct inodesc));
+    memset(&rootdesc, 0, sizeof(struct inodesc));
     rootdesc.id_type = ADDR;
     rootdesc.id_func = pass2check;
     rootdesc.id_number = ROOTINO;
@@ -220,7 +220,7 @@ pass2check(idesc)
        idesc->id_entryno++;
        lncntp[dirp->d_ino]--;
        dirp = (struct direct *)((char *)(dirp) + entrysize);
-       memset((char *)dirp, 0, n);
+       memset(dirp, 0, n);
        dirp->d_reclen = n;
        if (reply("FIX") == 1)
            ret |= ALTERED;
@@ -241,7 +241,7 @@ pass2check(idesc)
        idesc->id_entryno++;
        lncntp[dirp->d_ino]--;
        dirp = (struct direct *)((char *)(dirp) + n);
-       memset((char *)dirp, 0, n);
+       memset(dirp, 0, n);
        dirp->d_reclen = n;
     }
     if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) {
index 50751ad..d6e42c6 100644 (file)
@@ -74,7 +74,7 @@ pass3()
     ino_t inumber, orphan;
     int loopcnt;
 
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = DATA;
     for (inumber = ROOTINO; inumber <= lastino; inumber++) {
 #if defined(ACLS) && defined(AFS_HPUX_ENV)
index d4c54db..76ca298 100644 (file)
@@ -77,7 +77,7 @@ pass4()
 #endif /* ACLS */
 
 
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = ADDR;
     idesc.id_func = pass4check;
     for (inumber = ROOTINO; inumber <= lastino; inumber++) {
index 96c762b..0c662d9 100644 (file)
@@ -100,7 +100,7 @@ pass5()
     struct cg *ocg = (struct cg *)buf;
 #endif /* AFS_NEWCG_ENV */
 
-    memset((char *)newcg, 0, (int)fs->fs_cgsize);
+    memset(newcg, 0, (int)fs->fs_cgsize);
     newcg->cg_niblk = fs->fs_ipg;
 #ifdef AFS_NEWCG_ENV
     postype = (int)fs->fs_postblformat;
@@ -154,10 +154,10 @@ pass5()
 #endif /* AFS_NEWCG_ENV */
 
     }
-    memset((char *)&idesc[0], 0, sizeof idesc);
+    memset(&idesc[0], 0, sizeof idesc);
     for (i = 0; i < 3; i++)
        idesc[i].id_type = ADDR;
-    memset((char *)&cstotal, 0, sizeof(struct csum));
+    memset(&cstotal, 0, sizeof(struct csum));
     (void)time(&now);
 #ifdef notdef
     /* this is the original from UCB/McKusick, but it is clearly wrong.  It is
@@ -213,14 +213,14 @@ pass5()
            newcg->cg_irotor = cg->cg_irotor;
        else
            newcg->cg_irotor = 0;
-       memset((char *)&newcg->cg_frsum[0], 0, sizeof newcg->cg_frsum);
+       memset(&newcg->cg_frsum[0], 0, sizeof newcg->cg_frsum);
 #ifdef AFS_NEWCG_ENV
-       memset((char *)&cg_blktot(newcg)[0], 0, sumsize + mapsize);
+       memset(&cg_blktot(newcg)[0], 0, sumsize + mapsize);
 #else /* AFS_NEWCG_ENV */
-       memset((char *)newcg->cg_btot, 0, sizeof(newcg->cg_btot));
-       memset((char *)newcg->cg_b, 0, sizeof(newcg->cg_b));
-       memset((char *)newcg->cg_iused, 0, sizeof(newcg->cg_iused));
-       memset((char *)newcg->cg_free, 0, howmany(fs->fs_fpg, NBBY));
+       memset(newcg->cg_btot, 0, sizeof(newcg->cg_btot));
+       memset(newcg->cg_b, 0, sizeof(newcg->cg_b));
+       memset(newcg->cg_iused, 0, sizeof(newcg->cg_iused));
+       memset(newcg->cg_free, 0, howmany(fs->fs_fpg, NBBY));
 #endif /* AFS_NEWCG_ENV */
 #ifdef AFS_NEWCG_ENV
        if (fs->fs_postblformat == FS_42POSTBLFMT)
index 4db9fd8..ca0098d 100644 (file)
@@ -739,7 +739,7 @@ readsb(listerr)
        if (memcmp
            ((char *)&sblock.fs_blank[0], (char *)&altsblock.fs_blank[0],
             MAXCSBUFS * sizeof(int))) {
-           memset((char *)sblock.fs_blank, 0, sizeof(sblock.fs_blank));
+           memset(sblock.fs_blank, 0, sizeof(sblock.fs_blank));
        } else {
 #endif /* __alpha */
            badsb(listerr,
index 9d794d6..07396e7 100644 (file)
@@ -591,7 +591,7 @@ getpathname(namebuf, curdir, ino)
        strcpy(namebuf, "?");
        return;
     }
-    memset((char *)&idesc, 0, sizeof(struct inodesc));
+    memset(&idesc, 0, sizeof(struct inodesc));
     idesc.id_type = DATA;
     cp = &namebuf[BUFSIZ - 1];
     *cp = '\0';
index e139198..ec91931 100644 (file)
@@ -89,7 +89,7 @@ main(int argc, char **argv)
        printf("usage: pxclient <serverHost>\n");
        exit(1);
     }
-    memset((char *)&host, 0, sizeof(struct sockaddr_in));
+    memset(&host, 0, sizeof(struct sockaddr_in));
     host.sin_family = AF_INET;
     host.sin_addr.s_addr = inet_addr(av[0]);
 #ifdef STRUCT_SOCKADDR_HAS_SA_LEN
index f4c2b8a..615c303 100644 (file)
@@ -157,7 +157,7 @@ GetCE(void)
     entry = CEFree;
     CEFree = entry->next;
     CEs++;
-    memset((char *)entry, 0, CLIENT_TO_ZERO(entry));
+    memset(entry, 0, CLIENT_TO_ZERO(entry));
     return (entry);
 
 }                              /*GetCE */
@@ -245,7 +245,7 @@ GetHT(void)
     entry = HTFree;
     HTFree = entry->next;
     HTs++;
-    memset((char *)entry, 0, HOST_TO_ZERO(entry));
+    memset(entry, 0, HOST_TO_ZERO(entry));
     return (entry);
 
 }                              /*GetHT */
@@ -3720,7 +3720,7 @@ h_CheckHosts(void)
 {
     afs_uint32 now = FT_ApproxTime();
 
-    memset((char *)&zerofid, 0, sizeof(zerofid));
+    memset(&zerofid, 0, sizeof(zerofid));
     /*
      * Send a probe to the workstation if it hasn't been heard from in
      * 15 minutes
index 1d9b158..47d9a8c 100644 (file)
@@ -153,13 +153,13 @@ void
 FidZap(DirHandle * file)
 {
     IH_RELEASE(file->dirh_handle);
-    memset((char *)file, 0, sizeof(DirHandle));
+    memset(file, 0, sizeof(DirHandle));
 }
 
 void
 FidZero(DirHandle * file)
 {
-    memset((char *)file, 0, sizeof(DirHandle));
+    memset(file, 0, sizeof(DirHandle));
 }
 
 int
index 2a99d05..3e52e2c 100644 (file)
@@ -662,9 +662,9 @@ ClearXStatValues(void)
     /*
      * Zero all xstat-related structures.
      */
-    memset((char *)(&afs_perfstats), 0, sizeof(struct afs_PerfStats));
+    memset((&afs_perfstats), 0, sizeof(struct afs_PerfStats));
 #if FS_STATS_DETAILED
-    memset((char *)(&afs_FullPerfStats), 0,
+    memset((&afs_FullPerfStats), 0,
           sizeof(struct fs_stats_FullPerfStats));
 
     /*
index 6d591a4..8f20dd9 100644 (file)
@@ -824,7 +824,7 @@ convert_vlentry(int new, int fromvers, int tovers,
        struct vlentry_2 vl;
        struct vlentry_3 *xnvlentry = (struct vlentry_3 *)vlentryp;
 
-       memset((char *)&vl, 0, sizeof(struct vlentry_2));
+       memset(&vl, 0, sizeof(struct vlentry_2));
        vl.volumeId[0] = xnvlentry->volumeId[0];
        vl.volumeId[1] = xnvlentry->volumeId[1];
        vl.volumeId[2] = xnvlentry->volumeId[2];
@@ -859,7 +859,7 @@ convert_vlentry(int new, int fromvers, int tovers,
             1 ? sizeof(struct vlheader_1) : sizeof(struct vlheader_2))
            - (fromvers ==
               1 ? sizeof(struct vlheader_1) : sizeof(struct vlheader_2));
-       memset((char *)&vl, 0, sizeof(struct vlentry_1));
+       memset(&vl, 0, sizeof(struct vlentry_1));
        vl.volumeId[0] = xnvlentry->volumeId[0];
        vl.volumeId[1] = xnvlentry->volumeId[1];
        vl.volumeId[2] = xnvlentry->volumeId[2];
index 1090049..e37cf66 100644 (file)
@@ -1123,8 +1123,8 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
 
     maxentries = (header.vital_header.eofPtr / sizeof(vlentry)) + 1;
     record = (struct er *)malloc(maxentries * sizeof(struct er));
-    memset((char *)record, 0, (maxentries * sizeof(struct er)));
-    memset((char *)serveraddrs, 0, sizeof(serveraddrs));
+    memset(record, 0, (maxentries * sizeof(struct er)));
+    memset(serveraddrs, 0, sizeof(serveraddrs));
 
     /* Will fill in the record array of entries it found */
     ReadAllEntries(&header);
index b9ac712..1d572f0 100644 (file)
@@ -377,7 +377,7 @@ GetExtentBlock(register struct ubik_trans *trans, register afs_int32 base)
            if (!ex_addr[base])
                ERROR_EXIT(VL_NOMEM);
        }
-       memset((char *)ex_addr[base], 0, VL_ADDREXTBLK_SIZE);
+       memset(ex_addr[base], 0, VL_ADDREXTBLK_SIZE);
 
        /* Write the full extension block at end of vldb */
        ex_addr[base]->ex_flags = htonl(VLCONTBLOCK);
index 60f635b..cb339e8 100644 (file)
@@ -1102,7 +1102,7 @@ VLockPartition_r(char *name)
                            CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
        assert(dp->lock_fd != INVALID_FD);
 
-       memset((char *)&lap, 0, sizeof(lap));
+       memset(&lap, 0, sizeof(lap));
        rc = LockFileEx((HANDLE) dp->lock_fd, LOCKFILE_EXCLUSIVE_LOCK, 0, 1,
                        0, &lap);
        assert(rc);
@@ -1117,7 +1117,7 @@ VUnlockPartition_r(char *name)
 
     if (!dp)
        return;                 /* no partition, will fail later */
-    memset((char *)&lap, 0, sizeof(lap));
+    memset(&lap, 0, sizeof(lap));
 
     UnlockFileEx((HANDLE) dp->lock_fd, 0, 1, 0, &lap);
     CloseHandle((HANDLE) dp->lock_fd);
index 93e7dc3..b271e5e 100644 (file)
@@ -1469,7 +1469,7 @@ void
 VolumeHeaderToDisk(VolumeDiskHeader_t * dh, VolumeHeader_t * h)
 {
 
-    memset((char *)dh, 0, sizeof(VolumeDiskHeader_t));
+    memset(dh, 0, sizeof(VolumeDiskHeader_t));
     dh->stamp = h->stamp;
     dh->id = h->id;
     dh->parent = h->parent;
@@ -1504,7 +1504,7 @@ VolumeHeaderToDisk(VolumeDiskHeader_t * dh, VolumeHeader_t * h)
 void
 DiskToVolumeHeader(VolumeHeader_t * h, VolumeDiskHeader_t * dh)
 {
-    memset((char *)h, 0, sizeof(VolumeHeader_t));
+    memset(h, 0, sizeof(VolumeHeader_t));
     h->stamp = dh->stamp;
     h->id = dh->id;
     h->parent = dh->parent;
@@ -2381,7 +2381,7 @@ attach2(Error * ec, VolId volumeId, char *path, register struct VolumeHeader * h
         * area and mark it as initialized.
         */
        if (!(V_stat_initialized(vp))) {
-           memset((char *)(V_stat_area(vp)), 0, VOL_STATS_BYTES);
+           memset((V_stat_area(vp)), 0, VOL_STATS_BYTES);
            V_stat_initialized(vp) = 1;
        }
 #endif /* OPENAFS_VOL_STATS */
@@ -5010,7 +5010,7 @@ VAdjustVolumeStatistics_r(register Volume * vp)
         * All we need to do is bzero the entire VOL_STATS_BYTES of
         * the detailed volume statistics area.
         */
-       memset((char *)(V_stat_area(vp)), 0, VOL_STATS_BYTES);
+       memset((V_stat_area(vp)), 0, VOL_STATS_BYTES);
 #endif /* OPENAFS_VOL_STATS */
     }
 
index 7a6c3f6..001ae0a 100644 (file)
@@ -1183,7 +1183,7 @@ ProcessIndex(Volume * vp, VnodeClass class, afs_int32 ** Bufp, int *sizep,
                FDH_CLOSE(fdP);
                return -1;
            }
-           memset((char *)Buf, 0, nVnodes * sizeof(afs_int32));
+           memset(Buf, 0, nVnodes * sizeof(afs_int32));
            STREAM_SEEK(afile, offset = vcp->diskSize, 0);
            while (1) {
                code = STREAM_READ(vnode, vcp->diskSize, 1, afile);
index 233efec..18cf505 100644 (file)
@@ -1999,7 +1999,7 @@ FillVolInfo(Volume * vp, volint_info_handle_t * handle)
         * Copy out the stat fields in a single operation.
         */
        if ((now - hdr->dayUseDate) > OneDay) {
-           memset((char *)&(handle->volinfo_ptr.ext->stat_reads[0]),
+           memset(&(handle->volinfo_ptr.ext->stat_reads[0]),
                   0, numStatBytes);
        } else {
            memcpy((char *)&(handle->volinfo_ptr.ext->stat_reads[0]),
index 105a17e..a92f822 100644 (file)
@@ -105,7 +105,7 @@ static struct tqHead busyHead, notokHead;
 static void
 qInit(struct tqHead *ahead)
 {
-    memset((char *)ahead, 0, sizeof(struct tqHead));
+    memset(ahead, 0, sizeof(struct tqHead));
     return;
 }
 
index 8adbceb..5d48c4d 100644 (file)
@@ -3325,8 +3325,8 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_int32 afromserver,
     struct volser_status volstatus;
     char hoststr[16];
 
-    memset((char *)remembertime, 0, sizeof(remembertime));
-    memset((char *)&results, 0, sizeof(results));
+    memset(remembertime, 0, sizeof(remembertime));
+    memset(&results, 0, sizeof(results));
 
     vcode = ubik_VL_SetLock(cstruct, 0, afromvol, RWVOL, VLOP_RELEASE);
     if (vcode != VL_RERELEASE)