From 5f980acefd4414b754b2cc3ce7fb144a77bd4160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 25 Jan 2017 21:04:13 +0100 Subject: [PATCH] Upgrade to latest eventcore. --- dub.sdl | 2 +- source/vibe/core/file.d | 8 ++++---- source/vibe/core/sync.d | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dub.sdl b/dub.sdl index d9e1204..cd4accc 100644 --- a/dub.sdl +++ b/dub.sdl @@ -4,7 +4,7 @@ authors "Sönke Ludwig" copyright "Copyright © 2016, rejectedsoftware e.K." license "MIT" -dependency "eventcore" version="~>0.7.0" +dependency "eventcore" version="~>0.8.0" targetName "vibe_core" diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index cddcd52..929df12 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -414,7 +414,7 @@ struct FileStream { eventDriver.files.releaseRef(m_fd); } - @property int fd() { return m_fd; } + @property int fd() { return cast(int)m_fd; } /// The path of the file. @property Path path() const { return ctx.path; } @@ -497,7 +497,7 @@ logDebug("Written %s", res[2]); write(cast(const(ubyte)[])bytes); } - void write(InputStream)(InputStream stream, ulong nbytes = 0) + void write(InputStream)(InputStream stream, ulong nbytes = ulong.max) if (isInputStream!InputStream) { writeDefault(this, stream, nbytes); @@ -519,7 +519,7 @@ logDebug("Written %s", res[2]); mixin validateRandomAccessStream!FileStream; -private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, InputStream stream, ulong nbytes = 0) +private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, InputStream stream, ulong nbytes = ulong.max) if (isOutputStream!OutputStream && isInputStream!InputStream) { import vibe.internal.allocator : theAllocator, make, dispose; @@ -531,7 +531,7 @@ private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, Input auto buffer = bufferobj.bytes[]; //logTrace("default write %d bytes, empty=%s", nbytes, stream.empty); - if (nbytes == 0) { + if (nbytes == ulong.max) { while (!stream.empty) { size_t chunk = min(stream.leastSize, buffer.length); assert(chunk > 0, "leastSize returned zero for non-empty stream."); diff --git a/source/vibe/core/sync.d b/source/vibe/core/sync.d index 411bd07..aaec4f1 100644 --- a/source/vibe/core/sync.d +++ b/source/vibe/core/sync.d @@ -840,7 +840,7 @@ struct ManualEvent { if (w.m_driver is drv) lw = w; else { try { - () @trusted { return cast(shared)w.m_driver; } ().events.trigger(w.m_event); + () @trusted { return cast(shared)w.m_driver; } ().events.trigger(w.m_event, true); } catch (Exception e) assert(false, e.msg); } return true;