util/tests: initialize variable
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 15 Apr 2020 20:22:27 +0000 (22:22 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 14:48:40 +0000 (14:48 +0000)
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@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>

src/util/tests/hash_table/random_entry.c

index 4902a999de6a57f26b9b2e97514e2522d262cf83..75c4ef652fc17f84d445f227ed134777ab866bae 100644 (file)
@@ -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;