From 7a333523ea5930d666686d5614328d10db4ef9e2 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 28 Jul 2009 10:32:10 +0100 Subject: [PATCH] Fix signed vs unsigned pointers in volser Cast iod_Read returns to (char *) Fix signed vs unsigned pointer argument issues Reviewed-on: http://gerrit.openafs.org/236 Tested-by: Marc Dionne Reviewed-by: Derrick Brashear --- src/volser/dumpstuff.c | 4 ++-- src/volser/restorevol.c | 2 +- src/volser/vol_split.c | 6 +++--- src/volser/vsprocs.c | 11 ++++++++--- src/volser/vsutils.c | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 727aeb9eb..d18341558 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -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; diff --git a/src/volser/restorevol.c b/src/volser/restorevol.c index abf445ef4..e619df024 100644 --- a/src/volser/restorevol.c +++ b/src/volser/restorevol.c @@ -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': diff --git a/src/volser/vol_split.c b/src/volser/vol_split.c index 7a26910c2..b4c84e344 100644 --- a/src/volser/vol_split.c +++ b/src/volser/vol_split.c @@ -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; diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 60086586e..a999eb04a 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -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 is allright(indicated by beibg able to * start a transaction, delete the */ 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; diff --git a/src/volser/vsutils.c b/src/volser/vsutils.c index 10fd1c71b..e9bc5573e 100644 --- a/src/volser/vsutils.c +++ b/src/volser/vsutils.c @@ -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; -- 2.39.5