summaryrefslogtreecommitdiff
path: root/lib/gl_array_list.c
diff options
context:
space:
mode:
authorDylan Cali <calid1984@gmail.com>2014-09-16 16:42:36 +0100
committerPádraig Brady <P@draigBrady.com>2014-09-16 17:03:00 +0100
commit5549ef8e01b431f26cfcf2991fbee44ca32c7dcb (patch)
tree0f2e67360e621d28abea608aaae3225c4c5b3dbf /lib/gl_array_list.c
parent41473cf94a0e9eef96870b76eed9070f87d0c01a (diff)
downloadgnulib-5549ef8e01b431f26cfcf2991fbee44ca32c7dcb.tar.gz
avltree-list: avoid compiler warnings
* lib/gl_anytree_list2.h: Add _GL_ATTRIBUTE_PURE to avoid -Werror=suggest-attribute=pure. * lib/gl_array_list.c: Likewise. * lib/gl_avltree_list.c (gl_avltree_list_check_invariants): Add extern declaration to avoid -Werror=missing-prototypes. This is not added to a header as only exported for tests. Add (void) to the check_invariants() call to indicate we're discarding the result in this context which avoids -Werror=unused-value. Note we don't use ignore_value here to avoid a dependency as we know we'll not be adding __attribute__((warn_unused_result)) to check_invariants(). Add _GL_ATTRIBUTE_CONST to avoid -Werror=suggest-attribute=const.
Diffstat (limited to 'lib/gl_array_list.c')
-rw-r--r--lib/gl_array_list.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gl_array_list.c b/lib/gl_array_list.c
index b61b6cae26..3220dd83aa 100644
--- a/lib/gl_array_list.c
+++ b/lib/gl_array_list.c
@@ -120,7 +120,7 @@ gl_array_size (gl_list_t list)
return list->count;
}
-static const void *
+static const void * _GL_ATTRIBUTE_PURE
gl_array_node_value (gl_list_t list, gl_list_node_t node)
{
uintptr_t index = NODE_TO_INDEX (node);
@@ -142,7 +142,7 @@ gl_array_node_nx_set_value (gl_list_t list, gl_list_node_t node,
return 0;
}
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
gl_array_next_node (gl_list_t list, gl_list_node_t node)
{
uintptr_t index = NODE_TO_INDEX (node);
@@ -156,7 +156,7 @@ gl_array_next_node (gl_list_t list, gl_list_node_t node)
return NULL;
}
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
gl_array_previous_node (gl_list_t list, gl_list_node_t node)
{
uintptr_t index = NODE_TO_INDEX (node);
@@ -169,7 +169,7 @@ gl_array_previous_node (gl_list_t list, gl_list_node_t node)
return NULL;
}
-static const void *
+static const void * _GL_ATTRIBUTE_PURE
gl_array_get_at (gl_list_t list, size_t position)
{
size_t count = list->count;