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

View file

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

View file

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

View file

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

View file

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

View file

@ -146,11 +146,11 @@ final class Parser
///Destroy the parser. ///Destroy the parser.
@trusted ~this() @trusted ~this()
{ {
clear(currentEvent_); currentEvent_.destroy();
clear(tagDirectives_); tagDirectives_.destroy();
tagDirectives_ = null; tagDirectives_ = null;
clear(states_); states_.destroy();
clear(marks_); 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. //GC doesn't need to care about any references in this struct anymore.
static if(hasIndirections!T){GC.removeRange(cast(void*)ptr);} 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); core.stdc.stdlib.free(ptr);
} }

View file

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

View file

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

View file

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

View file

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