[Mesa-dev] [PATCH mesa v2] i965: searching the cache doesn't need to modify it
Eric Engestrom
eric.engestrom at intel.com
Tue Oct 2 14:30:09 UTC 2018
Ping?
I'm just adding `const` to make it easier to read and understand the
code, and allow the compiler to tell us if we make a mistake and start
modifying things shouldn't.
On Tuesday, 2018-08-07 12:02:53 +0100, Eric Engestrom wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> ---
> v2: forgot the hunk that was the point of this :facepalm:
> ---
> src/mesa/drivers/dri/i965/brw_program_cache.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_program_cache.c b/src/mesa/drivers/dri/i965/brw_program_cache.c
> index 600b0611c8b89095e393..a9a21d911612f9218e2a 100644
> --- a/src/mesa/drivers/dri/i965/brw_program_cache.c
> +++ b/src/mesa/drivers/dri/i965/brw_program_cache.c
> @@ -142,11 +142,11 @@ brw_cache_item_equals(const struct brw_cache_item *a,
> (memcmp(a->key, b->key, a->key_size) == 0);
> }
>
> -static struct brw_cache_item *
> -search_cache(struct brw_cache *cache, GLuint hash,
> - struct brw_cache_item *lookup)
> +static const struct brw_cache_item *
> +search_cache(const struct brw_cache *cache, GLuint hash,
> + const struct brw_cache_item *lookup)
> {
> - struct brw_cache_item *c;
> + const struct brw_cache_item *c;
>
> #if 0
> int bucketcount = 0;
> @@ -194,11 +194,11 @@ rehash(struct brw_cache *cache)
> * Returns the buffer object matching cache_id and key, or NULL.
> */
> bool
> -brw_search_cache(struct brw_cache *cache, enum brw_cache_id cache_id,
> +brw_search_cache(const struct brw_cache *cache, enum brw_cache_id cache_id,
> const void *key, GLuint key_size, uint32_t *inout_offset,
> void *inout_prog_data, bool flag_state)
> {
> - struct brw_cache_item *item;
> + const struct brw_cache_item *item;
> struct brw_cache_item lookup;
> GLuint hash;
>
> --
> Cheers,
> Eric
>
More information about the mesa-dev
mailing list