Merge pull request #6 from John-Colvin/patch-1

fixes for git master dmd
This commit is contained in:
Ferdinand Majerech 2013-03-23 10:19:20 -07:00
commit 9f9c96e317
3 changed files with 6 additions and 7 deletions

View file

@ -428,11 +428,11 @@ long constructLong(ref Node node)
//Zero. //Zero.
if(value == "0") {result = cast(long)0;} if(value == "0") {result = cast(long)0;}
//Binary. //Binary.
else if(value.startsWith("0b")){result = sign * parse!int(value[2 .. $], 2);} else if(value.startsWith("0b")){result = sign * to!int(value[2 .. $], 2);}
//Hexadecimal. //Hexadecimal.
else if(value.startsWith("0x")){result = sign * parse!int(value[2 .. $], 16);} else if(value.startsWith("0x")){result = sign * to!int(value[2 .. $], 16);}
//Octal. //Octal.
else if(value[0] == '0') {result = sign * parse!int(value, 8);} else if(value[0] == '0') {result = sign * to!int(value, 8);}
//Sexagesimal. //Sexagesimal.
else if(value.canFind(":")) else if(value.canFind(":"))
{ {

View file

@ -1,4 +1,3 @@
// Copyright Ferdinand Majerech 2011. // Copyright Ferdinand Majerech 2011.
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@ -1585,7 +1584,7 @@ struct ScalarWriter
} }
///Determine hints (indicators) for block scalar. ///Determine hints (indicators) for block scalar.
size_t determineBlockHints(ref char[] hints, uint bestIndent) const pure @trusted size_t determineBlockHints(char[] hints, uint bestIndent) const pure @trusted
{ {
size_t hintsIdx = 0; size_t hintsIdx = 0;
if(text_.length == 0){return hintsIdx;} if(text_.length == 0){return hintsIdx;}

View file

@ -302,7 +302,7 @@ final class Reader
try for(size_t c = 0; chars && !decoder_.done;) try for(size_t c = 0; chars && !decoder_.done;)
{ {
const slice = decoder_.getDChars(chars); const slice = decoder_.getDChars(chars);
buffer_[oldLength + c .. oldLength + c + slice.length] = slice; buffer_[oldLength + c .. oldLength + c + slice.length] = slice[];
c += slice.length; c += slice.length;
chars -= slice.length; chars -= slice.length;
} }
@ -626,7 +626,7 @@ struct UTFBlockDecoder(size_t bufferSize_) if (bufferSize_ % 2 == 0)
* *
* Returns: True if all the characters are printable, false otherwise. * Returns: True if all the characters are printable, false otherwise.
*/ */
bool printable(const ref dchar[] chars) pure @safe nothrow bool printable(const dchar[] chars) pure @safe nothrow
{ {
foreach(c; chars) foreach(c; chars)
{ {