From 4facd0d37192a06dd40016961f8d6a113f45318d Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 19 Sep 2009 08:42:19 +0200 Subject: [PATCH] Silence the remaining amd64 warnings for stuff that has WARNS set. --- usr.sbin/iostat/iostat.c | 10 +++++----- usr.sbin/lpr/lpd/printjob.c | 6 +++--- usr.sbin/memcontrol/memcontrol.c | 3 ++- usr.sbin/pfctl/pf_print_state.c | 2 +- usr.sbin/pfctl/pfctl_parser.c | 2 +- usr.sbin/pflogd/pflogd.c | 2 +- usr.sbin/resident/resident.c | 6 +++--- usr.sbin/vnconfig/vnconfig.c | 6 +++--- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 970c5d655b..5398ce1488 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -597,9 +597,9 @@ devstats(int perf_select) msdig, ms_per_transaction); else - printf("%4.1qu%4.1qu%5.*Lf ", - total_blocks, - total_transfers, + printf("%4.1ju%4.1ju%5.*Lf ", + (uintmax_t)total_blocks, + (uintmax_t)total_transfers, msdig, ms_per_transaction); } else { @@ -612,9 +612,9 @@ devstats(int perf_select) total_mb = total_bytes; total_mb /= 1024 * 1024; - printf(" %5.2Lf %3.1qu %5.2Lf ", + printf(" %5.2Lf %3.1ju %5.2Lf ", kb_per_transfer, - total_transfers, + (uintmax_t)total_transfers, total_mb); } } diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index cbb2a86acf..38ceb4b834 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1111,10 +1111,10 @@ sendagain: copycnt++; if (copycnt < 2) - sprintf(buf, "%c%qd %s\n", type, stb.st_size, file); + sprintf(buf, "%c%jd %s\n", type, (intmax_t)stb.st_size, file); else - sprintf(buf, "%c%qd %s_c%d\n", type, stb.st_size, file, - copycnt); + sprintf(buf, "%c%jd %s_c%d\n", type, (intmax_t)stb.st_size, + file, copycnt); amt = strlen(buf); for (i = 0; ; i++) { if (write(pfd, buf, amt) != amt || diff --git a/usr.sbin/memcontrol/memcontrol.c b/usr.sbin/memcontrol/memcontrol.c index fb03a4a685..d240b40ff7 100644 --- a/usr.sbin/memcontrol/memcontrol.c +++ b/usr.sbin/memcontrol/memcontrol.c @@ -178,7 +178,8 @@ listfunc(int memfd, int argc, char *argv[]) continue; if (owner && strcmp(mrd[i].mr_owner, owner)) continue; - printf("%qx/%qx %.8s ", mrd[i].mr_base, mrd[i].mr_len, + printf("%jx/%jx %.8s ", + (uintmax_t)mrd[i].mr_base, (uintmax_t)mrd[i].mr_len, mrd[i].mr_owner[0] ? mrd[i].mr_owner : "-"); for (j = 0; attrnames[j].name != NULL; j++) if (mrd[i].mr_flags & attrnames[j].val) diff --git a/usr.sbin/pfctl/pf_print_state.c b/usr.sbin/pfctl/pf_print_state.c index ef931c449a..1144527e80 100644 --- a/usr.sbin/pfctl/pf_print_state.c +++ b/usr.sbin/pfctl/pf_print_state.c @@ -287,7 +287,7 @@ print_state(struct pf_state *s, int opts) } if (opts & PF_OPT_VERBOSE2) { printf(" id: %016llx creatorid: %08x", - be64toh(s->id), ntohl(s->creatorid)); + (unsigned long long)be64toh(s->id), ntohl(s->creatorid)); printf(" synchronization: "); if ((s->sync_flags & PFSTATE_GOT_SYN_MASK) == diff --git a/usr.sbin/pfctl/pfctl_parser.c b/usr.sbin/pfctl/pfctl_parser.c index b9a39d7c40..1b8d8687d3 100644 --- a/usr.sbin/pfctl/pfctl_parser.c +++ b/usr.sbin/pfctl/pfctl_parser.c @@ -555,7 +555,7 @@ print_status(struct pf_status *s, int opts) s->src_nodes, ""); for (i = 0; i < SCNT_MAX; i++) { printf(" %-25s %14lld ", pf_scounters[i], - s->scounters[i]); + (unsigned long long)s->scounters[i]); if (runtime > 0) printf("%14.1f/s\n", (double)s->scounters[i] / (double)runtime); diff --git a/usr.sbin/pflogd/pflogd.c b/usr.sbin/pflogd/pflogd.c index 8872c89db2..c799a4edb7 100644 --- a/usr.sbin/pflogd/pflogd.c +++ b/usr.sbin/pflogd/pflogd.c @@ -397,7 +397,7 @@ dump_packet_nobuf(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) if (fwrite(h, sizeof(*h), 1, f) != 1) { /* try to undo header to prevent corruption */ off_t pos = ftello(f); - if (pos < sizeof(*h) || + if ((size_t)pos < sizeof(*h) || ftruncate(fileno(f), pos - sizeof(*h))) { logmsg(LOG_ERR, "Write failed, corrupted logfile!"); set_suspended(1); diff --git a/usr.sbin/resident/resident.c b/usr.sbin/resident/resident.c index ed6e8df72d..1b290ea8ba 100644 --- a/usr.sbin/resident/resident.c +++ b/usr.sbin/resident/resident.c @@ -89,10 +89,10 @@ list_residents(void) /* print the list of retrieved resident binary */ printf("%-4s\t%-15s\t%-12s\t%-30s\n","Id", "Size", "Address", "Executable"); for (i = 0; i < res_count; ++i) { - printf("%-4d\t%-15lld\t0x%-12x\t%-30s\n", + printf("%-4d\t%-15jd\t0x%-12x\t%-30s\n", buf[i].res_id, - buf[i].res_stat.st_size, - buf[i].res_entry_addr, + (intmax_t)buf[i].res_stat.st_size, + (int)buf[i].res_entry_addr, buf[i].res_file); } diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c index 572da8fca8..3335d411c5 100644 --- a/usr.sbin/vnconfig/vnconfig.c +++ b/usr.sbin/vnconfig/vnconfig.c @@ -325,8 +325,8 @@ getinfo( const char *vname ) fprintf(stdout, "not in use\n"); else if ((strcmp(vnu.vnu_file, _VN_USER_SWAP)) == 0) fprintf(stdout, - "consuming %lld VM pages\n", - vnu.vnu_size); + "consuming %jd VM pages\n", + (intmax_t)vnu.vnu_size); else fprintf(stdout, "covering %s on %s, inode %ju\n", @@ -498,7 +498,7 @@ config(struct vndisk *vnp) if (verbose) { printf("%s: %s, ", dev, file); if (vnp->size != 0) { - printf("%lld bytes mapped\n", vnio.vn_size); + printf("%jd bytes mapped\n", (intmax_t)vnio.vn_size); } else { printf("complete file mapped\n"); } -- 2.41.0