about summary refs log tree commit diff
path: root/src/nix-hash
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-09-04T21·06+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-09-04T21·06+0000
commit75068e7d753cf6cbe45a4bf294000dca9bd41d8b (patch)
treec6274cc10caab08349b5585206034f41ca4a575f /src/nix-hash
parentaab88127321344d5818d823bff515d127108d058 (diff)
* Use a proper namespace.
* Optimise header file usage a bit.
* Compile the parser as C++.

Diffstat (limited to 'src/nix-hash')
-rw-r--r--src/nix-hash/nix-hash.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nix-hash/nix-hash.cc b/src/nix-hash/nix-hash.cc
index dd2ed8d4f4..1282af070e 100644
--- a/src/nix-hash/nix-hash.cc
+++ b/src/nix-hash/nix-hash.cc
@@ -5,9 +5,12 @@
 #include "help.txt.hh"
 
 
+using namespace nix;
+
+
 void printHelp()
 {
-    cout << string((char *) helpText, sizeof helpText);
+    std::cout << string((char *) helpText, sizeof helpText);
 }
 
 
@@ -43,7 +46,7 @@ void run(Strings args)
         for (Strings::iterator i = ss.begin(); i != ss.end(); ++i) {
             Hash h = flat ? hashFile(ht, *i) : hashPath(ht, *i);
             if (truncate && h.hashSize > 20) h = compressHash(h, 20);
-            cout << format("%1%\n") %
+            std::cout << format("%1%\n") %
                 (base32 ? printHash32(h) : printHash(h));
         }
     }
@@ -51,7 +54,7 @@ void run(Strings args)
     else {
         for (Strings::iterator i = ss.begin(); i != ss.end(); ++i) {
             Hash h = op == opTo16 ? parseHash32(ht, *i) : parseHash(ht, *i);
-            cout << format("%1%\n") %
+            std::cout << format("%1%\n") %
                 (op == opTo16 ? printHash(h) : printHash32(h));
         }
     }