summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy3
-rw-r--r--meson.build3
-rw-r--r--src/Configuration.cpp40
-rw-r--r--src/UIFile.hpp6
-rw-r--r--src/event_to_string.cpp1
-rw-r--r--src/main.cpp4
6 files changed, 28 insertions, 29 deletions
diff --git a/.clang-tidy b/.clang-tidy
index cec10cc..e225b83 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,4 +1,4 @@
-# Copyright 2020-2023 David Robillard <d@drobilla.net>
+# Copyright 2020-2024 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later
Checks: >
@@ -43,6 +43,7 @@ Checks: >
-hicpp-signed-bitwise,
-llvm-header-guard,
-llvmlibc-*,
+ -misc-include-cleaner,
-misc-no-recursion,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
diff --git a/meson.build b/meson.build
index 90d60d4..32c79d4 100644
--- a/meson.build
+++ b/meson.build
@@ -121,9 +121,8 @@ gtkmm_dep = dependency(
ganv_dep = dependency(
'ganv-1',
- fallback: ['ganv', 'ganv_dep'],
include_type: 'system',
- version: '>= 1.5.2',
+ version: '>= 1.8.2',
)
dependencies = [
diff --git a/src/Configuration.cpp b/src/Configuration.cpp
index 9bb2ac6..d434aeb 100644
--- a/src/Configuration.cpp
+++ b/src/Configuration.cpp
@@ -192,13 +192,13 @@ Configuration::load()
for (const auto& filename : filenames) {
file.open(filename.c_str(), std::ios::in);
if (file.good()) {
- std::cout << "Loading configuration from " << filename << std::endl;
+ std::cout << "Loading configuration from " << filename << "\n";
break;
}
}
if (!file.good()) {
- std::cout << "No configuration file present" << std::endl;
+ std::cout << "No configuration file present\n";
return;
}
@@ -253,8 +253,7 @@ Configuration::load()
}
}
if (!found) {
- std::cerr << "error: color for unknown port type `" << type_name << "'"
- << std::endl;
+ std::cerr << "error: color for unknown port type `" << type_name << "'\n";
}
} else if (key == "module_position") {
Coord loc;
@@ -273,7 +272,7 @@ Configuration::load()
type = SignalDirection::duplex;
} else {
std::cerr << "error: bad position type `" << type_str
- << "' for module `" << name << "'" << std::endl;
+ << "' for module `" << name << "'\n";
file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
continue;
}
@@ -283,8 +282,7 @@ Configuration::load()
set_module_location(name, type, loc);
} else {
- std::cerr << "warning: unknown configuration key `" << key << "'"
- << std::endl;
+ std::cerr << "warning: unknown configuration key `" << key << "'\n";
file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
@@ -304,7 +302,7 @@ write_module_position(std::ofstream& os,
const Coord& loc)
{
os << "module_position \"" << name << "\""
- << " " << type << " " << loc.x << " " << loc.y << std::endl;
+ << " " << type << " " << loc.x << " " << loc.y << "\n";
}
void
@@ -316,36 +314,36 @@ Configuration::save()
for (const std::string& filename : filenames) {
file.open(filename.c_str(), std::ios::out);
if (file.good()) {
- std::cout << "Writing configuration to " << filename << std::endl;
+ std::cout << "Writing configuration to " << filename << "\n";
break;
}
}
if (!file.good()) {
- std::cout << "Unable to open configuration file to write" << std::endl;
+ std::cout << "Unable to open configuration file to write\n";
return;
}
file << "window_location " << get<setting::WindowLocation>().x << " "
- << get<setting::WindowLocation>().y << std::endl;
+ << get<setting::WindowLocation>().y << "\n";
file << "window_size " << get<setting::WindowSize>().x << " "
- << get<setting::WindowSize>().y << std::endl;
+ << get<setting::WindowSize>().y << "\n";
- file << "zoom_level " << get<setting::Zoom>() << std::endl;
- file << "font_size " << get<setting::FontSize>() << std::endl;
- file << "show_toolbar " << get<setting::ToolbarVisible>() << std::endl;
- file << "sprung_layout " << get<setting::SprungLayout>() << std::endl;
- file << "show_messages " << get<setting::MessagesVisible>() << std::endl;
- file << "sort_ports " << get<setting::SortedPorts>() << std::endl;
- file << "messages_height " << get<setting::MessagesHeight>() << std::endl;
- file << "human_names " << get<setting::HumanNames>() << std::endl;
+ file << "zoom_level " << get<setting::Zoom>() << "\n";
+ file << "font_size " << get<setting::FontSize>() << "\n";
+ file << "show_toolbar " << get<setting::ToolbarVisible>() << "\n";
+ file << "sprung_layout " << get<setting::SprungLayout>() << "\n";
+ file << "show_messages " << get<setting::MessagesVisible>() << "\n";
+ file << "sort_ports " << get<setting::SortedPorts>() << "\n";
+ file << "messages_height " << get<setting::MessagesHeight>() << "\n";
+ file << "human_names " << get<setting::HumanNames>() << "\n";
file << std::hex << std::uppercase;
for (unsigned i = 0U; i < n_port_types; ++i) {
if (_port_colors[i] != _default_port_colors[i]) {
file << "port_color " << port_type_names[i] << " " << _port_colors[i]
- << std::endl;
+ << "\n";
}
}
file << std::dec << std::nouppercase;
diff --git a/src/UIFile.hpp b/src/UIFile.hpp
index 36be144..38a46b1 100644
--- a/src/UIFile.hpp
+++ b/src/UIFile.hpp
@@ -41,7 +41,7 @@ public:
if (!bundle.empty()) {
const std::string bundle_ui_filename = bundle + "/" + ui_filename;
if (is_readable(bundle_ui_filename)) {
- std::cout << "Loading UI file " << bundle_ui_filename << std::endl;
+ std::cout << "Loading UI file " << bundle_ui_filename << "\n";
return Gtk::Builder::create_from_file(bundle_ui_filename);
}
}
@@ -49,12 +49,12 @@ public:
ui_filename = std::string(PATCHAGE_DATA_DIR) + "/" + ui_filename;
if (is_readable(ui_filename)) {
- std::cout << "Loading UI file " << ui_filename << std::endl;
+ std::cout << "Loading UI file " << ui_filename << "\n";
return Gtk::Builder::create_from_file(ui_filename);
}
std::stringstream ss;
- ss << "Unable to find " << ui_filename << std::endl;
+ ss << "Unable to find " << ui_filename << "\n";
throw std::runtime_error(ss.str());
return {};
}
diff --git a/src/event_to_string.cpp b/src/event_to_string.cpp
index 499966a..8212b9d 100644
--- a/src/event_to_string.cpp
+++ b/src/event_to_string.cpp
@@ -18,6 +18,7 @@ PATCHAGE_DISABLE_FMT_WARNINGS
PATCHAGE_RESTORE_WARNINGS
#include <optional>
+#include <ostream>
#include <string>
#include <variant>
diff --git a/src/main.cpp b/src/main.cpp
index 6d09fe4..0f4d1b0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -148,10 +148,10 @@ main(int argc, char** argv)
patchage.save();
} catch (std::exception& e) {
- std::cerr << "patchage: error: " << e.what() << std::endl;
+ std::cerr << "patchage: error: " << e.what() << "\n";
return 1;
} catch (Glib::Exception& e) {
- std::cerr << "patchage: error: " << e.what() << std::endl;
+ std::cerr << "patchage: error: " << e.what() << "\n";
return 1;
}