From e12667c8d21cebc18eda2fc5af1f9d6e9e91bbc4 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 26 Jul 2019 09:01:24 +0900 Subject: [PATCH] Replace some usages of `in` with `const scope` for object.d and rt/dmain2.d --- src/object.d | 18 +++++++++--------- src/rt/dmain2.d | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/object.d b/src/object.d index d284e0f78c..6fb84ab86c 100644 --- a/src/object.d +++ b/src/object.d @@ -1685,7 +1685,7 @@ class TypeInfo_Class : TypeInfo * Search all modules for TypeInfo_Class corresponding to classname. * Returns: null if not found */ - static const(TypeInfo_Class) find(in char[] classname) + static const(TypeInfo_Class) find(const scope char[] classname) { foreach (m; ModuleInfo) { @@ -2149,7 +2149,7 @@ struct ModuleInfo version (all) { deprecated("ModuleInfo cannot be copy-assigned because it is a variable-sized struct.") - void opAssign(in ModuleInfo m) { _flags = m._flags; _index = m._index; } + void opAssign(const scope ModuleInfo m) { _flags = m._flags; _index = m._index; } } else { @@ -2743,12 +2743,12 @@ extern (C) private struct AA { void* impl; } // size_t _aaLen(in AA aa) pure nothrow @nogc; - private void* _aaGetY(AA* paa, const TypeInfo_AssociativeArray ti, in size_t valsz, in void* pkey) pure nothrow; - private void* _aaGetX(AA* paa, const TypeInfo_AssociativeArray ti, in size_t valsz, in void* pkey, out bool found) pure nothrow; + private void* _aaGetY(AA* paa, const TypeInfo_AssociativeArray ti, const size_t valsz, const scope void* pkey) pure nothrow; + private void* _aaGetX(AA* paa, const TypeInfo_AssociativeArray ti, const size_t valsz, const scope void* pkey, out bool found) pure nothrow; // inout(void)* _aaGetRvalueX(inout AA aa, in TypeInfo keyti, in size_t valsz, in void* pkey); - inout(void[]) _aaValues(inout AA aa, in size_t keysz, in size_t valsz, const TypeInfo tiValueArray) pure nothrow; - inout(void[]) _aaKeys(inout AA aa, in size_t keysz, const TypeInfo tiKeyArray) pure nothrow; - void* _aaRehash(AA* paa, in TypeInfo keyti) pure nothrow; + inout(void[]) _aaValues(inout AA aa, const size_t keysz, const size_t valsz, const TypeInfo tiValueArray) pure nothrow; + inout(void[]) _aaKeys(inout AA aa, const size_t keysz, const TypeInfo tiKeyArray) pure nothrow; + void* _aaRehash(AA* paa, const scope TypeInfo keyti) pure nothrow; void _aaClear(AA aa) pure nothrow; // alias _dg_t = extern(D) int delegate(void*); @@ -3979,7 +3979,7 @@ private inout(TypeInfo) getElement(inout TypeInfo value) @trusted pure nothrow return cast(inout) element; } -private size_t getArrayHash(in TypeInfo element, in void* ptr, in size_t count) @trusted nothrow +private size_t getArrayHash(const scope TypeInfo element, const scope void* ptr, const size_t count) @trusted nothrow { if (!count) return 0; @@ -3988,7 +3988,7 @@ private size_t getArrayHash(in TypeInfo element, in void* ptr, in size_t count) if (!elementSize) return 0; - static bool hasCustomToHash(in TypeInfo value) @trusted pure nothrow + static bool hasCustomToHash(const scope TypeInfo value) @trusted pure nothrow { const element = getElement(value); diff --git a/src/rt/dmain2.d b/src/rt/dmain2.d index 31bae328cb..7f3679b929 100644 --- a/src/rt/dmain2.d +++ b/src/rt/dmain2.d @@ -554,7 +554,7 @@ extern (C) int _d_run_main(int argc, char **argv, MainFunc mainFunc) return result; } -private void formatThrowable(Throwable t, scope void delegate(in char[] s) nothrow sink) +private void formatThrowable(Throwable t, scope void delegate(const scope char[] s) nothrow sink) { foreach (u; t) { @@ -595,7 +595,7 @@ extern (C) void _d_print_throwable(Throwable t) { WCHAR* ptr; size_t len; - void sink(in char[] s) scope nothrow + void sink(const scope char[] s) scope nothrow { if (!s.length) return; int swlen = MultiByteToWideChar( @@ -683,7 +683,7 @@ extern (C) void _d_print_throwable(Throwable t) } } - void sink(in char[] buf) scope nothrow + void sink(const scope char[] buf) scope nothrow { fprintf(stderr, "%.*s", cast(int)buf.length, buf.ptr); }