Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0dd4779 in mainline


Ignore:
Timestamp:
2017-11-13T20:00:07Z (4 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
lfn, master
Children:
0a0b3d8
Parents:
a2afd8f
Message:

Use __restrict__ instead of restrict in header files.

Location:
uspace/lib
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/sys/time.h

    ra2afd8f r0dd4779  
    9393extern int time_local2str(const time_t, char *);
    9494extern double difftime(time_t, time_t);
    95 extern size_t strftime(char *restrict, size_t, const char *restrict,
    96     const struct tm *restrict);
     95extern size_t strftime(char *__restrict__, size_t, const char *__restrict__,
     96    const struct tm *__restrict__);
    9797
    9898#endif
  • uspace/lib/posix/include/posix/inttypes.h

    ra2afd8f r0dd4779  
    4343#include "libc/inttypes.h"
    4444
    45 extern intmax_t __POSIX_DEF__(strtoimax)(const char *restrict nptr,
    46     char **restrict endptr, int base);
    47 extern uintmax_t __POSIX_DEF__(strtoumax)(const char *restrict nptr,
    48     char **restrict endptr, int base);
     45extern intmax_t __POSIX_DEF__(strtoimax)(const char *__restrict__ nptr,
     46    char **__restrict__ endptr, int base);
     47extern uintmax_t __POSIX_DEF__(strtoumax)(const char *__restrict__ nptr,
     48    char **__restrict__ endptr, int base);
    4949
    5050
  • uspace/lib/posix/include/posix/pthread.h

    ra2afd8f r0dd4779  
    8080extern int pthread_attr_destroy(pthread_attr_t *);
    8181
    82 extern int pthread_mutex_init(pthread_mutex_t *restrict,
    83     const pthread_mutexattr_t *restrict);
     82extern int pthread_mutex_init(pthread_mutex_t *__restrict__,
     83    const pthread_mutexattr_t *__restrict__);
    8484extern int pthread_mutex_destroy(pthread_mutex_t *);
    8585extern int pthread_mutex_lock(pthread_mutex_t *);
     
    8989extern int pthread_mutexattr_init(pthread_mutexattr_t *);
    9090extern int pthread_mutexattr_destroy(pthread_mutexattr_t *);
    91 extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict,
    92     int *restrict);
     91extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict__,
     92    int *__restrict__);
    9393extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
    9494
    95 extern int pthread_cond_init(pthread_cond_t *restrict,
    96     const pthread_condattr_t *restrict);
     95extern int pthread_cond_init(pthread_cond_t *__restrict__,
     96    const pthread_condattr_t *__restrict__);
    9797extern int pthread_cond_destroy(pthread_cond_t *);
    9898extern int pthread_cond_broadcast(pthread_cond_t *);
    9999extern int pthread_cond_signal(pthread_cond_t *);
    100 extern int pthread_cond_timedwait(pthread_cond_t *restrict,
    101     pthread_mutex_t *restrict, const struct __POSIX_DEF__(timespec) *restrict);
    102 extern int pthread_cond_wait(pthread_cond_t *restrict,
    103     pthread_mutex_t *restrict);
     100extern int pthread_cond_timedwait(pthread_cond_t *__restrict__,
     101    pthread_mutex_t *__restrict__, const struct __POSIX_DEF__(timespec) *__restrict__);
     102extern int pthread_cond_wait(pthread_cond_t *__restrict__,
     103    pthread_mutex_t *__restrict__);
    104104
    105105extern int pthread_condattr_destroy(pthread_condattr_t *);
  • uspace/lib/posix/include/posix/signal.h

    ra2afd8f r0dd4779  
    229229};
    230230
    231 extern int __POSIX_DEF__(sigaction)(int sig, const struct __POSIX_DEF__(sigaction) *restrict act,
    232     struct __POSIX_DEF__(sigaction) *restrict oact);
     231extern int __POSIX_DEF__(sigaction)(int sig, const struct __POSIX_DEF__(sigaction) *__restrict__ act,
     232    struct __POSIX_DEF__(sigaction) *__restrict__ oact);
    233233
    234234extern void (*__POSIX_DEF__(signal)(int sig, void (*func)(int)))(int);
     
    246246extern int __POSIX_DEF__(sigismember)(const __POSIX_DEF__(sigset_t) *set, int signo);
    247247
    248 extern int __POSIX_DEF__(thread_sigmask)(int how, const __POSIX_DEF__(sigset_t) *restrict set,
    249     __POSIX_DEF__(sigset_t) *restrict oset);
    250 extern int __POSIX_DEF__(sigprocmask)(int how, const __POSIX_DEF__(sigset_t) *restrict set,
    251     __POSIX_DEF__(sigset_t) *restrict oset);
     248extern int __POSIX_DEF__(thread_sigmask)(int how, const __POSIX_DEF__(sigset_t) *__restrict__ set,
     249    __POSIX_DEF__(sigset_t) *__restrict__ oset);
     250extern int __POSIX_DEF__(sigprocmask)(int how, const __POSIX_DEF__(sigset_t) *__restrict__ set,
     251    __POSIX_DEF__(sigset_t) *__restrict__ oset);
    252252
    253253
  • uspace/lib/posix/include/posix/stdio.h

    ra2afd8f r0dd4779  
    143143#undef putc
    144144#define putc fputc
    145 extern int __POSIX_DEF__(fputs)(const char *restrict s, FILE *restrict stream);
     145extern int __POSIX_DEF__(fputs)(const char *__restrict__ s, FILE *__restrict__ stream);
    146146#undef getc
    147147#define getc fgetc
    148148extern int __POSIX_DEF__(ungetc)(int c, FILE *stream);
    149 extern ssize_t __POSIX_DEF__(getdelim)(char **restrict lineptr, size_t *restrict n,
    150     int delimiter, FILE *restrict stream);
    151 extern ssize_t __POSIX_DEF__(getline)(char **restrict lineptr, size_t *restrict n,
    152     FILE *restrict stream);
     149extern ssize_t __POSIX_DEF__(getdelim)(char **__restrict__ lineptr, size_t *__restrict__ n,
     150    int delimiter, FILE *__restrict__ stream);
     151extern ssize_t __POSIX_DEF__(getline)(char **__restrict__ lineptr, size_t *__restrict__ n,
     152    FILE *__restrict__ stream);
    153153
    154154/* Opening Streams */
    155 extern FILE *__POSIX_DEF__(freopen)(const char *restrict filename,
    156     const char *restrict mode, FILE *restrict stream);
     155extern FILE *__POSIX_DEF__(freopen)(const char *__restrict__ filename,
     156    const char *__restrict__ mode, FILE *__restrict__ stream);
    157157
    158158/* Error Messages */
     
    165165
    166166extern int __POSIX_DEF__(fsetpos)(FILE *stream, const __POSIX_DEF__(fpos_t) *pos);
    167 extern int __POSIX_DEF__(fgetpos)(FILE *restrict stream, __POSIX_DEF__(fpos_t) *restrict pos);
     167extern int __POSIX_DEF__(fgetpos)(FILE *__restrict__ stream, __POSIX_DEF__(fpos_t) *__restrict__ pos);
    168168extern int __POSIX_DEF__(fseek)(FILE *stream, long offset, int whence);
    169169extern int __POSIX_DEF__(fseeko)(FILE *stream, __POSIX_DEF__(off_t) offset, int whence);
     
    175175
    176176/* Formatted Output */
    177 extern int __POSIX_DEF__(dprintf)(int fildes, const char *restrict format, ...)
     177extern int __POSIX_DEF__(dprintf)(int fildes, const char *__restrict__ format, ...)
    178178    PRINTF_ATTRIBUTE(2, 3);
    179 extern int __POSIX_DEF__(vdprintf)(int fildes, const char *restrict format, va_list ap);
    180 extern int __POSIX_DEF__(sprintf)(char *restrict s, const char *restrict format, ...)
     179extern int __POSIX_DEF__(vdprintf)(int fildes, const char *__restrict__ format, va_list ap);
     180extern int __POSIX_DEF__(sprintf)(char *__restrict__ s, const char *__restrict__ format, ...)
    181181    PRINTF_ATTRIBUTE(2, 3);
    182 extern int __POSIX_DEF__(vsprintf)(char *restrict s, const char *restrict format, va_list ap);
     182extern int __POSIX_DEF__(vsprintf)(char *__restrict__ s, const char *__restrict__ format, va_list ap);
    183183
    184184/* Formatted Input */
    185185extern int __POSIX_DEF__(fscanf)(
    186     FILE *restrict stream, const char *restrict format, ...);
     186    FILE *__restrict__ stream, const char *__restrict__ format, ...);
    187187extern int __POSIX_DEF__(vfscanf)(
    188     FILE *restrict stream, const char *restrict format, va_list arg);
    189 extern int __POSIX_DEF__(scanf)(const char *restrict format, ...);
    190 extern int __POSIX_DEF__(vscanf)(const char *restrict format, va_list arg);
     188    FILE *__restrict__ stream, const char *__restrict__ format, va_list arg);
     189extern int __POSIX_DEF__(scanf)(const char *__restrict__ format, ...);
     190extern int __POSIX_DEF__(vscanf)(const char *__restrict__ format, va_list arg);
    191191extern int __POSIX_DEF__(sscanf)(
    192     const char *restrict s, const char *restrict format, ...);
     192    const char *__restrict__ s, const char *__restrict__ format, ...);
    193193extern int __POSIX_DEF__(vsscanf)(
    194     const char *restrict s, const char *restrict format, va_list arg);
     194    const char *__restrict__ s, const char *__restrict__ format, va_list arg);
    195195
    196196/* File Locking */
  • uspace/lib/posix/include/posix/stdlib.h

    ra2afd8f r0dd4779  
    9292
    9393/* Symbolic Links */
    94 extern char *__POSIX_DEF__(realpath)(const char *restrict name, char *restrict resolved);
     94extern char *__POSIX_DEF__(realpath)(const char *__restrict__ name, char *__restrict__ resolved);
    9595
    9696/* Floating Point Conversion */
    9797extern double __POSIX_DEF__(atof)(const char *nptr);
    98 extern float __POSIX_DEF__(strtof)(const char *restrict nptr, char **restrict endptr);
    99 extern double __POSIX_DEF__(strtod)(const char *restrict nptr, char **restrict endptr);
    100 extern long double __POSIX_DEF__(strtold)(const char *restrict nptr, char **restrict endptr);
     98extern float __POSIX_DEF__(strtof)(const char *__restrict__ nptr, char **__restrict__ endptr);
     99extern double __POSIX_DEF__(strtod)(const char *__restrict__ nptr, char **__restrict__ endptr);
     100extern long double __POSIX_DEF__(strtold)(const char *__restrict__ nptr, char **__restrict__ endptr);
    101101
    102102/* Integer Conversion */
     
    104104extern long int __POSIX_DEF__(atol)(const char *nptr);
    105105extern long long int __POSIX_DEF__(atoll)(const char *nptr);
    106 extern long int __POSIX_DEF__(strtol)(const char *restrict nptr,
    107     char **restrict endptr, int base);
    108 extern long long int __POSIX_DEF__(strtoll)(const char *restrict nptr,
    109     char **restrict endptr, int base);
    110 extern unsigned long int __POSIX_DEF__(strtoul)(const char *restrict nptr,
    111     char **restrict endptr, int base);
     106extern long int __POSIX_DEF__(strtol)(const char *__restrict__ nptr,
     107    char **__restrict__ endptr, int base);
     108extern long long int __POSIX_DEF__(strtoll)(const char *__restrict__ nptr,
     109    char **__restrict__ endptr, int base);
     110extern unsigned long int __POSIX_DEF__(strtoul)(const char *__restrict__ nptr,
     111    char **__restrict__ endptr, int base);
    112112extern unsigned long long int __POSIX_DEF__(strtoull)(
    113     const char *restrict nptr, char **restrict endptr, int base);
     113    const char *__restrict__ nptr, char **__restrict__ endptr, int base);
    114114
    115115/* Memory Allocation */
  • uspace/lib/posix/include/posix/string.h

    ra2afd8f r0dd4779  
    4848 * int      strcoll_l(const char *, const char *, locale_t);
    4949 * char    *strerror_l(int, locale_t);
    50  * size_t   strxfrm_l(char *restrict, const char *restrict, size_t, locale_t);
     50 * size_t   strxfrm_l(char *__restrict__, const char *__restrict__, size_t, locale_t);
    5151 */
    5252
     
    7474
    7575/* Copying and Concatenation */
    76 extern char *__POSIX_DEF__(strcpy)(char *restrict dest, const char *restrict src);
    77 extern char *__POSIX_DEF__(strncpy)(char *restrict dest, const char *restrict src, size_t n);
    78 extern char *__POSIX_DEF__(stpcpy)(char *restrict dest, const char *restrict src);
    79 extern char *__POSIX_DEF__(stpncpy)(char *restrict dest, const char *restrict src, size_t n);
    80 extern char *__POSIX_DEF__(strcat)(char *restrict dest, const char *restrict src);
    81 extern char *__POSIX_DEF__(strncat)(char *restrict dest, const char *restrict src, size_t n);
    82 extern void *__POSIX_DEF__(memccpy)(void *restrict dest, const void *restrict src, int c, size_t n);
     76extern char *__POSIX_DEF__(strcpy)(char *__restrict__ dest, const char *__restrict__ src);
     77extern char *__POSIX_DEF__(strncpy)(char *__restrict__ dest, const char *__restrict__ src, size_t n);
     78extern char *__POSIX_DEF__(stpcpy)(char *__restrict__ dest, const char *__restrict__ src);
     79extern char *__POSIX_DEF__(stpncpy)(char *__restrict__ dest, const char *__restrict__ src, size_t n);
     80extern char *__POSIX_DEF__(strcat)(char *__restrict__ dest, const char *__restrict__ src);
     81extern char *__POSIX_DEF__(strncat)(char *__restrict__ dest, const char *__restrict__ src, size_t n);
     82extern void *__POSIX_DEF__(memccpy)(void *__restrict__ dest, const void *__restrict__ src, int c, size_t n);
    8383extern char *__POSIX_DEF__(strdup)(const char *s);
    8484extern char *__POSIX_DEF__(strndup)(const char *s, size_t n);
     
    106106/* Collation Functions */
    107107extern int __POSIX_DEF__(strcoll)(const char *s1, const char *s2);
    108 extern size_t __POSIX_DEF__(strxfrm)(char *restrict s1, const char *restrict s2, size_t n);
     108extern size_t __POSIX_DEF__(strxfrm)(char *__restrict__ s1, const char *__restrict__ s2, size_t n);
    109109
    110110/* Error Messages */
  • uspace/lib/posix/include/posix/sys/stat.h

    ra2afd8f r0dd4779  
    129129
    130130extern int __POSIX_DEF__(fstat)(int fd, struct __POSIX_DEF__(stat) *st);
    131 extern int __POSIX_DEF__(lstat)(const char *restrict path, struct __POSIX_DEF__(stat) *restrict st);
    132 extern int __POSIX_DEF__(stat)(const char *restrict path, struct __POSIX_DEF__(stat) *restrict st);
     131extern int __POSIX_DEF__(lstat)(const char *__restrict__ path, struct __POSIX_DEF__(stat) *__restrict__ st);
     132extern int __POSIX_DEF__(stat)(const char *__restrict__ path, struct __POSIX_DEF__(stat) *__restrict__ st);
    133133extern int __POSIX_DEF__(chmod)(const char *path, __POSIX_DEF__(mode_t) mode);
    134134extern __POSIX_DEF__(mode_t) __POSIX_DEF__(umask)(__POSIX_DEF__(mode_t) mask);
  • uspace/lib/posix/include/posix/time.h

    ra2afd8f r0dd4779  
    8989
    9090/* Broken-down Time */
    91 extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *restrict timer,
    92     struct tm *restrict result);
    93 extern struct tm *__POSIX_DEF__(gmtime)(const time_t *restrict timep);
    94 extern struct tm *__POSIX_DEF__(localtime_r)(const time_t *restrict timer,
    95     struct tm *restrict result);
    96 extern struct tm *__POSIX_DEF__(localtime)(const time_t *restrict timep);
     91extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *__restrict__ timer,
     92    struct tm *__restrict__ result);
     93extern struct tm *__POSIX_DEF__(gmtime)(const time_t *__restrict__ timep);
     94extern struct tm *__POSIX_DEF__(localtime_r)(const time_t *__restrict__ timer,
     95    struct tm *__restrict__ result);
     96extern struct tm *__POSIX_DEF__(localtime)(const time_t *__restrict__ timep);
    9797
    9898/* Formatting Calendar Time */
    99 extern char *__POSIX_DEF__(asctime_r)(const struct tm *restrict timeptr,
    100     char *restrict buf);
    101 extern char *__POSIX_DEF__(asctime)(const struct tm *restrict timeptr);
     99extern char *__POSIX_DEF__(asctime_r)(const struct tm *__restrict__ timeptr,
     100    char *__restrict__ buf);
     101extern char *__POSIX_DEF__(asctime)(const struct tm *__restrict__ timeptr);
    102102extern char *__POSIX_DEF__(ctime_r)(const time_t *timer, char *buf);
    103103extern char *__POSIX_DEF__(ctime)(const time_t *timer);
Note: See TracChangeset for help on using the changeset viewer.