On 11/22, Aaron Watry wrote:
disk_cache_get returns void*, but we were storing/comparing a char*.

Signed-off-by: Aaron Watry <awa...@gmail.com>
---
Note that this did, and still, segfaults for me when I actually run it...

Strange. It passes for me.


But at least the compiler is no longer complaining about the type mismatch.
src/compiler/glsl/tests/cache_test.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/tests/cache_test.c 
b/src/compiler/glsl/tests/cache_test.c
index 0ef05aa..c663e54 100644
--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -208,14 +208,14 @@ test_put_and_get(void)
   _mesa_sha1_compute(blob, sizeof(blob), blob_key);

   /* Ensure that disk_cache_get returns nothing before anything is added. */
-   result = disk_cache_get(cache, blob_key, &size);
+   result = (char*) disk_cache_get(cache, blob_key, &size);

void * is implicitly convertable to char *, so I think the code is fine
as is. Maybe if I saw the compiler warning.

"result" could be declared void * to begin with, and that would be fine.
I just tested it, and it seems to work.

Also, please use (char *) for casts and not (char*) in Mesa.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to