@@ -768,7 +768,7 @@ static void reset_direct_storage(HashmapBase *h) {
768768 memset (p , DIB_RAW_INIT , sizeof (dib_raw_t ) * hi -> n_direct_buckets );
769769}
770770
771- static struct HashmapBase * hashmap_base_new (const struct hash_ops * hash_ops , enum HashmapType type HASHMAP_DEBUG_PARAMS ) {
771+ static struct HashmapBase * hashmap_base_new (const struct hash_ops * hash_ops , enum HashmapType type HASHMAP_DEBUG_PARAMS ) {
772772 HashmapBase * h ;
773773 const struct hashmap_type_info * hi = & hashmap_type_info [type ];
774774 bool up ;
@@ -808,27 +808,27 @@ static struct HashmapBase *hashmap_base_new(const struct hash_ops *hash_ops, enu
808808}
809809
810810Hashmap * _hashmap_new (const struct hash_ops * hash_ops HASHMAP_DEBUG_PARAMS ) {
811- return (Hashmap * ) hashmap_base_new (hash_ops , HASHMAP_TYPE_PLAIN HASHMAP_DEBUG_PASS_ARGS );
811+ return (Hashmap * ) hashmap_base_new (hash_ops , HASHMAP_TYPE_PLAIN HASHMAP_DEBUG_PASS_ARGS );
812812}
813813
814814OrderedHashmap * _ordered_hashmap_new (const struct hash_ops * hash_ops HASHMAP_DEBUG_PARAMS ) {
815- return (OrderedHashmap * ) hashmap_base_new (hash_ops , HASHMAP_TYPE_ORDERED HASHMAP_DEBUG_PASS_ARGS );
815+ return (OrderedHashmap * ) hashmap_base_new (hash_ops , HASHMAP_TYPE_ORDERED HASHMAP_DEBUG_PASS_ARGS );
816816}
817817
818818Set * _set_new (const struct hash_ops * hash_ops HASHMAP_DEBUG_PARAMS ) {
819- return (Set * ) hashmap_base_new (hash_ops , HASHMAP_TYPE_SET HASHMAP_DEBUG_PASS_ARGS );
819+ return (Set * ) hashmap_base_new (hash_ops , HASHMAP_TYPE_SET HASHMAP_DEBUG_PASS_ARGS );
820820}
821821
822822static int hashmap_base_ensure_allocated (HashmapBase * * h , const struct hash_ops * hash_ops ,
823- enum HashmapType type HASHMAP_DEBUG_PARAMS ) {
823+ enum HashmapType type HASHMAP_DEBUG_PARAMS ) {
824824 HashmapBase * q ;
825825
826826 assert (h );
827827
828828 if (* h )
829829 return 0 ;
830830
831- q = hashmap_base_new (hash_ops , type HASHMAP_DEBUG_PASS_ARGS );
831+ q = hashmap_base_new (hash_ops , type HASHMAP_DEBUG_PASS_ARGS );
832832 if (!q )
833833 return - ENOMEM ;
834834
@@ -837,15 +837,15 @@ static int hashmap_base_ensure_allocated(HashmapBase **h, const struct hash_ops
837837}
838838
839839int _hashmap_ensure_allocated (Hashmap * * h , const struct hash_ops * hash_ops HASHMAP_DEBUG_PARAMS ) {
840- return hashmap_base_ensure_allocated ((HashmapBase * * )h , hash_ops , HASHMAP_TYPE_PLAIN HASHMAP_DEBUG_PASS_ARGS );
840+ return hashmap_base_ensure_allocated ((HashmapBase * * )h , hash_ops , HASHMAP_TYPE_PLAIN HASHMAP_DEBUG_PASS_ARGS );
841841}
842842
843843int _ordered_hashmap_ensure_allocated (OrderedHashmap * * h , const struct hash_ops * hash_ops HASHMAP_DEBUG_PARAMS ) {
844- return hashmap_base_ensure_allocated ((HashmapBase * * )h , hash_ops , HASHMAP_TYPE_ORDERED HASHMAP_DEBUG_PASS_ARGS );
844+ return hashmap_base_ensure_allocated ((HashmapBase * * )h , hash_ops , HASHMAP_TYPE_ORDERED HASHMAP_DEBUG_PASS_ARGS );
845845}
846846
847847int _set_ensure_allocated (Set * * s , const struct hash_ops * hash_ops HASHMAP_DEBUG_PARAMS ) {
848- return hashmap_base_ensure_allocated ((HashmapBase * * )s , hash_ops , HASHMAP_TYPE_SET HASHMAP_DEBUG_PASS_ARGS );
848+ return hashmap_base_ensure_allocated ((HashmapBase * * )s , hash_ops , HASHMAP_TYPE_SET HASHMAP_DEBUG_PASS_ARGS );
849849}
850850
851851static void hashmap_free_no_clear (HashmapBase * h ) {
@@ -1711,13 +1711,13 @@ int _hashmap_move_one(HashmapBase *h, HashmapBase *other, const void *key) {
17111711 return 0 ;
17121712}
17131713
1714- HashmapBase * _hashmap_copy (HashmapBase * h ) {
1714+ HashmapBase * _hashmap_copy (HashmapBase * h HASHMAP_DEBUG_PARAMS ) {
17151715 HashmapBase * copy ;
17161716 int r ;
17171717
17181718 assert (h );
17191719
1720- copy = hashmap_base_new (h -> hash_ops , h -> type HASHMAP_DEBUG_SRC_ARGS );
1720+ copy = hashmap_base_new (h -> hash_ops , h -> type HASHMAP_DEBUG_PASS_ARGS );
17211721 if (!copy )
17221722 return NULL ;
17231723
@@ -1733,10 +1733,8 @@ HashmapBase *_hashmap_copy(HashmapBase *h) {
17331733 assert_not_reached ("Unknown hashmap type" );
17341734 }
17351735
1736- if (r < 0 ) {
1737- _hashmap_free (copy , false, false);
1738- return NULL ;
1739- }
1736+ if (r < 0 )
1737+ return _hashmap_free (copy , false, false);
17401738
17411739 return copy ;
17421740}
0 commit comments