diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-02-24 15:42:57 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2021-03-03 23:12:22 +0100 |
| commit | cd7ebdf9ae72ca45611cf6117f4e9fe21eb2b4b4 (patch) | |
| tree | bc36a274253034b02680b53941b09202a47cd809 | |
| parent | b5e85c2ef5132d60829921d551f7dbd0a1dbb8a3 (diff) | |
| download | man-pages-cd7ebdf9ae72ca45611cf6117f4e9fe21eb2b4b4.tar.gz | |
ctime.3: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of asctime_r(), gmtime_r(),
and localtime_r() shall be restrict. Glibc uses 'restrict' too.
Let's use it here too.
ctime_r will be covered in a future commit,
as the glibc implementation differs from POSIX.
......
============================= asctime
timezone/private.h:501:
char *asctime(struct tm const *);
time/time.h:139:
char *asctime (const struct tm *tp) THROW;
============================= asctime_r
timezone/private.h:502:
char *asctime_r(struct tm const *restrict, char *restrict);
timezone/private.h:522:
char *asctime_r(struct tm const *restrict, char *restrict);
timezone/private.h:711:
char *asctime_r(struct tm const *, char *);
time/time.h:149:
char *asctime_r (const struct tm *restrict tp,
char *restrict buf) THROW;
============================= ctime
timezone/private.h:503:
char *ctime(time_t const *);
time/time.h:142:
char *ctime (const time_t *timer) THROW;
============================= ctime_r
timezone/private.h:504:
char *ctime_r(time_t const *, char *);
timezone/private.h:712:
char *ctime_r(time_t const *, char *);
time/time.h:153:
char *ctime_r (const time_t *restrict timer,
char *restrict buf) THROW;
============================= gmtime
timezone/private.h:512:
struct tm *gmtime(time_t const *);
time/time.h:119:
struct tm *gmtime (const time_t *timer) THROW;
============================= gmtime_r
timezone/private.h:513:
struct tm *gmtime_r(time_t const *restrict, struct tm *restrict);
time/time.h:128:
struct tm *gmtime_r (const time_t *restrict timer,
struct tm *restrict tp) THROW;
============================= localtime
timezone/private.h:514:
struct tm *localtime(time_t const *);
time/time.h:123:
struct tm *localtime (const time_t *timer) THROW;
============================= localtime_r
timezone/private.h:515:
struct tm *localtime_r(time_t const *restrict, struct tm *restrict);
time/time.h:133:
struct tm *localtime_r (const time_t *restrict timer,
struct tm *restrict tp) THROW;
============================= mktime
timezone/private.h:516:
time_t mktime(struct tm *);
time/time.h:82:
time_t mktime (struct tm *tp) THROW;
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
| -rw-r--r-- | man3/ctime.3 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/man3/ctime.3 b/man3/ctime.3 index 89107975b2..c5434c84f5 100644 --- a/man3/ctime.3 +++ b/man3/ctime.3 @@ -41,16 +41,18 @@ localtime_r \- transform date and time to broken-down time or ASCII .B #include <time.h> .PP .BI "char *asctime(const struct tm *" tm ); -.BI "char *asctime_r(const struct tm *" tm ", char *" buf ); +.BI "char *asctime_r(const struct tm *restrict " tm ", char *restrict " buf ); .PP .BI "char *ctime(const time_t *" timep ); .BI "char *ctime_r(const time_t *" timep ", char *" buf ); .PP .BI "struct tm *gmtime(const time_t *" timep ); -.BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result ); +.BI "struct tm *gmtime_r(const time_t *restrict " timep , +.BI " struct tm *restrict " result ); .PP .BI "struct tm *localtime(const time_t *" timep ); -.BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result ); +.BI "struct tm *localtime_r(const time_t *restrict " timep , +.BI " struct tm *restrict " result ); .PP .BI "time_t mktime(struct tm *" tm ); .fi |
