From 237f1e31842da65ce5e799cdd09d8a9943a6cea8 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 23 Mar 2009 18:19:55 +0000 Subject: [PATCH] STABLE14-volid-cast-unsigned-int32-20090323 LICENSE IPL10 FIXES 124510 deal with the problem in 1.4.x by casting --- src/config/stds.h | 37 +++++++++++++++++ src/vol/fssync.c | 4 +- src/vol/listinodes.c | 4 +- src/vol/namei_ops.c | 4 +- src/vol/vol-info.c | 2 +- src/vol/vol-salvage.c | 6 +-- src/vol/volume.c | 4 +- src/vol/vutil.c | 2 +- src/volser/vol-dump.c | 2 +- src/volser/volprocs.c | 2 +- src/volser/vos.c | 96 +++++++++++++++++++++---------------------- 11 files changed, 100 insertions(+), 63 deletions(-) diff --git a/src/config/stds.h b/src/config/stds.h index 2ac240114..7380a8e61 100644 --- a/src/config/stds.h +++ b/src/config/stds.h @@ -255,4 +255,41 @@ struct afsUUID { }; typedef struct afsUUID afsUUID; +/* A macro that can be used when printf'ing 64 bit integers, as Unix and + * windows use a different format string + */ +#ifdef AFS_NT40_ENV +#define AFS_INT64_FMT "l64d" +#else +#define AFS_INT64_FMT "lld" +#endif + +/* Functions to safely cast afs_int32 and afs_uint32 so they can be used in + * printf statemements with %ld and %lu + */ +#ifdef AFS_NT40_ENV +#define static_inline __inline static +#define hdr_static_inline(x) __inline static x +#elif defined(AFS_HPUX_ENV) || defined(AFS_USR_HPUX_ENV) +#define static_inline static __inline +#define hdr_static_inline(x) static __inline x +#elif defined(AFS_AIX_ENV) || defined(AFS_USR_AIX_ENV) +#define static_inline static +#define hdr_static_inline(x) static x +#elif defined(AFS_SGI_ENV) || defined(AFS_USR_SGI_ENV) +#define static_inline static +#define hdr_static_inline(x) x +#else +#define static_inline static inline +#define hdr_static_inline(x) static inline x +#endif + +#ifdef AFS_64BIT_ENV +hdr_static_inline(afs_int32) afs_cast_int32(afs_int32 d) { return (afs_int32) d; } +hdr_static_inline(afs_uint32) afs_cast_uint32(afs_uint32 d) { return (afs_uint32) d; } +#else +hdr_static_inline(long) afs_cast_int32(afs_int32 d) { return (long) d; } +hdr_static_inline(unsigned long) afs_cast_uint32(afs_uint32 d) { return (unsigned long) d; } +#endif + #endif /* OPENAFS_CONFIG_AFS_STDS_H */ diff --git a/src/vol/fssync.c b/src/vol/fssync.c index 5751c2254..ad5830f40 100644 --- a/src/vol/fssync.c +++ b/src/vol/fssync.c @@ -527,7 +527,7 @@ defect #2080 for details. if (v) v->volumeID = 0; tvolName[0] = '/'; - sprintf(&tvolName[1], VFORMAT, command.volume); + sprintf(&tvolName[1], VFORMAT, afs_cast_uint32(command.volume)); vp = VAttachVolumeByName_r(&error, command.partName, tvolName, V_VOLUPD); @@ -667,7 +667,7 @@ FSYNC_Drop(int fd) Volume *vp; tvolName[0] = '/'; - sprintf(&tvolName[1], VFORMAT, p[i].volumeID); + sprintf(&tvolName[1], VFORMAT, afs_cast_uint32(p[i].volumeID)); vp = VAttachVolumeByName_r(&error, p[i].partName, tvolName, V_VOLUPD); if (vp) diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index c50a0a753..c5afe70bd 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -1664,7 +1664,7 @@ inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId) memset(&specinos, 0, sizeof(specinos)); - (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId); + (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(volumeId)); (void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", pname, headername); fd = open(oldpath, O_RDONLY); if (fd < 0) { @@ -1767,7 +1767,7 @@ inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId) } #endif - (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id); + (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(h.id)); (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", pname, headername); fd = open(newpath, O_CREAT | O_EXCL | O_RDWR, 0644); if (fd < 0) { diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 7d53751ec..af12fd9c1 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -1572,7 +1572,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId) char headername[16]; afs_int32 error = 0; - (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId); + (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(volumeId)); (void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", pname, headername); fd = open(oldpath, O_RDONLY); if (fd < 0) { @@ -1722,7 +1722,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId) h.smallVnodeIndex_hi = h.id; h.largeVnodeIndex_hi = h.id; h.linkTable_hi = h.id; - (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id); + (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(h.id)); (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", pname, headername); fd = open(newpath, O_CREAT | O_EXCL | O_RDWR, 0644); if (fd < 0) { diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index 736611397..b5893dcba 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -322,7 +322,7 @@ handleit(struct cmd_syndesc *as, void *arock) } } (void)afs_snprintf(name1, sizeof name1, VFORMAT, - (unsigned long)volumeId); + afs_cast_uint32(volumeId)); if (dsizeOnly && !saveinodes) printf ("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n"); diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 4bbc99c19..6fa07219b 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -1787,7 +1787,7 @@ GetVolumeSummary(VolumeId singleVolumeNumber) || (vsp->header.id == singleVolumeNumber || vsp->header.parent == singleVolumeNumber)) { (void)afs_snprintf(nameShouldBe, sizeof nameShouldBe, - VFORMAT, vsp->header.id); + VFORMAT, afs_cast_uint32(vsp->header.id)); if (singleVolumeNumber && vsp->header.id != singleVolumeNumber) AskOffline(vsp->header.id); @@ -2237,7 +2237,7 @@ SalvageVolumeHeaderFile(register struct InodeSummary *isp, if (isp->volSummary == NULL) { char name[64]; - (void)afs_snprintf(name, sizeof name, VFORMAT, isp->volumeId); + (void)afs_snprintf(name, sizeof name, VFORMAT, afs_cast_uint32(isp->volumeId)); if (check) { Log("No header file for volume %u\n", isp->volumeId); return -1; @@ -2264,7 +2264,7 @@ SalvageVolumeHeaderFile(register struct InodeSummary *isp, if (isp->volSummary->fileName) { strcpy(name, isp->volSummary->fileName); } else { - (void)afs_snprintf(name, sizeof name, VFORMAT, isp->volumeId); + (void)afs_snprintf(name, sizeof name, VFORMAT, afs_cast_uint32(isp->volumeId)); isp->volSummary->fileName = ToString(name); } diff --git a/src/vol/volume.c b/src/vol/volume.c index 81e41283c..ffdaf9d57 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -1680,7 +1680,7 @@ VGetVolumePath(Error * ec, VolId volumeId, char **partitionp, char **namep) *ec = 0; name[0] = '/'; - (void)afs_snprintf(&name[1], (sizeof name) - 1, VFORMAT, volumeId); + (void)afs_snprintf(&name[1], (sizeof name) - 1, VFORMAT, afs_cast_uint32(volumeId)); for (dp = DiskPartitionList; dp; dp = dp->next) { struct afs_stat status; strcpy(path, VPartitionPath(dp)); @@ -1712,7 +1712,7 @@ char * VolumeExternalName(VolumeId volumeId) { static char name[VMAXPATHLEN]; - (void)afs_snprintf(name, sizeof name, VFORMAT, volumeId); + (void)afs_snprintf(name, sizeof name, VFORMAT, afs_cast_uint32(volumeId)); return name; } diff --git a/src/vol/vutil.c b/src/vol/vutil.c index 1ad0bb849..6d2f21f9c 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -171,7 +171,7 @@ VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId) vol.stamp.magic = VOLUMEINFOMAGIC; vol.stamp.version = VOLUMEINFOVERSION; vol.destroyMe = DESTROY_ME; - (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, vol.id); + (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_cast_uint32(vol.id)); (void)afs_snprintf(volumePath, sizeof volumePath, "%s/%s", VPartitionPath(partition), headerName); fd = afs_open(volumePath, O_CREAT | O_EXCL | O_WRONLY, 0600); diff --git a/src/volser/vol-dump.c b/src/volser/vol-dump.c index cd1893c40..484482c16 100644 --- a/src/volser/vol-dump.c +++ b/src/volser/vol-dump.c @@ -241,7 +241,7 @@ handleit(struct cmd_syndesc *as, void *arock) exit(1); } - (void)afs_snprintf(name1, sizeof name1, VFORMAT, (unsigned long)volumeId); + (void)afs_snprintf(name1, sizeof name1, VFORMAT, afs_cast_uint32(volumeId)); HandleVolume(partP, name1, fileName, fromtime); return 0; } diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index c007a61c5..e38c7ec5c 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -152,7 +152,7 @@ ConvertVolume(afs_int32 avol, char *aname, afs_int32 asize) if (asize < 18) return -1; /* It's better using the Generic VFORMAT since otherwise we have to make changes to too many places... The 14 char limitation in names hits us again in AIX; print in field of 9 digits (still 10 for the rest), right justified with 0 padding */ - (void)afs_snprintf(aname, asize, VFORMAT, (unsigned long)avol); + (void)afs_snprintf(aname, asize, VFORMAT, afs_cast_uint32(avol)); return 0; } diff --git a/src/volser/vos.c b/src/volser/vos.c index 299c10030..e6ee3d7c2 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -546,13 +546,13 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast, qPut(&busyHead, pntr->volid); if (disp) fprintf(STDOUT, "**** Volume %lu is busy ****\n", - (unsigned long)pntr->volid); + afs_cast_uint32(pntr->volid)); } else { *totalNotOK += 1; qPut(¬okHead, pntr->volid); if (disp) fprintf(STDOUT, "**** Could not attach volume %lu ****\n", - (unsigned long)pntr->volid); + afs_cast_uint32(pntr->volid)); } fprintf(STDOUT, "\n"); } else { /* default listing */ @@ -581,13 +581,13 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast, qPut(&busyHead, pntr->volid); if (disp) fprintf(STDOUT, "**** Volume %lu is busy ****\n", - (unsigned long)pntr->volid); + afs_cast_uint32(pntr->volid)); } else { *totalNotOK += 1; qPut(¬okHead, pntr->volid); if (disp) fprintf(STDOUT, "**** Could not attach volume %lu ****\n", - (unsigned long)pntr->volid); + afs_cast_uint32(pntr->volid)); } } } @@ -776,14 +776,14 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP, qPut(&busyHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "**** Volume %lu is busy ****\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Busy volume */ else { (*a_totalNotOKP)++; qPut(¬okHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "**** Could not attach volume %lu ****\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Screwed volume */ fprintf(STDOUT, "\n"); } /*Long listing */ @@ -815,14 +815,14 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP, qPut(&busyHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "**** Volume %lu is busy ****\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Busy volume */ else { (*a_totalNotOKP)++; qPut(¬okHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "**** Could not attach volume %lu ****\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Screwed volume */ } /*Default listing */ } /*XDisplayFormat */ @@ -977,14 +977,14 @@ XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP, qPut(&busyHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "BUSY_VOL\t%lu\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Busy volume */ else { (*a_totalNotOKP)++; qPut(¬okHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "COULD_NOT_ATTACH\t%lu\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Screwed volume */ } /*Long listing */ else { @@ -1014,14 +1014,14 @@ XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP, qPut(&busyHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "VOLUME_BUSY\t%lu\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Busy volume */ else { (*a_totalNotOKP)++; qPut(¬okHead, a_xInfoP->volid); if (a_showProblems) fprintf(STDOUT, "COULD_NOT_ATTACH_VOLUME\t%lu\n", - (unsigned long)a_xInfoP->volid); + afs_cast_uint32(a_xInfoP->volid)); } /*Screwed volume */ } /*Default listing */ } /*XDisplayFormat */ @@ -1147,14 +1147,14 @@ DisplayVolumes(server, part, pntr, count, longlist, fast, quiet) while (busyHead.count) { qGet(&busyHead, &volid); fprintf(STDOUT, "**** Volume %lu is busy ****\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } } if (totalNotOK) { while (notokHead.count) { qGet(¬okHead, &volid); fprintf(STDOUT, "**** Could not attach volume %lu ****\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } } if (!quiet) { @@ -1235,14 +1235,14 @@ XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast, while (busyHead.count) { qGet(&busyHead, &volid); fprintf(STDOUT, "**** Volume %lu is busy ****\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } } if (totalNotOK) { while (notokHead.count) { qGet(¬okHead, &volid); fprintf(STDOUT, "**** Could not attach volume %lu ****\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } } @@ -1328,14 +1328,14 @@ XDisplayVolumes2(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast, while (busyHead.count) { qGet(&busyHead, &volid); fprintf(STDOUT, "BUSY_VOL\t%lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } } if (totalNotOK) { while (notokHead.count) { qGet(¬okHead, &volid); fprintf(STDOUT, "COULD_NOT_ATTACH\t%lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } } @@ -1556,14 +1556,14 @@ ExamineVolume(register struct cmd_syndesc *as, void *arock) if (verbose) { fprintf(STDOUT, "Fetching VLDB entry for %lu .. ", - (unsigned long)volid); + afs_cast_uint32(volid)); fflush(STDOUT); } vcode = VLDB_GetEntryByID(volid, -1, &entry); if (vcode) { fprintf(STDERR, "Could not fetch the entry for volume number %lu from VLDB \n", - (unsigned long)volid); + afs_cast_uint32(volid)); return (vcode); } if (verbose) @@ -1705,7 +1705,7 @@ SetFields(register struct cmd_syndesc *as, void *arock) if (code) { fprintf(STDERR, "Could not fetch the entry for volume number %lu from VLDB \n", - (unsigned long)volid); + afs_cast_uint32(volid)); return (code); } MapHostToNetwork(&entry); @@ -1737,7 +1737,7 @@ SetFields(register struct cmd_syndesc *as, void *arock) if (code) fprintf(STDERR, "Could not update volume info fields for volume number %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); return (code); } @@ -1949,7 +1949,7 @@ CreateVolume(register struct cmd_syndesc *as, void *arock) } MapPartIdIntoName(pnum, part); fprintf(STDOUT, "Volume %lu created on partition %s of %s\n", - (unsigned long)volid, part, as->parms[0].items->data); + afs_cast_uint32(volid), part, as->parms[0].items->data); return 0; } @@ -2035,7 +2035,7 @@ DeleteVolume(struct cmd_syndesc *as, void *arock) if (code) { fprintf(STDERR, "Could not fetch the entry for volume %lu from VLDB\n", - (unsigned long)volid); + afs_cast_uint32(volid)); PrintError("", code); return (code); } @@ -2093,7 +2093,7 @@ DeleteVolume(struct cmd_syndesc *as, void *arock) MapPartIdIntoName(partition, pname); fprintf(STDOUT, "Volume %lu on partition %s server %s deleted\n", - (unsigned long)volid, pname, hostutil_GetNameByINet(server)); + afs_cast_uint32(volid), pname, hostutil_GetNameByINet(server)); return 0; } @@ -2188,16 +2188,16 @@ MoveVolume(register struct cmd_syndesc *as, void *arock) code = UV_ListOneVolume(fromserver, frompart, volid, &p); if (code) { fprintf(STDERR, "vos:cannot access volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); exit(1); } if (TESTM) - fprintf(STDOUT, "volume %lu size %d\n", (unsigned long)volid, + fprintf(STDOUT, "volume %lu size %d\n", afs_cast_uint32(volid), p->size); if (partition.free <= p->size) { fprintf(STDERR, "vos: no space on target partition %s to move volume %lu\n", - toPartName, (unsigned long)volid); + toPartName, afs_cast_uint32(volid)); free(p); exit(1); } @@ -2219,7 +2219,7 @@ MoveVolume(register struct cmd_syndesc *as, void *arock) MapPartIdIntoName(topart, toPartName); MapPartIdIntoName(frompart, fromPartName); fprintf(STDOUT, "Volume %lu moved from %s %s to %s %s \n", - (unsigned long)volid, as->parms[1].items->data, fromPartName, + afs_cast_uint32(volid), as->parms[1].items->data, fromPartName, as->parms[3].items->data, toPartName); return 0; @@ -2339,14 +2339,14 @@ CopyVolume(register struct cmd_syndesc *as, void *arock) code = UV_ListOneVolume(fromserver, frompart, volid, &p); if (code) { fprintf(STDERR, "vos:cannot access volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); exit(1); } if (partition.free <= p->size) { fprintf(STDERR, "vos: no space on target partition %s to copy volume %lu\n", - toPartName, (unsigned long)volid); + toPartName, afs_cast_uint32(volid)); free(p); exit(1); } @@ -2364,7 +2364,7 @@ CopyVolume(register struct cmd_syndesc *as, void *arock) MapPartIdIntoName(topart, toPartName); MapPartIdIntoName(frompart, fromPartName); fprintf(STDOUT, "Volume %lu copied from %s %s to %s on %s %s \n", - (unsigned long)volid, as->parms[1].items->data, fromPartName, + afs_cast_uint32(volid), as->parms[1].items->data, fromPartName, tovolume, as->parms[4].items->data, toPartName); return 0; @@ -2464,7 +2464,7 @@ ShadowVolume(register struct cmd_syndesc *as, void *arock) code = UV_ListOneVolume(fromserver, frompart, volid, &p); if (code) { fprintf(STDERR, "vos:cannot access volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); exit(1); } strcpy(toVolName, p->name); @@ -2525,7 +2525,7 @@ ShadowVolume(register struct cmd_syndesc *as, void *arock) code = UV_ListOneVolume(fromserver, frompart, volid, &p); if (code) { fprintf(STDERR, "vos:cannot access volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); exit(1); } } @@ -2540,7 +2540,7 @@ ShadowVolume(register struct cmd_syndesc *as, void *arock) if (partition.free <= p->size) { fprintf(STDERR, "vos: no space on target partition %s to copy volume %lu\n", - toPartName, (unsigned long)volid); + toPartName, afs_cast_uint32(volid)); free(p); if (q) free(q); exit(1); @@ -2560,7 +2560,7 @@ ShadowVolume(register struct cmd_syndesc *as, void *arock) MapPartIdIntoName(topart, toPartName); MapPartIdIntoName(frompart, fromPartName); fprintf(STDOUT, "Volume %lu shadowed from %s %s to %s %s \n", - (unsigned long)volid, as->parms[1].items->data, fromPartName, + afs_cast_uint32(volid), as->parms[1].items->data, fromPartName, as->parms[3].items->data, toPartName); return 0; @@ -2730,7 +2730,7 @@ BackupVolume(register struct cmd_syndesc *as, void *arock) if (!code) { fprintf(STDERR, "FATAL ERROR: backup volume %lu exists on server %lu\n", - (unsigned long)buvolid, (unsigned long)buserver); + afs_cast_uint32(buvolid), (unsigned long)buserver); exit(1); } } @@ -3124,7 +3124,7 @@ RestoreVolume(register struct cmd_syndesc *as, void *arock) if (vol_elsewhere) { fprintf(STDERR, "%s volume %lu already exists on a different server/part; not allowed\n", - readonly ? "RO" : "RW", (unsigned long)avolid); + readonly ? "RO" : "RW", afs_cast_uint32(avolid)); exit(1); } } @@ -3896,7 +3896,7 @@ VolumeZap(register struct cmd_syndesc *as, void *arock) backupid = entry.volumeId[BACKVOL]; fprintf(STDERR, "Warning: Entry for volume number %lu exists in VLDB (but we're zapping it anyway!)\n", - (unsigned long)volid); + afs_cast_uint32(volid)); } if (zapbackupid) { volintInfo *pntr = (volintInfo *) 0; @@ -3917,7 +3917,7 @@ VolumeZap(register struct cmd_syndesc *as, void *arock) exit(1); } fprintf(STDOUT, "Backup Volume %lu deleted\n", - (unsigned long)backupid); + afs_cast_uint32(backupid)); } } code = UV_VolumeZap(server, part, volid); @@ -3925,7 +3925,7 @@ VolumeZap(register struct cmd_syndesc *as, void *arock) PrintDiagnostics("zap", code); exit(1); } - fprintf(STDOUT, "Volume %lu deleted\n", (unsigned long)volid); + fprintf(STDOUT, "Volume %lu deleted\n", afs_cast_uint32(volid)); return 0; } @@ -4092,7 +4092,7 @@ GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *vo if (vcode) { fprintf(STDERR, "Could not fetch the entry for volume %lu from VLDB \n", - (unsigned long)volid); + afs_cast_uint32(volid)); PrintError("", vcode); return (vcode); } @@ -4107,7 +4107,7 @@ GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *vo if (index == -1) { fprintf(STDERR, "RO volume is not found in VLDB entry for volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); return -1; } @@ -4120,7 +4120,7 @@ GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *vo if (index == -1) { fprintf(STDERR, "RW Volume is not found in VLDB entry for volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); return -1; } if (volid == rentry->volumeId[RWVOL]) { @@ -4137,7 +4137,7 @@ GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *vo } fprintf(STDERR, "unexpected volume type for volume %lu\n", - (unsigned long)volid); + afs_cast_uint32(volid)); return -1; } @@ -4939,7 +4939,7 @@ UnlockVLDB(register struct cmd_syndesc *as, void *arock) if (totalE) fprintf(STDOUT, "Could not lock %lu VLDB entries of %lu locked entries\n", - (unsigned long)totalE, (unsigned long)nentries); + afs_cast_uint32(totalE), (unsigned long)nentries); else { if (as->parms[0].items) { fprintf(STDOUT, @@ -5406,7 +5406,7 @@ ConvertRO(register struct cmd_syndesc *as, void *arock) if (vcode) { fprintf(STDERR, "Could not fetch the entry for volume %lu from VLDB\n", - (unsigned long)volid); + afs_cast_uint32(volid)); PrintError("convertROtoRW", code); return vcode; } @@ -5473,7 +5473,7 @@ ConvertRO(register struct cmd_syndesc *as, void *arock) if (code) { fprintf(STDERR, "Converting RO volume %lu to RW volume failed with code %d\n", - (unsigned long)volid, code); + afs_cast_uint32(volid), code); PrintError("convertROtoRW ", code); return -1; } -- 2.39.5