From cff3811a5d324b394fd772acddcc71dacee23ce0 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 15 Jul 2019 12:53:17 +0900 Subject: [PATCH] Replace usages of in with const scope --- src/gc/impl/conservative/gc.d | 4 ++-- src/rt/sections_elf_shared.d | 6 +++--- src/rt/util/container/hashtab.d | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gc/impl/conservative/gc.d b/src/gc/impl/conservative/gc.d index 6e1fb1e31f..19aa70de14 100644 --- a/src/gc/impl/conservative/gc.d +++ b/src/gc/impl/conservative/gc.d @@ -88,7 +88,7 @@ private // to allow compilation of this module without access to the rt package, // make these functions available from rt.lifetime void rt_finalizeFromGC(void* p, size_t size, uint attr) nothrow; - int rt_hasFinalizerInSegment(void* p, size_t size, uint attr, in void[] segment) nothrow; + int rt_hasFinalizerInSegment(void* p, size_t size, uint attr, const scope void[] segment) nothrow; // Declared as an extern instead of importing core.exception // to avoid inlining - see issue 13725. @@ -3191,7 +3191,7 @@ struct Pool } } - void freePageBits(size_t pagenum, in ref PageBits toFree) nothrow + void freePageBits(size_t pagenum, const scope ref PageBits toFree) nothrow { assert(!isLargeObject); assert(!nointerior.nbits); // only for large objects diff --git a/src/rt/sections_elf_shared.d b/src/rt/sections_elf_shared.d index 91ed1cadfd..e84753a246 100644 --- a/src/rt/sections_elf_shared.d +++ b/src/rt/sections_elf_shared.d @@ -689,7 +689,7 @@ version (Shared) !pthread_mutex_unlock(&_handleToDSOMutex) || assert(0); } - void getDependencies(in ref dl_phdr_info info, ref Array!(DSO*) deps) + void getDependencies(const scope ref dl_phdr_info info, ref Array!(DSO*) deps) { // get the entries of the .dynamic section ElfW!"Dyn"[] dyns; @@ -757,7 +757,7 @@ version (Shared) * Scan segments in Linux dl_phdr_info struct and store * the TLS and writeable data segments in *pdso. */ -void scanSegments(in ref dl_phdr_info info, DSO* pdso) nothrow @nogc +void scanSegments(const scope ref dl_phdr_info info, DSO* pdso) nothrow @nogc { foreach (ref phdr; info.dlpi_phdr[0 .. info.dlpi_phnum]) { @@ -846,7 +846,7 @@ bool findDSOInfoForAddr(in void* addr, dl_phdr_info* result=null) nothrow @nogc * Determine if 'addr' lies within shared object 'info'. * If so, return true and fill in 'result' with the corresponding ELF program header. */ -bool findSegmentForAddr(in ref dl_phdr_info info, in void* addr, ElfW!"Phdr"* result=null) nothrow @nogc +bool findSegmentForAddr(const scope ref dl_phdr_info info, const scope void* addr, ElfW!"Phdr"* result=null) nothrow @nogc { if (addr < cast(void*)info.dlpi_addr) // less than base address of object means quick reject return false; diff --git a/src/rt/util/container/hashtab.d b/src/rt/util/container/hashtab.d index 1e88f35c9d..a9e5847de5 100644 --- a/src/rt/util/container/hashtab.d +++ b/src/rt/util/container/hashtab.d @@ -90,7 +90,7 @@ struct HashTab(Key, Value) *get(key) = value; } - inout(Value)* opBinaryRight(string op)(in Key key) inout + inout(Value)* opBinaryRight(string op)(const scope Key key) inout if (op == "in") { if (_buckets.length) @@ -145,7 +145,7 @@ private: return &p._value; } - static hash_t hashOf(in ref Key key) @trusted + static hash_t hashOf(const scope ref Key key) @trusted { static if (is(Key U : U[])) return .hashOf(key, 0);