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> 2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com>
* libc/include/wordexp.h (wordexp): Add restrict keyword. * 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(gmtime, (const time_t *_timer));
struct tm *_EXFUN(localtime,(const time_t *_timer)); struct tm *_EXFUN(localtime,(const time_t *_timer));
#endif #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 *)); char *_EXFUN(ctime_r, (const time_t *, char *));
struct tm *_EXFUN(gmtime_r, (const time_t *, struct tm *)); struct tm *_EXFUN(gmtime_r, (const time_t *__restrict,
struct tm *_EXFUN(localtime_r, (const time_t *, struct tm *)); struct tm *__restrict));
struct tm *_EXFUN(localtime_r, (const time_t *__restrict,
struct tm *__restrict));
_END_STD_C _END_STD_C
@ -65,7 +70,9 @@ extern "C" {
#endif #endif
#ifndef __STRICT_ANSI__ #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, (_VOID));
_VOID _EXFUN(_tzset_r, (struct _reent *)); _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 */ /* Create a Per-Process Timer, P1003.1b-1993, p. 264 */
int _EXFUN(timer_create, 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 */ /* 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 */ /* Per-Process Timers, P1003.1b-1993, p. 267 */
int _EXFUN(timer_settime, int _EXFUN(timer_settime,
(timer_t timerid, int flags, const struct itimerspec *value, (timer_t timerid, int flags,
struct itimerspec *ovalue)); const struct itimerspec *__restrict value,
struct itimerspec *__restrict ovalue));
int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value)); int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value));
int _EXFUN(timer_getoverrun, (timer_t timerid)); 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, (const wchar_t *));
wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, 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(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(wcslcat, (wchar_t *, const wchar_t *, size_t));
size_t _EXFUN(wcslcpy, (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 *)); size_t _EXFUN(wcslen, (const wchar_t *));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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