Merge pull request #1964 from tom-tan/safe-some-methods-std-stdio

Mark std.stdio.File.this(this), isOpen, name and getFP as `@safe`
This commit is contained in:
Andrej Mitrovic 2014-02-26 16:41:04 +01:00
commit 7bd1ae66c3

View file

@ -360,7 +360,7 @@ Throws: $(D ErrnoException) if the file could not be opened.
detach();
}
this(this)
this(this) @safe
{
if (!_p) return;
assert(_p.refs);
@ -503,7 +503,7 @@ Throws: $(D ErrnoException) in case of error.
/** Returns $(D true) if the file is opened. */
@property bool isOpen() const pure nothrow
@property bool isOpen() const @safe pure nothrow
{
return _p !is null && _p.handle;
}
@ -525,7 +525,7 @@ Throws: $(D Exception) if the file is not opened.
/** Returns the name of the last opened file, if any.
If a $(D File) was created with $(LREF tmpfile) and $(LREF wrapFile)
it has no name.*/
@property string name() const pure nothrow
@property string name() const @safe pure nothrow
{
return _name;
}
@ -1456,7 +1456,7 @@ Note that the created file has no $(LREF name)*/
/**
Returns the $(D FILE*) corresponding to this object.
*/
FILE* getFP() pure
FILE* getFP() @safe pure
{
import std.exception : enforce;