From 18f3961189be61ac962292aec2e0444b6db09ddf Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 30 Mar 2012 17:11:01 +0200 Subject: [PATCH] use __restrict instead of restrict . doesn't choke gcc without -std=c99 . also used in prototypes already --- lib/libc/sys-minix/accept.c | 20 +++++------ lib/libc/sys-minix/getpeername.c | 20 +++++------ lib/libc/sys-minix/getsockname.c | 20 +++++------ lib/libc/sys-minix/getsockopt.c | 18 +++++----- lib/libc/sys-minix/gettimeofday.c | 2 +- lib/libc/sys-minix/recvfrom.c | 56 +++++++++++++++---------------- lib/libc/sys-minix/setitimer.c | 4 +-- 7 files changed, 70 insertions(+), 70 deletions(-) diff --git a/lib/libc/sys-minix/accept.c b/lib/libc/sys-minix/accept.c index 7e659884e..88c9c9c0c 100644 --- a/lib/libc/sys-minix/accept.c +++ b/lib/libc/sys-minix/accept.c @@ -20,14 +20,14 @@ #define DEBUG 0 -static int _tcp_accept(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len); +static int _tcp_accept(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len); -static int _uds_accept(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len); +static int _uds_accept(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len); -int accept(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len) +int accept(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int r; nwio_udpopt_t udpopt; @@ -60,8 +60,8 @@ int accept(int sock, struct sockaddr *restrict address, return r; } -static int _tcp_accept(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len) +static int _tcp_accept(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int r, s1, t_errno; tcp_cookie_t cookie; @@ -90,8 +90,8 @@ static int _tcp_accept(int sock, struct sockaddr *restrict address, return s1; } -static int _uds_accept(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len) +static int _uds_accept(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int s1; int r; diff --git a/lib/libc/sys-minix/getpeername.c b/lib/libc/sys-minix/getpeername.c index 20f6659f2..d0487248a 100644 --- a/lib/libc/sys-minix/getpeername.c +++ b/lib/libc/sys-minix/getpeername.c @@ -16,14 +16,14 @@ #define DEBUG 0 -static int _tcp_getpeername(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_tcpconf_t *tcpconfp); +static int _tcp_getpeername(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_tcpconf_t *tcpconfp); -static int _uds_getpeername(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len, struct sockaddr_un *uds_addr); +static int _uds_getpeername(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, struct sockaddr_un *uds_addr); -int getpeername(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len) +int getpeername(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int r; nwio_tcpconf_t tcpconf; @@ -61,8 +61,8 @@ int getpeername(int sock, struct sockaddr *restrict address, return -1; } -static int _tcp_getpeername(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_tcpconf_t *tcpconfp) +static int _tcp_getpeername(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_tcpconf_t *tcpconfp) { socklen_t len; struct sockaddr_in sin; @@ -88,8 +88,8 @@ static int _tcp_getpeername(int sock, struct sockaddr *restrict address, return 0; } -static int _uds_getpeername(int sock, struct sockaddr *restrict address, - socklen_t *restrict address_len, struct sockaddr_un *uds_addr) +static int _uds_getpeername(int sock, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, struct sockaddr_un *uds_addr) { socklen_t len; diff --git a/lib/libc/sys-minix/getsockname.c b/lib/libc/sys-minix/getsockname.c index a2dce74e1..d6ea05787 100644 --- a/lib/libc/sys-minix/getsockname.c +++ b/lib/libc/sys-minix/getsockname.c @@ -25,14 +25,14 @@ #define DEBUG 0 */ -static int _tcp_getsockname(int fd, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_tcpconf_t *tcpconfp); +static int _tcp_getsockname(int fd, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_tcpconf_t *tcpconfp); -static int _uds_getsockname(int fd, struct sockaddr *restrict address, - socklen_t *restrict address_len, struct sockaddr_un *uds_addr); +static int _uds_getsockname(int fd, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, struct sockaddr_un *uds_addr); -int getsockname(int fd, struct sockaddr *restrict address, - socklen_t *restrict address_len) +int getsockname(int fd, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int r; nwio_tcpconf_t tcpconf; @@ -75,8 +75,8 @@ int getsockname(int fd, struct sockaddr *restrict address, } -static int _tcp_getsockname(int fd, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_tcpconf_t *tcpconf) +static int _tcp_getsockname(int fd, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_tcpconf_t *tcpconf) { socklen_t len; struct sockaddr_in sin; @@ -104,8 +104,8 @@ static int _tcp_getsockname(int fd, struct sockaddr *restrict address, return 0; } -static int _uds_getsockname(int fd, struct sockaddr *restrict address, - socklen_t *restrict address_len, struct sockaddr_un *uds_addr) +static int _uds_getsockname(int fd, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, struct sockaddr_un *uds_addr) { socklen_t len; diff --git a/lib/libc/sys-minix/getsockopt.c b/lib/libc/sys-minix/getsockopt.c index 09a6dff64..c37b5dc36 100644 --- a/lib/libc/sys-minix/getsockopt.c +++ b/lib/libc/sys-minix/getsockopt.c @@ -22,16 +22,16 @@ #define DEBUG 0 static int _tcp_getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len); + void *__restrict option_value, socklen_t *__restrict option_len); static int _udp_getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len); + void *__restrict option_value, socklen_t *__restrict option_len); static int _uds_getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len); + void *__restrict option_value, socklen_t *__restrict option_len); static void getsockopt_copy(void *return_value, size_t return_len, - void *restrict option_value, socklen_t *restrict option_len); + void *__restrict option_value, socklen_t *__restrict option_len); int getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len) + void *__restrict option_value, socklen_t *__restrict option_len) { int r; nwio_tcpopt_t tcpopt; @@ -83,7 +83,7 @@ int getsockopt(int sock, int level, int option_name, } static void getsockopt_copy(void *return_value, size_t return_len, - void *restrict option_value, socklen_t *restrict option_len) + void *__restrict option_value, socklen_t *__restrict option_len) { /* copy as much data as possible */ if (*option_len < return_len) @@ -96,7 +96,7 @@ static void getsockopt_copy(void *return_value, size_t return_len, } static int _tcp_getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len) + void *__restrict option_value, socklen_t *__restrict option_len) { int i, r, err; @@ -157,7 +157,7 @@ static int _tcp_getsockopt(int sock, int level, int option_name, } static int _udp_getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len) + void *__restrict option_value, socklen_t *__restrict option_len) { int i; @@ -177,7 +177,7 @@ static int _udp_getsockopt(int sock, int level, int option_name, } static int _uds_getsockopt(int sock, int level, int option_name, - void *restrict option_value, socklen_t *restrict option_len) + void *__restrict option_value, socklen_t *__restrict option_len) { int i, r; size_t size; diff --git a/lib/libc/sys-minix/gettimeofday.c b/lib/libc/sys-minix/gettimeofday.c index 1532ef302..352c59612 100644 --- a/lib/libc/sys-minix/gettimeofday.c +++ b/lib/libc/sys-minix/gettimeofday.c @@ -12,7 +12,7 @@ gettimeofday.c __weak_alias(gettimeofday, _gettimeofday) #endif -int gettimeofday(struct timeval *restrict tp, void *restrict tzp) +int gettimeofday(struct timeval *__restrict tp, void *__restrict tzp) { message m; diff --git a/lib/libc/sys-minix/recvfrom.c b/lib/libc/sys-minix/recvfrom.c index 9b0cb41a6..091559f9e 100644 --- a/lib/libc/sys-minix/recvfrom.c +++ b/lib/libc/sys-minix/recvfrom.c @@ -22,22 +22,22 @@ #define DEBUG 0 -static ssize_t _tcp_recvfrom(int sock, void *restrict buffer, size_t length, - int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_tcpconf_t *tcpconfp); -static ssize_t _udp_recvfrom(int sock, void *restrict buffer, size_t length, - int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_udpopt_t *udpoptp); -static ssize_t _uds_recvfrom_conn(int sock, void *restrict buffer, - size_t length, int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len, struct sockaddr_un *uds_addr); -static ssize_t _uds_recvfrom_dgram(int sock, void *restrict buffer, - size_t length, int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len); - -ssize_t recvfrom(int sock, void *restrict buffer, size_t length, - int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len) +static ssize_t _tcp_recvfrom(int sock, void *__restrict buffer, size_t length, + int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_tcpconf_t *tcpconfp); +static ssize_t _udp_recvfrom(int sock, void *__restrict buffer, size_t length, + int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_udpopt_t *udpoptp); +static ssize_t _uds_recvfrom_conn(int sock, void *__restrict buffer, + size_t length, int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, struct sockaddr_un *uds_addr); +static ssize_t _uds_recvfrom_dgram(int sock, void *__restrict buffer, + size_t length, int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len); + +ssize_t recvfrom(int sock, void *__restrict buffer, size_t length, + int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int r; nwio_tcpconf_t tcpconf; @@ -93,9 +93,9 @@ ssize_t recvfrom(int sock, void *restrict buffer, size_t length, return -1; } -static ssize_t _tcp_recvfrom(int sock, void *restrict buffer, size_t length, - int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_tcpconf_t *tcpconfp) +static ssize_t _tcp_recvfrom(int sock, void *__restrict buffer, size_t length, + int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_tcpconf_t *tcpconfp) { int r; size_t len; @@ -127,9 +127,9 @@ static ssize_t _tcp_recvfrom(int sock, void *restrict buffer, size_t length, return r; } -static ssize_t _udp_recvfrom(int sock, void *restrict buffer, size_t length, - int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len, nwio_udpopt_t *udpoptp) +static ssize_t _udp_recvfrom(int sock, void *__restrict buffer, size_t length, + int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, nwio_udpopt_t *udpoptp) { int r, t_errno; size_t buflen, len; @@ -226,9 +226,9 @@ static ssize_t _udp_recvfrom(int sock, void *restrict buffer, size_t length, return length; } -static ssize_t _uds_recvfrom_conn(int sock, void *restrict buffer, - size_t length, int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len, struct sockaddr_un *uds_addr) +static ssize_t _uds_recvfrom_conn(int sock, void *__restrict buffer, + size_t length, int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len, struct sockaddr_un *uds_addr) { int r; size_t len; @@ -261,9 +261,9 @@ static ssize_t _uds_recvfrom_conn(int sock, void *restrict buffer, return r; } -static ssize_t _uds_recvfrom_dgram(int sock, void *restrict buffer, - size_t length, int flags, struct sockaddr *restrict address, - socklen_t *restrict address_len) +static ssize_t _uds_recvfrom_dgram(int sock, void *__restrict buffer, + size_t length, int flags, struct sockaddr *__restrict address, + socklen_t *__restrict address_len) { int r; size_t len; diff --git a/lib/libc/sys-minix/setitimer.c b/lib/libc/sys-minix/setitimer.c index 7a01b1d14..dfe86703f 100644 --- a/lib/libc/sys-minix/setitimer.c +++ b/lib/libc/sys-minix/setitimer.c @@ -8,8 +8,8 @@ * This is the implementation of the function to * invoke the interval timer setting system call. */ -int setitimer(int which, const struct itimerval *restrict value, - struct itimerval *restrict ovalue) +int setitimer(int which, const struct itimerval *__restrict value, + struct itimerval *__restrict ovalue) { message m; -- 2.44.0