Skip to content

Commit e4efd54

Browse files
committed
fix: fix rest of sign conversions for timeout/error
1 parent a83f665 commit e4efd54

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/incoming_msg.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Napi::Value IncomingMsg::IntoBuffer(const Napi::Env& env) {
3939
moved = true;
4040

4141
/* Put appropriate GC pressure according to the size of the buffer. */
42-
Napi::MemoryManagement::AdjustExternalMemory(env, length);
42+
Napi::MemoryManagement::AdjustExternalMemory(
43+
env, static_cast<int64_t>(length));
4344

4445
auto release = [](const Napi::Env& env, uint8_t*, Reference* ref) {
4546
const auto length = static_cast<int64_t>(zmq_msg_size(*ref));

src/observer.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
#include "./observer.h"
33

4+
#include <cstdint>
5+
46
#include "./context.h"
57
#include "./module.h"
68
#include "./socket.h"
@@ -283,7 +285,7 @@ void Observer::Receive(const Napi::Promise::Deferred& res) {
283285
#ifdef ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL
284286
case ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL:
285287
#endif
286-
event["error"] = ErrnoException(Env(), value).Value();
288+
event["error"] = ErrnoException(Env(), static_cast<int32_t>(value)).Value();
287289
break;
288290

289291
#ifdef ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL
@@ -305,6 +307,8 @@ void Observer::Receive(const Napi::Promise::Deferred& res) {
305307
Close();
306308
break;
307309
}
310+
default:
311+
break;
308312
}
309313

310314
res.Resolve(event);

src/socket.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,12 @@ void Socket::SetSockOpt(const Napi::CallbackInfo& info) {
872872
/* Mirror a few options that are used internally. */
873873
switch (option) {
874874
case ZMQ_SNDTIMEO:
875-
send_timeout = value;
875+
send_timeout = static_cast<int64_t>(value);
876876
break;
877877
case ZMQ_RCVTIMEO:
878-
receive_timeout = value;
878+
receive_timeout = static_cast<int64_t>(value);
879+
break;
880+
default:
879881
break;
880882
}
881883
}

src/util/uvdelayed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class UvDelayed {
2929
[[maybe_unused]] int32_t err = 0;
3030

3131
/* Idle handle is needed to stop the event loop from blocking in poll. */
32-
err = uv_idle_start(idle, [](uv_idle_t* idle) {});
32+
err = uv_idle_start(idle, []([[maybe_unused]] uv_idle_t* idle) {});
3333
assert(err == 0);
3434

3535
err = uv_check_start(check, [](uv_check_t* check) {

0 commit comments

Comments
 (0)