Skip to content

Commit

Permalink
Merge pull request #1964 from tom-tan/safe-some-methods-std-stdio
Browse files Browse the repository at this point in the history
Mark std.stdio.File.this(this), isOpen, name and getFP as `@safe`
  • Loading branch information
AndrejMitrovic committed Feb 26, 2014
2 parents 353c0df + 9418b30 commit 7bd1ae6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions std/stdio.d
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 7bd1ae6

Please sign in to comment.