about summary refs log tree commit diff
path: root/third_party/nix/src/nix/repl.cc
diff options
context:
space:
mode:
authorKane York <kanepyork@gmail.com>2020-08-01T22·32-0700
committerkanepyork <rikingcoding@gmail.com>2020-08-01T22·45+0000
commit72fc2fd27e8ca9ddd6dad7f1c8f508e115aa2b60 (patch)
treeeacd58ae5e0de9ffaadc265b8fd417f2f62d0433 /third_party/nix/src/nix/repl.cc
parentcc3c45f739133162c840d500c0d633f46a524e06 (diff)
fix(3p/nix): revert "apply all clang-tidy fixes" r/1534
This reverts commit ef54f5da9fa30b5c302f2a49595ee5d041f9706a.

Resolved conflicts:
	third_party/nix/src/libexpr/eval.cc
	third_party/nix/src/libstore/builtins/fetchurl.cc
	third_party/nix/src/libstore/references.cc
	third_party/nix/src/libutil/hash.cc
	third_party/nix/src/nix-daemon/nix-daemon.cc

Change-Id: Ib9cf6e96a79a23bde3983579ced3f92e530cb011
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1547
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'third_party/nix/src/nix/repl.cc')
-rw-r--r--third_party/nix/src/nix/repl.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/third_party/nix/src/nix/repl.cc b/third_party/nix/src/nix/repl.cc
index 91bf500893..7644b7b8c2 100644
--- a/third_party/nix/src/nix/repl.cc
+++ b/third_party/nix/src/nix/repl.cc
@@ -38,14 +38,14 @@ namespace nix {
 struct NixRepl : gc {
   std::string curDir;
   EvalState state;
-  Bindings* autoArgs{};
+  Bindings* autoArgs;
 
   Strings loadedFiles;
 
   const static int envSize = 32768;
   StaticEnv staticEnv;
-  Env* env{};
-  int displ{};
+  Env* env;
+  int displ;
   StringSet varNames;
 
   const Path historyFile;
@@ -194,7 +194,7 @@ static int listPossibleCallback(char* s, char*** avp) {
     return p;
   };
 
-  vp = check(static_cast<char**>(malloc(possible.size() * sizeof(char*))));
+  vp = check((char**)malloc(possible.size() * sizeof(char*)));
 
   for (auto& p : possible) {
     vp[ac++] = check(strdup(p.c_str()));
@@ -272,8 +272,8 @@ void NixRepl::mainLoop(const std::vector<std::string>& files) {
 }
 
 bool NixRepl::getLine(std::string& input, const std::string& prompt) {
-  struct sigaction act {};
-  struct sigaction old {};
+  struct sigaction act;
+  struct sigaction old;
   sigset_t savedSignalMask;
   sigset_t set;
 
@@ -334,8 +334,8 @@ StringSet NixRepl::completePrefix(const std::string& prefix) {
     cur = std::string(prefix, start + 1);
   }
 
-  size_t slash = 0;
-  size_t dot = 0;
+  size_t slash;
+  size_t dot;
 
   if ((slash = cur.rfind('/')) != std::string::npos) {
     try {
@@ -367,7 +367,7 @@ StringSet NixRepl::completePrefix(const std::string& prefix) {
       std::string cur2 = std::string(cur, dot + 1);
 
       Expr* e = parseString(expr);
-      Value v{};
+      Value v;
       e->eval(state, *env, v);
       state.forceAttrs(v);
 
@@ -477,7 +477,7 @@ bool NixRepl::processLine(std::string line) {
   }
 
   else if (command == ":a" || command == ":add") {
-    Value v{};
+    Value v;
     evalString(arg, v);
     addAttrsToScope(v);
   }
@@ -493,14 +493,14 @@ bool NixRepl::processLine(std::string line) {
   }
 
   else if (command == ":t") {
-    Value v{};
+    Value v;
     evalString(arg, v);
     std::cout << showType(v) << std::endl;
 
   } else if (command == ":u") {
-    Value v{};
-    Value f{};
-    Value result{};
+    Value v;
+    Value f;
+    Value result;
     evalString(arg, v);
     evalString(
         "drv: (import <nixpkgs> {}).runCommand \"shell\" { buildInputs = [ drv "
@@ -513,7 +513,7 @@ bool NixRepl::processLine(std::string line) {
   }
 
   else if (command == ":b" || command == ":i" || command == ":s") {
-    Value v{};
+    Value v;
     evalString(arg, v);
     Path drvPath = getDerivationPath(v);
 
@@ -540,7 +540,7 @@ bool NixRepl::processLine(std::string line) {
   }
 
   else if (command == ":p" || command == ":print") {
-    Value v{};
+    Value v;
     evalString(arg, v);
     printValue(std::cout, v, 1000000000) << std::endl;
   }
@@ -563,7 +563,7 @@ bool NixRepl::processLine(std::string line) {
       v.thunk.expr = e;
       addVarToScope(state.symbols.Create(name), v);
     } else {
-      Value v{};
+      Value v;
       evalString(line, v);
       printValue(std::cout, v, 1) << std::endl;
     }
@@ -575,8 +575,8 @@ bool NixRepl::processLine(std::string line) {
 void NixRepl::loadFile(const Path& path) {
   loadedFiles.remove(path);
   loadedFiles.push_back(path);
-  Value v{};
-  Value v2{};
+  Value v;
+  Value v2;
   state.evalFile(lookupFileArg(state, path), v);
   state.autoCallFunction(*autoArgs, v, v2);
   addAttrsToScope(v2);
@@ -626,7 +626,7 @@ void NixRepl::addVarToScope(const Symbol& name, Value& v) {
   }
   staticEnv.vars[name] = displ;
   env->values[displ++] = &v;
-  varNames.insert(std::string(name));
+  varNames.insert((std::string)name);
 }
 
 Expr* NixRepl::parseString(const std::string& s) {