X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Fcso_cache%2Fcso_hash.h;h=e984f117c95c437afd48cbcaf22693aea4b4ac80;hb=a142bb899291ae68d00f552959cf6ee1cbb9e6c2;hp=f50d69d47ab4db1ad44ee91743815358ba47cefe;hpb=e395ce03e92b707bef7080eae3c2daa7d9760e70;p=mesa.git diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.h b/src/gallium/auxiliary/cso_cache/cso_hash.h index f50d69d47ab..e984f117c95 100644 --- a/src/gallium/auxiliary/cso_cache/cso_hash.h +++ b/src/gallium/auxiliary/cso_cache/cso_hash.h @@ -53,8 +53,8 @@ extern "C" { struct cso_node { struct cso_node *next; - unsigned key; void *value; + unsigned key; }; struct cso_hash_iter { @@ -62,20 +62,16 @@ struct cso_hash_iter { struct cso_node *node; }; -struct cso_hash_data { +struct cso_hash { struct cso_node *fakeNext; struct cso_node **buckets; + struct cso_node *end; int size; short userNumBits; short numBits; int numBuckets; }; -struct cso_hash { - struct cso_hash_data data; - struct cso_node *end; -}; - void cso_hash_init(struct cso_hash *hash); void cso_hash_deinit(struct cso_hash *hash); @@ -149,8 +145,8 @@ cso_hash_find_node(struct cso_hash *hash, unsigned akey) { struct cso_node **node; - if (hash->data.numBuckets) { - node = &hash->data.buckets[akey % hash->data.numBuckets]; + if (hash->numBuckets) { + node = &hash->buckets[akey % hash->numBuckets]; assert(*node == hash->end || (*node)->next); while (*node != hash->end && (*node)->key != akey) node = &(*node)->next;