summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-05-31 08:59:25 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-05-31 12:42:33 +0200
commitd8a8fb3423499851bf06aac2302112944a276f97 (patch)
tree5450e799321f68e2ea5fbd037b46dc1c16628439 /lib
parentd2ae3a4ac629609fc29c16c53757767fd2963b88 (diff)
downloadgnulib-d8a8fb3423499851bf06aac2302112944a276f97.tar.gz
list: fix GCC warnings
* lib/gl_anytree_list2.h (gl_tree_iterator_free) (gl_tree_next_node, gl_tree_node_nx_set_value) (gl_tree_previous_node, gl_tree_next_node): Mark unused arguments. * lib/gl_anytree_oset.h (gl_tree_iterator_free): Likewise. * lib/gl_anylinked_list2.h (gl_linked_node_value) (gl_linked_node_nx_set_value, gl_linked_iterator_free): Likewise. * lib/gl_anytreehash_list2.h (gl_tree_search_from_to): Avoid using the same variable name in nested scopes.
Diffstat (limited to 'lib')
-rw-r--r--lib/gl_anylinked_list2.h18
-rw-r--r--lib/gl_anytree_list2.h14
-rw-r--r--lib/gl_anytree_oset.h2
-rw-r--r--lib/gl_anytreehash_list2.h6
4 files changed, 23 insertions, 17 deletions
diff --git a/lib/gl_anylinked_list2.h b/lib/gl_anylinked_list2.h
index 114106c7dc..3e01f8fa06 100644
--- a/lib/gl_anylinked_list2.h
+++ b/lib/gl_anylinked_list2.h
@@ -76,11 +76,11 @@ gl_linked_nx_create_empty (gl_list_implementation_t implementation,
static gl_list_t
gl_linked_nx_create (gl_list_implementation_t implementation,
- gl_listelement_equals_fn equals_fn,
- gl_listelement_hashcode_fn hashcode_fn,
- gl_listelement_dispose_fn dispose_fn,
- bool allow_duplicates,
- size_t count, const void **contents)
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
{
struct gl_list_impl *list =
(struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
@@ -170,13 +170,15 @@ gl_linked_size (gl_list_t list)
}
static const void * _GL_ATTRIBUTE_PURE
-gl_linked_node_value (gl_list_t list, gl_list_node_t node)
+gl_linked_node_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
return node->value;
}
static int
-gl_linked_node_nx_set_value (gl_list_t list, gl_list_node_t node,
+gl_linked_node_nx_set_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node,
const void *elt)
{
#if WITH_HASHTABLE
@@ -1021,7 +1023,7 @@ gl_linked_iterator_next (gl_list_iterator_t *iterator,
}
static void
-gl_linked_iterator_free (gl_list_iterator_t *iterator)
+gl_linked_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
{
}
diff --git a/lib/gl_anytree_list2.h b/lib/gl_anytree_list2.h
index c5a67dbd0c..939b797480 100644
--- a/lib/gl_anytree_list2.h
+++ b/lib/gl_anytree_list2.h
@@ -60,13 +60,15 @@ gl_tree_size (gl_list_t list)
}
static const void *
-gl_tree_node_value (gl_list_t list, gl_list_node_t node)
+gl_tree_node_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
return node->value;
}
static int
-gl_tree_node_nx_set_value (gl_list_t list, gl_list_node_t node, const void *elt)
+gl_tree_node_nx_set_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node, const void *elt)
{
#if WITH_HASHTABLE
if (elt != node->value)
@@ -101,7 +103,8 @@ gl_tree_node_nx_set_value (gl_list_t list, gl_list_node_t node, const void *elt)
}
static gl_list_node_t _GL_ATTRIBUTE_PURE
-gl_tree_next_node (gl_list_t list, gl_list_node_t node)
+gl_tree_next_node (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
if (node->right != NULL)
{
@@ -119,7 +122,8 @@ gl_tree_next_node (gl_list_t list, gl_list_node_t node)
}
static gl_list_node_t _GL_ATTRIBUTE_PURE
-gl_tree_previous_node (gl_list_t list, gl_list_node_t node)
+gl_tree_previous_node (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+ gl_list_node_t node)
{
if (node->left != NULL)
{
@@ -628,7 +632,7 @@ gl_tree_iterator_next (gl_list_iterator_t *iterator,
}
static void
-gl_tree_iterator_free (gl_list_iterator_t *iterator)
+gl_tree_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
{
}
diff --git a/lib/gl_anytree_oset.h b/lib/gl_anytree_oset.h
index e837f63241..d737e313d7 100644
--- a/lib/gl_anytree_oset.h
+++ b/lib/gl_anytree_oset.h
@@ -292,6 +292,6 @@ gl_tree_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
}
static void
-gl_tree_iterator_free (gl_oset_iterator_t *iterator)
+gl_tree_iterator_free (gl_oset_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
{
}
diff --git a/lib/gl_anytreehash_list2.h b/lib/gl_anytreehash_list2.h
index 69e6776b09..26e52bf389 100644
--- a/lib/gl_anytreehash_list2.h
+++ b/lib/gl_anytreehash_list2.h
@@ -61,13 +61,13 @@ gl_tree_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
{
/* We have to return only the one at the minimal
position >= start_index. */
- const void *elt;
+ const void *nodes_elt;
if (gl_oset_search_atleast (nodes,
compare_position_threshold,
(void *)(uintptr_t)start_index,
- &elt))
+ &nodes_elt))
{
- node = (gl_list_node_t) elt;
+ node = (gl_list_node_t) nodes_elt;
if (end_index == list->root->branch_size
|| node_position (node) < end_index)
return node;