use @safe everywhere

with a little bit of evil @trusted magic...
This commit is contained in:
Jeremy Baxter 2024-02-13 09:40:44 +13:00
parent 2e93c891fd
commit 8b392c5bab
2 changed files with 28 additions and 17 deletions

9
esv.d
View file

@ -29,7 +29,7 @@ import std.getopt : getoptConfig = config;
import std.path : baseName, dirName, expandTilde, isValidPath;
import std.process : environment, executeShell;
import std.regex : regex, matchFirst, replaceAll, replaceFirst;
import std.stdio : writef, writeln, writefln, stderr;
import std.stdio : writef, writeln, writefln, File;
import std.string : splitLines;
import initial;
@ -37,6 +37,8 @@ import initial;
import config;
import esvapi;
@safe:
enum VERSION = "0.2.0";
bool aFlag; /* audio */
@ -49,6 +51,8 @@ bool rFlag, RFlag; /* passage references */
string sFlag; /* search passages */
bool VFlag; /* show version */
File stderr;
version (OpenBSD) {
immutable(char) *promises;
}
@ -58,6 +62,9 @@ main(string[] args)
{
bool success;
/* @safe way of opening stderr on Unix */
stderr = File("/dev/stderr", "w");
version (OpenBSD) {
import core.sys.openbsd.unistd : pledge;
import std.string : toStringz;