if (afsd_debug) {
printf("%s: Current directory entry:\n", rn);
#ifdef AFS_SGI62_ENV
- printf("\tinode=%lld, reclen=%d, name='%s'\n", currp->d_ino,
+ printf("\tinode=%" AFS_INT64_FMT ", reclen=%d, name='%s'\n", currp->d_ino,
currp->d_reclen, currp->d_name);
#else
printf("\tinode=%d, reclen=%d, name='%s'\n", currp->d_ino,
#define static_inline static inline
#endif
+/* 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
+
#endif /* OPENAFS_CONFIG_AFS_STDS_H */
perror("stat");
exit(1);
}
- printf("ino=%lld\n", ino);
+ printf("ino=%" AFS_INT64_FMT "\n", ino);
printf("About to iopen(dev=(%d,%d), inode=%s, mode=%d\n",
major(status.st_dev), minor(status.st_dev), PrintInode(NULL, ino),
O_RDONLY);
fprintf(outFilep, "%s", printfStrings[pfpix++]);
break;
case 2: /* signed integer */
- fprintf(outFilep, "%lld", printfParms[pfpix++]);
+ fprintf(outFilep, "%" AFS_INT64_FMT, printfParms[pfpix++]);
break;
case 3: /* unsigned integer */
fprintf(outFilep, "%llu", printfParms[pfpix++]);
tempParam = alp[pix];
tempParam <<= 32;
tempParam |= alp[pix + 1];
- fprintf(outFilep, "p%d:%lld ", i, tempParam);
+ fprintf(outFilep, "p%d:%" AFS_INT64_FMT " ", i, tempParam);
#else /* AFS_SGI61_ENV */
fprintf(outFilep, "p%d:%d ", i, alp[pix]);
#endif /* AFS_SGI61_ENV */
#endif
#ifdef AFS_SGI62_ENV
printf
- ("\tf.chunk=%d, f.inode=%lld, f.chunkBytes=%d, f.states=%x",
+ ("\tf.chunk=%d, f.inode=%" AFS_INT64_FMT ", f.chunkBytes=%d, f.states=%x",
dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states);
#else
printf
#ifdef AFS_SGI62_ENV
findsym("cacheInode", &symoff);
kread(kmem, symoff, (char *)&inode, sizeof inode);
- printf("\tcacheInode = 0x%llx (%lld)\n", inode, inode);
+ printf("\tcacheInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
findsym("volumeInode", &symoff);
kread(kmem, symoff, (char *)&inode, sizeof inode);
- printf("\tvolumeInode = 0x%llx (%lld)\n", inode, inode);
+ printf("\tvolumeInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
#else
findsym("cacheInode", &symoff);
kread(kmem, symoff, (char *)&count, sizeof count);
if (preen)
printf("%s: ", devname);
#if defined(AFS_SUN56_ENV)
- printf("SIZE=%lld ", dp->di_size);
+ printf("SIZE=%" AFS_INT64_FMT " ", dp->di_size);
#else
printf("SIZE=%ld ", dp->di_size);
#endif
if (ndb < 0) {
if (debug)
#if defined(AFS_SUN56_ENV)
- printf("bad size %lld ndb %d:",
+ printf("bad size %" AFS_INT64_FMT " ndb %d:",
#else
printf("bad size %d ndb %d:",
#endif
AdjustDiskUsage(volptr, BlocksPreallocatedForVnode,
BlocksPreallocatedForVnode))) {
ViceLog(25,
- ("Insufficient space to allocate %lld blocks\n",
+ ("Insufficient space to allocate %" AFS_INT64_FMT " blocks\n",
(afs_intmax_t) BlocksPreallocatedForVnode));
return (errorCode);
}
print_vol_stats_viceP(struct DiskPartitionStats64 * stats)
{
printf("DiskPartitionStats64 = {\n");
- printf("\tfree = %lld\n", stats->free);
- printf("\tminFree = %lld\n", stats->minFree);
- printf("\ttotalUsable = %lld\n", stats->totalUsable);
- printf("\tf_files = %lld\n", stats->f_files);
+ printf("\tfree = %" AFS_INT64_FMT "\n", stats->free);
+ printf("\tminFree = %" AFS_INT64_FMT "\n", stats->minFree);
+ printf("\ttotalUsable = %" AFS_INT64_FMT "\n", stats->totalUsable);
+ printf("\tf_files = %" AFS_INT64_FMT "\n", stats->f_files);
#ifdef AFS_DEMAND_ATTACH_FS
printf("\tvol_list_len = %d\n", stats->vol_list_len);
#endif
} else {
IHandle_t *th;
IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
- Log("Warning: Lost ref on ihandle dev %d vid %d ino %lld\n",
+ Log("Warning: Lost ref on ihandle dev %d vid %d ino %" AFS_INT64_FMT "\n",
th->ih_dev, th->ih_vid, (int64_t) th->ih_ino);
IH_RELEASE(th);
if (code < 0)
fprintf(stderr, "Code = %d; Errno = %d\n", code, errno);
else
- fprintf(stderr, "Read %d bytes out of %lld\n", code, (afs_uintmax_t)size);
+ fprintf(stderr, "Read %d bytes out of %" AFS_INT64_FMT "\n", code, (afs_uintmax_t)size);
}
if ((code >= 0) && (code < BUFSIZE))
buffer[size] = 0; /* Add null char at end */
exit(1);
}
if (TESTM)
- fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+ fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
partition.free);
p = (volintInfo *) 0;
exit(1);
}
if (TESTM)
- fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+ fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
partition.free);
p = (volintInfo *) 0;
exit(1);
}
if (TESTM)
- fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+ fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
partition.free);
/* Don't do this again if we did it above */
exit(1);
}
fprintf(STDOUT,
- "Free space on partition %s: %lld K blocks out of total %lld\n",
+ "Free space on partition %s: %" AFS_INT64_FMT " K blocks out of total %" AFS_INT64_FMT "\n",
pname, partition.free, partition.minFree);
sumPartitions++;
AddUInt64(sumFree,partition.free,&sumFree);