Skip to content

Commit 118aa40

Browse files
committed
fix: silence poller UV reinterpret cast warnings
1 parent 3b14017 commit 118aa40

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/module.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ struct Terminator {
1818
assert(context != nullptr);
1919

2020
#ifdef ZMQ_BLOCKY
21-
bool const blocky = zmq_ctx_get(context, ZMQ_BLOCKY) != 0;
21+
const bool blocky = zmq_ctx_get(context, ZMQ_BLOCKY) != 0;
2222
#else
2323
/* If the option cannot be set, don't suggest to set it. */
24-
bool blocky = false;
24+
const bool blocky = false;
2525
#endif
2626

2727
/* Start termination asynchronously so we can detect if it takes long
@@ -35,7 +35,7 @@ struct Terminator {
3535
if (terminate.wait_for(500ms) == std::future_status::timeout) {
3636
/* We can't use process.emitWarning, because the Node.js runtime
3737
has already shut down. So we mimic it instead. */
38-
fprintf(stderr,
38+
(void)fprintf(stderr,
3939
"(node:%d) WARNING: Waiting for queued ZeroMQ messages to be "
4040
"delivered.%s\n",
4141
uv_os_getpid(),

src/poller.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class Poller {
7474
[[maybe_unused]] auto err = uv_timer_start(
7575
readable_timer.get(),
7676
[](uv_timer_t* timer) {
77+
// NOLINTNEXTLINE(*-pro-type-reinterpret-cast)
7778
auto& poller = *reinterpret_cast<Poller*>(timer->data);
7879
poller.Trigger(UV_READABLE);
7980
},
@@ -98,6 +99,7 @@ class Poller {
9899
[[maybe_unused]] auto err = uv_timer_start(
99100
writable_timer.get(),
100101
[](uv_timer_t* timer) {
102+
// NOLINTNEXTLINE(*-pro-type-reinterpret-cast)
101103
auto& poller = *reinterpret_cast<Poller*>(timer->data);
102104
poller.Trigger(UV_WRITABLE);
103105
},
@@ -164,6 +166,7 @@ class Poller {
164166
There is no guarantee that any events are available. */
165167
static void Callback(uv_poll_t* poll, int32_t status, int32_t /*events*/) {
166168
if (status == 0) {
169+
// NOLINTNEXTLINE(*-pro-type-reinterpret-cast)
167170
auto& poller = *reinterpret_cast<Poller*>(poll->data);
168171
poller.TriggerReadable();
169172
poller.TriggerWritable();

0 commit comments

Comments
 (0)