Skip to content

Commit 0105315

Browse files
committed
loader: clang-tidy
1 parent 626529f commit 0105315

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/loader/api_layer_interface.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define OPENXR_ENABLE_LAYERS_ENV_VAR "XR_ENABLE_API_LAYERS"
3838

3939
// Add any layers defined in the loader layer environment variable.
40-
static void AddEnvironmentApiLayers(const std::string& openxr_command, std::vector<std::string>& enabled_layers) {
40+
static void AddEnvironmentApiLayers(std::vector<std::string>& enabled_layers) {
4141
std::string layers = PlatformUtilsGetEnv(OPENXR_ENABLE_LAYERS_ENV_VAR);
4242

4343
std::size_t last_found = 0;
@@ -165,16 +165,16 @@ XrResult ApiLayerInterface::GetInstanceExtensionProperties(const std::string& op
165165
// Find any environmentally enabled explicit layers. If they're present, treat them like implicit layers
166166
// since we know that they're going to be enabled.
167167
std::vector<std::string> env_enabled_layers;
168-
AddEnvironmentApiLayers(openxr_command, env_enabled_layers);
168+
AddEnvironmentApiLayers(env_enabled_layers);
169169
if (!env_enabled_layers.empty()) {
170170
std::vector<std::unique_ptr<ApiLayerManifestFile>> exp_layer_man_files = {};
171171
result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_EXPLICIT_API_LAYER, exp_layer_man_files);
172172
if (XR_SUCCEEDED(result)) {
173-
for (auto exp_iter = exp_layer_man_files.begin(); exp_iter != exp_layer_man_files.end(); exp_iter++) {
173+
for (auto& exp_layer_man_file : exp_layer_man_files) {
174174
for (std::string& enabled_layer : env_enabled_layers) {
175175
// If this is an enabled layer, transfer it over to the manifest list.
176-
if (enabled_layer == (*exp_iter)->LayerName()) {
177-
manifest_files.push_back(std::move(*exp_iter));
176+
if (enabled_layer == exp_layer_man_file->LayerName()) {
177+
manifest_files.push_back(std::move(exp_layer_man_file));
178178
break;
179179
}
180180
}
@@ -209,7 +209,7 @@ XrResult ApiLayerInterface::LoadApiLayers(const std::string& openxr_command, uin
209209

210210
// Put all the enabled layers into a string vector
211211
std::vector<std::string> enabled_api_layers = {};
212-
AddEnvironmentApiLayers(openxr_command, enabled_api_layers);
212+
AddEnvironmentApiLayers(enabled_api_layers);
213213
if (enabled_api_layer_count > 0) {
214214
if (nullptr == enabled_api_layer_names) {
215215
LoaderLogger::LogErrorMessage(

src/loader/loader_core.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ XRLOADER_ABI_CATCH_FALLBACK
332332
// ---- Core 1.0 manual loader terminator functions
333333

334334
// Validate that the applicationInfo structure in the XrInstanceCreateInfo is valid.
335-
static XrResult ValidateApplicationInfo(LoaderInstance *loader_instance, const XrApplicationInfo &info) {
335+
static XrResult ValidateApplicationInfo(const XrApplicationInfo &info) {
336336
if (IsMissingNullTerminator<XR_MAX_APPLICATION_NAME_SIZE>(info.applicationName)) {
337337
LoaderLogger::LogValidationErrorMessage("VUID-XrApplicationInfo-applicationName-parameter", "xrCreateInstance",
338338
"application name missing NULL terminator.");
@@ -352,7 +352,7 @@ static XrResult ValidateApplicationInfo(LoaderInstance *loader_instance, const X
352352
}
353353

354354
// Validate that the XrInstanceCreateInfo is valid
355-
static XrResult ValidateInstanceCreateInfo(LoaderInstance *loader_instance, const XrInstanceCreateInfo *info) {
355+
static XrResult ValidateInstanceCreateInfo(const XrInstanceCreateInfo *info) {
356356
// Should have a valid 'type'
357357
if (XR_TYPE_INSTANCE_CREATE_INFO != info->type) {
358358
LoaderLogger::LogValidationErrorMessage("VUID-XrInstanceCreateInfo-type-type", "xrCreateInstance",
@@ -366,7 +366,7 @@ static XrResult ValidateInstanceCreateInfo(LoaderInstance *loader_instance, cons
366366
return XR_ERROR_VALIDATION_FAILURE;
367367
}
368368
// ApplicationInfo struct must be valid
369-
XrResult result = ValidateApplicationInfo(loader_instance, info->applicationInfo);
369+
XrResult result = ValidateApplicationInfo(info->applicationInfo);
370370
if (XR_FAILED(result)) {
371371
LoaderLogger::LogValidationErrorMessage("VUID-XrInstanceCreateInfo-applicationInfo-parameter", "xrCreateInstance",
372372
"info->applicationInfo is not valid.");
@@ -384,7 +384,7 @@ static XrResult ValidateInstanceCreateInfo(LoaderInstance *loader_instance, cons
384384
XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermCreateInstance(const XrInstanceCreateInfo *info, XrInstance *instance) XRLOADER_ABI_TRY {
385385
LoaderLogger::LogVerboseMessage("xrCreateInstance", "Entering loader terminator");
386386
LoaderInstance *loader_instance = reinterpret_cast<LoaderInstance *>(*instance);
387-
XrResult result = ValidateInstanceCreateInfo(loader_instance, info);
387+
XrResult result = ValidateInstanceCreateInfo(info);
388388
if (XR_FAILED(result)) {
389389
LoaderLogger::LogValidationErrorMessage("VUID-xrCreateInstance-info-parameter", "xrCreateInstance",
390390
"something wrong with XrInstanceCreateInfo contents");

0 commit comments

Comments
 (0)