Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
rename rt.util.string.intToString -> uintToString
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Jan 11, 2013
1 parent 7ec22ab commit 7a3fd42
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/object_.d
Expand Up @@ -559,7 +559,7 @@ class TypeInfo_StaticArray : TypeInfo
override string toString() const
{
char[20] tmp = void;
return cast(string)(value.toString() ~ "[" ~ tmp.intToString(len) ~ "]");
return cast(string)(value.toString() ~ "[" ~ tmp.uintToString(len) ~ "]");
}

override bool opEquals(Object o)
Expand Down Expand Up @@ -1375,7 +1375,7 @@ class Throwable : Object

if (file)
{
buf ~= this.classinfo.name ~ "@" ~ file ~ "(" ~ tmp.intToString(line) ~ ")";
buf ~= this.classinfo.name ~ "@" ~ file ~ "(" ~ tmp.uintToString(line) ~ ")";
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/rt/arrayassign.d
Expand Up @@ -36,7 +36,7 @@ extern (C) void[] _d_arrayassign(TypeInfo ti, void[] from, void[] to)
char[10] tmp1 = void;
char[10] tmp2 = void;
string msg = "lengths don't match for array copy, "c;
msg ~= tmp1.intToString(to.length) ~ " = " ~ tmp2.intToString(from.length);
msg ~= tmp1.uintToString(to.length) ~ " = " ~ tmp2.uintToString(from.length);
throw new Error(msg);
}

Expand Down Expand Up @@ -92,7 +92,7 @@ extern (C) void[] _d_arrayctor(TypeInfo ti, void[] from, void[] to)
{
char[10] tmp = void;
string msg = "lengths don't match for array initialization,"c;
msg ~= tmp.intToString(to.length) ~ " = " ~ tmp.intToString(from.length);
msg ~= tmp.uintToString(to.length) ~ " = " ~ tmp.uintToString(from.length);
throw new Error(msg);
}

Expand Down
2 changes: 1 addition & 1 deletion src/rt/arraycat.d
Expand Up @@ -32,7 +32,7 @@ byte[] _d_arraycopy(size_t size, byte[] from, byte[] to)
char[10] tmp1 = void;
char[10] tmp2 = void;
string msg = "lengths don't match for array copy, "c;
msg ~= tmp1.intToString(to.length) ~ " = " ~ tmp2.intToString(from.length);
msg ~= tmp1.uintToString(to.length) ~ " = " ~ tmp2.uintToString(from.length);
throw new Error(msg);
}
else if (to.ptr + to.length * size <= from.ptr ||
Expand Down
2 changes: 1 addition & 1 deletion src/rt/util/console.d
Expand Up @@ -49,7 +49,7 @@ struct Console
Console opCall( ulong val )
{
char[20] tmp = void;
return opCall( tmp.intToString( val ) );
return opCall( tmp.uintToString( val ) );
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/rt/util/string.d
Expand Up @@ -19,8 +19,7 @@ private import core.stdc.string;
pure:
nothrow:

// This should be renamed to uintToString()
char[] intToString( char[] buf, uint val )
char[] uintToString( char[] buf, uint val )
{
assert( buf.length > 9 );
auto p = buf.ptr + buf.length;
Expand All @@ -33,7 +32,7 @@ char[] intToString( char[] buf, uint val )
return buf[p - buf.ptr .. $];
}

char[] intToString( char[] buf, ulong val )
char[] uintToString( char[] buf, ulong val )
{
assert( buf.length >= 20 );
auto p = buf.ptr + buf.length;
Expand Down

0 comments on commit 7a3fd42

Please sign in to comment.