1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

Store Nix integers as longs

So on 64-bit systems, integers are now 64-bit.

Fixes #158.
This commit is contained in:
Eelco Dolstra 2013-08-19 12:35:03 +02:00
parent 297b762513
commit d308aeaf53
9 changed files with 25 additions and 23 deletions

View file

@ -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;

View file

@ -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'. */