From e89a3c1d8fa08aca6748f45f0dab2f541bfc212f Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 28 Apr 2020 17:47:12 -0500 Subject: [PATCH] st/oxr: Fix 32-bit warnings when checking for null handles --- src/xrt/state_trackers/oxr/oxr_api_negotiate.c | 2 +- src/xrt/state_trackers/oxr/oxr_api_verify.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_api_negotiate.c b/src/xrt/state_trackers/oxr/oxr_api_negotiate.c index 411e9ad75..6d995dbcf 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_negotiate.c +++ b/src/xrt/state_trackers/oxr/oxr_api_negotiate.c @@ -290,7 +290,7 @@ oxr_xrGetInstanceProcAddr(XrInstance instance, // We need to set this unconditionally, per the spec. *function = NULL; - if ((void *)instance == NULL) { + if (instance == XR_NULL_HANDLE) { oxr_log_init(&log, "xrGetInstanceProcAddr"); return handle_null(&log, name, function); } diff --git a/src/xrt/state_trackers/oxr/oxr_api_verify.h b/src/xrt/state_trackers/oxr/oxr_api_verify.h index 49145a821..d3187a289 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_verify.h +++ b/src/xrt/state_trackers/oxr/oxr_api_verify.h @@ -18,7 +18,7 @@ extern "C" { lookup) \ do { \ oxr_log_init(log, name); \ - if ((void *)thing == NULL) { \ + if (thing == XR_NULL_HANDLE) { \ return oxr_error(log, XR_ERROR_HANDLE_INVALID, \ "(" #thing " == NULL)"); \ } \ @@ -40,7 +40,7 @@ extern "C" { #define _OXR_VERIFY_SET(log, arg, new_arg, THING) \ do { \ - if ((void *)arg == NULL) { \ + if (arg == XR_NULL_HANDLE) { \ return oxr_error(log, XR_ERROR_HANDLE_INVALID, \ "(" #arg " == NULL)"); \ } \