list.h: remove restrict qualifier

This commit is contained in:
Yuxuan Shui 2019-04-08 03:11:29 +01:00
parent 4afc853d4f
commit a6decc3a0f
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 5 additions and 9 deletions

View File

@ -24,9 +24,8 @@ struct list_node {
#define list_prev_entry(ptr, node) list_entry((ptr)->node.prev, __typeof__(*(ptr)), node)
/// Insert a new node between two adjacent nodes in the list
static inline void
__list_insert_between(struct list_node *restrict prev, struct list_node *restrict next,
struct list_node *restrict new_) {
static inline void __list_insert_between(struct list_node *prev, struct list_node *next,
struct list_node *new_) {
new_->prev = prev;
new_->next = next;
next->prev = new_;
@ -34,14 +33,12 @@ __list_insert_between(struct list_node *restrict prev, struct list_node *restric
}
/// Insert a new node after `curr`
static inline void
list_insert_after(struct list_node *restrict curr, struct list_node *restrict new_) {
static inline void list_insert_after(struct list_node *curr, struct list_node *new_) {
__list_insert_between(curr, curr->next, new_);
}
/// Insert a new node before `curr`
static inline void
list_insert_before(struct list_node *restrict curr, struct list_node *restrict new_) {
static inline void list_insert_before(struct list_node *curr, struct list_node *new_) {
__list_insert_between(curr->prev, curr, new_);
}
@ -59,8 +56,7 @@ static inline void list_remove(struct list_node *to_remove) {
}
/// Move `to_move` so that it's before `new_next`
static inline void
list_move_before(struct list_node *restrict to_move, struct list_node *restrict new_next) {
static inline void list_move_before(struct list_node *to_move, struct list_node *new_next) {
list_remove(to_move);
list_insert_before(new_next, to_move);
}