Commit bbefb854 authored by Youness Alaoui's avatar Youness Alaoui

Remove all 'restrict' keywords as they are not supported by MSVC

parent 163f1386
......@@ -65,7 +65,7 @@ static void priv_prune_pending_checks (Stream *stream, guint component_id);
static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream, Component *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate);
static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Component *component, NiceCandidate *remotecand);
static int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now)
static int priv_timer_expired (GTimeVal *timer, GTimeVal *now)
{
return (now->tv_sec == timer->tv_sec) ?
now->tv_usec >= timer->tv_usec :
......
......@@ -59,7 +59,7 @@
#include "stun/usages/turn.h"
#include "socket.h"
static inline int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now)
static inline int priv_timer_expired (GTimeVal *timer, GTimeVal *now)
{
return (now->tv_sec == timer->tv_sec) ?
now->tv_usec >= timer->tv_usec :
......
......@@ -48,7 +48,7 @@
#include <assert.h>
void stun_sha1 (const uint8_t *msg, size_t len, uint8_t *sha,
const void *restrict key, size_t keylen, int padding)
const void *key, size_t keylen, int padding)
{
HMAC_CTX ctx;
uint16_t fakelen = htons (len - 20u);
......
......@@ -89,7 +89,7 @@ uint16_t stun_message_length (const StunMessage *msg)
const void *
stun_message_find (const StunMessage *msg, stun_attr_type_t type,
uint16_t *restrict palen)
uint16_t *palen)
{
size_t length = stun_message_length (msg);
size_t offset = 0;
......@@ -146,7 +146,7 @@ int stun_message_find_flag (const StunMessage *msg, stun_attr_type_t type)
int
stun_message_find32 (const StunMessage *msg, stun_attr_type_t type,
uint32_t *restrict pval)
uint32_t *pval)
{
const void *ptr;
uint16_t len;
......@@ -210,7 +210,7 @@ int stun_message_find_string (const StunMessage *msg, stun_attr_type_t type,
int
stun_message_find_addr (const StunMessage *msg, stun_attr_type_t type,
struct sockaddr *restrict addr, socklen_t *restrict addrlen)
struct sockaddr *addr, socklen_t *addrlen)
{
const uint8_t *ptr;
uint16_t len;
......@@ -270,8 +270,8 @@ stun_message_find_addr (const StunMessage *msg, stun_attr_type_t type,
int
stun_message_find_xor_addr (const StunMessage *msg, stun_attr_type_t type,
struct sockaddr *restrict addr,
socklen_t *restrict addrlen)
struct sockaddr *addr,
socklen_t *addrlen)
{
int val = stun_message_find_addr (msg, type, addr, addrlen);
if (val)
......@@ -282,7 +282,7 @@ stun_message_find_xor_addr (const StunMessage *msg, stun_attr_type_t type,
int
stun_message_find_xor_addr_full (const StunMessage *msg, stun_attr_type_t type,
struct sockaddr *restrict addr, socklen_t *restrict addrlen,
struct sockaddr *addr, socklen_t *addrlen,
uint32_t magic_cookie)
{
int val = stun_message_find_addr (msg, type, addr, addrlen);
......@@ -292,7 +292,7 @@ stun_message_find_xor_addr_full (const StunMessage *msg, stun_attr_type_t type,
return stun_xor_address (msg, addr, *addrlen, magic_cookie);
}
int stun_message_find_error (const StunMessage *msg, int *restrict code)
int stun_message_find_error (const StunMessage *msg, int *code)
{
uint16_t alen;
const uint8_t *ptr = stun_message_find (msg, STUN_ATTRIBUTE_ERROR_CODE, &alen);
......@@ -405,7 +405,7 @@ stun_message_append_string (StunMessage * msg, stun_attr_type_t type,
int
stun_message_append_addr (StunMessage *msg, stun_attr_type_t type,
const struct sockaddr *restrict addr, socklen_t addrlen)
const struct sockaddr *addr, socklen_t addrlen)
{
const void *pa;
uint8_t *ptr;
......@@ -457,7 +457,7 @@ stun_message_append_addr (StunMessage *msg, stun_attr_type_t type,
int stun_message_append_xor_addr (StunMessage *msg, stun_attr_type_t type,
const struct sockaddr *restrict addr, socklen_t addrlen)
const struct sockaddr *addr, socklen_t addrlen)
{
int val;
/* Must be big enough to hold any supported address: */
......@@ -477,7 +477,7 @@ int stun_message_append_xor_addr (StunMessage *msg, stun_attr_type_t type,
}
int stun_message_append_xor_addr_full (StunMessage *msg, stun_attr_type_t type,
const struct sockaddr *restrict addr, socklen_t addrlen,
const struct sockaddr *addr, socklen_t addrlen,
uint32_t magic_cookie)
{
int val;
......
......@@ -257,7 +257,7 @@ uint16_t stun_message_length (const StunMessage *msg);
* otherwise NULL.
*/
const void * stun_message_find (const StunMessage * msg, stun_attr_type_t type,
uint16_t *restrict palen);
uint16_t *palen);
/**
......@@ -323,7 +323,7 @@ int stun_message_find_string (const StunMessage *msg, stun_attr_type_t type,
* EAFNOSUPPORT if address family is unknown.
*/
int stun_message_find_addr (const StunMessage *msg, stun_attr_type_t type,
struct sockaddr *restrict addr, socklen_t *restrict addrlen);
struct sockaddr *addr, socklen_t *addrlen);
/**
* Extracts an obfuscated network address attribute from a valid STUN message.
......@@ -338,14 +338,14 @@ int stun_message_find_addr (const StunMessage *msg, stun_attr_type_t type,
* EAFNOSUPPORT if address family is unknown.
*/
int stun_message_find_xor_addr (const StunMessage *msg, stun_attr_type_t type,
struct sockaddr *restrict addr, socklen_t *restrict addrlen);
struct sockaddr *addr, socklen_t *addrlen);
int stun_message_find_xor_addr_full (const StunMessage *msg,
stun_attr_type_t type, struct sockaddr *restrict addr,
socklen_t *restrict addrlen, uint32_t magic_cookie);
stun_attr_type_t type, struct sockaddr *addr,
socklen_t *addrlen, uint32_t magic_cookie);
int stun_message_find_error (const StunMessage *msg, int *restrict code);
int stun_message_find_error (const StunMessage *msg, int *code);
void *stun_message_append (StunMessage *msg, stun_attr_type_t type,
size_t length);
......@@ -407,7 +407,7 @@ int stun_message_append_string (StunMessage *msg, stun_attr_type_t type,
* EINVAL if the socket address length is too small w.r.t. the address family.
*/
int stun_message_append_addr (StunMessage * msg, stun_attr_type_t type,
const struct sockaddr *restrict addr, socklen_t addrlen);
const struct sockaddr *addr, socklen_t addrlen);
/**
* Appends an attribute consisting of a xor'ed network address.
......@@ -421,10 +421,10 @@ int stun_message_append_addr (StunMessage * msg, stun_attr_type_t type,
* EINVAL if the socket address length is too small w.r.t. the address family.
*/
int stun_message_append_xor_addr (StunMessage * msg, stun_attr_type_t type,
const struct sockaddr *restrict addr, socklen_t addrlen);
const struct sockaddr *addr, socklen_t addrlen);
int stun_message_append_xor_addr_full (StunMessage * msg, stun_attr_type_t type,
const struct sockaddr *restrict addr, socklen_t addrlen,
const struct sockaddr *addr, socklen_t addrlen,
uint32_t magic_cookie);
/**
......
......@@ -200,7 +200,7 @@ int
stun_usage_ice_conncheck_create_reply (StunAgent *agent, StunMessage *req,
StunMessage *msg, uint8_t *buf, size_t *plen,
const struct sockaddr *src, socklen_t srclen,
bool *restrict control, uint64_t tie,
bool *control, uint64_t tie,
StunUsageIceCompatibility compatibility)
{
const char *username = NULL;
......
......@@ -103,8 +103,8 @@ StunUsageIceReturn stun_usage_ice_conncheck_process (StunMessage *msg,
int
stun_usage_ice_conncheck_create_reply (StunAgent *agent, StunMessage *req,
StunMessage *msg, uint8_t *buf, size_t *plen,
const struct sockaddr *restrict src, socklen_t srclen,
bool *restrict control, uint64_t tie,
const struct sockaddr *src, socklen_t srclen,
bool *control, uint64_t tie,
StunUsageIceCompatibility compatibility);
/**
......
......@@ -67,7 +67,7 @@
* Clock used throughout the STUN code.
* STUN requires a monotonic 1kHz clock to operate properly.
*/
static void stun_gettime (struct timeval *restrict now)
static void stun_gettime (struct timeval *now)
{
#if defined (_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK >= 0)
struct timespec spec;
......
......@@ -123,8 +123,8 @@ static int stun_socket (int family, int type, int proto)
}
int stun_trans_create (stun_trans_t *restrict tr, int type, int proto,
const struct sockaddr *restrict srv, socklen_t srvlen)
int stun_trans_create (stun_trans_t *tr, int type, int proto,
const struct sockaddr *srv, socklen_t srvlen)
{
int val, fd;
......@@ -231,8 +231,8 @@ ssize_t stun_trans_sendto (stun_trans_t *tr, const uint8_t *buf, size_t len,
ssize_t stun_trans_recvfrom (stun_trans_t *tr, uint8_t *buf, size_t maxlen,
struct sockaddr *restrict dst,
socklen_t *restrict dstlen)
struct sockaddr * dst,
socklen_t * dstlen)
{
static const int flags = MSG_DONTWAIT | MSG_NOSIGNAL;
ssize_t val;
......
......@@ -122,8 +122,8 @@ ssize_t stun_trans_sendto (stun_trans_t *tr, const uint8_t *buf, size_t len,
const struct sockaddr *dst, socklen_t dstlen);
ssize_t stun_trans_recvfrom (stun_trans_t *tr, uint8_t *buf, size_t maxlen,
struct sockaddr *restrict src,
socklen_t *restrict srclen);
struct sockaddr *src,
socklen_t *srclen);
ssize_t stun_trans_send (stun_trans_t *tr, const uint8_t *buf, size_t len);
......
......@@ -168,7 +168,7 @@ void stun_debug_bytes (const void *data, size_t len)
}
int stun_xor_address (const StunMessage *msg,
struct sockaddr *restrict addr, socklen_t addrlen,
struct sockaddr *addr, socklen_t addrlen,
uint32_t magic_cookie)
{
switch (addr->sa_family)
......
......@@ -72,7 +72,7 @@ void stun_debug (const char *fmt, ...);
void stun_debug_bytes (const void *data, size_t len);
int stun_xor_address (const StunMessage *msg,
struct sockaddr *restrict addr, socklen_t addrlen,
struct sockaddr *addr, socklen_t addrlen,
uint32_t magic_cookie);
int stun_memcmp (const StunMessage *msg, stun_attr_type_t type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment