X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Furcu%2Flist.h;h=4bc88b3f22c505e0f83355d3919eff80fb3ac868;hb=HEAD;hp=f3b867839030fb3ceeda4192f2c0f4c20b856971;hpb=c7f4490afcccb5d27b0f17e99ea782b21449e27b;p=urcu.git diff --git a/include/urcu/list.h b/include/urcu/list.h index f3b8678..f2d77bb 100644 --- a/include/urcu/list.h +++ b/include/urcu/list.h @@ -1,25 +1,12 @@ +// SPDX-FileCopyrightText: 2002 Free Software Foundation, Inc. +// SPDX-FileCopyrightText: 2009 Pierre-Marc Fournier +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * Copyright (C) 2002 Free Software Foundation, Inc. * (originally part of the GNU C Library) * Contributed by Ulrich Drepper , 2002. - * - * Copyright (C) 2009 Pierre-Marc Fournier - * Conversion to RCU list. - * Copyright (C) 2010 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _CDS_LIST_H @@ -46,7 +33,7 @@ struct cds_list_head { #define CDS_INIT_LIST_HEAD(ptr) \ (ptr)->next = (ptr)->prev = (ptr) -#define CDS_LIST_HEAD_INIT(name) { .prev = &(name), .next = &(name) } +#define CDS_LIST_HEAD_INIT(name) { .next = &(name), .prev = &(name) } /* Add new element at the head of the list. */ static inline @@ -101,7 +88,7 @@ void cds_list_move(struct cds_list_head *elem, struct cds_list_head *head) /* Replace an old entry. */ static inline -void cds_list_replace(struct cds_list_head *old, struct cds_list_head *_new) +void cds_list_replace(const struct cds_list_head *old, struct cds_list_head *_new) { _new->next = old->next; _new->prev = old->prev; @@ -182,7 +169,7 @@ void cds_list_splice(struct cds_list_head *add, struct cds_list_head *head) pos = (p), p = cds_list_entry((pos)->member.next, __typeof__(*(pos)), member)) static inline -int cds_list_empty(struct cds_list_head *head) +int cds_list_empty(const struct cds_list_head *head) { return head == head->next; }