From cafeb9ce71d2bf8fa489a28182e6e2a33d3ef420 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 20 Nov 2012 22:25:08 -0800 Subject: [PATCH] array-oset, linkedhash-list, rbtree-oset: no need for 'inline' * lib/gl_array_oset.c (gl_array_nx_add_at): (gl_array_remove_at): * lib/gl_linkedhash_list.c (hash_resize_after_add) (add_to_bucket, remove_from_bucket): * lib/gl_rbtree_oset.c (rotate_left, rotate_right): Change 'static inline' to 'static', as it's simpler to omit 'inline' unless there's a significant performance advantage. --- ChangeLog | 9 +++++++++ lib/gl_array_oset.c | 4 ++-- lib/gl_linkedhash_list.c | 6 +++--- lib/gl_rbtree_oset.c | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69e99abfa..77ce4881f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2012-11-29 Paul Eggert + array-oset, linkedhash-list, rbtree-oset: no need for 'inline' + * lib/gl_array_oset.c (gl_array_nx_add_at): + (gl_array_remove_at): + * lib/gl_linkedhash_list.c (hash_resize_after_add) + (add_to_bucket, remove_from_bucket): + * lib/gl_rbtree_oset.c (rotate_left, rotate_right): + Change 'static inline' to 'static', as it's simpler to omit + 'inline' unless there's a significant performance advantage. + list, oset, xlist, xoset, xsublist: simplify via extern inline * lib/gl_list.h, lib/gl_list.c (GL_LIST_INLINE): * lib/gl_oset.c, lib/gl_oset.h (GL_OSET_INLINE): diff --git a/lib/gl_array_oset.c b/lib/gl_array_oset.c index 0ae7fb413..e1c62a388 100644 --- a/lib/gl_array_oset.c +++ b/lib/gl_array_oset.c @@ -184,7 +184,7 @@ grow (gl_oset_t set) /* Add the given element ELT at the given position, 0 <= position <= gl_oset_size (set). Return 1 upon success, -1 upon out-of-memory. */ -static inline int +static int gl_array_nx_add_at (gl_oset_t set, size_t position, const void *elt) { size_t count = set->count; @@ -204,7 +204,7 @@ gl_array_nx_add_at (gl_oset_t set, size_t position, const void *elt) /* Remove the element at the given position, 0 <= position < gl_oset_size (set). */ -static inline void +static void gl_array_remove_at (gl_oset_t set, size_t position) { size_t count = set->count; diff --git a/lib/gl_linkedhash_list.c b/lib/gl_linkedhash_list.c index 633bb64a2..fa77b6a33 100644 --- a/lib/gl_linkedhash_list.c +++ b/lib/gl_linkedhash_list.c @@ -43,7 +43,7 @@ #include "gl_anyhash_list2.h" /* Resize the hash table if needed, after list->count was incremented. */ -static inline void +static void hash_resize_after_add (gl_list_t list) { size_t count = list->count; @@ -53,7 +53,7 @@ hash_resize_after_add (gl_list_t list) } /* Add a node to the hash table structure. */ -static inline void +static void add_to_bucket (gl_list_t list, gl_list_node_t node) { size_t bucket = node->h.hashcode % list->table_size; @@ -65,7 +65,7 @@ add_to_bucket (gl_list_t list, gl_list_node_t node) #define add_to_bucket(list,node) ((add_to_bucket) (list, node), 0) /* Remove a node from the hash table structure. */ -static inline void +static void remove_from_bucket (gl_list_t list, gl_list_node_t node) { size_t bucket = node->h.hashcode % list->table_size; diff --git a/lib/gl_rbtree_oset.c b/lib/gl_rbtree_oset.c index a94c14d17..2b5a9f3e6 100644 --- a/lib/gl_rbtree_oset.c +++ b/lib/gl_rbtree_oset.c @@ -82,7 +82,7 @@ struct gl_oset_impl Change the tree structure, update the branch sizes. The caller must update the colors and register D as child of its parent. */ -static inline gl_oset_node_t +static gl_oset_node_t rotate_left (gl_oset_node_t b_node, gl_oset_node_t d_node) { gl_oset_node_t c_node = d_node->left; @@ -108,7 +108,7 @@ rotate_left (gl_oset_node_t b_node, gl_oset_node_t d_node) Change the tree structure, update the branch sizes. The caller must update the colors and register B as child of its parent. */ -static inline gl_oset_node_t +static gl_oset_node_t rotate_right (gl_oset_node_t b_node, gl_oset_node_t d_node) { gl_oset_node_t c_node = b_node->right; -- 2.11.0