diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2018-02-07 10:00:22 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2018-02-07 12:16:29 -0700 |
| commit | 73ea021245393a7c500a0d3e4e71d3786582d32b (patch) | |
| tree | ddf59a2838487a1762bec3df94eee6332b35cc1f | |
| parent | 68e9d8d14e611b36f96221c03038eb252075b008 (diff) | |
| download | usermoji-73ea021245393a7c500a0d3e4e71d3786582d32b.tar.xz | |
layers: Avoid warnings in vk_layer_logging.h
This file was often included in files where only a subset of the
functions were called, resulting in -Wunused_function warnings from
GCC. Made these functions inline to avoid the warnings.
Change-Id: Iaa3765ee51a290f0dd82d1a6a91116b6e1eec2c1
| -rw-r--r-- | layers/vk_layer_logging.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/layers/vk_layer_logging.h b/layers/vk_layer_logging.h index 9a5f549a..80192b0e 100644 --- a/layers/vk_layer_logging.h +++ b/layers/vk_layer_logging.h @@ -36,7 +36,6 @@ #include <unordered_map> #include <vector> - typedef struct _debug_report_data { VkLayerDbgFunctionNode *debug_callback_list; VkLayerDbgFunctionNode *default_debug_callback_list; @@ -236,8 +235,8 @@ static inline PFN_vkVoidFunction debug_report_get_instance_proc_addr(debug_repor // then allocates an array that can hold that many structs, as well as that // many VkDebugReportCallbackEXT handles. It then copies each // VkDebugReportCallbackCreateInfoEXT, and initializes each handle. -static VkResult layer_copy_tmp_callbacks(const void *pChain, uint32_t *num_callbacks, VkDebugReportCallbackCreateInfoEXT **infos, - VkDebugReportCallbackEXT **callbacks) { +static inline VkResult layer_copy_tmp_callbacks(const void *pChain, uint32_t *num_callbacks, + VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks) { uint32_t n = *num_callbacks = 0; const void *pNext = pChain; @@ -281,15 +280,15 @@ static VkResult layer_copy_tmp_callbacks(const void *pChain, uint32_t *num_callb } // This utility frees the arrays allocated by layer_copy_tmp_callbacks() -static void layer_free_tmp_callbacks(VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { +static inline void layer_free_tmp_callbacks(VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { free(infos); free(callbacks); } // This utility enables all of the VkDebugReportCallbackCreateInfoEXT structs // that were copied by layer_copy_tmp_callbacks() -static VkResult layer_enable_tmp_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, - VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { +static inline VkResult layer_enable_tmp_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, + VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { VkResult rtn = VK_SUCCESS; for (uint32_t i = 0; i < num_callbacks; i++) { rtn = layer_create_msg_callback(debug_data, false, &infos[i], NULL, &callbacks[i]); @@ -305,8 +304,8 @@ static VkResult layer_enable_tmp_callbacks(debug_report_data *debug_data, uint32 // This utility disables all of the VkDebugReportCallbackCreateInfoEXT structs // that were copied by layer_copy_tmp_callbacks() -static void layer_disable_tmp_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, - VkDebugReportCallbackEXT *callbacks) { +static inline void layer_disable_tmp_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, + VkDebugReportCallbackEXT *callbacks) { for (uint32_t i = 0; i < num_callbacks; i++) { layer_destroy_msg_callback(debug_data, callbacks[i], NULL); } @@ -324,9 +323,9 @@ static inline bool will_log_msg(debug_report_data *debug_data, VkFlags msgFlags) return true; } #ifndef WIN32 -static int string_sprintf(std::string *output, const char *fmt, ...) __attribute__((format(printf, 2, 3))); +static inline int string_sprintf(std::string *output, const char *fmt, ...) __attribute__((format(printf, 2, 3))); #endif -static int string_sprintf(std::string *output, const char *fmt, ...) { +static inline int string_sprintf(std::string *output, const char *fmt, ...) { std::string &formatted = *output; va_list argptr; va_start(argptr, fmt); |
