st/nine: Fix incompatible-pointer-types-discards-qualifiers errors.
authorVinson Lee <vlee@freedesktop.org>
Mon, 2 Mar 2020 05:38:18 +0000 (21:38 -0800)
committerVinson Lee <vlee@freedesktop.org>
Mon, 9 Mar 2020 22:37:54 +0000 (15:37 -0700)
../src/gallium/state_trackers/nine/nine_ff.c:129:28: error: initializing 'struct nine_ff_vs_key *' with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    struct nine_ff_vs_key *vs = key;
                           ^    ~~~
../src/gallium/state_trackers/nine/nine_ff.c:145:28: error: initializing 'struct nine_ff_ps_key *' with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    struct nine_ff_ps_key *ps = key;
                           ^    ~~~

Fixes: fdd96578ef2d ("nine: Add state tracker nine for Direct3D9 (v3)")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Andre Heider <a.heider@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4015>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4015>

src/gallium/state_trackers/nine/nine_ff.c

index a97a83ff1c3968e5228ca33cb57552c1d43f43c5..16d0ab2ab5c9bc07ec245afdaa1ac4c08b251bd9 100644 (file)
@@ -126,7 +126,7 @@ struct nine_ff_ps_key
 
 static uint32_t nine_ff_vs_key_hash(const void *key)
 {
-    struct nine_ff_vs_key *vs = key;
+    const struct nine_ff_vs_key *vs = key;
     unsigned i;
     uint32_t hash = vs->value32[0];
     for (i = 1; i < ARRAY_SIZE(vs->value32); ++i)
@@ -142,7 +142,7 @@ static bool nine_ff_vs_key_comp(const void *key1, const void *key2)
 }
 static uint32_t nine_ff_ps_key_hash(const void *key)
 {
-    struct nine_ff_ps_key *ps = key;
+    const struct nine_ff_ps_key *ps = key;
     unsigned i;
     uint32_t hash = ps->value32[0];
     for (i = 1; i < ARRAY_SIZE(ps->value32); ++i)