From 6e96b91aa1b34815027f3a8a21f7443603de1ea2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 11 Feb 2020 15:59:12 +0900 Subject: [PATCH] Fix a couple more optimization warnings --- libs/video/renderer/vulkan/device.c | 2 +- libs/video/renderer/vulkan/util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/video/renderer/vulkan/device.c b/libs/video/renderer/vulkan/device.c index 0ed7ec808..750534f53 100644 --- a/libs/video/renderer/vulkan/device.c +++ b/libs/video/renderer/vulkan/device.c @@ -59,7 +59,7 @@ #include "util.h" -static int +static int __attribute__((const)) count_bits (uint32_t val) { int bits = 0; diff --git a/libs/video/renderer/vulkan/util.h b/libs/video/renderer/vulkan/util.h index ae87b8096..41181ff9e 100644 --- a/libs/video/renderer/vulkan/util.h +++ b/libs/video/renderer/vulkan/util.h @@ -5,7 +5,7 @@ typedef struct strset_s strset_t; -int count_strings (const char * const *str); +int count_strings (const char * const *str) __attribute__((const)); void merge_strings (const char **out, const char * const *in1, const char * const *in2); void prune_strings (strset_t *strset, const char **strings, uint32_t *count);