diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-11-25 13:46:23 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-11-25 13:46:23 +0000 |
commit | d482870337349732ad1c9f3715730fd32b6216d0 (patch) | |
tree | a7395d230c93fee8c52d2b4730963001bdf7149d /newlib/libc/time | |
parent | 3073f26d6ab5d0ce902d5bfe75600e6577d903c9 (diff) | |
download | cygnal-d482870337349732ad1c9f3715730fd32b6216d0.tar.gz cygnal-d482870337349732ad1c9f3715730fd32b6216d0.tar.bz2 cygnal-d482870337349732ad1c9f3715730fd32b6216d0.zip |
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.
Diffstat (limited to 'newlib/libc/time')
-rw-r--r-- | newlib/libc/time/asctime_r.c | 4 | ||||
-rw-r--r-- | newlib/libc/time/gmtime_r.c | 4 | ||||
-rw-r--r-- | newlib/libc/time/lcltime_r.c | 4 | ||||
-rw-r--r-- | newlib/libc/time/strftime.c | 17 | ||||
-rw-r--r-- | newlib/libc/time/strptime.c | 6 |
5 files changed, 18 insertions, 17 deletions
diff --git a/newlib/libc/time/asctime_r.c b/newlib/libc/time/asctime_r.c index e8abff1c0..2ec53698e 100644 --- a/newlib/libc/time/asctime_r.c +++ b/newlib/libc/time/asctime_r.c @@ -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" diff --git a/newlib/libc/time/gmtime_r.c b/newlib/libc/time/gmtime_r.c index fb39238d3..14c9c7640 100644 --- a/newlib/libc/time/gmtime_r.c +++ b/newlib/libc/time/gmtime_r.c @@ -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)); } diff --git a/newlib/libc/time/lcltime_r.c b/newlib/libc/time/lcltime_r.c index cf386719c..9e168aa3f 100644 --- a/newlib/libc/time/lcltime_r.c +++ b/newlib/libc/time/lcltime_r.c @@ -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); } diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index 2bcedb2a0..ea15813d8 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -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; diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c index 601f93e8a..d7dd7a2b2 100644 --- a/newlib/libc/time/strptime.c +++ b/newlib/libc/time/strptime.c @@ -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; |