diff options
Diffstat (limited to 'third_party/nix/src/libexpr')
-rw-r--r-- | third_party/nix/src/libexpr/attr-path.cc | 4 | ||||
-rw-r--r-- | third_party/nix/src/libexpr/get-drvs.cc | 3 | ||||
-rw-r--r-- | third_party/nix/src/libexpr/names.cc | 6 |
3 files changed, 9 insertions, 4 deletions
diff --git a/third_party/nix/src/libexpr/attr-path.cc b/third_party/nix/src/libexpr/attr-path.cc index 628b58c1b1e3..5f14fca21493 100644 --- a/third_party/nix/src/libexpr/attr-path.cc +++ b/third_party/nix/src/libexpr/attr-path.cc @@ -1,5 +1,7 @@ #include "attr-path.hh" +#include <absl/strings/numbers.h> + #include "eval-inline.hh" #include "util.hh" @@ -50,7 +52,7 @@ Value* findAlongAttrPath(EvalState& state, const std::string& attrPath, /* Is i an index (integer) or a normal attribute name? */ enum { apAttr, apIndex } apType = apAttr; unsigned int attrIndex; - if (string2Int(attr, attrIndex)) { + if (absl::SimpleAtoi(attr, &attrIndex)) { apType = apIndex; } diff --git a/third_party/nix/src/libexpr/get-drvs.cc b/third_party/nix/src/libexpr/get-drvs.cc index bc40ec3fef6c..968108e78c51 100644 --- a/third_party/nix/src/libexpr/get-drvs.cc +++ b/third_party/nix/src/libexpr/get-drvs.cc @@ -4,6 +4,7 @@ #include <regex> #include <utility> +#include <absl/strings/numbers.h> #include <glog/logging.h> #include "derivations.hh" @@ -243,7 +244,7 @@ NixInt DrvInfo::queryMetaInt(const std::string& name, NixInt def) { /* Backwards compatibility with before we had support for integer meta fields. */ NixInt n; - if (string2Int(v->string.s, n)) { + if (absl::SimpleAtoi(v->string.s, &n)) { return n; } } diff --git a/third_party/nix/src/libexpr/names.cc b/third_party/nix/src/libexpr/names.cc index 20c326776cb7..769f9e99db29 100644 --- a/third_party/nix/src/libexpr/names.cc +++ b/third_party/nix/src/libexpr/names.cc @@ -2,6 +2,8 @@ #include <memory> +#include <absl/strings/numbers.h> + #include "util.hh" namespace nix { @@ -68,8 +70,8 @@ std::string nextComponent(std::string::const_iterator& p, static bool componentsLT(const std::string& c1, const std::string& c2) { int n1; int n2; - bool c1Num = string2Int(c1, n1); - bool c2Num = string2Int(c2, n2); + bool c1Num = absl::SimpleAtoi(c1, &n1); + bool c2Num = absl::SimpleAtoi(c2, &n2); if (c1Num && c2Num) { return n1 < n2; |