From eb4344653e76a336722108e2d091fc6b1c5ce32c Mon Sep 17 00:00:00 2001 From: JinShil Date: Sat, 31 Aug 2019 12:29:15 +0900 Subject: [PATCH 1/2] Replace `hash_t` with `size_t` --- source/vibe/core/path.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/core/path.d b/source/vibe/core/path.d index 312fd0c..ccf95ff 100644 --- a/source/vibe/core/path.d +++ b/source/vibe/core/path.d @@ -542,7 +542,7 @@ struct GenericPath(F) { string toString() const nothrow @nogc { return m_path; } /// Computes a hash sum, enabling storage within associative arrays. - hash_t toHash() const nothrow @trusted + size_t toHash() const nothrow @trusted { try return typeid(string).getHash(&m_path); catch (Exception e) assert(false, "getHash for string throws!?"); From bb257891327c6e34c13d9c0adeee93dbd5606545 Mon Sep 17 00:00:00 2001 From: JinShil Date: Sat, 31 Aug 2019 12:30:50 +0900 Subject: [PATCH 2/2] Replace `sizediff_t` with `ptrdiff_t` --- source/vibe/internal/string.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/vibe/internal/string.d b/source/vibe/internal/string.d index 217fa98..f101364 100644 --- a/source/vibe/internal/string.d +++ b/source/vibe/internal/string.d @@ -130,7 +130,7 @@ string stripA(string s) } /// Finds the first occurence of any of the characters in `chars` -sizediff_t indexOfAny(string str, string chars) +ptrdiff_t indexOfAny(string str, string chars) @safe pure { foreach (i, char ch; str) if (chars.canFind(ch)) @@ -149,7 +149,7 @@ alias countUntilAny = indexOfAny; The index of the closing bracket or -1 for unbalanced strings and strings that don't start with a bracket. */ -sizediff_t matchBracket(string str, bool nested = true) +ptrdiff_t matchBracket(string str, bool nested = true) @safe pure nothrow { if (str.length < 2) return -1; @@ -173,7 +173,7 @@ sizediff_t matchBracket(string str, bool nested = true) @safe unittest { - static struct Test { string str; sizediff_t res; } + static struct Test { string str; ptrdiff_t res; } enum tests = [ Test("[foo]", 4), Test("", 4), Test("{baz}", 4), Test("[", -1), Test("[foo", -1), Test("ab[f]", -1),