diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 1aca3a5e6aeeee..619c9ef6196373 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -185,7 +185,7 @@ void TCPWrap::SetKeepAlive(const FunctionCallbackInfo& args) { Environment* env = wrap->env(); int enable; if (!args[0]->Int32Value(env->context()).To(&enable)) return; - unsigned int delay = args[1].As()->Value(); + unsigned int delay = static_cast(args[1].As()->Value()); int err = uv_tcp_keepalive(&wrap->handle_, enable, delay); args.GetReturnValue().Set(err); } @@ -278,7 +278,8 @@ void TCPWrap::Listen(const FunctionCallbackInfo& args) { void TCPWrap::Connect(const FunctionCallbackInfo& args) { CHECK(args[2]->IsUint32()); - int port = args[2].As()->Value(); + // explicit cast to fit to libuv's type expectation + int port = static_cast(args[2].As()->Value()); Connect(args, [port](const char* ip_address, sockaddr_in* addr) { return uv_ip4_addr(ip_address, port, addr);