diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-20T21·27+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-20T21·27+0100 |
commit | 689ef502f5b0655c9923ed77da2ae3504630f473 (patch) | |
tree | 3e331c153646f136875f047cc3b9f0aad8c86341 /third_party/nix/src/libstore/legacy-ssh-store.cc | |
parent | d331d3a0b5c497a46e2636f308234be66566c04c (diff) |
refactor(3p/nix): Apply clang-tidy's readability-* fixes r/788
This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
Diffstat (limited to 'third_party/nix/src/libstore/legacy-ssh-store.cc')
-rw-r--r-- | third_party/nix/src/libstore/legacy-ssh-store.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/third_party/nix/src/libstore/legacy-ssh-store.cc b/third_party/nix/src/libstore/legacy-ssh-store.cc index 7723581136d8..9a84e0295657 100644 --- a/third_party/nix/src/libstore/legacy-ssh-store.cc +++ b/third_party/nix/src/libstore/legacy-ssh-store.cc @@ -58,7 +58,7 @@ struct LegacySSHStore : public Store { auto conn = make_ref<Connection>(); conn->sshConn = master.startCommand( fmt("%s --serve --write", remoteProgram) + - (remoteStore.get() == "" + (remoteStore.get().empty() ? "" : " --store " + shellEscape(remoteStore.get()))); conn->to = FdSink(conn->sshConn->in.get()); @@ -120,7 +120,7 @@ struct LegacySSHStore : public Store { } auto s = readString(conn->from); - assert(s == ""); + assert(s.empty()); callback(std::move(info)); } catch (...) { @@ -139,8 +139,8 @@ struct LegacySSHStore : public Store { if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 5) { conn->to << cmdAddToStoreNar << info.path << info.deriver << info.narHash.to_string(Base16, false) << info.references - << info.registrationTime << info.narSize << info.ultimate - << info.sigs << info.ca; + << info.registrationTime << info.narSize + << static_cast<uint64_t>(info.ultimate) << info.sigs << info.ca; try { copyNAR(source, conn->to); } catch (...) { @@ -201,7 +201,8 @@ struct LegacySSHStore : public Store { conn->to << settings.maxLogSize; } if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 3) { - conn->to << settings.buildRepeat << settings.enforceDeterminism; + conn->to << settings.buildRepeat + << static_cast<uint64_t>(settings.enforceDeterminism); } conn->to.flush(); @@ -231,7 +232,8 @@ struct LegacySSHStore : public Store { auto conn(connections->get()); - conn->to << cmdQueryClosure << includeOutputs << paths; + conn->to << cmdQueryClosure << static_cast<uint64_t>(includeOutputs) + << paths; conn->to.flush(); auto res = readStorePaths<PathSet>(*this, conn->from); @@ -243,7 +245,7 @@ struct LegacySSHStore : public Store { NoSubstitute) override { auto conn(connections->get()); - conn->to << cmdQueryValidPaths << false // lock + conn->to << cmdQueryValidPaths << 0u // lock << maybeSubstitute << paths; conn->to.flush(); |