Commit bb84fa14 authored by Eric Engestrom's avatar Eric Engestrom Committed by Eric Engestrom

util: use C99 declaration in the for-loop hash_table_foreach() macro

Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric@engestrom.ch>
Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
parent 3d261cf7
...@@ -3635,7 +3635,6 @@ static void visit_post_phi(struct ac_nir_context *ctx, ...@@ -3635,7 +3635,6 @@ static void visit_post_phi(struct ac_nir_context *ctx,
static void phi_post_pass(struct ac_nir_context *ctx) static void phi_post_pass(struct ac_nir_context *ctx)
{ {
struct hash_entry *entry;
hash_table_foreach(ctx->phis, entry) { hash_table_foreach(ctx->phis, entry) {
visit_post_phi(ctx, (nir_phi_instr*)entry->key, visit_post_phi(ctx, (nir_phi_instr*)entry->key,
(LLVMValueRef)entry->data); (LLVMValueRef)entry->data);
......
...@@ -180,8 +180,6 @@ vir_setup_def(struct v3d_compile *c, struct qblock *block, int ip, ...@@ -180,8 +180,6 @@ vir_setup_def(struct v3d_compile *c, struct qblock *block, int ip,
static void static void
sf_state_clear(struct hash_table *partial_update_ht) sf_state_clear(struct hash_table *partial_update_ht)
{ {
struct hash_entry *entry;
hash_table_foreach(partial_update_ht, entry) { hash_table_foreach(partial_update_ht, entry) {
struct partial_update_state *state = entry->data; struct partial_update_state *state = entry->data;
......
...@@ -134,7 +134,6 @@ vir_lower_uniforms(struct v3d_compile *c) ...@@ -134,7 +134,6 @@ vir_lower_uniforms(struct v3d_compile *c)
*/ */
uint32_t max_count = 0; uint32_t max_count = 0;
uint32_t max_index = 0; uint32_t max_index = 0;
struct hash_entry *entry;
hash_table_foreach(ht, entry) { hash_table_foreach(ht, entry) {
uint32_t count = (uintptr_t)entry->data; uint32_t count = (uintptr_t)entry->data;
uint32_t index = (uintptr_t)entry->key - 1; uint32_t index = (uintptr_t)entry->key - 1;
......
...@@ -6645,7 +6645,6 @@ ast_case_statement_list::hir(exec_list *instructions, ...@@ -6645,7 +6645,6 @@ ast_case_statement_list::hir(exec_list *instructions,
* if default should be chosen or not. * if default should be chosen or not.
*/ */
if (!default_case.is_empty()) { if (!default_case.is_empty()) {
struct hash_entry *entry;
ir_factory body(instructions, state); ir_factory body(instructions, state);
ir_expression *cmp = NULL; ir_expression *cmp = NULL;
......
...@@ -362,7 +362,6 @@ create_buffer_blocks(void *mem_ctx, struct gl_context *ctx, ...@@ -362,7 +362,6 @@ create_buffer_blocks(void *mem_ctx, struct gl_context *ctx,
ctx->Const.UseSTD430AsDefaultPacking); ctx->Const.UseSTD430AsDefaultPacking);
unsigned i = 0; unsigned i = 0;
struct hash_entry *entry;
hash_table_foreach (block_hash, entry) { hash_table_foreach (block_hash, entry) {
const struct link_uniform_block_active *const b = const struct link_uniform_block_active *const b =
(const struct link_uniform_block_active *) entry->data; (const struct link_uniform_block_active *) entry->data;
...@@ -429,7 +428,6 @@ link_uniform_blocks(void *mem_ctx, ...@@ -429,7 +428,6 @@ link_uniform_blocks(void *mem_ctx,
unsigned num_ubo_variables = 0; unsigned num_ubo_variables = 0;
unsigned num_ssbo_variables = 0; unsigned num_ssbo_variables = 0;
count_block_size block_size; count_block_size block_size;
struct hash_entry *entry;
hash_table_foreach (block_hash, entry) { hash_table_foreach (block_hash, entry) {
struct link_uniform_block_active *const b = struct link_uniform_block_active *const b =
......
...@@ -380,7 +380,6 @@ ir_constant_propagation_visitor::visit_enter(ir_if *ir) ...@@ -380,7 +380,6 @@ ir_constant_propagation_visitor::visit_enter(ir_if *ir)
acp->make_empty(); acp->make_empty();
killed_all = true; killed_all = true;
} else { } else {
hash_entry *htk;
hash_table_foreach(new_kills, htk) hash_table_foreach(new_kills, htk)
kill((ir_variable *) htk->key, (uintptr_t) htk->data); kill((ir_variable *) htk->key, (uintptr_t) htk->data);
} }
...@@ -420,7 +419,6 @@ ir_constant_propagation_visitor::handle_loop(ir_loop *ir, bool keep_acp) ...@@ -420,7 +419,6 @@ ir_constant_propagation_visitor::handle_loop(ir_loop *ir, bool keep_acp)
this->acp = orig_acp; this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all; this->killed_all = this->killed_all || orig_killed_all;
hash_entry *htk;
hash_table_foreach(new_kills, htk) { hash_table_foreach(new_kills, htk) {
kill((ir_variable *) htk->key, (uintptr_t) htk->data); kill((ir_variable *) htk->key, (uintptr_t) htk->data);
} }
......
...@@ -190,7 +190,6 @@ do_constant_variable(exec_list *instructions) ...@@ -190,7 +190,6 @@ do_constant_variable(exec_list *instructions)
_mesa_key_pointer_equal); _mesa_key_pointer_equal);
v.run(instructions); v.run(instructions);
struct hash_entry *hte;
hash_table_foreach(v.ht, hte) { hash_table_foreach(v.ht, hte) {
struct assignment_entry *entry = (struct assignment_entry *) hte->data; struct assignment_entry *entry = (struct assignment_entry *) hte->data;
......
...@@ -50,7 +50,6 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) ...@@ -50,7 +50,6 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
v.run(instructions); v.run(instructions);
struct hash_entry *e;
hash_table_foreach(v.ht, e) { hash_table_foreach(v.ht, e) {
ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)e->data; ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)e->data;
......
...@@ -160,7 +160,6 @@ validate_variables_in_hash_table(struct hash_table *ht, ...@@ -160,7 +160,6 @@ validate_variables_in_hash_table(struct hash_table *ht,
va_end(args); va_end(args);
struct hash_entry *entry;
hash_table_foreach(ht, entry) { hash_table_foreach(ht, entry) {
const ir_instruction *const ir = (ir_instruction *) entry->key; const ir_instruction *const ir = (ir_instruction *) entry->key;
const ir_variable *const v = ir->as_variable(); const ir_variable *const v = ir->as_variable();
......
...@@ -85,7 +85,6 @@ nir_lower_global_vars_to_local(nir_shader *shader) ...@@ -85,7 +85,6 @@ nir_lower_global_vars_to_local(nir_shader *shader)
} }
} }
struct hash_entry *entry;
hash_table_foreach(var_func_table, entry) { hash_table_foreach(var_func_table, entry) {
nir_variable *var = (void *)entry->key; nir_variable *var = (void *)entry->key;
nir_function_impl *impl = entry->data; nir_function_impl *impl = entry->data;
......
...@@ -359,7 +359,6 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader, ...@@ -359,7 +359,6 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
patch_indirects, split_inputs, true); patch_indirects, split_inputs, true);
/* Remove old input from the shaders inputs list */ /* Remove old input from the shaders inputs list */
struct hash_entry *entry;
hash_table_foreach(split_inputs, entry) { hash_table_foreach(split_inputs, entry) {
nir_variable *var = (nir_variable *) entry->key; nir_variable *var = (nir_variable *) entry->key;
exec_node_remove(&var->node); exec_node_remove(&var->node);
...@@ -369,7 +368,6 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader, ...@@ -369,7 +368,6 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
} }
/* Remove old output from the shaders outputs list */ /* Remove old output from the shaders outputs list */
struct hash_entry *entry;
hash_table_foreach(split_outputs, entry) { hash_table_foreach(split_outputs, entry) {
nir_variable *var = (nir_variable *) entry->key; nir_variable *var = (nir_variable *) entry->key;
exec_node_remove(&var->node); exec_node_remove(&var->node);
...@@ -406,7 +404,6 @@ nir_lower_io_arrays_to_elements(nir_shader *producer, nir_shader *consumer) ...@@ -406,7 +404,6 @@ nir_lower_io_arrays_to_elements(nir_shader *producer, nir_shader *consumer)
patch_indirects, split_inputs, false); patch_indirects, split_inputs, false);
/* Remove old input from the shaders inputs list */ /* Remove old input from the shaders inputs list */
struct hash_entry *entry;
hash_table_foreach(split_inputs, entry) { hash_table_foreach(split_inputs, entry) {
nir_variable *var = (nir_variable *) entry->key; nir_variable *var = (nir_variable *) entry->key;
exec_node_remove(&var->node); exec_node_remove(&var->node);
......
...@@ -360,7 +360,6 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask) ...@@ -360,7 +360,6 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask)
} }
/* Remove old input from the shaders inputs list */ /* Remove old input from the shaders inputs list */
struct hash_entry *entry;
hash_table_foreach(split_inputs, entry) { hash_table_foreach(split_inputs, entry) {
nir_variable *var = (nir_variable *) entry->key; nir_variable *var = (nir_variable *) entry->key;
exec_node_remove(&var->node); exec_node_remove(&var->node);
......
...@@ -201,7 +201,6 @@ gather_vars_written(struct copy_prop_var_state *state, ...@@ -201,7 +201,6 @@ gather_vars_written(struct copy_prop_var_state *state,
/* Merge new information to the parent control flow node. */ /* Merge new information to the parent control flow node. */
if (written) { if (written) {
written->modes |= new_written->modes; written->modes |= new_written->modes;
struct hash_entry *new_entry;
hash_table_foreach(new_written->derefs, new_entry) { hash_table_foreach(new_written->derefs, new_entry) {
struct hash_entry *old_entry = struct hash_entry *old_entry =
_mesa_hash_table_search_pre_hashed(written->derefs, new_entry->hash, _mesa_hash_table_search_pre_hashed(written->derefs, new_entry->hash,
...@@ -575,7 +574,6 @@ invalidate_copies_for_cf_node(struct copy_prop_var_state *state, ...@@ -575,7 +574,6 @@ invalidate_copies_for_cf_node(struct copy_prop_var_state *state,
} }
} }
struct hash_entry *entry;
hash_table_foreach (written->derefs, entry) { hash_table_foreach (written->derefs, entry) {
nir_deref_instr *deref_written = (nir_deref_instr *)entry->key; nir_deref_instr *deref_written = (nir_deref_instr *)entry->key;
kill_aliases(copies, deref_written, (uintptr_t)entry->data); kill_aliases(copies, deref_written, (uintptr_t)entry->data);
......
...@@ -727,7 +727,6 @@ validate_block(nir_block *block, validate_state *state) ...@@ -727,7 +727,6 @@ validate_block(nir_block *block, validate_state *state)
} }
} }
struct set_entry *entry;
set_foreach(block->predecessors, entry) { set_foreach(block->predecessors, entry) {
const nir_block *pred = entry->key; const nir_block *pred = entry->key;
validate_assert(state, pred->successors[0] == block || validate_assert(state, pred->successors[0] == block ||
...@@ -936,7 +935,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state) ...@@ -936,7 +935,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
if (reg_state->uses->entries != 0) { if (reg_state->uses->entries != 0) {
printf("extra entries in register uses:\n"); printf("extra entries in register uses:\n");
struct set_entry *entry;
set_foreach(reg_state->uses, entry) set_foreach(reg_state->uses, entry)
printf("%p\n", entry->key); printf("%p\n", entry->key);
...@@ -951,7 +949,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state) ...@@ -951,7 +949,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
if (reg_state->if_uses->entries != 0) { if (reg_state->if_uses->entries != 0) {
printf("extra entries in register if_uses:\n"); printf("extra entries in register if_uses:\n");
struct set_entry *entry;
set_foreach(reg_state->if_uses, entry) set_foreach(reg_state->if_uses, entry)
printf("%p\n", entry->key); printf("%p\n", entry->key);
...@@ -966,7 +963,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state) ...@@ -966,7 +963,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
if (reg_state->defs->entries != 0) { if (reg_state->defs->entries != 0) {
printf("extra entries in register defs:\n"); printf("extra entries in register defs:\n");
struct set_entry *entry;
set_foreach(reg_state->defs, entry) set_foreach(reg_state->defs, entry)
printf("%p\n", entry->key); printf("%p\n", entry->key);
...@@ -1033,7 +1029,6 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state) ...@@ -1033,7 +1029,6 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state)
if (def_state->uses->entries != 0) { if (def_state->uses->entries != 0) {
printf("extra entries in SSA def uses:\n"); printf("extra entries in SSA def uses:\n");
struct set_entry *entry;
set_foreach(def_state->uses, entry) set_foreach(def_state->uses, entry)
printf("%p\n", entry->key); printf("%p\n", entry->key);
...@@ -1048,7 +1043,6 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state) ...@@ -1048,7 +1043,6 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state)
if (def_state->if_uses->entries != 0) { if (def_state->if_uses->entries != 0) {
printf("extra entries in SSA def uses:\n"); printf("extra entries in SSA def uses:\n");
struct set_entry *entry;
set_foreach(def_state->if_uses, entry) set_foreach(def_state->if_uses, entry)
printf("%p\n", entry->key); printf("%p\n", entry->key);
...@@ -1157,7 +1151,6 @@ dump_errors(validate_state *state) ...@@ -1157,7 +1151,6 @@ dump_errors(validate_state *state)
if (_mesa_hash_table_num_entries(errors) > 0) { if (_mesa_hash_table_num_entries(errors) > 0) {
fprintf(stderr, "%d additional errors:\n", fprintf(stderr, "%d additional errors:\n",
_mesa_hash_table_num_entries(errors)); _mesa_hash_table_num_entries(errors));
struct hash_entry *entry;
hash_table_foreach(errors, entry) { hash_table_foreach(errors, entry) {
fprintf(stderr, "%s\n", (char *)entry->data); fprintf(stderr, "%s\n", (char *)entry->data);
} }
......
...@@ -151,7 +151,6 @@ fd6_sampler_state_delete(struct pipe_context *pctx, void *hwcso) ...@@ -151,7 +151,6 @@ fd6_sampler_state_delete(struct pipe_context *pctx, void *hwcso)
struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx)); struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx));
struct fd6_sampler_stateobj *samp = hwcso; struct fd6_sampler_stateobj *samp = hwcso;
struct hash_entry *entry;
hash_table_foreach(fd6_ctx->tex_cache, entry) { hash_table_foreach(fd6_ctx->tex_cache, entry) {
struct fd6_texture_state *state = entry->data; struct fd6_texture_state *state = entry->data;
...@@ -344,7 +343,6 @@ fd6_sampler_view_destroy(struct pipe_context *pctx, ...@@ -344,7 +343,6 @@ fd6_sampler_view_destroy(struct pipe_context *pctx,
struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx)); struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx));
struct fd6_pipe_sampler_view *view = fd6_pipe_sampler_view(_view); struct fd6_pipe_sampler_view *view = fd6_pipe_sampler_view(_view);
struct hash_entry *entry;
hash_table_foreach(fd6_ctx->tex_cache, entry) { hash_table_foreach(fd6_ctx->tex_cache, entry) {
struct fd6_texture_state *state = entry->data; struct fd6_texture_state *state = entry->data;
...@@ -508,7 +506,6 @@ fd6_texture_fini(struct pipe_context *pctx) ...@@ -508,7 +506,6 @@ fd6_texture_fini(struct pipe_context *pctx)
{ {
struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx)); struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx));
struct hash_entry *entry;
hash_table_foreach(fd6_ctx->tex_cache, entry) { hash_table_foreach(fd6_ctx->tex_cache, entry) {
fd6_texture_state_destroy(entry->data); fd6_texture_state_destroy(entry->data);
} }
......
...@@ -76,7 +76,6 @@ struct ir3_cache * ir3_cache_create(const struct ir3_cache_funcs *funcs, void *d ...@@ -76,7 +76,6 @@ struct ir3_cache * ir3_cache_create(const struct ir3_cache_funcs *funcs, void *d
void ir3_cache_destroy(struct ir3_cache *cache) void ir3_cache_destroy(struct ir3_cache *cache)
{ {
/* _mesa_hash_table_destroy is so *almost* useful.. */ /* _mesa_hash_table_destroy is so *almost* useful.. */
struct hash_entry *entry;
hash_table_foreach(cache->ht, entry) { hash_table_foreach(cache->ht, entry) {
cache->funcs->destroy_state(cache->data, entry->data); cache->funcs->destroy_state(cache->data, entry->data);
} }
...@@ -117,7 +116,6 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key, ...@@ -117,7 +116,6 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key,
*/ */
void ir3_cache_invalidate(struct ir3_cache *cache, void *stobj) void ir3_cache_invalidate(struct ir3_cache *cache, void *stobj)
{ {
struct hash_entry *entry;
hash_table_foreach(cache->ht, entry) { hash_table_foreach(cache->ht, entry) {
const struct ir3_cache_key *key = entry->key; const struct ir3_cache_key *key = entry->key;
if ((key->fs == stobj) || (key->vs == stobj)) { if ((key->fs == stobj) || (key->vs == stobj)) {
......
...@@ -43,7 +43,6 @@ v3d_flush(struct pipe_context *pctx) ...@@ -43,7 +43,6 @@ v3d_flush(struct pipe_context *pctx)
{ {
struct v3d_context *v3d = v3d_context(pctx); struct v3d_context *v3d = v3d_context(pctx);
struct hash_entry *entry;
hash_table_foreach(v3d->jobs, entry) { hash_table_foreach(v3d->jobs, entry) {
struct v3d_job *job = entry->data; struct v3d_job *job = entry->data;
v3d_job_submit(v3d, job); v3d_job_submit(v3d, job);
......
...@@ -47,8 +47,6 @@ remove_from_ht(struct hash_table *ht, void *key) ...@@ -47,8 +47,6 @@ remove_from_ht(struct hash_table *ht, void *key)
static void static void
v3d_job_free(struct v3d_context *v3d, struct v3d_job *job) v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
{ {
struct set_entry *entry;
set_foreach(job->bos, entry) { set_foreach(job->bos, entry) {
struct v3d_bo *bo = (struct v3d_bo *)entry->key; struct v3d_bo *bo = (struct v3d_bo *)entry->key;
v3d_bo_unreference(&bo); v3d_bo_unreference(&bo);
...@@ -57,8 +55,6 @@ v3d_job_free(struct v3d_context *v3d, struct v3d_job *job) ...@@ -57,8 +55,6 @@ v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
remove_from_ht(v3d->jobs, &job->key); remove_from_ht(v3d->jobs, &job->key);
if (job->write_prscs) { if (job->write_prscs) {
struct set_entry *entry;
set_foreach(job->write_prscs, entry) { set_foreach(job->write_prscs, entry) {
const struct pipe_resource *prsc = entry->key; const struct pipe_resource *prsc = entry->key;
...@@ -175,7 +171,6 @@ v3d_flush_jobs_reading_resource(struct v3d_context *v3d, ...@@ -175,7 +171,6 @@ v3d_flush_jobs_reading_resource(struct v3d_context *v3d,
v3d_flush_jobs_writing_resource(v3d, prsc); v3d_flush_jobs_writing_resource(v3d, prsc);
struct hash_entry *entry;
hash_table_foreach(v3d->jobs, entry) { hash_table_foreach(v3d->jobs, entry) {
struct v3d_job *job = entry->data; struct v3d_job *job = entry->data;
...@@ -351,7 +346,6 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job) ...@@ -351,7 +346,6 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
stderr, stderr,
V3D_DEBUG & V3D_DEBUG_CL); V3D_DEBUG & V3D_DEBUG_CL);
struct set_entry *entry;
set_foreach(job->bos, entry) { set_foreach(job->bos, entry) {
struct v3d_bo *bo = (void *)entry->key; struct v3d_bo *bo = (void *)entry->key;
char *name = ralloc_asprintf(NULL, "%s_0x%x", char *name = ralloc_asprintf(NULL, "%s_0x%x",
......
...@@ -618,7 +618,6 @@ v3d_shader_state_delete(struct pipe_context *pctx, void *hwcso) ...@@ -618,7 +618,6 @@ v3d_shader_state_delete(struct pipe_context *pctx, void *hwcso)
struct v3d_context *v3d = v3d_context(pctx); struct v3d_context *v3d = v3d_context(pctx);
struct v3d_uncompiled_shader *so = hwcso; struct v3d_uncompiled_shader *so = hwcso;
struct hash_entry *entry;
hash_table_foreach(v3d->fs_cache, entry) { hash_table_foreach(v3d->fs_cache, entry) {
delete_from_cache_if_matches(v3d->fs_cache, &v3d->prog.fs, delete_from_cache_if_matches(v3d->fs_cache, &v3d->prog.fs,
entry, so); entry, so);
...@@ -673,7 +672,6 @@ v3d_program_fini(struct pipe_context *pctx) ...@@ -673,7 +672,6 @@ v3d_program_fini(struct pipe_context *pctx)
{ {
struct v3d_context *v3d = v3d_context(pctx); struct v3d_context *v3d = v3d_context(pctx);
struct hash_entry *entry;
hash_table_foreach(v3d->fs_cache, entry) { hash_table_foreach(v3d->fs_cache, entry) {
struct v3d_compiled_shader *shader = entry->data; struct v3d_compiled_shader *shader = entry->data;
v3d_bo_unreference(&shader->bo); v3d_bo_unreference(&shader->bo);
......
...@@ -42,7 +42,6 @@ vc4_flush(struct pipe_context *pctx) ...@@ -42,7 +42,6 @@ vc4_flush(struct pipe_context *pctx)
{ {
struct vc4_context *vc4 = vc4_context(pctx); struct vc4_context *vc4 = vc4_context(pctx);
struct hash_entry *entry;
hash_table_foreach(vc4->jobs, entry) { hash_table_foreach(vc4->jobs, entry) {
struct vc4_job *job = entry->data; struct vc4_job *job = entry->data;
vc4_job_submit(vc4, job); vc4_job_submit(vc4, job);
......
...@@ -118,7 +118,6 @@ vc4_flush_jobs_reading_resource(struct vc4_context *vc4, ...@@ -118,7 +118,6 @@ vc4_flush_jobs_reading_resource(struct vc4_context *vc4,
vc4_flush_jobs_writing_resource(vc4, prsc); vc4_flush_jobs_writing_resource(vc4, prsc);
struct hash_entry *entry;
hash_table_foreach(vc4->jobs, entry) { hash_table_foreach(vc4->jobs, entry) {
struct vc4_job *job = entry->data; struct vc4_job *job = entry->data;
......
...@@ -2975,7 +2975,6 @@ vc4_shader_state_delete(struct pipe_context *pctx, void *hwcso) ...@@ -2975,7 +2975,6 @@ vc4_shader_state_delete(struct pipe_context *pctx, void *hwcso)
struct vc4_context *vc4 = vc4_context(pctx); struct vc4_context *vc4 = vc4_context(pctx);
struct vc4_uncompiled_shader *so = hwcso; struct vc4_uncompiled_shader *so = hwcso;
struct hash_entry *entry;
hash_table_foreach(vc4->fs_cache, entry) { hash_table_foreach(vc4->fs_cache, entry) {
delete_from_cache_if_matches(vc4->fs_cache, &vc4->prog.fs, delete_from_cache_if_matches(vc4->fs_cache, &vc4->prog.fs,
entry, so); entry, so);
......
...@@ -173,8 +173,6 @@ qir_setup_def(struct vc4_compile *c, struct qblock *block, int ip, ...@@ -173,8 +173,6 @@ qir_setup_def(struct vc4_compile *c, struct qblock *block, int ip,
static void static void
sf_state_clear(struct hash_table *partial_update_ht) sf_state_clear(struct hash_table *partial_update_ht)
{ {
struct hash_entry *entry;
hash_table_foreach(partial_update_ht, entry) { hash_table_foreach(partial_update_ht, entry) {
struct partial_update_state *state = entry->data; struct partial_update_state *state = entry->data;
......
...@@ -136,7 +136,6 @@ qir_lower_uniforms(struct vc4_compile *c) ...@@ -136,7 +136,6 @@ qir_lower_uniforms(struct vc4_compile *c)
*/ */
uint32_t max_count = 0; uint32_t max_count = 0;
uint32_t max_index = 0; uint32_t max_index = 0;
struct hash_entry *entry;
hash_table_foreach(ht, entry) { hash_table_foreach(ht, entry) {
uint32_t count = (uintptr_t)entry->data; uint32_t count = (uintptr_t)entry->data;
uint32_t index = (uintptr_t)entry->key - 1; uint32_t index = (uintptr_t)entry->key - 1;
......
...@@ -702,8 +702,6 @@ void gen_spec_destroy(struct gen_spec *spec) ...@@ -702,8 +702,6 @@ void gen_spec_destroy(struct gen_spec *spec)
struct gen_group * struct gen_group *
gen_spec_find_instruction(struct gen_spec *spec, const uint32_t *p) gen_spec_find_instruction(struct gen_spec *spec, const uint32_t *p)
{ {
struct hash_entry *entry;
hash_table_foreach(spec->commands, entry) { hash_table_foreach(spec->commands, entry) {
struct gen_group *command = entry->data; struct gen_group *command = entry->data;
uint32_t opcode = *p & command->opcode_mask; uint32_t opcode = *p & command->opcode_mask;
......
...@@ -245,7 +245,6 @@ brw_nir_analyze_ubo_ranges(const struct brw_compiler *compiler, ...@@ -245,7 +245,6 @@ brw_nir_analyze_ubo_ranges(const struct brw_compiler *compiler,
struct util_dynarray ranges; struct util_dynarray ranges;
util_dynarray_init(&ranges, mem_ctx); util_dynarray_init(&ranges, mem_ctx);
struct hash_entry *entry;
hash_table_foreach(state.blocks, entry) { hash_table_foreach(state.blocks, entry) {
const int b = entry->hash - 1; const int b = entry->hash - 1;
const struct ubo_block_info *info = entry->data; const struct ubo_block_info *info = entry->data;
......
...@@ -839,7 +839,6 @@ display_registers_window(struct window *win) ...@@ -839,7 +839,6 @@ display_registers_window(struct window *win)
filter.Draw(); filter.Draw();
ImGui::BeginChild(ImGui::GetID("##block")); ImGui::BeginChild(ImGui::GetID("##block"));
struct hash_entry *entry;
hash_table_foreach(context.file->spec->registers_by_name, entry) { hash_table_foreach(context.file->spec->registers_by_name, entry) {
struct gen_group *reg = (struct gen_group *) entry->data; struct gen_group *reg = (struct gen_group *) entry->data;
if (filter.PassFilter(reg->name) && if (filter.PassFilter(reg->name) &&
...@@ -895,7 +894,6 @@ display_commands_window(struct window *win) ...@@ -895,7 +894,6 @@ display_commands_window(struct window *win)
if (ImGui::Button("Dwords")) show_dwords ^= 1; if (ImGui::Button("Dwords")) show_dwords ^= 1;
ImGui::BeginChild(ImGui::GetID("##block")); ImGui::BeginChild(ImGui::GetID("##block"));
struct hash_entry *entry;
hash_table_foreach(context.file->spec->commands, entry) { hash_table_foreach(context.file->spec->commands, entry) {
struct gen_group *cmd = (struct gen_group *) entry->data; struct gen_group *cmd = (struct gen_group *) entry->data;
if ((cmd_filter.PassFilter(cmd->name) && if ((cmd_filter.PassFilter(cmd->name) &&
......
...@@ -237,7 +237,6 @@ anv_pipeline_cache_finish(struct anv_pipeline_cache *cache) ...@@ -237,7 +237,6 @@ anv_pipeline_cache_finish(struct anv_pipeline_cache *cache)
* going away, the shader cache has to hold a reference to all shader * going away, the shader cache has to hold a reference to all shader
* binaries it contains. We unref them when we destroy the cache. * binaries it contains. We unref them when we destroy the cache.
*/ */
struct hash_entry *entry;
hash_table_foreach(cache->cache, entry) hash_table_foreach(cache->cache, entry)
anv_shader_bin_unref(cache->device, entry->data); anv_shader_bin_unref(cache->device, entry->data);
...@@ -499,7 +498,6 @@ VkResult anv_GetPipelineCacheData( ...@@ -499,7 +498,6 @@ VkResult anv_GetPipelineCacheData(
VkResult result = VK_SUCCESS; VkResult result = VK_SUCCESS;
if (cache->cache) { if (cache->cache) {
struct hash_entry *entry;
hash_table_foreach(cache->cache, entry) { hash_table_foreach(cache->cache, entry) {
struct anv_shader_bin *shader = entry->data; struct anv_shader_bin *shader = entry->data;
...@@ -540,7 +538,6 @@ VkResult anv_MergePipelineCaches( ...@@ -540,7 +538,6 @@ VkResult anv_MergePipelineCaches(
if (!src->cache) if (!src->cache)
continue; continue;
struct hash_entry *entry;
hash_table_foreach(src->cache, entry) { hash_table_foreach(src->cache, entry) {
struct anv_shader_bin *bin = entry->data; struct anv_shader_bin *bin = entry->data;
assert(bin); assert(bin);
......
...@@ -1848,7 +1848,6 @@ static bool ...@@ -1848,7 +1848,6 @@ static bool
kernel_has_dynamic_config_support(struct brw_context *brw) kernel_has_dynamic_config_support(struct brw_context *brw)
{ {
__DRIscreen *screen = brw->screen->driScrnPriv; __DRIscreen *screen = brw->screen->driScrnPriv;
struct hash_entry *entry;
hash_table_foreach(brw->perfquery.oa_metrics_table, entry) { hash_table_foreach(brw->perfquery.oa_metrics_table, entry) {
struct brw_perf_query_info *query = entry->data; struct brw_perf_query_info *query = entry->data;
...@@ -1872,7 +1871,6 @@ static void ...@@ -1872,7 +1871,6 @@ static void
init_oa_configs(struct brw_context *brw) init_oa_configs(struct brw_context *brw)
{ {
__DRIscreen *screen = brw->screen->driScrnPriv; __DRIscreen *screen = brw->screen->driScrnPriv;
struct hash_entry *entry;
hash_table_foreach(brw->perfquery.oa_metrics_table, entry) { hash_table_foreach(brw->perfquery.oa_metrics_table, entry) {
const struct brw_perf_query_info *query = entry->data; const struct brw_perf_query_info *query = entry->data;
......
...@@ -979,11 +979,9 @@ intel_renderbuffer_move_to_temp(struct brw_context *brw, ...@@ -979,11 +979,9 @@ intel_renderbuffer_move_to_temp(struct brw_context *brw,
void void
brw_cache_sets_clear(struct brw_context *brw) brw_cache_sets_clear(struct brw_context *brw)
{ {
struct hash_entry *render_entry;
hash_table_foreach(brw->render_cache, render_entry) hash_table_foreach(brw->render_cache, render_entry)
_mesa_hash_table_remove(brw->render_cache, render_entry); _mesa_hash_table_remove(brw->render_cache, render_entry);
struct set_entry *depth_entry;
set_foreach(brw->depth_cache, depth_entry) set_foreach(brw->depth_cache, depth_entry)