Skip to content

Commit d13e029

Browse files
zerhackenindutny
authored andcommitted
crypto: fix a couple of VC++ warnings
Signed-off-by: Fedor Indutny <fedor@indutny.com>
1 parent 226f98a commit d13e029

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/node_crypto.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
761761
return sc->env()->ThrowTypeError("Bad parameter");
762762
}
763763

764-
SSL_CTX_set_options(sc->ctx_, args[0]->IntegerValue());
764+
SSL_CTX_set_options(sc->ctx_, static_cast<long>(args[0]->IntegerValue()));
765765
}
766766

767767

@@ -4516,7 +4516,7 @@ void Certificate::VerifySpkac(const FunctionCallbackInfo<Value>& args) {
45164516
char* data = Buffer::Data(args[0]);
45174517
assert(data != NULL);
45184518

4519-
i = certificate->VerifySpkac(data, length) > 0;
4519+
i = certificate->VerifySpkac(data, length);
45204520

45214521
args.GetReturnValue().Set(i);
45224522
}

src/node_crypto_clienthello.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
125125
hello.has_ticket_ = tls_ticket_ != NULL && tls_ticket_size_ != 0;
126126
hello.ocsp_request_ = ocsp_request_;
127127
hello.servername_ = servername_;
128-
hello.servername_size_ = servername_size_;
128+
hello.servername_size_ = static_cast<uint8_t>(servername_size_);
129129
onhello_cb_(cb_arg_, hello);
130130
}
131131

src/tcp_wrap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void TCPWrap::Open(const FunctionCallbackInfo<Value>& args) {
246246
Environment* env = Environment::GetCurrent(args.GetIsolate());
247247
HandleScope scope(env->isolate());
248248
TCPWrap* wrap = Unwrap<TCPWrap>(args.Holder());
249-
int fd = args[0]->IntegerValue();
249+
int fd = static_cast<int>(args[0]->IntegerValue());
250250
uv_tcp_open(&wrap->handle_, fd);
251251
}
252252

0 commit comments

Comments
 (0)