2013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com>

* libc/include/time.h (time): Add restrict keyword.
	* libc/include/wchar.h (wcsftime): Add restrict keyword.
	* libc/time/asctime_r.c (asctime_r): Same.
	* libc/time/gmtime_r.c (gmtime_r): Same.
	* libc/time/lcltime_r.c (lcltime_r): Same.
	* libc/time/strftime.c (strftime): Same.
	* libc/time/strptime.c (strptime): Same.
	* libc/sys/linux/linuxthreads/timer_create.c (timer_create): Same.
	* libc/sys/linux/linuxthreads/timer_settime.c (timer_settime): Same.
This commit is contained in:
Joel Sherrill 2013-11-25 13:46:23 +00:00
parent 3073f26d6a
commit d482870337
10 changed files with 53 additions and 30 deletions

View File

@ -1,3 +1,14 @@
2013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com>
* libc/include/time.h (time): Add restrict keyword.
* libc/include/wchar.h (wcsftime): Add restrict keyword.
* libc/time/asctime_r.c (asctime_r): Same.
* libc/time/gmtime_r.c (gmtime_r): Same.
* libc/time/lcltime_r.c (lcltime_r): Same.
* libc/time/strftime.c (strftime): Same.
* libc/time/strptime.c (strptime): Same.
* libc/sys/linux/linuxthreads/timer_create.c (timer_create): Same.
* libc/sys/linux/linuxthreads/timer_settime.c (timer_settime): Same.
2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com>
* libc/include/wordexp.h (wordexp): Add restrict keyword.

View File

@ -51,12 +51,17 @@ char *_EXFUN(ctime, (const time_t *_time));
struct tm *_EXFUN(gmtime, (const time_t *_timer));
struct tm *_EXFUN(localtime,(const time_t *_timer));
#endif
size_t _EXFUN(strftime, (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t));
size_t _EXFUN(strftime, (char *__restrict _s,
size_t _maxsize, const char *__restrict _fmt,
const struct tm *__restrict _t));
char *_EXFUN(asctime_r, (const struct tm *, char *));
char *_EXFUN(asctime_r, (const struct tm *__restrict,
char *__restrict));
char *_EXFUN(ctime_r, (const time_t *, char *));
struct tm *_EXFUN(gmtime_r, (const time_t *, struct tm *));
struct tm *_EXFUN(localtime_r, (const time_t *, struct tm *));
struct tm *_EXFUN(gmtime_r, (const time_t *__restrict,
struct tm *__restrict));
struct tm *_EXFUN(localtime_r, (const time_t *__restrict,
struct tm *__restrict));
_END_STD_C
@ -65,7 +70,9 @@ extern "C" {
#endif
#ifndef __STRICT_ANSI__
char *_EXFUN(strptime, (const char *, const char *, struct tm *));
char *_EXFUN(strptime, (const char *__restrict,
const char *__restrict,
struct tm *__restrict));
_VOID _EXFUN(tzset, (_VOID));
_VOID _EXFUN(_tzset_r, (struct _reent *));
@ -150,7 +157,9 @@ int _EXFUN(clock_getres, (clockid_t clock_id, struct timespec *res));
/* Create a Per-Process Timer, P1003.1b-1993, p. 264 */
int _EXFUN(timer_create,
(clockid_t clock_id, struct sigevent *evp, timer_t *timerid));
(clockid_t clock_id,
struct sigevent *__restrict evp,
timer_t *__restrict timerid));
/* Delete a Per_process Timer, P1003.1b-1993, p. 266 */
@ -159,8 +168,9 @@ int _EXFUN(timer_delete, (timer_t timerid));
/* Per-Process Timers, P1003.1b-1993, p. 267 */
int _EXFUN(timer_settime,
(timer_t timerid, int flags, const struct itimerspec *value,
struct itimerspec *ovalue));
(timer_t timerid, int flags,
const struct itimerspec *__restrict value,
struct itimerspec *__restrict ovalue));
int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value));
int _EXFUN(timer_getoverrun, (timer_t timerid));

View File

@ -79,7 +79,8 @@ wchar_t *_EXFUN(wcpcpy, (wchar_t * , const wchar_t *));
wchar_t *_EXFUN(wcsdup, (const wchar_t *));
wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * ));
size_t _EXFUN(wcscspn, (const wchar_t *, const wchar_t *));
size_t _EXFUN(wcsftime, (wchar_t *, size_t, const wchar_t *, const struct tm *));
size_t _EXFUN(wcsftime, (wchar_t *__restrict, size_t,
const wchar_t *__restrict, const struct tm *__restrict));
size_t _EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t));
size_t _EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t));
size_t _EXFUN(wcslen, (const wchar_t *));

View File

@ -30,8 +30,8 @@
int
timer_create (clock_id, evp, timerid)
clockid_t clock_id;
struct sigevent *evp;
timer_t *timerid;
struct sigevent *__restrict evp;
timer_t *__restrict timerid;
{
int retval = -1;
struct timer_node *newtimer = NULL;

View File

@ -29,8 +29,8 @@ int
timer_settime (timerid, flags, value, ovalue)
timer_t timerid;
int flags;
const struct itimerspec *value;
struct itimerspec *ovalue;
const struct itimerspec *__restrict value;
struct itimerspec *__restrict ovalue;
{
struct timer_node *timer;
struct thread_node *thread = NULL;

View File

@ -7,8 +7,8 @@
char *
_DEFUN (asctime_r, (tim_p, result),
_CONST struct tm *tim_p _AND
char *result)
_CONST struct tm *__restrict tim_p _AND
char *__restrict result)
{
static _CONST char day_name[7][3] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"

View File

@ -7,8 +7,8 @@
struct tm *
_DEFUN (gmtime_r, (tim_p, res),
_CONST time_t * tim_p _AND
struct tm *res)
_CONST time_t *__restrict tim_p _AND
struct tm *__restrict res)
{
return (_mktm_r (tim_p, res, 1));
}

View File

@ -11,8 +11,8 @@
struct tm *
_DEFUN (localtime_r, (tim_p, res),
_CONST time_t * tim_p _AND
struct tm *res)
_CONST time_t *__restrict tim_p _AND
struct tm *__restrict res)
{
return _mktm_r (tim_p, res, 0);
}

View File

@ -24,8 +24,9 @@ INDEX
ANSI_SYNOPSIS
#include <time.h>
size_t strftime(char *<[s]>, size_t <[maxsize]>,
const char *<[format]>, const struct tm *<[timp]>);
size_t strftime(char *restrict<[s]>, size_t <[maxsize]>,
const char *restrict<[format]>,
const struct tm *restrict<[timp]>);
TRAD_SYNOPSIS
#include <time.h>
@ -662,10 +663,10 @@ static size_t __strftime (CHAR *, size_t, const CHAR *, const struct tm *,
size_t
_DEFUN (strftime, (s, maxsize, format, tim_p),
CHAR *s _AND
CHAR *__restrict s _AND
size_t maxsize _AND
_CONST CHAR *format _AND
_CONST struct tm *tim_p)
_CONST CHAR *__restrict format _AND
_CONST struct tm *__restrict tim_p)
{
era_info_t *era_info = NULL;
alt_digits_t *alt_digits = NULL;
@ -686,10 +687,10 @@ __strftime (CHAR *s, size_t maxsize, const CHAR *format,
size_t
_DEFUN (strftime, (s, maxsize, format, tim_p),
CHAR *s _AND
CHAR *__restrict s _AND
size_t maxsize _AND
_CONST CHAR *format _AND
_CONST struct tm *tim_p)
_CONST CHAR *__restrict format _AND
_CONST struct tm *__restrict tim_p)
#endif /* !_WANT_C99_TIME_FORMATS */
{
size_t count = 0;

View File

@ -153,9 +153,9 @@ set_week_number_mon4 (struct tm *timeptr, int wnum)
char *
//strptime (const char *buf, const char *format, struct tm *timeptr)
_DEFUN (strptime, (buf, format, timeptr),
_CONST char *buf _AND
_CONST char *format _AND
struct tm *timeptr)
_CONST char *__restrict buf _AND
_CONST char *__restrict format _AND
struct tm *__restrict timeptr)
{
char c;
int ymd = 0;