Mesa (master): util/tests: initialize variable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 16 15:09:18 UTC 2020


Module: Mesa
Branch: master
Commit: c55fc3543537fdc7b402584a076eb87d258b4c51
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c55fc3543537fdc7b402584a076eb87d258b4c51

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Apr 15 22:22:27 2020 +0200

util/tests: initialize variable

This just silences a compiler-warning about a potentially uninitialized
variable. It's not uninitialized, but it's a bit hard for the compiler
to see. So let's just initialize it to zero.

Reviewed-by: Brian Paul <brianp at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>

---

 src/util/tests/hash_table/random_entry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/tests/hash_table/random_entry.c b/src/util/tests/hash_table/random_entry.c
index 4902a999de6..75c4ef652fc 100644
--- a/src/util/tests/hash_table/random_entry.c
+++ b/src/util/tests/hash_table/random_entry.c
@@ -58,7 +58,7 @@ main(int argc, char **argv)
    struct hash_table *ht;
    struct hash_entry *entry;
    uint32_t keys[SIZE];
-   uint32_t i, random_value;
+   uint32_t i, random_value = 0;
 
    (void) argc;
    (void) argv;



More information about the mesa-commit mailing list