- 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.
This commit is contained in:
parent
ad90696815
commit
620035ef89
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101888
@ -121,7 +121,8 @@ double difftime(time_t, time_t);
|
|||||||
struct tm *gmtime(const time_t *);
|
struct tm *gmtime(const time_t *);
|
||||||
struct tm *localtime(const time_t *);
|
struct tm *localtime(const time_t *);
|
||||||
time_t mktime(struct tm *);
|
time_t mktime(struct tm *);
|
||||||
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);
|
||||||
time_t time(time_t *);
|
time_t time(time_t *);
|
||||||
|
|
||||||
#if __POSIX_VISIBLE
|
#if __POSIX_VISIBLE
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.In time.h
|
.In time.h
|
||||||
.Ft size_t
|
.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
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Fn strftime
|
.Fn strftime
|
||||||
|
@ -44,16 +44,14 @@ static char * _add(const char *, char *, const char *);
|
|||||||
static char * _conv(int, 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 *);
|
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[];
|
extern char * tzname[];
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
strftime(s, maxsize, format, t)
|
strftime(char *__restrict s, size_t maxsize, const char *__restrict format,
|
||||||
char *const s;
|
const struct tm *__restrict t)
|
||||||
const size_t maxsize;
|
|
||||||
const char *const format;
|
|
||||||
const struct tm *const t;
|
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user