From 629c956618c26f0228beea6719cd3f1461cf9259 Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 27 Dec 2018 00:29:08 +0100 Subject: [PATCH] Change variable being shadowed apperror was shadowing another variable in the scope outside of the if statement, leading to a warning. Adding an underscore changes the var name without changing the meaning. In the future a different structure should probably be chosen for the statements. --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c137975..96bfff1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,8 +58,8 @@ void installManifest(bool cleaninstall = false) { if (apperror != vr::VRApplicationError_None) { throw std::runtime_error(std::string("Could not add application manifest: ") + std::string(vr::VRApplications()->GetApplicationsErrorNameFromEnum(apperror))); } else if (!alreadyInstalled || cleaninstall) { - auto apperror = vr::VRApplications()->SetApplicationAutoLaunch(advsettings::OverlayController::applicationKey, true); - if (apperror != vr::VRApplicationError_None) { + auto app_error = vr::VRApplications()->SetApplicationAutoLaunch(advsettings::OverlayController::applicationKey, true); + if (app_error != vr::VRApplicationError_None) { throw std::runtime_error(std::string("Could not set auto start: ") + std::string(vr::VRApplications()->GetApplicationsErrorNameFromEnum(apperror))); } }