diff options
| author | Courtney Goeltzenleuchter <courtneygo@google.com> | 2015-12-17 09:53:29 -0700 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2015-12-17 12:09:38 -0700 |
| commit | d3cdaaf00f4295d3e095ddfa3713c9857ac3c139 (patch) | |
| tree | 58442349f0d7263f515cc27ca787b8bd194e58ea | |
| parent | bf56443a1e5f9b1f0de854aac3f24c10c62d0ea5 (diff) | |
| download | usermoji-d3cdaaf00f4295d3e095ddfa3713c9857ac3c139.tar.xz | |
demos: Fix compiler warnings
gcc complains that return result is unused. This change
prevents the warning and should be a no-op otherwise.
| -rw-r--r-- | demos/cube.c | 12 | ||||
| -rw-r--r-- | demos/tri.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/demos/cube.c b/demos/cube.c index 21516a0e..6230ef26 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -996,7 +996,7 @@ bool loadTexture(const char *filename, uint8_t *rgba_data, int32_t *width, int32_t *height) { FILE *fPtr = fopen(filename,"rb"); - char header[256], *cPtr; + char header[256], *cPtr, *tmp; if (!fPtr) return false; @@ -1020,7 +1020,8 @@ bool loadTexture(const char *filename, uint8_t *rgba_data, fclose(fPtr); return true; } - fgets(header, 256, fPtr); // Format + tmp = fgets(header, 256, fPtr); // Format + (void) tmp; if (cPtr == NULL || strncmp(header, "255\n", 3)) { fclose(fPtr); return false; @@ -1031,7 +1032,8 @@ bool loadTexture(const char *filename, uint8_t *rgba_data, uint8_t *rowPtr = rgba_data; for(int x = 0; x < *width; x++) { - fread(rowPtr, 3, 1, fPtr); + size_t s = fread(rowPtr, 3, 1, fPtr); + (void) s; rowPtr[3] = 255; /* Alpha of 1 */ rowPtr += 4; } @@ -1428,7 +1430,7 @@ static VkShaderModule demo_prepare_shader_module(struct demo* demo, { VkShaderModule module; VkShaderModuleCreateInfo moduleCreateInfo; - VkResult err; + VkResult U_ASSERT_ONLY err; moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; moduleCreateInfo.pNext = NULL; @@ -2442,7 +2444,7 @@ static void demo_init_vk(struct demo *demo) static void demo_init_vk_swapchain(struct demo *demo) { - VkResult err; + VkResult U_ASSERT_ONLY err; uint32_t i; // Create a WSI surface for the window: diff --git a/demos/tri.c b/demos/tri.c index a672ddfb..9bfa7d7b 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -886,7 +886,7 @@ static void demo_prepare_textures(struct demo *demo) { 0xffff0000, 0xff00ff00 }, }; uint32_t i; - VkResult err; + VkResult U_ASSERT_ONLY err; vkGetPhysicalDeviceFormatProperties(demo->gpu, tex_format, &props); |
