From 81d23967b611550cf558b47fe24423119bbaf6a1 Mon Sep 17 00:00:00 2001 From: kistlin Date: Mon, 17 Jan 2022 06:53:14 +0100 Subject: [PATCH] revert some changes after the review --- core/src/config.cpp | 2 +- core/src/core.cpp | 10 +++------- core/src/gui/main_window.cpp | 2 +- core/src/utils/networking.cpp | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/core/src/config.cpp b/core/src/config.cpp index 66bf4d75..d5ea33f6 100644 --- a/core/src/config.cpp +++ b/core/src/config.cpp @@ -36,7 +36,7 @@ void ConfigManager::load(json def, bool lock) { file >> conf; file.close(); } - catch (const std::exception& e) { + catch (std::exception e) { spdlog::error("Config file '{0}' is corrupted, resetting it", path); conf = def; save(false); diff --git a/core/src/core.cpp b/core/src/core.cpp index dee1f226..c68d978e 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -337,7 +337,7 @@ int sdrpp_main(int argc, char* argv[]) { #else const char* glsl_version = "#version 120"; GLFWmonitor* monitor = NULL; - for (size_t i = 0; i < OPENGL_VERSION_COUNT; i++) { + for (int i = 0; i < OPENGL_VERSION_COUNT; i++) { glsl_version = OPENGL_VERSIONS_GLSL[i]; glfwWindowHint(GLFW_CLIENT_API, OPENGL_VERSIONS_IS_ES[i] ? GLFW_OPENGL_ES_API : GLFW_OPENGL_API); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, OPENGL_VERSIONS_MAJOR[i]); @@ -450,12 +450,8 @@ int sdrpp_main(int argc, char* argv[]) { bandplan::loadColorTable(bandColors); bool _maximized = maximized; - int fsWidth = 0; - int fsHeight = 0; - int fsPosX = 0; - int fsPosY = 0; - int _winWidth = 0; - int _winHeight = 0; + int fsWidth, fsHeight, fsPosX, fsPosY; + int _winWidth, _winHeight; glfwGetWindowSize(core::window, &_winWidth, &_winHeight); if (fullScreen) { diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 45cde988..572f6a39 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -487,7 +487,7 @@ void MainWindow::draw() { if (gui::menu.draw(firstMenuRender)) { core::configManager.acquire(); json arr = json::array(); - for (size_t i = 0; i < gui::menu.order.size(); i++) { + for (int i = 0; i < gui::menu.order.size(); i++) { arr[i]["name"] = gui::menu.order[i].name; arr[i]["open"] = gui::menu.order[i].open; } diff --git a/core/src/utils/networking.cpp b/core/src/utils/networking.cpp index ea67cd21..8d51b48a 100644 --- a/core/src/utils/networking.cpp +++ b/core/src/utils/networking.cpp @@ -288,7 +288,7 @@ namespace net { } entry.handler(std::move(client), entry.ctx); } - catch (const std::exception& e) { + catch (std::exception e) { listening = false; return; }