summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrobert <robert@FreeBSD.org>2002-08-14 23:20:48 +0000
committerrobert <robert@FreeBSD.org>2002-08-14 23:20:48 +0000
commitf0abd50e99b630b7ce1849ce6d024d7ea4b3bc98 (patch)
tree433d2e30afb321df49de5b3e5b0d47da7cb507e0 /lib
parent698d5a31a4ebe531737cd6f545ac15ff26b06838 (diff)
downloadFreeBSD-src-f0abd50e99b630b7ce1849ce6d024d7ea4b3bc98.zip
FreeBSD-src-f0abd50e99b630b7ce1849ce6d024d7ea4b3bc98.tar.gz
- Add the 'restrict' qualifier to the function definition of
strftime(3) for IEEE Std 1003.1-2001 compliance and remove excessive usage of the 'const' qualifier that was neither present in the prototype in the publice header, nor in the local prototype just above the function definition. - Replace the K&R function definition with a ANSI-C one. - Update the prototype of strftime(3) in its manual page.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdtime/strftime.32
-rw-r--r--lib/libc/stdtime/strftime.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/libc/stdtime/strftime.3 b/lib/libc/stdtime/strftime.3
index 172a6a6..6877775 100644
--- a/lib/libc/stdtime/strftime.3
+++ b/lib/libc/stdtime/strftime.3
@@ -47,7 +47,7 @@
.Sh SYNOPSIS
.In time.h
.Ft size_t
-.Fn strftime "char *buf" "size_t maxsize" "const char *format" "const struct tm *timeptr"
+.Fn strftime "char *restrict buf" "size_t maxsize" "const char *restrict format" "const struct tm *restrict timeptr"
.Sh DESCRIPTION
The
.Fn strftime
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index bd3ba29..ab50bdc 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -44,16 +44,14 @@ static char * _add(const char *, char *, const char *);
static char * _conv(int, const char *, char *, const char *);
static char * _fmt(const char *, const struct tm *, char *, const char *);
-size_t strftime(char *, size_t, const char *, const struct tm *);
+size_t strftime(char *__restrict, size_t, const char *__restrict,
+ const struct tm *__restrict);
extern char * tzname[];
size_t
-strftime(s, maxsize, format, t)
- char *const s;
- const size_t maxsize;
- const char *const format;
- const struct tm *const t;
+strftime(char *__restrict s, size_t maxsize, const char *__restrict format,
+ const struct tm *__restrict t)
{
char *p;
OpenPOWER on IntegriCloud