Fixed deprecation errors for DMD 2.066

This commit is contained in:
Ferdinand Majerech 2014-07-19 04:17:18 +02:00
parent c856a35eb0
commit bc7519f561
11 changed files with 38 additions and 38 deletions

View file

@ -84,7 +84,7 @@ final class Composer
parser_ = null;
resolver_ = null;
constructor_ = null;
clear(anchors_);
anchors_.destroy();
anchors_ = null;
}
@ -167,7 +167,7 @@ final class Composer
//Drop the DOCUMENT-END event.
parser_.getEvent();
clear(anchors_);
anchors_.destroy();
return node;
}

View file

@ -108,11 +108,11 @@ final class Constructor
/// Destroy the constructor.
pure @safe nothrow ~this()
{
clear(fromScalar_);
fromScalar_.destroy();
fromScalar_ = null;
clear(fromSequence_);
fromSequence_.destroy();
fromSequence_ = null;
clear(fromMapping_);
fromMapping_.destroy();
fromMapping_ = null;
}
@ -698,7 +698,7 @@ Node.Pair[] constructOrderedMap(ref Node node)
//Detect duplicates.
//TODO this should be replaced by something with deterministic memory allocation.
auto keys = redBlackTree!Node();
scope(exit){clear(keys);}
scope(exit){keys.destroy();}
foreach(ref pair; pairs)
{
enforce(!(pair.key in keys),
@ -767,7 +767,7 @@ Node[] constructSet(ref Node node)
// memory allocation if possible.
// Detect duplicates.
ubyte[Node] map;
scope(exit){clear(map);}
scope(exit){map.destroy();}
Node[] nodes;
foreach(ref pair; pairs)
{
@ -837,7 +837,7 @@ Node.Pair[] constructMap(ref Node node)
//Detect duplicates.
//TODO this should be replaced by something with deterministic memory allocation.
auto keys = redBlackTree!Node();
scope(exit){clear(keys);}
scope(exit){keys.destroy();}
foreach(ref pair; pairs)
{
enforce(!(pair.key in keys),

View file

@ -189,14 +189,14 @@ struct Dumper
///Specify custom Resolver to use.
@property void resolver(Resolver resolver) @trusted
{
clear(resolver_);
resolver_.destroy();
resolver_ = resolver;
}
///Specify custom Representer to use.
@property void representer(Representer representer) @trusted
{
clear(representer_);
representer_.destroy();
representer_ = representer;
}

View file

@ -187,14 +187,14 @@ struct Emitter
@trusted ~this()
{
stream_ = null;
clear(states_);
clear(events_);
clear(indents_);
clear(tagDirectives_);
states_.destroy();
events_.destroy();
indents_.destroy();
tagDirectives_.destroy();
tagDirectives_ = null;
clear(preparedAnchor_);
preparedAnchor_.destroy();
preparedAnchor_ = null;
clear(preparedTag_);
preparedTag_.destroy();
preparedTag_ = null;
}
@ -206,7 +206,7 @@ struct Emitter
{
event_ = events_.pop();
state_();
clear(event_);
event_.destroy();
}
}

View file

@ -167,9 +167,9 @@ struct Loader
///Destroy the Loader.
@trusted ~this()
{
clear(reader_);
clear(scanner_);
clear(parser_);
reader_.destroy();
scanner_.destroy();
parser_.destroy();
}
///Set stream _name. Used in debugging messages.

View file

@ -146,11 +146,11 @@ final class Parser
///Destroy the parser.
@trusted ~this()
{
clear(currentEvent_);
clear(tagDirectives_);
currentEvent_.destroy();
tagDirectives_.destroy();
tagDirectives_ = null;
clear(states_);
clear(marks_);
states_.destroy();
marks_.destroy();
}
/**

View file

@ -196,7 +196,7 @@ void free(T)(T* ptr) @system nothrow
{
//GC doesn't need to care about any references in this struct anymore.
static if(hasIndirections!T){GC.removeRange(cast(void*)ptr);}
static if(hasMember!(T, "__dtor")){clear(*ptr);}
static if(hasMember!(T, "__dtor")){(*ptr).destroy;}
core.stdc.stdlib.free(ptr);
}

View file

@ -86,7 +86,7 @@ final class Representer
///Destroy the Representer.
pure @safe nothrow ~this()
{
clear(representers_);
representers_.destroy();
representers_ = null;
}
@ -555,7 +555,7 @@ Node representPairs(ref Node node, Representer representer) @system
{
//TODO this should be replaced by something with deterministic memory allocation.
auto keys = redBlackTree!Node();
scope(exit){clear(keys);}
scope(exit){keys.destroy();}
foreach(ref pair; pairs)
{
if(pair.key in keys){return true;}

View file

@ -73,7 +73,7 @@ final class Resolver
///Destroy the Resolver.
pure @safe nothrow ~this()
{
clear(yamlImplicitResolvers_);
yamlImplicitResolvers_.destroy();
yamlImplicitResolvers_ = null;
}

View file

@ -163,11 +163,11 @@ final class Scanner
///Destroy the scanner.
@trusted ~this()
{
clear(tokens_);
clear(indents_);
clear(possibleSimpleKeys_);
tokens_.destroy();
indents_.destroy();
possibleSimpleKeys_.destroy();
possibleSimpleKeys_ = null;
clear(appender_);
appender_.destroy();
reader_ = null;
}
@ -438,7 +438,7 @@ final class Scanner
unwindIndent(-1);
removePossibleSimpleKey();
allowSimpleKey_ = false;
clear(possibleSimpleKeys_);
possibleSimpleKeys_.destroy;
tokens_.push(streamEndToken(reader_.mark, reader_.mark));
done_ = true;

View file

@ -87,11 +87,11 @@ struct Serializer
@safe ~this()
{
emitter_.emit(streamEndEvent(Mark(), Mark()));
clear(YAMLVersion_);
YAMLVersion_.destroy();
YAMLVersion_ = null;
clear(serializedNodes_);
serializedNodes_.destroy();
serializedNodes_ = null;
clear(anchors_);
anchors_.destroy();
anchors_ = null;
}
@ -103,8 +103,8 @@ struct Serializer
anchorNode(node);
serializeNode(node);
emitter_.emit(documentEndEvent(Mark(), Mark(), explicitEnd_));
clear(serializedNodes_);
clear(anchors_);
serializedNodes_.destroy();
anchors_.destroy();
Anchor[Node] emptyAnchors;
anchors_ = emptyAnchors;
lastAnchorID_ = 0;