-/* $OpenBSD: du.c,v 1.31 2015/10/10 05:32:52 deraadt Exp $ */
+/* $OpenBSD: du.c,v 1.32 2016/08/24 03:13:45 guenther Exp $ */
/* $NetBSD: du.c,v 1.11 1996/10/18 07:20:35 thorpej Exp $ */
/*
int linkchk(FTSENT *);
-void prtout(quad_t, char *, int);
+void prtout(int64_t, char *, int);
void usage(void);
int
FTS *fts;
FTSENT *p;
long blocksize;
- quad_t totalblocks;
+ int64_t totalblocks;
int ftsoptions, listfiles, maxdepth;
int Hflag, Lflag, cflag, hflag, kflag;
int ch, notused, rval;
* root of a traversal, display the total.
*/
if (p->fts_level <= maxdepth)
- prtout((quad_t)howmany(p->fts_number,
+ prtout(howmany(p->fts_number,
(unsigned long)blocksize), p->fts_path,
hflag);
break;
if (errno)
err(1, "fts_read");
if (cflag) {
- prtout((quad_t)howmany(totalblocks, blocksize), "total", hflag);
+ prtout(howmany(totalblocks, blocksize), "total", hflag);
}
fts_close(fts);
exit(rval);
}
void
-prtout(quad_t size, char *path, int hflag)
+prtout(int64_t size, char *path, int hflag)
{
if (!hflag)
- (void)printf("%lld\t%s\n", (long long)size, path);
+ (void)printf("%lld\t%s\n", size, path);
else {
char buf[FMT_SCALED_STRSIZE];
if (fmt_scaled(size * 512, buf) == 0)
(void)printf("%s\t%s\n", buf, path);
else
- (void)printf("%lld\t%s\n", (long long)size, path);
+ (void)printf("%lld\t%s\n", size, path);
}
}
-/* $OpenBSD: display.c,v 1.24 2016/03/15 04:19:13 mmcc Exp $ */
+/* $OpenBSD: display.c,v 1.25 2016/08/24 03:13:45 guenther Exp $ */
/* $NetBSD: display.c,v 1.12 2001/12/07 15:14:29 bjh21 Exp $ */
/*
for (pr = endfu->nextpr; pr; pr = pr->nextpr)
switch(pr->flags) {
case F_ADDRESS:
- (void)printf(pr->fmt, (quad_t)eaddress);
+ (void)printf(pr->fmt, (int64_t)eaddress);
break;
case F_TEXT:
(void)printf("%s", pr->fmt);
switch(pr->flags) {
case F_ADDRESS:
- (void)printf(pr->fmt, (quad_t)address);
+ (void)printf(pr->fmt, (int64_t)address);
break;
case F_BPAD:
(void)printf(pr->fmt, "");
case F_INT:
switch(pr->bcnt) {
case 1:
- (void)printf(pr->fmt, (quad_t)*bp);
+ (void)printf(pr->fmt, (int64_t)*bp);
break;
case 2:
memmove(&s2, bp, sizeof(s2));
- (void)printf(pr->fmt, (quad_t)s2);
+ (void)printf(pr->fmt, (int64_t)s2);
break;
case 4:
memmove(&s4, bp, sizeof(s4));
- (void)printf(pr->fmt, (quad_t)s4);
+ (void)printf(pr->fmt, (int64_t)s4);
break;
case 8:
memmove(&s8, bp, sizeof(s8));
case F_UINT:
switch(pr->bcnt) {
case 1:
- (void)printf(pr->fmt, (u_quad_t)*bp);
+ (void)printf(pr->fmt, (uint64_t)*bp);
break;
case 2:
memmove(&u2, bp, sizeof(u2));
- (void)printf(pr->fmt, (u_quad_t)u2);
+ (void)printf(pr->fmt, (uint64_t)u2);
break;
case 4:
memmove(&u4, bp, sizeof(u4));
- (void)printf(pr->fmt, (u_quad_t)u4);
+ (void)printf(pr->fmt, (uint64_t)u4);
break;
case 8:
memmove(&u8, bp, sizeof(u8));
-/* $OpenBSD: parse.c,v 1.20 2016/03/15 04:19:13 mmcc Exp $ */
+/* $OpenBSD: parse.c,v 1.21 2016/08/24 03:13:45 guenther Exp $ */
/* $NetBSD: parse.c,v 1.12 2001/12/07 13:37:39 bjh21 Exp $ */
/*
PR *pr, **nextpr;
FU *fu;
char *p1, *p2;
- char savech, *fmtp, cs[3];
+ char savech, *fmtp, cs[4];
int nconv, prec;
size_t len;
else
pr->flags = F_UINT;
- cs[2] = '\0';
- cs[1] = cs[0];
- cs[0] = 'q';
+ cs[3] = '\0';
+ cs[2] = cs[0];
+ cs[1] = 'l';
+ cs[0] = 'l';
switch(fu->bcnt) {
case 0: case 4:
pr->bcnt = 4;
++p2;
switch(p1[2]) {
case 'd': case 'o': case'x':
- cs[0] = 'q';
- cs[1] = p1[2];
- cs[2] = '\0';
+ cs[0] = 'l';
+ cs[1] = 'l';
+ cs[2] = p1[2];
+ cs[3] = '\0';
break;
default:
if (p1[2])
-/* $OpenBSD: vmstat.c,v 1.80 2015/08/20 22:32:42 deraadt Exp $ */
+/* $OpenBSD: vmstat.c,v 1.81 2016/08/24 03:13:45 guenther Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
struct vmtotal Total;
struct nchstats nchstats;
long nchcount;
- u_quad_t *intrcnt;
+ uint64_t *intrcnt;
} s, s1, s2, s3, z;
extern struct _disk cur;
size = sizeof(si->time);
if (sysctl(cp_time_mib, 2, &si->time, &size, NULL, 0) < 0) {
error("Can't get KERN_CPTIME: %s\n", strerror(errno));
- bzero(&si->time, sizeof(si->time));
+ memset(&si->time, 0, sizeof(si->time));
}
size = sizeof(si->nchstats);
if (sysctl(nchstats_mib, 2, &si->nchstats, &size, NULL, 0) < 0) {
error("Can't get KERN_NCHSTATS: %s\n", strerror(errno));
- bzero(&si->nchstats, sizeof(si->nchstats));
+ memset(&si->nchstats, 0, sizeof(si->nchstats));
}
size = sizeof(si->uvmexp);
if (sysctl(uvmexp_mib, 2, &si->uvmexp, &size, NULL, 0) < 0) {
error("Can't get VM_UVMEXP: %s\n", strerror(errno));
- bzero(&si->uvmexp, sizeof(si->uvmexp));
+ memset(&si->uvmexp, 0, sizeof(si->uvmexp));
}
size = sizeof(si->Total);
if (sysctl(vmtotal_mib, 2, &si->Total, &size, NULL, 0) < 0) {
error("Can't get VM_METER: %s\n", strerror(errno));
- bzero(&si->Total, sizeof(si->Total));
+ memset(&si->Total, 0, sizeof(si->Total));
}
}
allocinfo(struct Info *si)
{
memset(si, 0, sizeof(*si));
- si->intrcnt = calloc(nintr, sizeof(u_quad_t));
+ si->intrcnt = calloc(nintr, sizeof(*si->intrcnt));
if (si->intrcnt == NULL)
errx(2, "out of memory");
}
static void
copyinfo(struct Info *from, struct Info *to)
{
- u_quad_t *intrcnt;
+ uint64_t *intrcnt;
intrcnt = to->intrcnt;
*to = *from;
- bcopy(from->intrcnt, to->intrcnt = intrcnt, nintr * sizeof (u_quad_t));
+ memcpy(to->intrcnt = intrcnt, from->intrcnt, nintr * sizeof(*intrcnt));
}
static void