diff --git a/source/vibe/core/channel.d b/source/vibe/core/channel.d index 9a60335..de21fcf 100644 --- a/source/vibe/core/channel.d +++ b/source/vibe/core/channel.d @@ -107,11 +107,11 @@ struct Channel(T, size_t buffer_size = 100) { */ bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst) in { assert(dst.empty); } - body { return m_impl.consumeAll(dst); } + do { return m_impl.consumeAll(dst); } /// ditto bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst) shared in { assert(dst.empty); } - body { return m_impl.consumeAll(dst); } + do { return m_impl.consumeAll(dst); } /** Enqueues an element. diff --git a/source/vibe/core/concurrency.d b/source/vibe/core/concurrency.d index f6402c5..efbf7e8 100644 --- a/source/vibe/core/concurrency.d +++ b/source/vibe/core/concurrency.d @@ -505,7 +505,7 @@ private struct IsolatedArray(T) //assert(isSorted(indices), "Indices must be in ascending order."); assert(indices[$-1] <= m_array.length, "Splice index out of bounds."); } - body { + do { auto ret = new IsolatedArray!T[indices.length]; size_t lidx = 0; foreach( i, sidx; indices ){ @@ -521,7 +521,7 @@ private struct IsolatedArray(T) assert(array.m_array.ptr == m_array.ptr+m_array.length || array.m_array.ptr+array.length == m_array.ptr, "Argument to merge() must be a neighbouring array partition."); } - body { + do { if( array.m_array.ptr == m_array.ptr + m_array.length ){ m_array = m_array.ptr[0 .. m_array.length + array.length]; } else { diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index 94ad8ce..658c513 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -1019,7 +1019,7 @@ nothrow { */ @property size_t workerThreadCount() out(count) { assert(count > 0, "No worker threads started after setupWorkerThreads!?"); } -body { +do { setupWorkerThreads(); synchronized (st_threadsMutex) return st_workerPool.threadCount; @@ -1253,7 +1253,7 @@ struct Timer { */ void rearm(Duration dur, bool periodic = false) nothrow in { assert(dur >= 0.seconds, "Negative timer duration specified."); } - body { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); } + do { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); } /** Resets the timer and avoids any firing. */ diff --git a/source/vibe/core/net.d b/source/vibe/core/net.d index 86cc541..08be6e8 100644 --- a/source/vibe/core/net.d +++ b/source/vibe/core/net.d @@ -365,16 +365,16 @@ struct NetworkAddress { @property inout(sockaddr_in)* sockAddrInet4() inout pure nothrow in { assert (family == AF_INET); } - body { return &addr_ip4; } + do { return &addr_ip4; } @property inout(sockaddr_in6)* sockAddrInet6() inout pure nothrow in { assert (family == AF_INET6); } - body { return &addr_ip6; } + do { return &addr_ip6; } version (Posix) { @property inout(sockaddr_un)* sockAddrUnix() inout pure nothrow in { assert (family == AddressFamily.UNIX); } - body { return &addr_unix; } + do { return &addr_unix; } } /** Returns a string representation of the IP address diff --git a/source/vibe/internal/freelistref.d b/source/vibe/internal/freelistref.d index 395fea0..d0799ce 100644 --- a/source/vibe/internal/freelistref.d +++ b/source/vibe/internal/freelistref.d @@ -190,7 +190,7 @@ in { assert((cast(size_t) chunk.ptr) % T.alignof == 0, format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof)); -} body { +} do { enum classSize = __traits(classInstanceSize, T); auto result = () @trusted { return cast(T) chunk.ptr; } (); @@ -226,7 +226,7 @@ in { assert((cast(size_t) chunk.ptr) % T.alignof == 0, format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof)); -} body { +} do { return emplace(() @trusted { return cast(T*)chunk.ptr; } (), args); }