]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
set: rename _set_ensure_allocated() -> set_ensure_allocated()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 17:10:31 +0000 (02:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 20:58:33 +0000 (05:58 +0900)
Follow-ups for c09ce222b6379e8f73695e5ce53fce76a44d78c7.

src/basic/hashmap.c
src/basic/set.h

index ccb62e7b2a2187fba5013cf6eba925dbb29432c1..db55705fdbeeee778e0cb315eb39f779a0c29edc 100644 (file)
@@ -843,7 +843,7 @@ int ordered_hashmap_ensure_allocated(OrderedHashmap **h, const struct hash_ops *
         return hashmap_base_ensure_allocated((HashmapBase**)h, hash_ops, HASHMAP_TYPE_ORDERED);
 }
 
-int _set_ensure_allocated(Set **s, const struct hash_ops *hash_ops) {
+int set_ensure_allocated(Set **s, const struct hash_ops *hash_ops) {
         return hashmap_base_ensure_allocated((HashmapBase**)s, hash_ops, HASHMAP_TYPE_SET);
 }
 
@@ -1285,7 +1285,7 @@ int set_put(Set *s, const void *key) {
 int set_ensure_put(Set **s, const struct hash_ops *hash_ops, const void *key) {
         int r;
 
-        r = _set_ensure_allocated(s, hash_ops);
+        r = set_ensure_allocated(s, hash_ops);
         if (r < 0)
                 return r;
 
@@ -1883,7 +1883,7 @@ int set_put_strndup_full(Set **s, const struct hash_ops *hash_ops, const char *p
         assert(s);
         assert(p);
 
-        r = _set_ensure_allocated(s, hash_ops);
+        r = set_ensure_allocated(s, hash_ops);
         if (r < 0)
                 return r;
 
index 789bf9b73349c3ccefe31c5a053c3ca419bdbaa7..9dd7bd403dbc22c74884aaa5111a545fd0696b54 100644 (file)
@@ -16,8 +16,7 @@ static inline Set* set_free(Set *s) {
 
 #define set_copy(s) ((Set*) _hashmap_copy(HASHMAP_BASE(s)))
 
-int _set_ensure_allocated(Set **s, const struct hash_ops *hash_ops);
-#define set_ensure_allocated(h, ops) _set_ensure_allocated(h, ops)
+int set_ensure_allocated(Set **s, const struct hash_ops *hash_ops);
 
 int set_put(Set *s, const void *key);
 /* no set_update */
@@ -103,7 +102,7 @@ int set_put_strndup_full(Set **s, const struct hash_ops *hash_ops, const char *p
 #define set_put_strndup(s, p, n) set_put_strndup_full(s, &string_hash_ops_free, p, n)
 #define set_put_strdup(s, p) set_put_strndup(s, p, SIZE_MAX)
 
-int set_put_strdupv_full(Set **s, const struct hash_ops *hash_ops, char **l );
+int set_put_strdupv_full(Set **s, const struct hash_ops *hash_ops, char **l);
 #define set_put_strdupv(s, l) set_put_strdupv_full(s, &string_hash_ops_free, l)
 
 int set_put_strsplit(Set *s, const char *v, const char *separators, ExtractFlags flags);