about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/primops
diff options
context:
space:
mode:
authorKane York <kanepyork@gmail.com>2020-08-02T00·17-0700
committerkanepyork <rikingcoding@gmail.com>2020-08-08T22·16+0000
commit1de00e6c42ee6beaaa490104888ef09be1d4a0d4 (patch)
treed98a37ae13525510e3b76feed56b3865360374d1 /third_party/nix/src/libexpr/primops
parent053a1380023591e8eb3f514b4214226c95da207d (diff)
chore(3p/nix): apply google-readability-casting r/1619
Command run: jq <compile_commands.json -r 'map(.file)|.[]' | grep -v '/generated/' | parallel clang-tidy -p compile_commands.json -checks=-*,google-readability-casting --fix

Manual fixes applied in src/nix-env/nix-env.cc, src/libstore/store-api.cc

Change-Id: I406b4be9368c557ca59329bf6f7002704e955f8d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1557
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/nix/src/libexpr/primops')
-rw-r--r--third_party/nix/src/libexpr/primops/fetchGit.cc3
-rw-r--r--third_party/nix/src/libexpr/primops/fetchMercurial.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/third_party/nix/src/libexpr/primops/fetchGit.cc b/third_party/nix/src/libexpr/primops/fetchGit.cc
index d0e0d389ccca..2b2ca476cbbb 100644
--- a/third_party/nix/src/libexpr/primops/fetchGit.cc
+++ b/third_party/nix/src/libexpr/primops/fetchGit.cc
@@ -129,7 +129,8 @@ GitInfo exportGit(ref<Store> store, const std::string& uri,
        git fetch to update the local ref to the remote ref. */
     struct stat st;
     doFetch = stat(localRefFile.c_str(), &st) != 0 ||
-              (uint64_t)st.st_mtime + settings.tarballTtl <= (uint64_t)now;
+              static_cast<uint64_t>(st.st_mtime) + settings.tarballTtl <=
+                  static_cast<uint64_t>(now);
   }
   if (doFetch) {
     DLOG(INFO) << "fetching Git repository '" << uri << "'";
diff --git a/third_party/nix/src/libexpr/primops/fetchMercurial.cc b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
index 0367b2120b66..df42b6d94884 100644
--- a/third_party/nix/src/libexpr/primops/fetchMercurial.cc
+++ b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
@@ -92,7 +92,8 @@ HgInfo exportMercurial(ref<Store> store, const std::string& uri,
   time_t now = time(0);
   struct stat st;
   if (stat(stampFile.c_str(), &st) != 0 ||
-      (uint64_t)st.st_mtime + settings.tarballTtl <= (uint64_t)now) {
+      static_cast<uint64_t>(st.st_mtime) + settings.tarballTtl <=
+          static_cast<uint64_t>(now)) {
     /* Except that if this is a commit hash that we already have,
        we don't have to pull again. */
     if (!(std::regex_match(rev, commitHashRegex) && pathExists(cacheDir) &&