Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƫl Zasso <targos@protonmail.com>2021-01-30 18:59:54 +0300
committerRich Trott <rtrott@gmail.com>2021-02-08 04:51:41 +0300
commitb346cd1760dfad560d89cb797be2cf6f9f77bb77 (patch)
treed5a8ab6889d72e8090cd5198905db8635fe37008 /src/node_options.cc
parent907d6b6b40a62c5ae831bbd7551e7c57c3a27b6b (diff)
src: avoid implicit type conversions
This fixes a bunch of C4244 ('conversion' conversion from 'type1' to 'type2', possible loss of data) MSVC warnings in the code base. PR-URL: https://github.com/nodejs/node/pull/37149 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_options.cc')
-rw-r--r--src/node_options.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/node_options.cc b/src/node_options.cc
index 08b5fda6991..d292231218f 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -945,12 +945,14 @@ void GetOptions(const FunctionCallbackInfo<Value>& args) {
*_ppop_instance.Lookup<bool>(field, opts));
break;
case kInteger:
- value = Number::New(isolate,
- *_ppop_instance.Lookup<int64_t>(field, opts));
+ value = Number::New(
+ isolate,
+ static_cast<double>(*_ppop_instance.Lookup<int64_t>(field, opts)));
break;
case kUInteger:
- value = Number::New(isolate,
- *_ppop_instance.Lookup<uint64_t>(field, opts));
+ value = Number::New(
+ isolate,
+ static_cast<double>(*_ppop_instance.Lookup<uint64_t>(field, opts)));
break;
case kString:
if (!ToV8Value(context,