]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Fix signed vs unsigned pointers in volser
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Tue, 28 Jul 2009 09:32:10 +0000 (10:32 +0100)
committerDerrick Brashear <shadow@dementia.org>
Wed, 29 Jul 2009 11:15:38 +0000 (04:15 -0700)
Cast iod_Read returns to (char *)
Fix signed vs unsigned pointer argument issues

Reviewed-on: http://gerrit.openafs.org/236
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/volser/dumpstuff.c
src/volser/restorevol.c
src/volser/vol_split.c
src/volser/vsprocs.c
src/volser/vsutils.c

index 727aeb9eb0bce8e1dc1e33c6deb94080bb677323..d183415589bd0be2eca729ce30789e7a27f882dc 100644 (file)
@@ -177,7 +177,7 @@ iod_getc(register struct iod *iodp)
        iodp->haveOldChar = 0;
        return iodp->oldChar;
     }
-    if (iod_Read(iodp, &t, 1) == 1)
+    if (iod_Read(iodp, (char *) &t, 1) == 1)
        return t;
     return EOF;
 }
@@ -1339,7 +1339,7 @@ volser_WriteFile(int vn, struct iod *iodp, FdHandle_t * handleP, int tag,
        if (nbytes < size)
            size = nbytes;
 
-       if ((code = iod_Read(iodp, p, size)) != size) {
+       if ((code = iod_Read(iodp, (char *) p, size)) != size) {
            Log("1 Volser: WriteFile: Error reading dump file %d size=%llu nbytes=%u (%d of %u); restore aborted\n", vn, (afs_uintmax_t) filesize, nbytes, code, size);
            *status = 3;
            break;
index abf445ef4880d0644a99939a286f3d4dc5a6da04..e619df024adc326d79c096d51633929b96fde8c7 100644 (file)
@@ -233,7 +233,7 @@ ReadVolumeHeader(afs_int32 count)
            break;
 
        case 'v':
-           ntohl(readvalue(4));        /* version stamp - ignore */
+           (void)ntohl(readvalue(4));  /* version stamp - ignore */
            break;
 
        case 'n':
index 7a26910c26c24422fe61a13a64946d5283dc3067..b4c84e344b9d9159eabf8723c28a773317c4119a 100644 (file)
@@ -85,9 +85,9 @@ struct Msg {
 static afs_int32 
 ExtractVnodes(struct Msg *m, Volume *vol, afs_int32 class, 
              struct VnodeExtract **list,
-             afs_int32 *length, afs_uint32 where, 
+             afs_uint32 *length, afs_uint32 where,
              struct VnodeDiskObject *vd,
-             afs_int32 *parent, struct VnodeDiskObject *parentvd)
+             afs_uint32 *parent, struct VnodeDiskObject *parentvd)
 {
     afs_int32 code = 0;
     char buf[SIZEOF_LARGEDISKVNODE];
@@ -186,7 +186,7 @@ static afs_int32
 FindVnodes(struct Msg *m, afs_uint32 where, 
           struct VnodeExtract *list, afs_int32 length, 
           struct VnodeExtract *dlist, afs_int32 dlength, 
-          afs_int32 *needed, afs_int32 class)
+          afs_uint32 *needed, afs_int32 class)
 {
     afs_int32 i, j, found = 0;
     afs_int32 parent = 0;
index 60086586e70719d864d69eda4dac8cd35fc29118..a999eb04af5b39d13b05d168c908dc3724c76fb3 100644 (file)
@@ -165,14 +165,16 @@ do { \
 
 
 /* Protos for static routines */
+#if 0
 static afs_int32 CheckAndDeleteVolume(struct rx_connection *aconn,
                                      afs_int32 apart, afs_uint32 okvol,
                                      afs_uint32 delvol);
+#endif
 static int DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
                  afs_int32 flags);
 static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
                    struct rx_connection **connPtr, afs_int32 * transPtr,
-                   afs_int32 * crtimePtr, afs_int32 * uptimePtr);
+                   afs_uint32 * crtimePtr, afs_uint32 * uptimePtr);
 static int SimulateForwardMultiple(struct rx_connection *fromconn,
                                   afs_int32 fromtid, afs_int32 fromdate,
                                   manyDests * tr, afs_int32 flags,
@@ -455,7 +457,7 @@ UV_Bind(afs_int32 aserver, afs_int32 port)
 static int 
 AFSVolCreateVolume_retry(struct rx_connection *z_conn,
                       afs_int32 partition, char *name, afs_int32 type,
-                      afs_int32 parent, afs_int32 *volid, afs_int32 *trans)
+                      afs_int32 parent, afs_uint32 *volid, afs_int32 *trans)
 {
     afs_int32 code;
     int retries = 3;
@@ -495,6 +497,7 @@ AFSVolTransCreate_retry(struct rx_connection *z_conn,
     return code;
 }
 
+#if 0
 /* if <okvol> is allright(indicated by beibg able to
  * start a transaction, delete the <delvol> */
 static afs_int32
@@ -543,6 +546,8 @@ CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart,
     }
 }
 
+#endif
+
 /* called by EmuerateEntry, show vldb entry in a reasonable format */
 void
 SubEnumerateEntry(struct nvldbentry *entry)
@@ -3148,7 +3153,7 @@ DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
 static int
 GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
         struct rx_connection **connPtr, afs_int32 * transPtr,
-        afs_int32 * crtimePtr, afs_int32 * uptimePtr)
+        afs_uint32 * crtimePtr, afs_uint32 * uptimePtr)
 {
     afs_uint32 volid;
     struct volser_status tstatus;
index 10fd1c71bacc1ad937d1f5789616f6df725bc6fa..e9bc5573e9c597f0fde55aded501d5077a435b00 100644 (file)
@@ -286,7 +286,8 @@ VLDB_IsSameAddrs(afs_int32 serv1, afs_int32 serv2, afs_int32 *errorp)
     register int code;
     ListAddrByAttributes attrs;
     bulkaddrs addrs;
-    afs_uint32 *addrp, nentries, unique, i, j, f1, f2;
+    afs_uint32 *addrp, i, j, f1, f2;
+    afs_int32 unique, nentries;
     afsUUID uuid;
     static int initcache = 0;