rxMaxMTU = atoi(argv[++code]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
- printf("rxMaxMTU %d invalid; must be between %d-%lu\n",
+ printf("rxMaxMTU %d invalid; must be between %d-%" AFS_SIZET_FMT "\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
exit(1);
#define AFS_INT64_FMT "lld"
#define AFS_UINT64_FMT "llu"
#define AFS_PTR_FMT "p"
+#ifdef AFS_64BITPOINTER_ENV
+#define AFS_SIZET_FMT "lu"
+#else
#define AFS_SIZET_FMT "u"
-#endif
+#endif /* AFS_64BITPOINTER_ENV */
+#endif /* AFS_NT40_ENV */
/* Functions to safely cast afs_int32 and afs_uint32 so they can be used in
* printf statemements with %ld and %lu
*/
if (curses_debug)
fprintf(stderr,
- "[%s:%s] Allocating %lu bytes for curses window private space in base window\n",
+ "[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for curses window private space in base window\n",
mn, rn, sizeof(struct gator_cursesgwin));
c_data =
(struct gator_cursesgwin *)malloc(sizeof(struct gator_cursesgwin));
if (c_data == (struct gator_cursesgwin *)0) {
fprintf(stderr,
- "[%s:%s] Can't allocate %lu bytes for curses window private space in base window\n",
+ "[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for curses window private space in base window\n",
mn, rn, sizeof(struct gator_cursesgwin));
return (-1);
}
if (curses_debug)
fprintf(stderr,
- "[%s:%s] Allocating %lu bytes for new gwin structure\n", mn,
+ "[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for new gwin structure\n", mn,
rn, sizeof(struct gwin));
newgwin = (struct gwin *)malloc(sizeof(struct gwin));
if (newgwin == NULL) {
fprintf(stderr,
- "[%s:%s] Can't malloc() %lu bytes for new gwin structure: Errno is %d\n",
+ "[%s:%s] Can't malloc() %" AFS_SIZET_FMT " bytes for new gwin structure: Errno is %d\n",
mn, rn, sizeof(struct gwin), errno);
return (NULL);
}
if (curses_debug)
fprintf(stderr,
- "[%s:%s] Allocating %lu bytes for curses window private space\n",
+ "[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for curses window private space\n",
mn, rn, sizeof(struct gator_cursesgwin));
c_data =
(struct gator_cursesgwin *)malloc(sizeof(struct gator_cursesgwin));
if (c_data == (struct gator_cursesgwin *)0) {
fprintf(stderr,
- "[%s:%s] Can't allocate %lu bytes for curses window private space\n",
+ "[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for curses window private space\n",
mn, rn, sizeof(struct gator_cursesgwin));
free(newgwin);
return (NULL);
(struct gator_lightobj *)malloc(sizeof(struct gator_lightobj));
if (light_data == (struct gator_lightobj *)0) {
fprintf(stderr,
- "[%s:%s] Can't allocate %lu bytes for light object private data region, errno is %d\n",
+ "[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for light object private data region, errno is %d\n",
mn, rn, sizeof(struct gator_lightobj), errno);
return (errno);
}
(struct gwin_strparams *)malloc(sizeof(struct gwin_strparams));
if (light_strparams == (struct gwin_strparams *)0) {
fprintf(stderr,
- "[%s:%s] Can't allocate %lu bytes for light object label in private data region, errno is %d\n",
+ "[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for light object label in private data region, errno is %d\n",
mn, rn, sizeof(struct gwin_strparams), errno);
free(light_data);
return (errno);
if (objects_debug)
fprintf(stderr,
- "[%s:%s] Allocating %lu bytes for new onode structure\n", mn,
+ "[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for new onode structure\n", mn,
rn, sizeof(struct onode));
new_onode = (struct onode *)malloc(sizeof(struct onode));
if (new_onode == NULL) {
fprintf(stderr,
- "[%s:%s] Can't allocate %lu bytes for new onode structure; errno is %d\n",
+ "[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for new onode structure; errno is %d\n",
mn, rn, sizeof(struct onode), errno);
return (NULL);
}
a_cbhdr->entry[0].textp = NULL;
if (gator_textcb_debug)
- fprintf(stderr, "[%s]: Freeing text entry array at %p (%lu bytes)\n",
+ fprintf(stderr, "[%s]: Freeing text entry array at %p (%" AFS_SIZET_FMT " bytes)\n",
rn, a_cbhdr->entry,
(a_cbhdr->maxEntriesStored *
sizeof(struct gator_textcb_entry)));
* Description:
* Implementation of the gator text object.
*------------------------------------------------------------------------*/
-#define IGNORE_STDS_H
#include <afsconfig.h>
#include <afs/param.h>
*/
if (objects_debug)
fprintf(stderr,
- "[%s:%s] Allocating %lu bytes for text object private data region\n",
+ "[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for text object private data region\n",
mn, rn, sizeof(struct gator_textobj));
text_data = (struct gator_textobj *)malloc(sizeof(struct gator_textobj));
if (text_data == (struct gator_textobj *)0) {
fprintf(stderr,
- "[%s:%s] Can't allocate %lu bytes for text object private data region, errno is %d\n",
+ "[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for text object private data region, errno is %d\n",
mn, rn, sizeof(struct gator_textobj), errno);
return (errno);
}
/* now read the info */
r = read(fd, &uheader, sizeof(uheader));
if (r != sizeof(uheader)) {
- printf("error: read of %lu bytes failed: %d %d\n", sizeof(uheader), r,
+ printf("error: read of %" AFS_SIZET_FMT " bytes failed: %d %d\n", sizeof(uheader), r,
errno);
return (-1);
}
if (header->headerSize != sizeof(struct kaheader)) {
code++;
fprintf(stderr,
- "HEADER SIZE WRONG: file indicates %d, should be %lu\n",
+ "HEADER SIZE WRONG: file indicates %d, should be %" AFS_SIZET_FMT "\n",
header->headerSize, sizeof(struct kaheader));
}
if (header->hashsize != HASHSIZE) {
i = NameHash(&entry);
if (i != j) {
fprintf(stderr,
- "Entry %lu, %s, found in hash chain %d (should be %d)\n",
+ "Entry %" AFS_SIZET_FMT ", %s, found in hash chain %d (should be %d)\n",
((index -
sizeof(struct kaheader)) / sizeof(struct kaentry)),
EntryName(&entry), j, i);
/* now read the info */
r = read(fd, &uheader, sizeof(uheader));
if (r != sizeof(uheader)) {
- printf("error: read of %lu bytes failed: %d %d\n", sizeof(uheader), r,
- errno);
+ printf("error: read of %" AFS_SIZET_FMT " bytes failed: %d %d\n",
+ sizeof(uheader), r, errno);
return (-1);
}
rxMaxMTU = atoi(argv[++a]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
- printf("rxMaxMTU %d invalid; must be between %d-%lu\n",
+ printf("rxMaxMTU %d invalid; must be between %d-%" AFS_SIZET_FMT "\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
PT_EXIT(1);
if (size != sizeof(struct rx_statistics)) {
fprintf(file,
- "Unexpected size of stats structure: was %d, expected %lud\n",
+ "Unexpected size of stats structure: was %d, expected %" AFS_SIZET_FMT "\n",
size, sizeof(struct rx_statistics));
}
/*Debugging */
if (scout_debug)
- fprintf(scout_debugfd, "[%s] Scout label is '%s', %lu chars\n", rn,
+ fprintf(scout_debugfd, "[%s] Scout label is '%s', %" AFS_SIZET_FMT " chars\n", rn,
lightdata->label, strlen(lightdata->label));
}
tp = uss_common_FieldCp(path_field, a_access, ' ', sizeof(path_field),
&overflow);
if (overflow) {
- fprintf(stderr, "%s: * Pathname field too long (max is %lu chars)\n",
+ fprintf(stderr, "%s: * Pathname field too long (max is %" AFS_SIZET_FMT " chars)\n",
uss_whoami, sizeof(path_field));
return (-1);
}
struct cm_initparams_v1 *c1;
if (c.cacheConfig_len != sizeof(*c1) / sizeof(afs_uint32)) {
- printf("cmdebug: configuration data size mismatch (%d != %lu)\n",
+ printf("cmdebug: configuration data size mismatch (%d != %" AFS_SIZET_FMT ")\n",
c.cacheConfig_len, sizeof(*c1) / sizeof(afs_uint32));
return 0;
}
for (i = 0; i < tsize; i++) {
if (afs_fstat(i, &status) != -1) {
printf("%d: dev %x, inode %u, length %u, type/mode %x\n", i,
- status.st_dev, status.st_ino,
+ (unsigned int) status.st_dev,
+ (unsigned int) status.st_ino,
(unsigned int) status.st_size,
status.st_mode);
}
rxMaxMTU = atoi(argv[++i]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
- printf("rxMaxMTU %d%% invalid; must be between %d-%lu\n",
+ printf("rxMaxMTU %d%% invalid; must be between %d-%" AFS_SIZET_FMT "\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
return -1;
if (vl3p->flags == VLFREE)
return;
- printf("%s\tPos=%lu NextIdHash=[%d:%d:%d] NextNameHash=%d\n",
+ printf("%s\tPos=%" AFS_SIZET_FMT " NextIdHash=[%d:%d:%d] NextNameHash=%d\n",
vl3p->name, (oldpos - sizeof(struct vlentry_3)),
vl3p->nextIdHash[0], vl3p->nextIdHash[1], vl3p->nextIdHash[2],
vl3p->nextNameHash);
rxMaxMTU = atoi(argv[++index]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
- printf("rxMaxMTU %d invalid; must be between %d-%lu\n",
+ printf("rxMaxMTU %d invalid; must be between %d-%" AFS_SIZET_FMT "\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
return -1;
rxMaxMTU = atoi(argv[++code]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
- printf("rxMaxMTU %d invalid; must be between %d-%lu\n",
+ printf("rxMaxMTU %d invalid; must be between %d-%" AFS_SIZET_FMT "\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
exit(1);
malloc(a_numServers * sizeof(struct xstat_cm_ConnectionInfo));
if (xstat_cm_ConnInfo == (struct xstat_cm_ConnectionInfo *)0) {
fprintf(stderr,
- "[%s] Can't allocate %d connection info structs (%lu bytes)\n",
+ "[%s] Can't allocate %d connection info structs (%" AFS_SIZET_FMT " bytes)\n",
rn, a_numServers,
(a_numServers * sizeof(struct xstat_cm_ConnectionInfo)));
return (-1); /*No cleanup needs to be done yet */
malloc(a_numServers * sizeof(struct xstat_fs_ConnectionInfo));
if (xstat_fs_ConnInfo == (struct xstat_fs_ConnectionInfo *)0) {
fprintf(stderr,
- "[%s] Can't allocate %d connection info structs (%lu bytes)\n",
+ "[%s] Can't allocate %d connection info structs (%" AFS_SIZET_FMT " bytes)\n",
rn, a_numServers,
(a_numServers * sizeof(struct xstat_fs_ConnectionInfo)));
return (-1); /*No cleanup needs to be done yet */