Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Path EvalState::toRealPath(const Path & path, const PathSet & context)
!context.empty() && store->isInStore(path)
? store->toRealPath(path)
: path;
};
}


Value * EvalState::addConstant(const string & name, Value & v)
Expand Down
2 changes: 1 addition & 1 deletion src/libexpr/json-to-value.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace nix {

MakeError(JSONParseError, EvalError)
MakeError(JSONParseError, EvalError);

void parseJSON(EvalState & state, const string & s, Value & v);

Expand Down
16 changes: 8 additions & 8 deletions src/libexpr/nixexpr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
namespace nix {


MakeError(EvalError, Error)
MakeError(ParseError, Error)
MakeError(AssertionError, EvalError)
MakeError(ThrownError, AssertionError)
MakeError(Abort, EvalError)
MakeError(TypeError, EvalError)
MakeError(UndefinedVarError, Error)
MakeError(RestrictedPathError, Error)
MakeError(EvalError, Error);
MakeError(ParseError, Error);
MakeError(AssertionError, EvalError);
MakeError(ThrownError, AssertionError);
MakeError(Abort, EvalError);
MakeError(TypeError, EvalError);
MakeError(UndefinedVarError, Error);
MakeError(RestrictedPathError, Error);


/* Position objects. */
Expand Down
2 changes: 1 addition & 1 deletion src/libstore/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ void replaceValidPath(const Path & storePath, const Path tmpPath)
}


MakeError(NotDeterministic, BuildError)
MakeError(NotDeterministic, BuildError);


void DerivationGoal::buildDone()
Expand Down
12 changes: 6 additions & 6 deletions src/libstore/store-api.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
namespace nix {


MakeError(SubstError, Error)
MakeError(BuildError, Error) /* denotes a permanent build failure */
MakeError(InvalidPath, Error)
MakeError(Unsupported, Error)
MakeError(SubstituteGone, Error)
MakeError(SubstituterDisabled, Error)
MakeError(SubstError, Error);
MakeError(BuildError, Error); // denotes a permanent build failure
MakeError(InvalidPath, Error);
MakeError(Unsupported, Error);
MakeError(SubstituteGone, Error);
MakeError(SubstituterDisabled, Error);


struct BasicDerivation;
Expand Down
26 changes: 13 additions & 13 deletions src/libutil/args.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,39 @@ public:
Args & args;
Flag::ptr flag;
friend class Args;
FlagMaker(Args & args) : args(args), flag(std::make_shared<Flag>()) { };
FlagMaker(Args & args) : args(args), flag(std::make_shared<Flag>()) { }
public:
~FlagMaker();
FlagMaker & longName(const std::string & s) { flag->longName = s; return *this; };
FlagMaker & shortName(char s) { flag->shortName = s; return *this; };
FlagMaker & description(const std::string & s) { flag->description = s; return *this; };
FlagMaker & label(const std::string & l) { flag->arity = 1; flag->labels = {l}; return *this; };
FlagMaker & labels(const Strings & ls) { flag->arity = ls.size(); flag->labels = ls; return *this; };
FlagMaker & arity(size_t arity) { flag->arity = arity; return *this; };
FlagMaker & handler(std::function<void(std::vector<std::string>)> handler) { flag->handler = handler; return *this; };
FlagMaker & handler(std::function<void()> handler) { flag->handler = [handler](std::vector<std::string>) { handler(); }; return *this; };
FlagMaker & longName(const std::string & s) { flag->longName = s; return *this; }
FlagMaker & shortName(char s) { flag->shortName = s; return *this; }
FlagMaker & description(const std::string & s) { flag->description = s; return *this; }
FlagMaker & label(const std::string & l) { flag->arity = 1; flag->labels = {l}; return *this; }
FlagMaker & labels(const Strings & ls) { flag->arity = ls.size(); flag->labels = ls; return *this; }
FlagMaker & arity(size_t arity) { flag->arity = arity; return *this; }
FlagMaker & handler(std::function<void(std::vector<std::string>)> handler) { flag->handler = handler; return *this; }
FlagMaker & handler(std::function<void()> handler) { flag->handler = [handler](std::vector<std::string>) { handler(); }; return *this; }
FlagMaker & handler(std::function<void(std::string)> handler) {
flag->arity = 1;
flag->handler = [handler](std::vector<std::string> ss) { handler(std::move(ss[0])); };
return *this;
};
FlagMaker & category(const std::string & s) { flag->category = s; return *this; };
}
FlagMaker & category(const std::string & s) { flag->category = s; return *this; }

template<class T>
FlagMaker & dest(T * dest)
{
flag->arity = 1;
flag->handler = [=](std::vector<std::string> ss) { *dest = ss[0]; };
return *this;
};
}

template<class T>
FlagMaker & set(T * dest, const T & val)
{
flag->arity = 0;
flag->handler = [=](std::vector<std::string> ss) { *dest = val; };
return *this;
};
}

FlagMaker & mkHashTypeFlag(HashType * ht);
};
Expand Down
2 changes: 1 addition & 1 deletion src/libutil/serialise.hh
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Sink & operator << (Sink & sink, const Strings & s);
Sink & operator << (Sink & sink, const StringSet & s);


MakeError(SerialisationError, Error)
MakeError(SerialisationError, Error);


template<typename T>
Expand Down
2 changes: 1 addition & 1 deletion src/libutil/thread-pool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace nix {

MakeError(ThreadPoolShutDown, Error)
MakeError(ThreadPoolShutDown, Error);

/* A simple thread pool that executes a queue of work items
(lambdas). */
Expand Down
4 changes: 2 additions & 2 deletions src/libutil/types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ public:
{ \
public: \
using superClass::superClass; \
};
}

MakeError(Error, BaseError)
MakeError(Error, BaseError);

class SysError : public Error
{
Expand Down
6 changes: 3 additions & 3 deletions src/libutil/util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void readFull(int fd, unsigned char * buf, size_t count);
void writeFull(int fd, const unsigned char * buf, size_t count, bool allowInterrupts = true);
void writeFull(int fd, const string & s, bool allowInterrupts = true);

MakeError(EndOfFile, Error)
MakeError(EndOfFile, Error);


/* Read a file descriptor until EOF occurs. */
Expand Down Expand Up @@ -333,10 +333,10 @@ void inline checkInterrupt()
_interrupted();
}

MakeError(Interrupted, BaseError)
MakeError(Interrupted, BaseError);


MakeError(FormatError, Error)
MakeError(FormatError, Error);


/* String tokenizer. */
Expand Down