Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: assignment to valid type #32879

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/tcp_wrap.cc
Expand Up @@ -185,7 +185,7 @@ void TCPWrap::SetKeepAlive(const FunctionCallbackInfo<Value>& args) {
Environment* env = wrap->env();
int enable;
if (!args[0]->Int32Value(env->context()).To(&enable)) return;
unsigned int delay = args[1].As<Uint32>()->Value();
unsigned int delay = static_cast<unsigned int>(args[1].As<Uint32>()->Value());
int err = uv_tcp_keepalive(&wrap->handle_, enable, delay);
args.GetReturnValue().Set(err);
}
Expand Down Expand Up @@ -278,7 +278,8 @@ void TCPWrap::Listen(const FunctionCallbackInfo<Value>& args) {

void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) {
CHECK(args[2]->IsUint32());
int port = args[2].As<Uint32>()->Value();
// explicit cast to fit to libuv's type expectation
int port = static_cast<int>(args[2].As<Uint32>()->Value());
Connect<sockaddr_in>(args,
[port](const char* ip_address, sockaddr_in* addr) {
return uv_ip4_addr(ip_address, port, addr);
Expand Down