Index: lib/libutil/libutil.h =================================================================== RCS file: /private/FreeBSD/src/lib/libutil/libutil.h,v retrieving revision 1.40 diff -u -p -r1.40 libutil.h --- lib/libutil/libutil.h 24 May 2004 22:19:27 -0000 1.40 +++ lib/libutil/libutil.h 6 Jan 2005 23:03:58 -0000 @@ -39,6 +39,8 @@ #ifndef _LIBUTIL_H_ #define _LIBUTIL_H_ +#include + #define PROPERTY_MAX_NAME 64 #define PROPERTY_MAX_VALUE 512 @@ -69,7 +71,7 @@ int openpty(int *_amaster, int *_aslave, struct termios *_termp, struct winsize *_winp); int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); -int humanize_number(char *_buf, size_t _len, int64_t _number, +int humanize_number(char *_buf, size_t _len, intmax_t _number, const char *_suffix, int _scale, int _flags); const char *uu_lockerr(int _uu_lockresult); int uu_lock(const char *_ttyname); Index: lib/libutil/humanize_number.c =================================================================== RCS file: /private/FreeBSD/src/lib/libutil/humanize_number.c,v retrieving revision 1.2 diff -u -p -r1.2 humanize_number.c --- lib/libutil/humanize_number.c 25 Sep 2004 14:11:34 -0000 1.2 +++ lib/libutil/humanize_number.c 6 Jan 2005 23:00:28 -0000 @@ -49,13 +49,13 @@ __FBSDID("$FreeBSD: src/lib/libutil/huma #include int -humanize_number(char *buf, size_t len, int64_t bytes, +humanize_number(char *buf, size_t len, intmax_t bytes, const char *suffix, int scale, int flags) { const char *prefixes, *sep; - int b, i, r, maxscale, s1, s2, sign; - int64_t divisor, max; - size_t baselen; + intmax_t divisor, max; + size_t baselen; + int b, i, r, maxscale, s1, s2, sign; assert(buf != NULL); assert(suffix != NULL); @@ -139,9 +139,8 @@ humanize_number(char *buf, size_t len, i sign * s1, localeconv()->decimal_point, s2, sep, SCALE2PREFIX(i), suffix); } else - r = snprintf(buf, len, "%lld%s%s%s", - /* LONGLONG */ - (long long)(sign * ((bytes + 50) / 100)), + r = snprintf(buf, len, "%jd%s%s%s", + (intmax_t)(sign * ((bytes + 50) / 100)), sep, SCALE2PREFIX(i), suffix); return (r); Index: lib/libutil/humanize_number.3 =================================================================== RCS file: /private/FreeBSD/src/lib/libutil/humanize_number.3,v retrieving revision 1.7 diff -u -p -r1.7 humanize_number.3 --- lib/libutil/humanize_number.3 26 Sep 2004 12:08:31 -0000 1.7 +++ lib/libutil/humanize_number.3 6 Jan 2005 23:01:21 -0000 @@ -47,7 +47,7 @@ .In libutil.h .Ft int .Fo humanize_number -.Fa "char *buf" "size_t len" "int64_t number" "const char *suffix" +.Fa "char *buf" "size_t len" "intmax_t number" "const char *suffix" .Fa "int scale" "int flags" .Fc .Sh DESCRIPTION Index: bin/df/df.c =================================================================== RCS file: /private/FreeBSD/src/bin/df/df.c,v retrieving revision 1.63 diff -u -p -r1.63 df.c --- bin/df/df.c 20 Jul 2004 18:24:47 -0000 1.63 +++ bin/df/df.c 6 Jan 2005 23:48:27 -0000 @@ -79,7 +79,7 @@ static void addstat(struct statfs *, s static char *getmntpt(const char *); static int int64width(int64_t); static char *makenetvfslist(void); -static void prthuman(const struct statfs *, int64_t); +static void prthuman(const struct statfs *, intmax_t); static void prthumanval(int64_t); static intmax_t fsbtoblk(int64_t, uint64_t, u_long); static void prtstat(struct statfs *, struct maxwidths *); @@ -328,7 +328,7 @@ regetmntinfo(struct statfs **mntbufp, lo } static void -prthuman(const struct statfs *sfsp, int64_t used) +prthuman(const struct statfs *sfsp, intmax_t used) { prthumanval(sfsp->f_blocks * sfsp->f_bsize); @@ -337,7 +337,7 @@ prthuman(const struct statfs *sfsp, int6 } static void -prthumanval(int64_t bytes) +prthumanval(intmax_t bytes) { char buf[6]; int flags; Index: bin/ls/print.c =================================================================== RCS file: /private/FreeBSD/src/bin/ls/print.c,v retrieving revision 1.73 diff -u -p -r1.73 print.c --- bin/ls/print.c 8 Jun 2004 09:27:42 -0000 1.73 +++ bin/ls/print.c 6 Jan 2005 23:49:59 -0000 @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD: src/bin/ls/print.c,v static int printaname(const FTSENT *, u_long, u_long); static void printlink(const FTSENT *); static void printtime(time_t); -static int printtype(u_int); +static int printtype(unsigned); static void printsize(size_t, off_t); #ifdef COLORLS static void endcolor(int); @@ -600,11 +600,11 @@ printsize(size_t width, off_t bytes) if (f_humanval) { char buf[5]; - humanize_number(buf, sizeof(buf), (int64_t)bytes, "", + humanize_number(buf, sizeof(buf), (intmax_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%5s ", buf); } else - (void)printf("%*jd ", (u_int)width, bytes); + (void)printf("%*jd ", (unsigned)width, bytes); } static void Index: usr.bin/du/du.c =================================================================== RCS file: /private/FreeBSD/src/usr.bin/du/du.c,v retrieving revision 1.37 diff -u -p -r1.37 du.c --- usr.bin/du/du.c 7 Jan 2005 00:12:24 -0000 1.37 +++ usr.bin/du/du.c 7 Jan 2005 00:20:36 -0000 @@ -73,7 +73,7 @@ struct ignentry { static int linkchk(FTSENT *); static void usage(void); -void prthumanval(int64_t); +void prthumanval(intmax_t); void ignoreadd(const char *); void ignoreclean(void); int ignorep(FTSENT *); @@ -231,7 +231,7 @@ main(int argc, char *argv[]) if (p->fts_level <= depth) { if (hflag) { - (void) prthumanval(howmany(p->fts_bignum, blocksize)); + (void) prthumanval((intmax_t)howmany(p->fts_bignum, blocksize)); (void) printf("\t%s\n", p->fts_path); } else { (void) printf("%jd\t%s\n", @@ -257,8 +257,7 @@ main(int argc, char *argv[]) if (listall || p->fts_level == 0) { if (hflag) { - (void) prthumanval(howmany(p->fts_statp->st_blocks, - blocksize)); + (void) prthumanval((intmax_t)howmany(p->fts_statp->st_blocks, blocksize)); (void) printf("\t%s\n", p->fts_path); } else { (void) printf("%jd\t%s\n", @@ -277,7 +276,7 @@ main(int argc, char *argv[]) if (cflag) { if (hflag) { - (void) prthumanval(howmany(savednumber, blocksize)); + (void) prthumanval((intmax_t)howmany(savednumber, blocksize)); (void) printf("\ttotal\n"); } else { (void) printf("%jd\ttotal\n", (intmax_t)howmany(savednumber, blocksize)); @@ -423,7 +422,7 @@ linkchk(FTSENT *p) } void -prthumanval(int64_t bytes) +prthumanval(intmax_t bytes) { char buf[5]; Index: usr.sbin/diskinfo/diskinfo.c =================================================================== RCS file: /private/FreeBSD/src/usr.sbin/diskinfo/diskinfo.c,v retrieving revision 1.7 diff -u -p -r1.7 diskinfo.c --- usr.sbin/diskinfo/diskinfo.c 9 Nov 2004 12:28:41 -0000 1.7 +++ usr.sbin/diskinfo/diskinfo.c 7 Jan 2005 00:21:38 -0000 @@ -116,7 +116,7 @@ main(int argc, char **argv) printf("\t%u", fwsectors); } } else { - humanize_number(buf, 5, (int64_t)mediasize, "", + humanize_number(buf, 5, (intmax_t)mediasize, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf("%s\n", argv[i]); printf("\t%-12u\t# sectorsize\n", sectorsize); Index: sbin/mdconfig/mdconfig.c =================================================================== RCS file: /private/FreeBSD/src/sbin/mdconfig/mdconfig.c,v retrieving revision 1.39 diff -u -p -r1.39 mdconfig.c --- sbin/mdconfig/mdconfig.c 27 Dec 2004 17:20:06 -0000 1.39 +++ sbin/mdconfig/mdconfig.c 6 Jan 2005 23:51:41 -0000 @@ -273,12 +273,12 @@ list(const int fd) } static void -prthumanval(int64_t bytes) +prthumanval(off_t bytes) { char buf[6]; - humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), - bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), (intmax_t)bytes, + "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%6s", buf); } Index: sbin/ggate/shared/ggate.c =================================================================== RCS file: /private/FreeBSD/src/sbin/ggate/shared/ggate.c,v retrieving revision 1.4 diff -u -p -r1.4 ggate.c --- sbin/ggate/shared/ggate.c 8 Sep 2004 07:57:14 -0000 1.4 +++ sbin/ggate/shared/ggate.c 6 Jan 2005 23:55:11 -0000 @@ -277,7 +277,7 @@ show_config(struct ggeom *gp, int verbos printf("queue_count: %s\n", get_conf(gp, "queue_count")); printf(" queue_size: %s\n", get_conf(gp, "queue_size")); printf(" references: %s\n", get_conf(gp, "ref")); - humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "", + humanize_number(buf, sizeof(buf), (intmax_t)pp->lg_mediasize, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf(" mediasize: %jd (%s)\n", (intmax_t)pp->lg_mediasize, buf); printf(" sectorsize: %u\n", pp->lg_sectorsize); Index: sbin/geom/core/geom.c =================================================================== RCS file: /private/FreeBSD/src/sbin/geom/core/geom.c,v retrieving revision 1.9 diff -u -p -r1.9 geom.c --- sbin/geom/core/geom.c 28 Dec 2004 17:07:18 -0000 1.9 +++ sbin/geom/core/geom.c 6 Jan 2005 23:55:54 -0000 @@ -588,7 +588,7 @@ show_one_provider(struct gprovider *pp, char buf[5]; printf("Name: %s\n", pp->lg_name); - humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "", + humanize_number(buf, sizeof(buf), (intmax_t)pp->lg_mediasize, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf("%sMediasize: %jd (%s)\n", prefix, (intmax_t)pp->lg_mediasize, buf); @@ -612,8 +612,8 @@ show_one_consumer(struct gconsumer *cp, char buf[5]; printf("Name: %s\n", pp->lg_name); - humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "", - HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + humanize_number(buf, sizeof(buf), (intmax_t)pp->lg_mediasize, + "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf("%sMediasize: %jd (%s)\n", prefix, (intmax_t)pp->lg_mediasize, buf); printf("%sSectorsize: %u\n", prefix, pp->lg_sectorsize);