diff options
author | Nicolas Mattia <nicolas@nmattia.com> | 2021-12-23 14:12:48 +0100 |
---|---|---|
committer | Nicolas Mattia <nicolas@nmattia.com> | 2021-12-23 14:12:49 +0100 |
commit | b16643b6fc9abb5c243a1d83cfe0da93c441bb2c (patch) | |
tree | 79cfcfb9b2c8005ea477655bea94b14ecaeeb0dc /src | |
parent | 6ca2db2dad8d239e123acd28186a50512cf7cba3 (diff) |
Use int64_t and NixFloat in fromTOML types
This makes sure that values parsed from TOML have a proper size. Using
e.g. `double` caused issues on i686 where the size of `double` (32bit)
was too small to accommodate some values.
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/primops/fromTOML.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/primops/fromTOML.cc b/src/libexpr/primops/fromTOML.cc index bfea1ce34..221c40db9 100644 --- a/src/libexpr/primops/fromTOML.cc +++ b/src/libexpr/primops/fromTOML.cc @@ -47,10 +47,10 @@ static void prim_fromTOML(EvalState & state, const Pos & pos, Value * * args, Va mkBool(v, toml::get<bool>(t)); break;; case toml::value_t::integer: - mkInt(v, toml::get<long>(t)); + mkInt(v, toml::get<int64_t>(t)); break;; case toml::value_t::floating: - mkFloat(v, toml::get<double>(t)); + mkFloat(v, toml::get<NixFloat>(t)); break;; case toml::value_t::string: mkString(v, toml::get<std::string>(t)); |