summaryrefslogtreecommitdiff
path: root/lib/gl_anytree_list2.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-10-10 22:52:22 +0200
committerBruno Haible <bruno@clisp.org>2020-10-10 22:57:22 +0200
commit0edaafc813caff4101c58405c6ab279597afc0b9 (patch)
treee4031a904f313282a995090044d3e9496551946b /lib/gl_anytree_list2.h
parent7b926fc24cf169ad5c762c807e6e9f28baa09ff0 (diff)
downloadgnulib-0edaafc813caff4101c58405c6ab279597afc0b9.tar.gz
*-list, *-oset, *-omap: Avoid possible compiler warnings.
Reported by Marc Nieper-Wißkirchen in <https://lists.gnu.org/r/bug-gnulib/2020-10/msg00025.html>. * lib/gl_anylinked_list2.h (gl_linked_iterator, gl_linked_iterator_from_to): Mark as 'pure'. (gl_linked_iterator_free): Mark as 'const'. * lib/gl_anytree_list2.h (gl_tree_size, gl_tree_node_value, gl_tree_search_from_to, gl_tree_indexof_from_to, gl_tree_iterator, gl_tree_iterator_from_to, gl_tree_sortedlist_search, gl_tree_sortedlist_search_from_to, gl_tree_sortedlist_indexof, gl_tree_sortedlist_indexof_from_to): Mark as 'pure'. (gl_tree_iterator_free): Mark as 'const'. * lib/gl_anytree_omap.h (gl_tree_size, gl_tree_iterator): Mark as 'pure'. (gl_tree_iterator_free): Mark as 'const'. * lib/gl_anytree_oset.h (gl_tree_size, gl_tree_next_node, gl_tree_prev_node, gl_tree_iterator): Mark as 'pure'. (gl_tree_iterator_free): Mark as 'const'. * lib/gl_anytreehash_list1.h (node_position, compare_by_position, compare_position_threshold): Mark as 'pure'. * lib/gl_array_list.c (gl_array_size, gl_array_indexof_from_to, gl_array_search_from_to, gl_array_iterator, gl_array_iterator_from_to, gl_array_sortedlist_indexof_from_to, gl_array_sortedlist_indexof, gl_array_sortedlist_search_from_to, gl_array_sortedlist_search): Mark as 'pure'. (gl_array_iterator_free): Mark as 'const'. * lib/gl_array_omap.c (gl_array_size, gl_array_indexof, gl_array_search, gl_array_search_atleast, gl_array_iterator): Mark as 'pure'. (gl_array_iterator_free): Mark as 'const'. * lib/gl_array_oset.c (gl_array_size, gl_array_indexof, gl_array_search, gl_array_indexof_atleast, gl_array_search_atleast, gl_array_iterator, gl_array_iterator_atleast): Mark as 'pure'. (gl_array_iterator_free): Mark as 'const'. * lib/gl_carray_list.c (gl_carray_size, gl_carray_node_value, gl_carray_next_node, gl_carray_previous_node, gl_carray_get_at, gl_carray_indexof_from_to, gl_carray_search_from_to, gl_carray_iterator, gl_carray_iterator_from_to, gl_carray_sortedlist_indexof_from_to, gl_carray_sortedlist_indexof, gl_carray_sortedlist_search_from_to, gl_carray_sortedlist_search): Mark as 'pure'. (gl_carray_iterator_free): Mark as 'const'.
Diffstat (limited to 'lib/gl_anytree_list2.h')
-rw-r--r--lib/gl_anytree_list2.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/gl_anytree_list2.h b/lib/gl_anytree_list2.h
index 939b797480..3cb34221db 100644
--- a/lib/gl_anytree_list2.h
+++ b/lib/gl_anytree_list2.h
@@ -53,13 +53,13 @@ gl_tree_nx_create_empty (gl_list_implementation_t implementation,
#endif
}
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
gl_tree_size (gl_list_t list)
{
return (list->root != NULL ? list->root->branch_size : 0);
}
-static const void *
+static const void * _GL_ATTRIBUTE_PURE
gl_tree_node_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
gl_list_node_t node)
{
@@ -221,7 +221,7 @@ gl_tree_nx_set_at (gl_list_t list, size_t position, const void *elt)
#if !WITH_HASHTABLE
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
gl_tree_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
const void *elt)
{
@@ -332,7 +332,7 @@ gl_tree_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
}
}
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
gl_tree_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
const void *elt)
{
@@ -552,7 +552,7 @@ gl_tree_list_free (gl_list_t list)
/* --------------------- gl_list_iterator_t Data Type --------------------- */
-static gl_list_iterator_t
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
gl_tree_iterator (gl_list_t list)
{
gl_list_iterator_t result;
@@ -577,7 +577,7 @@ gl_tree_iterator (gl_list_t list)
return result;
}
-static gl_list_iterator_t
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
gl_tree_iterator_from_to (gl_list_t list, size_t start_index, size_t end_index)
{
size_t count = (list->root != NULL ? list->root->branch_size : 0);
@@ -631,14 +631,14 @@ gl_tree_iterator_next (gl_list_iterator_t *iterator,
return false;
}
-static void
+static void _GL_ATTRIBUTE_CONST
gl_tree_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
{
}
/* ---------------------- Sorted gl_list_t Data Type ---------------------- */
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
gl_tree_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar,
const void *elt)
{
@@ -679,7 +679,7 @@ gl_tree_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar,
return NULL;
}
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
gl_tree_sortedlist_search_from_to (gl_list_t list,
gl_listelement_compar_fn compar,
size_t low, size_t high,
@@ -761,7 +761,7 @@ gl_tree_sortedlist_search_from_to (gl_list_t list,
return NULL;
}
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
gl_tree_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
const void *elt)
{
@@ -816,7 +816,7 @@ gl_tree_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
return (size_t)(-1);
}
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
gl_tree_sortedlist_indexof_from_to (gl_list_t list,
gl_listelement_compar_fn compar,
size_t low, size_t high,