crypto: fix a couple of VC++ warnings
authorRasmus Christian Pedersen <zerhacken@yahoo.com>
Mon, 28 Apr 2014 12:45:20 +0000 (14:45 +0200)
committerFedor Indutny <fedor@indutny.com>
Tue, 29 Apr 2014 10:13:28 +0000 (14:13 +0400)
Signed-off-by: Fedor Indutny <fedor@indutny.com>
src/node_crypto.cc
src/node_crypto_clienthello.cc
src/tcp_wrap.cc

index 20ad96a..d81e24b 100644 (file)
@@ -761,7 +761,7 @@ void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
     return sc->env()->ThrowTypeError("Bad parameter");
   }
 
-  SSL_CTX_set_options(sc->ctx_, args[0]->IntegerValue());
+  SSL_CTX_set_options(sc->ctx_, static_cast<long>(args[0]->IntegerValue()));
 }
 
 
@@ -4516,7 +4516,7 @@ void Certificate::VerifySpkac(const FunctionCallbackInfo<Value>& args) {
   char* data = Buffer::Data(args[0]);
   assert(data != NULL);
 
-  i = certificate->VerifySpkac(data, length) > 0;
+  i = certificate->VerifySpkac(data, length);
 
   args.GetReturnValue().Set(i);
 }
index c1228c7..227d64c 100644 (file)
@@ -125,7 +125,7 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
   hello.has_ticket_ = tls_ticket_ != NULL && tls_ticket_size_ != 0;
   hello.ocsp_request_ = ocsp_request_;
   hello.servername_ = servername_;
-  hello.servername_size_ = servername_size_;
+  hello.servername_size_ = static_cast<uint8_t>(servername_size_);
   onhello_cb_(cb_arg_, hello);
 }
 
index 6f89b5d..d0e2573 100644 (file)
@@ -246,7 +246,7 @@ void TCPWrap::Open(const FunctionCallbackInfo<Value>& args) {
   Environment* env = Environment::GetCurrent(args.GetIsolate());
   HandleScope scope(env->isolate());
   TCPWrap* wrap = Unwrap<TCPWrap>(args.Holder());
-  int fd = args[0]->IntegerValue();
+  int fd = static_cast<int>(args[0]->IntegerValue());
   uv_tcp_open(&wrap->handle_, fd);
 }