The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Fix bitwise operation on signed int warnings.

authored by

Ryan Pavlik and committed by
Jakob Bornecrantz
cff131da f43ac484

+12 -11
+5 -4
src/xrt/state_trackers/oxr/oxr_api_action.c
··· 415 415 } 416 416 417 417 if (!oxr_path_is_valid(&log, inst, topLevelUserPath)) { 418 - return oxr_error(&log, XR_ERROR_PATH_INVALID, "(topLevelUserPath == %zu) Is not a valid path", 418 + return oxr_error(&log, XR_ERROR_PATH_INVALID, "(topLevelUserPath == %" PRId64 ") Is not a valid path", 419 419 topLevelUserPath); 420 420 } 421 421 ··· 472 472 } 473 473 474 474 if (!oxr_path_is_valid(&log, inst, getInfo->sourcePath)) { 475 - return oxr_error(&log, XR_ERROR_PATH_INVALID, "(getInfo->sourcePath == %zu) Is not a valid path", 476 - getInfo->sourcePath); 475 + return oxr_error(&log, XR_ERROR_PATH_INVALID, 476 + "(getInfo->sourcePath == %" PRId64 ") Is not a valid path", getInfo->sourcePath); 477 477 } 478 478 479 479 const XrInputSourceLocalizedNameFlags all = XR_INPUT_SOURCE_LOCALIZED_NAME_USER_PATH_BIT | ··· 482 482 483 483 if ((getInfo->whichComponents & ~all) != 0) { 484 484 return oxr_error(&log, XR_ERROR_VALIDATION_FAILURE, 485 - "(getInfo->whichComponents == %08zx) contains invalid bits", getInfo->whichComponents); 485 + "(getInfo->whichComponents == %08" PRIx64 ") contains invalid bits", 486 + getInfo->whichComponents); 486 487 } 487 488 488 489 if (getInfo->whichComponents == 0) {
+2 -2
src/xrt/state_trackers/oxr/oxr_input_transform.c
··· 236 236 enum oxr_dpad_region bound_region = dpad_state->bound_region; 237 237 enum oxr_dpad_region active_regions = OXR_DPAD_REGION_CENTER; 238 238 239 - for (int i = 0; i < 4; i++) { 240 - enum oxr_dpad_region query_region = 1 << i; 239 + for (unsigned int i = 0; i < 4; i++) { 240 + enum oxr_dpad_region query_region = 1u << i; 241 241 242 242 bool rot90 = 243 243 (query_region == OXR_DPAD_REGION_LEFT) || (query_region == OXR_DPAD_REGION_RIGHT);
+5 -5
src/xrt/state_trackers/oxr/oxr_objects.h
··· 178 178 */ 179 179 enum oxr_dpad_region 180 180 { 181 - OXR_DPAD_REGION_CENTER = 0, 182 - OXR_DPAD_REGION_UP = (1 << 0), 183 - OXR_DPAD_REGION_DOWN = (1 << 1), 184 - OXR_DPAD_REGION_LEFT = (1 << 2), 185 - OXR_DPAD_REGION_RIGHT = (1 << 3), 181 + OXR_DPAD_REGION_CENTER = 0u, 182 + OXR_DPAD_REGION_UP = (1u << 0u), 183 + OXR_DPAD_REGION_DOWN = (1u << 1u), 184 + OXR_DPAD_REGION_LEFT = (1u << 2u), 185 + OXR_DPAD_REGION_RIGHT = (1u << 3u), 186 186 }; 187 187 188 188 /*!