GHash: use unsigned int for ghash_size
This commit is contained in:
@@ -86,7 +86,7 @@ void BLI_ghash_clear_ex(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP va
|
||||
const unsigned int nentries_reserve);
|
||||
void *BLI_ghash_popkey(GHash *gh, void *key, GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_ghash_size(GHash *gh) ATTR_WARN_UNUSED_RESULT;
|
||||
unsigned int BLI_ghash_size(GHash *gh) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_ghash_flag_set(GHash *gh, unsigned int flag);
|
||||
void BLI_ghash_flag_clear(GHash *gh, unsigned int flag);
|
||||
|
||||
@@ -220,7 +220,7 @@ GSet *BLI_gset_new_ex(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info,
|
||||
const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
GSet *BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
GSet *BLI_gset_copy(GSet *gs, GSetKeyCopyFP keycopyfp) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_gset_size(GSet *gs) ATTR_WARN_UNUSED_RESULT;
|
||||
unsigned int BLI_gset_size(GSet *gs) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_gset_flag_set(GSet *gs, unsigned int flag);
|
||||
void BLI_gset_flag_clear(GSet *gs, unsigned int flag);
|
||||
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp);
|
||||
|
||||
@@ -664,9 +664,9 @@ void BLI_ghash_reserve(GHash *gh, const unsigned int nentries_reserve)
|
||||
/**
|
||||
* \return size of the GHash.
|
||||
*/
|
||||
int BLI_ghash_size(GHash *gh)
|
||||
unsigned int BLI_ghash_size(GHash *gh)
|
||||
{
|
||||
return (int)gh->nentries;
|
||||
return gh->nentries;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1243,9 +1243,9 @@ GSet *BLI_gset_copy(GSet *gs, GHashKeyCopyFP keycopyfp)
|
||||
return (GSet *)ghash_copy((GHash *)gs, keycopyfp, NULL);
|
||||
}
|
||||
|
||||
int BLI_gset_size(GSet *gs)
|
||||
unsigned int BLI_gset_size(GSet *gs)
|
||||
{
|
||||
return (int)((GHash *)gs)->nentries;
|
||||
return ((GHash *)gs)->nentries;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1040,8 +1040,8 @@ bool BM_mesh_intersect(
|
||||
}
|
||||
}
|
||||
|
||||
splice_ls = MEM_mallocN((unsigned int)BLI_gset_size(s.wire_edges) * sizeof(*splice_ls), __func__);
|
||||
STACK_INIT(splice_ls, (unsigned int)BLI_gset_size(s.wire_edges));
|
||||
splice_ls = MEM_mallocN(BLI_gset_size(s.wire_edges) * sizeof(*splice_ls), __func__);
|
||||
STACK_INIT(splice_ls, BLI_gset_size(s.wire_edges));
|
||||
|
||||
for (node = s.vert_dissolve; node; node = node->next) {
|
||||
BMEdge *e_pair[2];
|
||||
|
||||
@@ -419,8 +419,8 @@ static void bm_uuidwalk_rehash(
|
||||
UUID_Int *uuid_store;
|
||||
unsigned int i;
|
||||
|
||||
unsigned int rehash_store_len_new = (unsigned int)MAX2(BLI_ghash_size(uuidwalk->verts_uuid),
|
||||
BLI_ghash_size(uuidwalk->faces_uuid));
|
||||
unsigned int rehash_store_len_new = MAX2(BLI_ghash_size(uuidwalk->verts_uuid),
|
||||
BLI_ghash_size(uuidwalk->faces_uuid));
|
||||
|
||||
bm_uuidwalk_rehash_reserve(uuidwalk, rehash_store_len_new);
|
||||
uuid_store = uuidwalk->cache.rehash_store;
|
||||
@@ -862,7 +862,7 @@ static BMFace **bm_mesh_region_match_pair(
|
||||
break;
|
||||
}
|
||||
|
||||
found = ((unsigned int)BLI_ghash_size(w_dst->faces_uuid) == faces_src_region_len);
|
||||
found = (BLI_ghash_size(w_dst->faces_uuid) == faces_src_region_len);
|
||||
if (found) {
|
||||
break;
|
||||
}
|
||||
@@ -875,7 +875,7 @@ static BMFace **bm_mesh_region_match_pair(
|
||||
|
||||
if (found) {
|
||||
GHashIterator gh_iter;
|
||||
const unsigned int faces_result_len = (unsigned int)BLI_ghash_size(w_dst->faces_uuid);
|
||||
const unsigned int faces_result_len = BLI_ghash_size(w_dst->faces_uuid);
|
||||
unsigned int i;
|
||||
|
||||
faces_result = MEM_mallocN(sizeof(*faces_result) * (faces_result_len + 1), __func__);
|
||||
|
||||
Reference in New Issue
Block a user