Skip to content

Commit

Permalink
Fix compilation with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoreno committed Feb 16, 2024
1 parent 237dcbe commit 6a65f61
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
28 changes: 14 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ else()
add_definitions ("-O2")
endif()

# # if mold installed, use it
# find_program(MOLD mold)
# if (MOLD)
# message(STATUS "Using mold linker")
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
# else()
# find_program(LLD lld)
# if (LLD)
# message(STATUS "Using lld linker")
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
# else()
# message(STATUS "Using default linker. Other options are mold and lld.")
# endif()
# endif()
# if mold installed, use it
find_program(MOLD mold)
if (MOLD)
message(STATUS "Using mold linker")
add_link_options("-fuse-ld=lld")
else()
find_program(LLD lld)
if (LLD)
message(STATUS "Using lld linker")
add_link_options("-fuse-ld=lld")
else()
message(STATUS "Using default linker. Other options are mold and lld.")
endif()
endif()



Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ build: build/bin/rtpmidid

build/bin/rtpmidid: src/* tests/* CMakeLists.txt
mkdir -p build
cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja $(CMAKE_EXTRA_ARGS)
cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja $(CMAKE_EXTRA_ARGS)
cd build && ninja

build-dev:
Expand Down
2 changes: 1 addition & 1 deletion lib/rtpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void rtpserver_t::rearm_ck_timeout(std::shared_ptr<rtppeer_t> peer) {

// If no signal in 60 secs, remove the peer
peerdata->timer_connection =
poller.add_timer_event(std::chrono::seconds(60), [peerdata, peer]() {
poller.add_timer_event(std::chrono::seconds(60), [peer]() {
DEBUG("Timeout waiting for CK. Disconnecting.");
peer->disconnect();
});
Expand Down
4 changes: 2 additions & 2 deletions src/argv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace rtpmididns {
const char *VERSION = RTPMIDID_VERSION;

// NOLINTNEXTLINE (cppcoreguidelines-pro-bounds-pointer-arithmetic)
const char *const CMDLINE_HELP = 1 + R"(
const char *const CMDLINE_HELP = &R"(
Real Time Protocol Music Instrument Digital Interface Daemon v{}
(C) 2019-2023 David Moreno Montero <[email protected]>
Share ALSA sequencer MIDI ports using rtpmidi, and viceversa.
Expand All @@ -52,7 +52,7 @@ Internet use has not been tested, but may also deliver high latency
and jitter.
Options:
)";
)"[1];

struct argument_t {
std::string arg;
Expand Down
2 changes: 1 addition & 1 deletion src/aseq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void aseq_t::read_ready() {
} break;
default:
static std::array<bool, SND_SEQ_EVENT_NONE + 1> warning_raised{};
assert(ev->type < warning_raised.size());
// assert(ev->type < warning_raised.size());
// NOLINTNEXTLINE
if (!warning_raised[ev->type]) {

Expand Down
4 changes: 2 additions & 2 deletions src/control_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const char *const MSG_CLOSE_CONN =
"{\"event\": \"close\", \"detail\": \"Shutdown\", \"code\": 0}\n";
const char *const MSG_TOO_LONG =
"{\"event\": \"close\", \"detail\": \"Message too long\", \"code\": 1}\n";
const char *const MSG_UNKNOWN_COMMAND =
"{\"error\": \"Unknown command\", \"code\": 2}";
// const char *const MSG_UNKNOWN_COMMAND =
// "{\"error\": \"Unknown command\", \"code\": 2}";

static const std::regex PEER_COMMAND_RE = std::regex("^(\\d*)\\.(.*)");

Expand Down
2 changes: 1 addition & 1 deletion src/local_alsa_multi_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ local_alsa_multi_listener_t::new_alsa_connection(const aseq_t::port_t &port,

midipeer_id_t networkpeer_id = MIDIPEER_ID_INVALID;
router->for_each_peer<network_rtpmidi_listener_t>(
[this, &name, &networkpeer_id](auto *peer) {
[&name, &networkpeer_id](auto *peer) {
if (peer->name_ == name) {
peer->use_count++;
networkpeer_id = peer->peer_id;
Expand Down
2 changes: 1 addition & 1 deletion src/network_rtpmidi_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ network_rtpmidi_client_t::network_rtpmidi_client_t(
});

disconnect_connection = peer->peer.disconnect_event.connect(
[this](rtpmidid::rtppeer_t::disconnect_reason_e reason) {
[](rtpmidid::rtppeer_t::disconnect_reason_e reason) {
DEBUG("Peer disconnected: {}. Remove rtpmidi peer and alsa port too.",
reason);
// rtpmidid::poller.call_later([this] {
Expand Down

0 comments on commit 6a65f61

Please sign in to comment.