[Mesa-dev] [PATCH v2 01/11] util/list: Make some helpers take const lists

Christian Gmeiner christian.gmeiner at gmail.com
Sun Jul 29 07:28:04 UTC 2018


Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

Jason Ekstrand <jason at jlekstrand.net> schrieb am So., 29. Juli 2018, 07:46:

> They're all just querying things about the list and not mutating
> anything.
>
> Reviewed-by: Thomas Helland<thomashelland90 at gmail.com>
> ---
>  src/util/list.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/util/list.h b/src/util/list.h
> index 6edb7501109..09d1b4cae64 100644
> --- a/src/util/list.h
> +++ b/src/util/list.h
> @@ -72,7 +72,7 @@ static inline void list_addtail(struct list_head *item,
> struct list_head *list)
>      list->prev = item;
>  }
>
> -static inline bool list_empty(struct list_head *list);
> +static inline bool list_empty(const struct list_head *list);
>
>  static inline void list_replace(struct list_head *from, struct list_head
> *to)
>  {
> @@ -101,7 +101,7 @@ static inline void list_delinit(struct list_head *item)
>      item->prev = item;
>  }
>
> -static inline bool list_empty(struct list_head *list)
> +static inline bool list_empty(const struct list_head *list)
>  {
>     return list->next == list;
>  }
> @@ -114,7 +114,7 @@ static inline bool list_is_singular(const struct
> list_head *list)
>     return list->next != NULL && list->next != list && list->next->next ==
> list;
>  }
>
> -static inline unsigned list_length(struct list_head *list)
> +static inline unsigned list_length(const struct list_head *list)
>  {
>     struct list_head *node;
>     unsigned length = 0;
> @@ -145,7 +145,7 @@ static inline void list_splicetail(struct list_head
> *src, struct list_head *dst)
>     dst->prev = src->prev;
>  }
>
> -static inline void list_validate(struct list_head *list)
> +static inline void list_validate(const struct list_head *list)
>  {
>     struct list_head *node;
>     assert(list->next->prev == list && list->prev->next == list);
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

 --
Christian Gmeiner, MSc

https://christian-gmeiner.info

-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180729/11bb713f/attachment-0001.html>


More information about the mesa-dev mailing list