summaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2014-06-02 15:05:51 +0300
committerCarl Worth <[email protected]>2015-01-16 13:47:40 -0800
commit165575d0a8ca2af582a7c78776a4a76a84cc2ed8 (patch)
treee6d5a81a0a51004a7b76bb12bb591d26211603c8 /common.py
parent62d5b4b03aa63582cf0801d306d7ca055cca40a0 (diff)
mesa: Add iterate method for string_to_uint_map
The upcoming shader cache needs this to be able to cache hash data from the gl_shader_program structure. Edited-by: Carl Worth <[email protected]>: There is an internal implementation detail that the hash table underlying the struct string_to_uint_map stores each value internally as (value+1). The user needn't be very concerned with this (other than knowing that a value of UINT_MAX cannot be stored) since put() adds 1 and get() subtracts 1. So in this commit, rather than call the user's function directly with hash_table_call_foreach, we call through a wrapper that fixes up the off-by-one values before the caller's callback sees them. And with this wrapper in place, we also give a better signature to the callback function being passed to iterate(), so that this callback function can actually expect a char* and an unsigned argument, (rather than a couple of void* ). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'common.py')
0 files changed, 0 insertions, 0 deletions