From dba33d4018c07699b59f024ca61442c896579c64 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Feb 2014 11:48:42 +0100 Subject: [PATCH] Minor style fixes --- src/download-via-ssh/download-via-ssh.cc | 14 +++++++++++--- src/libstore/globals.cc | 2 +- src/libstore/globals.hh | 2 +- src/nix-store/nix-store.cc | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/download-via-ssh/download-via-ssh.cc b/src/download-via-ssh/download-via-ssh.cc index d85f1572f..68fdeb4ca 100644 --- a/src/download-via-ssh/download-via-ssh.cc +++ b/src/download-via-ssh/download-via-ssh.cc @@ -16,7 +16,9 @@ using namespace nix; // * use a database // * show progress -static std::pair connect(string conn) { + +static std::pair connect(const string & conn) +{ Pipe to, from; to.create(); from.create(); @@ -51,7 +53,9 @@ static std::pair connect(string conn) { return std::pair(to.writeSide.borrow(), from.readSide.borrow()); } -static void substitute(std::pair & pipes, Path storePath, Path destPath) { + +static void substitute(std::pair & pipes, Path storePath, Path destPath) +{ writeInt(cmdSubstitute, pipes.first); writeString(storePath, pipes.first); pipes.first.flush(); @@ -59,7 +63,9 @@ static void substitute(std::pair & pipes, Path storePath, Path std::cout << std::endl; } -static void query(std::pair & pipes) { + +static void query(std::pair & pipes) +{ writeInt(cmdQuery, pipes.first); for (string line; getline(std::cin, line);) { Strings tokenized = tokenizeString(line); @@ -92,6 +98,7 @@ static void query(std::pair & pipes) { } } + void run(Strings args) { if (args.empty()) @@ -129,6 +136,7 @@ void run(Strings args) throw UsageError(format("download-via-ssh: unknown command `%1%'") % *i); } + void printHelp() { std::cerr << "Usage: download-via-ssh --query|--substitute store-path dest-path" << std::endl; diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 1d4bcd94f..40000c9db 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -215,7 +215,7 @@ string Settings::pack() } -void Settings::unpack(const string &pack) { +void Settings::unpack(const string & pack) { Strings lines = tokenizeString(pack, "\n"); foreach (Strings::iterator, i, lines) { string::size_type eq = i->find('='); diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 13772c65c..31324478b 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -25,7 +25,7 @@ struct Settings { string pack(); - void unpack(const string &pack); + void unpack(const string & pack); SettingsMap getOverrides(); diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 350a4ce0f..f017b9ead 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -835,7 +835,7 @@ static void opClearFailedPaths(Strings opFlags, Strings opArgs) } -// Serve the nix store in a way usable by a restricted ssh user +/* Serve the nix store in a way usable by a restricted ssh user. */ static void opServe(Strings opFlags, Strings opArgs) { if (!opArgs.empty() || !opFlags.empty())