util: use C99 declaration in the for-loop hash_table_foreach() macro
authorEric Engestrom <eric@engestrom.ch>
Sat, 20 Oct 2018 17:00:08 +0000 (18:00 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Thu, 25 Oct 2018 11:43:18 +0000 (12:43 +0100)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
36 files changed:
src/amd/common/ac_nir_to_llvm.c
src/broadcom/compiler/vir_live_variables.c
src/broadcom/compiler/vir_lower_uniforms.c
src/compiler/glsl/ast_to_hir.cpp
src/compiler/glsl/link_uniform_blocks.cpp
src/compiler/glsl/opt_constant_propagation.cpp
src/compiler/glsl/opt_constant_variable.cpp
src/compiler/glsl/opt_dead_code.cpp
src/compiler/glsl/tests/array_refcount_test.cpp
src/compiler/nir/nir_lower_global_vars_to_local.c
src/compiler/nir/nir_lower_io_arrays_to_elements.c
src/compiler/nir/nir_lower_io_to_scalar.c
src/compiler/nir/nir_opt_copy_prop_vars.c
src/compiler/nir/nir_validate.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.c
src/gallium/drivers/freedreno/ir3/ir3_cache.c
src/gallium/drivers/v3d/v3d_context.c
src/gallium/drivers/v3d/v3d_job.c
src/gallium/drivers/v3d/v3d_program.c
src/gallium/drivers/vc4/vc4_context.c
src/gallium/drivers/vc4/vc4_job.c
src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/vc4/vc4_qir_live_variables.c
src/gallium/drivers/vc4/vc4_qir_lower_uniforms.c
src/intel/common/gen_decoder.c
src/intel/compiler/brw_nir_analyze_ubo_ranges.c
src/intel/tools/aubinator_viewer.cpp
src/intel/vulkan/anv_pipeline_cache.c
src/mesa/drivers/dri/i965/brw_performance_query.c
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/main/hash.c
src/util/hash_table.c
src/util/hash_table.h
src/util/tests/hash_table/clear.c
src/util/tests/hash_table/collision.c
src/vulkan/wsi/wsi_common_x11.c

index ee75e2890dd4fd300289b572f9ada43f0f25a0c4..5ab81987d08d04f2c937caa497662f2ed0631479 100644 (file)
@@ -3635,7 +3635,6 @@ static void visit_post_phi(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) {
                visit_post_phi(ctx, (nir_phi_instr*)entry->key,
                               (LLVMValueRef)entry->data);
index 019cde145673bd1cf5eedc07775836dbb56a89fa..2879e23b43c3f1210884495abff44df09a9f13df 100644 (file)
@@ -180,8 +180,6 @@ vir_setup_def(struct v3d_compile *c, struct qblock *block, int ip,
 static void
 sf_state_clear(struct hash_table *partial_update_ht)
 {
-        struct hash_entry *entry;
-
         hash_table_foreach(partial_update_ht, entry) {
                 struct partial_update_state *state = entry->data;
 
index 1e900404c9c937949fd76a2b3c218f08f0a4147d..570e601a66c8da598c2ef772113ea5f9492def18 100644 (file)
@@ -134,7 +134,6 @@ vir_lower_uniforms(struct v3d_compile *c)
                  */
                 uint32_t max_count = 0;
                 uint32_t max_index = 0;
-                struct hash_entry *entry;
                 hash_table_foreach(ht, entry) {
                         uint32_t count = (uintptr_t)entry->data;
                         uint32_t index = (uintptr_t)entry->key - 1;
index 97329e5be24045c65dfab39367414f74045a216d..084b7021a9f22af83a0f1eb2af9ea4e09955d290 100644 (file)
@@ -6645,7 +6645,6 @@ ast_case_statement_list::hir(exec_list *instructions,
     * if default should be chosen or not.
     */
    if (!default_case.is_empty()) {
-      struct hash_entry *entry;
       ir_factory body(instructions, state);
 
       ir_expression *cmp = NULL;
index 0ab9687b7fbe4d27f3f5ca48ff6d5fbbf4cf4abe..0b8905862986615006822138585605cc2d906194 100644 (file)
@@ -362,7 +362,6 @@ create_buffer_blocks(void *mem_ctx, struct gl_context *ctx,
                       ctx->Const.UseSTD430AsDefaultPacking);
 
    unsigned i = 0;
-   struct hash_entry *entry;
    hash_table_foreach (block_hash, entry) {
       const struct link_uniform_block_active *const b =
          (const struct link_uniform_block_active *) entry->data;
@@ -429,7 +428,6 @@ link_uniform_blocks(void *mem_ctx,
    unsigned num_ubo_variables = 0;
    unsigned num_ssbo_variables = 0;
    count_block_size block_size;
-   struct hash_entry *entry;
 
    hash_table_foreach (block_hash, entry) {
       struct link_uniform_block_active *const b =
index a603c9fbbf96ba3cba0846e53829c181b6b2578e..642bd641ed62459c97a26fa7ab27f36bc533c53b 100644 (file)
@@ -380,7 +380,6 @@ ir_constant_propagation_visitor::visit_enter(ir_if *ir)
       acp->make_empty();
       killed_all = true;
    } else {
-      hash_entry *htk;
       hash_table_foreach(new_kills, htk)
          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)
    this->acp = orig_acp;
    this->killed_all = this->killed_all || orig_killed_all;
 
-   hash_entry *htk;
    hash_table_foreach(new_kills, htk) {
       kill((ir_variable *) htk->key, (uintptr_t) htk->data);
    }
index 914b46004c15c354c49b552e312a2076fceee71c..15d8cf7cdfd1a2dccb2ac2351910caf48e9920e1 100644 (file)
@@ -190,7 +190,6 @@ do_constant_variable(exec_list *instructions)
                                   _mesa_key_pointer_equal);
    v.run(instructions);
 
-   struct hash_entry *hte;
    hash_table_foreach(v.ht, hte) {
       struct assignment_entry *entry = (struct assignment_entry *) hte->data;
 
index 75e668ae46da727dfd3ad0f169fa828daeafe5ab..1eff3f2fd143c2da2603c0381c5fd6aab80ebe01 100644 (file)
@@ -50,7 +50,6 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
 
    v.run(instructions);
 
-   struct hash_entry *e;
    hash_table_foreach(v.ht, e) {
       ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)e->data;
 
index 0d8f4521caed02396ae36ce1a98c6236e45c8bcb..45c204dc2f8a8e38555845ba1548ab81bff1c6b0 100644 (file)
@@ -160,7 +160,6 @@ validate_variables_in_hash_table(struct hash_table *ht,
 
    va_end(args);
 
-   struct hash_entry *entry;
    hash_table_foreach(ht, entry) {
       const ir_instruction *const ir = (ir_instruction *) entry->key;
       const ir_variable *const v = ir->as_variable();
index d441215a44d6aceed1671f059d1a60ff67903848..be99cf9ad02c84c6dd26cf52832604da3dfb3048 100644 (file)
@@ -85,7 +85,6 @@ nir_lower_global_vars_to_local(nir_shader *shader)
       }
    }
 
-   struct hash_entry *entry;
    hash_table_foreach(var_func_table, entry) {
       nir_variable *var = (void *)entry->key;
       nir_function_impl *impl = entry->data;
index 432524c2feb8a68b789d8d40af4b144d0cf64ba9..f0bc487d6bec720378401550b62f0f486ac9cc9f 100644 (file)
@@ -359,7 +359,6 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
                                   patch_indirects, split_inputs, true);
 
       /* Remove old input from the shaders inputs list */
-      struct hash_entry *entry;
       hash_table_foreach(split_inputs, entry) {
          nir_variable *var = (nir_variable *) entry->key;
          exec_node_remove(&var->node);
@@ -369,7 +368,6 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
    }
 
    /* Remove old output from the shaders outputs list */
-   struct hash_entry *entry;
    hash_table_foreach(split_outputs, entry) {
       nir_variable *var = (nir_variable *) entry->key;
       exec_node_remove(&var->node);
@@ -406,7 +404,6 @@ nir_lower_io_arrays_to_elements(nir_shader *producer, nir_shader *consumer)
                                patch_indirects, split_inputs, false);
 
    /* Remove old input from the shaders inputs list */
-   struct hash_entry *entry;
    hash_table_foreach(split_inputs, entry) {
       nir_variable *var = (nir_variable *) entry->key;
       exec_node_remove(&var->node);
index f0c2a6a95d6d396cbfa02e6dd44952d727d53d7f..2b98e298cce4d1048d094c2bc5c71b299263fc2f 100644 (file)
@@ -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 */
-   struct hash_entry *entry;
    hash_table_foreach(split_inputs, entry) {
       nir_variable *var = (nir_variable *) entry->key;
       exec_node_remove(&var->node);
index b664ef27d356c21264296e803a9560c284bc49ef..7a21ad56c79aef99989f57aab924ed41772c9a70 100644 (file)
@@ -201,7 +201,6 @@ gather_vars_written(struct copy_prop_var_state *state,
       /* Merge new information to the parent control flow node. */
       if (written) {
          written->modes |= new_written->modes;
-         struct hash_entry *new_entry;
          hash_table_foreach(new_written->derefs, new_entry) {
             struct hash_entry *old_entry =
                _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,
       }
    }
 
-   struct hash_entry *entry;
    hash_table_foreach (written->derefs, entry) {
       nir_deref_instr *deref_written = (nir_deref_instr *)entry->key;
       kill_aliases(copies, deref_written, (uintptr_t)entry->data);
index 1852224b520bb20267f1eacea454d17c65c8f503..cf7ef91f08c6c850e28b645bb57b112270d76c2c 100644 (file)
@@ -727,7 +727,6 @@ validate_block(nir_block *block, validate_state *state)
       }
    }
 
-   struct set_entry *entry;
    set_foreach(block->predecessors, entry) {
       const nir_block *pred = entry->key;
       validate_assert(state, pred->successors[0] == block ||
@@ -936,7 +935,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
 
    if (reg_state->uses->entries != 0) {
       printf("extra entries in register uses:\n");
-      struct set_entry *entry;
       set_foreach(reg_state->uses, entry)
          printf("%p\n", entry->key);
 
@@ -951,7 +949,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
 
    if (reg_state->if_uses->entries != 0) {
       printf("extra entries in register if_uses:\n");
-      struct set_entry *entry;
       set_foreach(reg_state->if_uses, entry)
          printf("%p\n", entry->key);
 
@@ -966,7 +963,6 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
 
    if (reg_state->defs->entries != 0) {
       printf("extra entries in register defs:\n");
-      struct set_entry *entry;
       set_foreach(reg_state->defs, entry)
          printf("%p\n", entry->key);
 
@@ -1033,7 +1029,6 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state)
 
    if (def_state->uses->entries != 0) {
       printf("extra entries in SSA def uses:\n");
-      struct set_entry *entry;
       set_foreach(def_state->uses, entry)
          printf("%p\n", entry->key);
 
@@ -1048,7 +1043,6 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state)
 
    if (def_state->if_uses->entries != 0) {
       printf("extra entries in SSA def uses:\n");
-      struct set_entry *entry;
       set_foreach(def_state->if_uses, entry)
          printf("%p\n", entry->key);
 
@@ -1157,7 +1151,6 @@ dump_errors(validate_state *state)
    if (_mesa_hash_table_num_entries(errors) > 0) {
       fprintf(stderr, "%d additional errors:\n",
               _mesa_hash_table_num_entries(errors));
-      struct hash_entry *entry;
       hash_table_foreach(errors, entry) {
          fprintf(stderr, "%s\n", (char *)entry->data);
       }
index a48c4ee1ad0b4ff12e05ae06a692283bd01cd5aa..0fa20e01e67334e9b7350a690fa0157e2fb27e26 100644 (file)
@@ -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_sampler_stateobj *samp = hwcso;
 
-       struct hash_entry *entry;
        hash_table_foreach(fd6_ctx->tex_cache, entry) {
                struct fd6_texture_state *state = entry->data;
 
@@ -344,7 +343,6 @@ fd6_sampler_view_destroy(struct pipe_context *pctx,
        struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx));
        struct fd6_pipe_sampler_view *view = fd6_pipe_sampler_view(_view);
 
-       struct hash_entry *entry;
        hash_table_foreach(fd6_ctx->tex_cache, entry) {
                struct fd6_texture_state *state = entry->data;
 
@@ -508,7 +506,6 @@ fd6_texture_fini(struct pipe_context *pctx)
 {
        struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx));
 
-       struct hash_entry *entry;
        hash_table_foreach(fd6_ctx->tex_cache, entry) {
                fd6_texture_state_destroy(entry->data);
        }
index 05edeed468184a172a3905c3172acb5080b3097d..a198ef4c769f17508113433907dedd1b08a0bd73 100644 (file)
@@ -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)
 {
        /* _mesa_hash_table_destroy is so *almost* useful.. */
-       struct hash_entry *entry;
        hash_table_foreach(cache->ht, entry) {
                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,
  */
 void ir3_cache_invalidate(struct ir3_cache *cache, void *stobj)
 {
-       struct hash_entry *entry;
        hash_table_foreach(cache->ht, entry) {
                const struct ir3_cache_key *key = entry->key;
                if ((key->fs == stobj) || (key->vs == stobj)) {
index 2fd2fa0bbf3ef84f5382b70b0657d47bf2bb8ca4..12741b578e3524bf12251a98744ef448b654dd23 100644 (file)
@@ -43,7 +43,6 @@ v3d_flush(struct pipe_context *pctx)
 {
         struct v3d_context *v3d = v3d_context(pctx);
 
-        struct hash_entry *entry;
         hash_table_foreach(v3d->jobs, entry) {
                 struct v3d_job *job = entry->data;
                 v3d_job_submit(v3d, job);
index 3645305f4f0878fbb1d19262426cf371981d51d9..8ba5c8996dc3b920b9f8ab3bb33c1f17de109131 100644 (file)
@@ -47,8 +47,6 @@ remove_from_ht(struct hash_table *ht, void *key)
 static void
 v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
 {
-        struct set_entry *entry;
-
         set_foreach(job->bos, entry) {
                 struct v3d_bo *bo = (struct v3d_bo *)entry->key;
                 v3d_bo_unreference(&bo);
@@ -57,8 +55,6 @@ v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
         remove_from_ht(v3d->jobs, &job->key);
 
         if (job->write_prscs) {
-                struct set_entry *entry;
-
                 set_foreach(job->write_prscs, entry) {
                         const struct pipe_resource *prsc = entry->key;
 
@@ -175,7 +171,6 @@ v3d_flush_jobs_reading_resource(struct v3d_context *v3d,
 
         v3d_flush_jobs_writing_resource(v3d, prsc);
 
-        struct hash_entry *entry;
         hash_table_foreach(v3d->jobs, entry) {
                 struct v3d_job *job = entry->data;
 
@@ -351,7 +346,6 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
                                                 stderr,
                                                 V3D_DEBUG & V3D_DEBUG_CL);
 
-        struct set_entry *entry;
         set_foreach(job->bos, entry) {
                 struct v3d_bo *bo = (void *)entry->key;
                 char *name = ralloc_asprintf(NULL, "%s_0x%x",
index e9fae77d5c0712026a75bc3a14fd245a30dac04e..1d4b0bb20804f4a8bd45c53abd2641ddb091db89 100644 (file)
@@ -618,7 +618,6 @@ v3d_shader_state_delete(struct pipe_context *pctx, void *hwcso)
         struct v3d_context *v3d = v3d_context(pctx);
         struct v3d_uncompiled_shader *so = hwcso;
 
-        struct hash_entry *entry;
         hash_table_foreach(v3d->fs_cache, entry) {
                 delete_from_cache_if_matches(v3d->fs_cache, &v3d->prog.fs,
                                              entry, so);
@@ -673,7 +672,6 @@ v3d_program_fini(struct pipe_context *pctx)
 {
         struct v3d_context *v3d = v3d_context(pctx);
 
-        struct hash_entry *entry;
         hash_table_foreach(v3d->fs_cache, entry) {
                 struct v3d_compiled_shader *shader = entry->data;
                 v3d_bo_unreference(&shader->bo);
index 9ff39c2655f8259f4c050d4c7ba2e193043f837a..ffd7d4c8555fe72adefb4a457a3b5f2926e7675a 100644 (file)
@@ -42,7 +42,6 @@ vc4_flush(struct pipe_context *pctx)
 {
         struct vc4_context *vc4 = vc4_context(pctx);
 
-        struct hash_entry *entry;
         hash_table_foreach(vc4->jobs, entry) {
                 struct vc4_job *job = entry->data;
                 vc4_job_submit(vc4, job);
index 725697658475f2009d059f508d54b75796f9f54f..f38c464754117703f5f3fe891f48656134442ff4 100644 (file)
@@ -118,7 +118,6 @@ vc4_flush_jobs_reading_resource(struct vc4_context *vc4,
 
         vc4_flush_jobs_writing_resource(vc4, prsc);
 
-        struct hash_entry *entry;
         hash_table_foreach(vc4->jobs, entry) {
                 struct vc4_job *job = entry->data;
 
index f734d1210529c57e8787509ff6aadde650d35d39..4896833177a941c2d28e5fb9afb7a352eb05cb83 100644 (file)
@@ -2975,7 +2975,6 @@ vc4_shader_state_delete(struct pipe_context *pctx, void *hwcso)
         struct vc4_context *vc4 = vc4_context(pctx);
         struct vc4_uncompiled_shader *so = hwcso;
 
-        struct hash_entry *entry;
         hash_table_foreach(vc4->fs_cache, entry) {
                 delete_from_cache_if_matches(vc4->fs_cache, &vc4->prog.fs,
                                              entry, so);
index 7108b3ee9b652ac9e2c656c344eb5906de0719f3..5629ce044d9d6da60eb96d4a28a0b359f6232457 100644 (file)
@@ -173,8 +173,6 @@ qir_setup_def(struct vc4_compile *c, struct qblock *block, int ip,
 static void
 sf_state_clear(struct hash_table *partial_update_ht)
 {
-        struct hash_entry *entry;
-
         hash_table_foreach(partial_update_ht, entry) {
                 struct partial_update_state *state = entry->data;
 
index ad19f06d31b98b3ae3134cb603455792ac4e83e5..d7c22e75c2938fc52513fb64c8deb9a7627d7a60 100644 (file)
@@ -136,7 +136,6 @@ qir_lower_uniforms(struct vc4_compile *c)
                  */
                 uint32_t max_count = 0;
                 uint32_t max_index = 0;
-                struct hash_entry *entry;
                 hash_table_foreach(ht, entry) {
                         uint32_t count = (uintptr_t)entry->data;
                         uint32_t index = (uintptr_t)entry->key - 1;
index 5f6e7a0b808e4d53797dd1e856195bf15a648388..f24d3ccf15d163291a04252ba3303dddb56cdd1c 100644 (file)
@@ -702,8 +702,6 @@ void gen_spec_destroy(struct gen_spec *spec)
 struct gen_group *
 gen_spec_find_instruction(struct gen_spec *spec, const uint32_t *p)
 {
-   struct hash_entry *entry;
-
    hash_table_foreach(spec->commands, entry) {
       struct gen_group *command = entry->data;
       uint32_t opcode = *p & command->opcode_mask;
index cfa531675fc148d55e74aab431cfddd6a8b89f9c..2dfc7b8ddd6c7994486a2278cee3ed581194e956 100644 (file)
@@ -245,7 +245,6 @@ brw_nir_analyze_ubo_ranges(const struct brw_compiler *compiler,
    struct util_dynarray ranges;
    util_dynarray_init(&ranges, mem_ctx);
 
-   struct hash_entry *entry;
    hash_table_foreach(state.blocks, entry) {
       const int b = entry->hash - 1;
       const struct ubo_block_info *info = entry->data;
index d5d289032e8f589538fcecf217a020ec0a90a53a..27ef4f7e99b5b0c2a4e7b65594587d89443499ed 100644 (file)
@@ -839,7 +839,6 @@ display_registers_window(struct window *win)
    filter.Draw();
 
    ImGui::BeginChild(ImGui::GetID("##block"));
-   struct hash_entry *entry;
    hash_table_foreach(context.file->spec->registers_by_name, entry) {
       struct gen_group *reg = (struct gen_group *) entry->data;
       if (filter.PassFilter(reg->name) &&
@@ -895,7 +894,6 @@ display_commands_window(struct window *win)
    if (ImGui::Button("Dwords")) show_dwords ^= 1;
 
    ImGui::BeginChild(ImGui::GetID("##block"));
-   struct hash_entry *entry;
    hash_table_foreach(context.file->spec->commands, entry) {
       struct gen_group *cmd = (struct gen_group *) entry->data;
       if ((cmd_filter.PassFilter(cmd->name) &&
index 3efa427279d6b29d0c685de9d37c86c8b0a91658..eac058fb47f2b0cc2759fab5ef67fa8ea67e8feb 100644 (file)
@@ -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
        * binaries it contains.  We unref them when we destroy the cache.
        */
-      struct hash_entry *entry;
       hash_table_foreach(cache->cache, entry)
          anv_shader_bin_unref(cache->device, entry->data);
 
@@ -499,7 +498,6 @@ VkResult anv_GetPipelineCacheData(
 
    VkResult result = VK_SUCCESS;
    if (cache->cache) {
-      struct hash_entry *entry;
       hash_table_foreach(cache->cache, entry) {
          struct anv_shader_bin *shader = entry->data;
 
@@ -540,7 +538,6 @@ VkResult anv_MergePipelineCaches(
       if (!src->cache)
          continue;
 
-      struct hash_entry *entry;
       hash_table_foreach(src->cache, entry) {
          struct anv_shader_bin *bin = entry->data;
          assert(bin);
index ff9272999d1b21a23895fb45dc616bff4654b405..10e3d024f171b1587c67233104c999a31d426c11 100644 (file)
@@ -1848,7 +1848,6 @@ static bool
 kernel_has_dynamic_config_support(struct brw_context *brw)
 {
    __DRIscreen *screen = brw->screen->driScrnPriv;
-   struct hash_entry *entry;
 
    hash_table_foreach(brw->perfquery.oa_metrics_table, entry) {
       struct brw_perf_query_info *query = entry->data;
@@ -1872,7 +1871,6 @@ static void
 init_oa_configs(struct brw_context *brw)
 {
    __DRIscreen *screen = brw->screen->driScrnPriv;
-   struct hash_entry *entry;
 
    hash_table_foreach(brw->perfquery.oa_metrics_table, entry) {
       const struct brw_perf_query_info *query = entry->data;
index 968d61014e524cdfda8f7f4fe4447c4fed6de93f..2bbbc34114c3935e3eccc1394441c2a19f4e3ea1 100644 (file)
@@ -979,11 +979,9 @@ intel_renderbuffer_move_to_temp(struct brw_context *brw,
 void
 brw_cache_sets_clear(struct brw_context *brw)
 {
-   struct hash_entry *render_entry;
    hash_table_foreach(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)
       _mesa_set_remove(brw->depth_cache, depth_entry);
 }
index 9a6d5ed5edbd1942c29dccd5dd5a93ca6c21328b..902c5efc65a670ff8f7b273ed8313b960bede7d3 100644 (file)
@@ -283,8 +283,6 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table,
                     void (*callback)(GLuint key, void *data, void *userData),
                     void *userData)
 {
-   struct hash_entry *entry;
-
    assert(callback);
    _mesa_HashLockMutex(table);
    table->InDeleteAll = GL_TRUE;
@@ -316,7 +314,6 @@ hash_walk_unlocked(const struct _mesa_HashTable *table,
    assert(table);
    assert(callback);
 
-   struct hash_entry *entry;
    hash_table_foreach(table->ht, entry) {
       callback((uintptr_t)entry->key, entry->data, userData);
    }
index 7ee9e18a1fcaff149afd5912ffa6197cbf06258c..fc152f84a4dde7d7a2c7d1229234d9bde2eef149 100644 (file)
@@ -177,8 +177,6 @@ _mesa_hash_table_destroy(struct hash_table *ht,
       return;
 
    if (delete_function) {
-      struct hash_entry *entry;
-
       hash_table_foreach(ht, entry) {
          delete_function(entry);
       }
@@ -284,7 +282,7 @@ static void
 _mesa_hash_table_rehash(struct hash_table *ht, unsigned new_size_index)
 {
    struct hash_table old_ht;
-   struct hash_entry *table, *entry;
+   struct hash_entry *table;
 
    if (new_size_index >= ARRAY_SIZE(hash_sizes))
       return;
index 40ff041e94ba1bd57bc682307e1f2778865f54e6..d89fc1dc1c87028722e0b2d3ece0bb4dc8ac2527 100644 (file)
@@ -139,9 +139,9 @@ _mesa_fnv32_1a_accumulate_block(uint32_t hash, const void *data, size_t size)
  * an entry's data with the deleted marker), but not against insertion
  * (which may rehash the table, making entry a dangling pointer).
  */
-#define hash_table_foreach(ht, entry)                   \
-   for (entry = _mesa_hash_table_next_entry(ht, NULL);  \
-        entry != NULL;                                  \
+#define hash_table_foreach(ht, entry)                                      \
+   for (struct hash_entry *entry = _mesa_hash_table_next_entry(ht, NULL);  \
+        entry != NULL;                                                     \
         entry = _mesa_hash_table_next_entry(ht, entry))
 
 static inline void
@@ -151,8 +151,6 @@ hash_table_call_foreach(struct hash_table *ht,
                                          void *closure),
                         void *closure)
 {
-   struct hash_entry *entry;
-
    hash_table_foreach(ht, entry)
       callback(entry->key, entry->data, closure);
 }
index 526700bfb0ffa72fd334ad49374085f2ab69ec8b..3d6bf80c0cf8b7747e982f474d814ae9613a4275 100644 (file)
@@ -53,7 +53,6 @@ static void delete_function(struct hash_entry *entry)
 int main()
 {
    struct hash_table *ht;
-   struct hash_entry *entry;
    const uint32_t size = 1000;
    bool flags[size];
    uint32_t i;
index 69a4c29eca7a8cb0757a1ba1b7195106ab63a745..ba8913281fbd5aff63eafb0cb9defc7203523c94 100644 (file)
@@ -37,7 +37,7 @@ main(int argc, char **argv)
    const char *str1 = "test1";
    const char *str2 = "test2";
    const char *str3 = "test3";
-   struct hash_entry *entry1, *entry2, *search_entry;
+   struct hash_entry *entry1, *entry2;
    uint32_t bad_hash = 5;
    int i;
 
index 16a544ec775cb612e4c11db53818159e1b822c84..6eb72827eda5a6ce67c7767958d15118e9c42601 100644 (file)
@@ -1545,7 +1545,6 @@ wsi_x11_finish_wsi(struct wsi_device *wsi_device,
       (struct wsi_x11 *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_XCB];
 
    if (wsi) {
-      struct hash_entry *entry;
       hash_table_foreach(wsi->connections, entry)
          wsi_x11_connection_destroy(wsi_device, entry->data);