convert from strsuftoull() (from ../../bin/dd) to strsuftoll(3) in libc

This commit is contained in:
lukem 2002-11-29 13:06:32 +00:00
parent 336730e201
commit d08243260c
2 changed files with 14 additions and 15 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2002/09/18 03:54:33 lukem Exp $ # $NetBSD: Makefile,v 1.10 2002/11/29 13:06:32 lukem Exp $
# #
.include <bsd.own.mk> .include <bsd.own.mk>
@ -6,7 +6,7 @@
PROG= makefs PROG= makefs
SRCS= makefs.c walk.c \ SRCS= makefs.c walk.c \
ffs.c mkfs.c buf.c \ ffs.c mkfs.c buf.c \
getid.c misc.c spec.c pack_dev.c stat_flags.c strsuftoull.c \ getid.c misc.c spec.c pack_dev.c stat_flags.c \
ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ffs_tables.c ufs_bmap.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ffs_tables.c ufs_bmap.c
MAN= makefs.8 MAN= makefs.8

View File

@ -1,4 +1,4 @@
/* $NetBSD: makefs.c,v 1.13 2002/01/31 22:44:02 tv Exp $ */ /* $NetBSD: makefs.c,v 1.14 2002/11/29 13:06:33 lukem Exp $ */
/* /*
* Copyright (c) 2001-2002 Wasabi Systems, Inc. * Copyright (c) 2001-2002 Wasabi Systems, Inc.
@ -37,7 +37,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint) #if defined(__RCSID) && !defined(__lint)
__RCSID("$NetBSD: makefs.c,v 1.13 2002/01/31 22:44:02 tv Exp $"); __RCSID("$NetBSD: makefs.c,v 1.14 2002/11/29 13:06:33 lukem Exp $");
#endif /* !__lint */ #endif /* !__lint */
#include <assert.h> #include <assert.h>
@ -51,7 +51,6 @@ __RCSID("$NetBSD: makefs.c,v 1.13 2002/01/31 22:44:02 tv Exp $");
#include "makefs.h" #include "makefs.h"
#include "mtree.h" #include "mtree.h"
#include "strsuftoull.h"
/* /*
* list of supported file systems and dispatch functions * list of supported file systems and dispatch functions
@ -144,18 +143,18 @@ main(int argc, char *argv[])
if (optarg[len] == '%') { if (optarg[len] == '%') {
optarg[len] = '\0'; optarg[len] = '\0';
fsoptions.freeblockpc = fsoptions.freeblockpc =
strsuftoull("free block percentage", strsuftoll("free block percentage",
optarg, 0, 99); optarg, 0, 99);
} else { } else {
fsoptions.freeblocks = fsoptions.freeblocks =
strsuftoull("free blocks", strsuftoll("free blocks",
optarg, 0, LLONG_MAX); optarg, 0, LLONG_MAX);
} }
break; break;
case 'd': case 'd':
debug = debug =
(int)strsuftoull("debug mask", optarg, 0, UINT_MAX); (int)strsuftoll("debug mask", optarg, 0, UINT_MAX);
break; break;
case 'f': case 'f':
@ -163,11 +162,11 @@ main(int argc, char *argv[])
if (optarg[len] == '%') { if (optarg[len] == '%') {
optarg[len] = '\0'; optarg[len] = '\0';
fsoptions.freefilepc = fsoptions.freefilepc =
strsuftoull("free file percentage", strsuftoll("free file percentage",
optarg, 0, 99); optarg, 0, 99);
} else { } else {
fsoptions.freefiles = fsoptions.freefiles =
strsuftoull("free files", strsuftoll("free files",
optarg, 0, LLONG_MAX); optarg, 0, LLONG_MAX);
} }
break; break;
@ -178,7 +177,7 @@ main(int argc, char *argv[])
case 'M': case 'M':
fsoptions.minsize = fsoptions.minsize =
strsuftoull("minimum size", optarg, 1LL, LLONG_MAX); strsuftoll("minimum size", optarg, 1LL, LLONG_MAX);
break; break;
case 'N': case 'N':
@ -190,7 +189,7 @@ main(int argc, char *argv[])
case 'm': case 'm':
fsoptions.maxsize = fsoptions.maxsize =
strsuftoull("maximum size", optarg, 1LL, LLONG_MAX); strsuftoll("maximum size", optarg, 1LL, LLONG_MAX);
break; break;
case 'o': case 'o':
@ -208,12 +207,12 @@ main(int argc, char *argv[])
case 's': case 's':
fsoptions.minsize = fsoptions.maxsize = fsoptions.minsize = fsoptions.maxsize =
strsuftoull("size", optarg, 1LL, LLONG_MAX); strsuftoll("size", optarg, 1LL, LLONG_MAX);
break; break;
case 'S': case 'S':
fsoptions.sectorsize = fsoptions.sectorsize =
(int)strsuftoull("sector size", optarg, (int)strsuftoll("sector size", optarg,
1LL, INT_MAX); 1LL, INT_MAX);
break; break;
@ -276,7 +275,7 @@ set_option(option_t *options, const char *var, const char *val)
for (i = 0; options[i].name != NULL; i++) { for (i = 0; options[i].name != NULL; i++) {
if (strcmp(options[i].name, var) != 0) if (strcmp(options[i].name, var) != 0)
continue; continue;
*options[i].value = (int)strsuftoull(options[i].desc, val, *options[i].value = (int)strsuftoll(options[i].desc, val,
options[i].minimum, options[i].maximum); options[i].minimum, options[i].maximum);
return (1); return (1);
} }