summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2007-11-18 02:20:02 +0000
committerjb <jb@FreeBSD.org>2007-11-18 02:20:02 +0000
commit1897d443737babd0f1fc863aaa795ababef2cc69 (patch)
tree806bfb9a30a25f180257ead37ca1fa1a69de2d0a
parente14c498cfa6d5238a4bd07f36e48f48f211de745 (diff)
downloadFreeBSD-src-1897d443737babd0f1fc863aaa795ababef2cc69.zip
FreeBSD-src-1897d443737babd0f1fc863aaa795ababef2cc69.tar.gz
Constify the first argument to expand_number() so that it can
be called with a const without the compiler grisling.
-rw-r--r--lib/libutil/expand_number.32
-rw-r--r--lib/libutil/expand_number.c2
-rw-r--r--lib/libutil/libutil.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/libutil/expand_number.3 b/lib/libutil/expand_number.3
index 92e8961..23e488d 100644
--- a/lib/libutil/expand_number.3
+++ b/lib/libutil/expand_number.3
@@ -37,7 +37,7 @@
.In libutil.h
.Ft int
.Fo expand_number
-.Fa "char *buf" "int64_t *num"
+.Fa "const char *buf" "int64_t *num"
.Fc
.Sh DESCRIPTION
The
diff --git a/lib/libutil/expand_number.c b/lib/libutil/expand_number.c
index 5cc2608..0f896ee 100644
--- a/lib/libutil/expand_number.c
+++ b/lib/libutil/expand_number.c
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
* 8) A positive decimal number followed by a 'e' or 'E' (mult by 1 << 60).
*/
int
-expand_number(char *buf, int64_t *num)
+expand_number(const char *buf, int64_t *num)
{
static const char unit[] = "bkmgtpe";
char *endptr, s;
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
index 1df9510..aa663a7 100644
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -82,7 +82,7 @@ int forkpty(int *_amaster, char *_name,
struct termios *_termp, struct winsize *_winp);
int humanize_number(char *_buf, size_t _len, int64_t _number,
const char *_suffix, int _scale, int _flags);
-int expand_number(char *_buf, int64_t *_num);
+int expand_number(const char *_buf, int64_t *_num);
const char *uu_lockerr(int _uu_lockresult);
int uu_lock(const char *_ttyname);
int uu_unlock(const char *_ttyname);
OpenPOWER on IntegriCloud