loader: Fix improper cast warning.
authorJamie Madill <jmadill@chromium.org>
Wed, 8 Nov 2017 19:48:32 +0000 (14:48 -0500)
committerMark Lobodzinski <mark@lunarg.com>
Mon, 27 Nov 2017 22:30:19 +0000 (15:30 -0700)
warning C4057: 'function': 'LPBYTE' differs in indirection to slightly different base types

This was popping up in some Windows builds. Also add it to the list
of warnings enabled by default with MSVS.

Change-Id: I2703f2e57ba3fb33ec03fbc7b8324c75187abec6

CMakeLists.txt
loader/loader.c

index fdc63bd..785d6fc 100644 (file)
@@ -94,6 +94,8 @@ if(WIN32)
     # Warn about potentially uninitialized variables
     add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34701>")
     add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34703>")
+    # Warn about different indirection types.
+    add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34057>")
 endif()
 
 if(NOT WIN32)
index 8f954e0..ca6d571 100644 (file)
@@ -465,7 +465,7 @@ bool loaderGetDeviceRegistryEntry(const struct loader_instance *inst, char **reg
         value_name,
         NULL,
         &data_type,
-        manifest_path,
+        (BYTE *)manifest_path,
         &requiredSize
     );