aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-01-21 18:29:55 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-01-21 18:29:55 +0100
commit94f9c14d526abfe9b18045fc638e8f5a3a670210 (patch)
tree3bdd2cc964314dc48959171a2364d51dbf71f8e2 /src
parenta26307b28192e61bc06b5f5ef42f0fb51858d822 (diff)
Fix some clang warnings
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/eval.hh14
-rw-r--r--src/libexpr/nixexpr.hh3
-rw-r--r--src/libexpr/parser.y2
-rw-r--r--src/libexpr/value.hh4
-rw-r--r--src/libstore/build.cc5
-rw-r--r--src/libstore/gc.cc2
6 files changed, 12 insertions, 18 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 45ab423c1..5ae5a1e3c 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -82,8 +82,6 @@ void copyContext(const Value & v, PathSet & context);
paths. */
typedef std::map<Path, Path> SrcToStore;
-struct EvalState;
-
std::ostream & operator << (std::ostream & str, const Value & v);
@@ -216,9 +214,9 @@ private:
inline Value * lookupVar(Env * env, const ExprVar & var, bool noEval);
- friend class ExprVar;
- friend class ExprAttrs;
- friend class ExprLet;
+ friend struct ExprVar;
+ friend struct ExprAttrs;
+ friend struct ExprLet;
Expr * parse(const char * text, const Path & path,
const Path & basePath, StaticEnv & staticEnv);
@@ -278,9 +276,9 @@ private:
typedef std::map<Pos, unsigned int> AttrSelects;
AttrSelects attrSelects;
- friend class ExprOpUpdate;
- friend class ExprOpConcatLists;
- friend class ExprSelect;
+ friend struct ExprOpUpdate;
+ friend struct ExprOpConcatLists;
+ friend struct ExprSelect;
friend void prim_getAttr(EvalState & state, Value * * args, Value & v);
};
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index bc6993477..7586fffb8 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -48,7 +48,7 @@ std::ostream & operator << (std::ostream & str, const Pos & pos);
struct Env;
struct Value;
-struct EvalState;
+class EvalState;
struct StaticEnv;
struct Expr;
@@ -71,6 +71,7 @@ string showAttrPath(const AttrPath & attrPath);
struct Expr
{
+ virtual ~Expr() { };
virtual void show(std::ostream & str);
virtual void bindVars(const StaticEnv & env);
virtual void eval(EvalState & state, Env & env, Value & v);
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index d89d92c7a..8a084fea0 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -252,7 +252,7 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, const char * err
nix::Formals * formals;
nix::Formal * formal;
nix::NixInt n;
- char * id; // !!! -> Symbol
+ const char * id; // !!! -> Symbol
char * path;
char * uri;
std::vector<nix::AttrName> * attrNames;
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh
index 982582793..2feb2f949 100644
--- a/src/libexpr/value.hh
+++ b/src/libexpr/value.hh
@@ -22,13 +22,13 @@ typedef enum {
} ValueType;
-struct Bindings;
+class Bindings;
struct Env;
struct Expr;
struct ExprLambda;
struct PrimOp;
struct PrimOp;
-struct Symbol;
+class Symbol;
typedef long NixInt;
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 4329d9a22..1b379752f 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -75,12 +75,9 @@ using std::map;
static string pathNullDevice = "/dev/null";
-static const uid_t rootUserId = 0;
-
-
/* Forward definition. */
class Worker;
-class HookInstance;
+struct HookInstance;
/* A pointer to a goal. */
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index d212259f3..79bd7d56b 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -22,8 +22,6 @@ static string gcLockName = "gc.lock";
static string tempRootsDir = "temproots";
static string gcRootsDir = "gcroots";
-static const int defaultGcLevel = 1000;
-
/* Acquire the global GC lock. This is used to prevent new Nix
processes from starting after the temporary root files have been