From bfd865481695f94f55187175ef03c82c1132f4bc Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Tue, 17 Mar 2015 14:08:31 +0800 Subject: [PATCH] Fixed compilation for dmd 2.067 --- source/dyaml/composer.d | 4 ++-- source/dyaml/constructor.d | 4 ++-- source/dyaml/fastcharsearch.d | 2 +- source/dyaml/node.d | 4 ++-- source/dyaml/nogcutil.d | 1 + source/dyaml/representer.d | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/dyaml/composer.d b/source/dyaml/composer.d index e7f2b32..e9bba34 100644 --- a/source/dyaml/composer.d +++ b/source/dyaml/composer.d @@ -55,13 +55,13 @@ final class Composer ///We need one appender for each nesting level that involves ///a pair array, as the inner levels are processed as a ///part of the outer levels. Used as a stack. - Appender!(Node.Pair[], Node.Pair)[] pairAppenders_; + Appender!(Node.Pair[])[] pairAppenders_; ///Used to reduce allocations when creating node arrays. /// ///We need one appender for each nesting level that involves ///a node array, as the inner levels are processed as a ///part of the outer levels. Used as a stack. - Appender!(Node[], Node)[] nodeAppenders_; + Appender!(Node[])[] nodeAppenders_; public: /** diff --git a/source/dyaml/constructor.d b/source/dyaml/constructor.d index 56cee4c..3a56ab8 100644 --- a/source/dyaml/constructor.d +++ b/source/dyaml/constructor.d @@ -347,7 +347,7 @@ final class Constructor * ctor = Constructor function. */ auto addConstructor(T)(const Tag tag, T function(ref Node) ctor) - @safe pure nothrow + @safe nothrow { assert((tag in fromScalar_) is null && (tag in fromSequence_) is null && @@ -859,7 +859,7 @@ struct MyStruct { int x, y, z; - const int opCmp(ref const MyStruct s) const pure @safe nothrow + int opCmp(ref const MyStruct s) const pure @safe nothrow { if(x != s.x){return x - s.x;} if(y != s.y){return y - s.y;} diff --git a/source/dyaml/fastcharsearch.d b/source/dyaml/fastcharsearch.d index 47d2df6..8aa1c60 100644 --- a/source/dyaml/fastcharsearch.d +++ b/source/dyaml/fastcharsearch.d @@ -70,7 +70,7 @@ string searchCode(dstring chars, uint tableSize)() @safe pure //nothrow { code ~= q{ - static immutable ubyte table_[%s] = [ + static immutable ubyte[%s] table_ = [ %s]; }.format(tableSize, table[].map!(c => c ? q{true} : q{false}).join(q{, })); } diff --git a/source/dyaml/node.d b/source/dyaml/node.d index 0c96097..f7a3703 100644 --- a/source/dyaml/node.d +++ b/source/dyaml/node.d @@ -1804,7 +1804,7 @@ package: // // Params: pairs = Appender managing the array of pairs to merge into. // toMerge = Pair to merge. -void merge(ref Appender!(Node.Pair[], Node.Pair) pairs, ref Node.Pair toMerge) @trusted +void merge(ref Appender!(Node.Pair[]) pairs, ref Node.Pair toMerge) @trusted { foreach(ref pair; pairs.data) { @@ -1820,7 +1820,7 @@ void merge(ref Appender!(Node.Pair[], Node.Pair) pairs, ref Node.Pair toMerge) @ // // Params: pairs = Appender managing the array of pairs to merge into. // toMerge = Pairs to merge. -void merge(ref Appender!(Node.Pair[], Node.Pair) pairs, Node.Pair[] toMerge) @trusted +void merge(ref Appender!(Node.Pair[]) pairs, Node.Pair[] toMerge) @trusted { bool eq(ref Node.Pair a, ref Node.Pair b){return a.key == b.key;} diff --git a/source/dyaml/nogcutil.d b/source/dyaml/nogcutil.d index e4373b3..d907bbc 100644 --- a/source/dyaml/nogcutil.d +++ b/source/dyaml/nogcutil.d @@ -12,6 +12,7 @@ module dyaml.nogcutil; import std.traits; import std.typecons; +import std.typetuple; import std.range; diff --git a/source/dyaml/representer.d b/source/dyaml/representer.d index a06c63a..2c436b3 100644 --- a/source/dyaml/representer.d +++ b/source/dyaml/representer.d @@ -602,7 +602,7 @@ struct MyStruct { int x, y, z; - const int opCmp(ref const MyStruct s) const pure @safe nothrow + int opCmp(ref const MyStruct s) const pure @safe nothrow { if(x != s.x){return x - s.x;} if(y != s.y){return y - s.y;}