aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-19 12:35:03 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-19 12:35:03 +0200
commitd308aeaf53b7324af98dfa949a747526c241ef30 (patch)
treeacae7f07b45d26007e8a6bbc3d6c8bfa1bf5e34c /src/libutil
parent297b762513ad416582c0850095506f802ff5b1bb (diff)
Store Nix integers as longs
So on 64-bit systems, integers are now 64-bit. Fixes #158.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc8
-rw-r--r--src/libutil/util.hh7
2 files changed, 6 insertions, 9 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index bc07a84f4..5a88a158c 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -1083,14 +1083,6 @@ bool statusOk(int status)
}
-string int2String(int n)
-{
- std::ostringstream str;
- str << n;
- return str.str();
-}
-
-
bool hasSuffix(const string & s, const string & suffix)
{
return s.size() >= suffix.size() && string(s, s.size() - suffix.size()) == suffix;
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 6c83987c5..86c65b763 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -319,7 +319,12 @@ template<class N> bool string2Int(const string & s, N & n)
return str && str.get() == EOF;
}
-string int2String(int n);
+template<class N> string int2String(N n)
+{
+ std::ostringstream str;
+ str << n;
+ return str.str();
+}
/* Return true iff `s' ends in `suffix'. */