summaryrefslogtreecommitdiffstats
path: root/validation.c
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2018-03-01 14:36:41 +0000
committerTomasz Kramkowski <tk@the-tk.com>2018-03-01 14:43:25 +0000
commitaf3045190ff503657cfe8e53a3bc03965ceeadc4 (patch)
tree2a39cf5fe085168cc1d1fcba6415618360eff72c /validation.c
parent032b0b6a16de49063f2b1563f097533548800c49 (diff)
downloadvulkan-master.tar.gz
vulkan-master.tar.xz
vulkan-master.zip
various code cleanupHEADmaster
Diffstat (limited to 'validation.c')
-rw-r--r--validation.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/validation.c b/validation.c
index c9d2f9f..cfe258a 100644
--- a/validation.c
+++ b/validation.c
@@ -1,12 +1,15 @@
+#ifndef WITH_VALIDATION
+#define WITH_VALIDATION
+#endif
+
+#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
-
#include "eprintf.h"
#include "nelem.h"
-#define WITH_VALIDATION
#include "validation.h"
static const char *vlayers[] = {
@@ -43,7 +46,7 @@ static bool havelayers(void)
instlrp = emalloc(ninstlrp * sizeof *instlrp);
vkEnumerateInstanceLayerProperties(&ninstlrp, instlrp);
- for (int vl = 0; vl < NELEM(vlayers); vl++) {
+ for (size_t vl = 0; vl < NELEM(vlayers); vl++) {
for (uint32_t il = 0; il < ninstlrp; il++)
if (strcmp(vlayers[vl], instlrp[il].layerName) == 0)
goto next;
@@ -95,6 +98,8 @@ void validation_destroycb(VkInstance inst, void *_cb)
PFN_vkDestroyDebugReportCallbackEXT func;
VkDebugReportCallbackEXT *cb = _cb;
+ assert(cb != NULL);
+
func = (PFN_vkDestroyDebugReportCallbackEXT)
vkGetInstanceProcAddr(inst, "vkDestroyDebugReportCallbackEXT");
if (func == NULL)