From 56cc7d469b2f919cb189e70a3fc4620a8a0a90e6 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 20 Jun 2017 00:50:34 +1000 Subject: [PATCH 1/2] Fix forced non-const Address --- std/socket.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/socket.d b/std/socket.d index a375e2ee058..63fd43539a9 100644 --- a/std/socket.d +++ b/std/socket.d @@ -2956,7 +2956,7 @@ public: * Returns: The number of bytes actually sent, or $(D Socket.ERROR) on * failure. */ - ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags, Address to) @trusted + ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags, in Address to) @trusted { static if (is(typeof(MSG_NOSIGNAL))) { @@ -2972,7 +2972,7 @@ public: } /// ditto - ptrdiff_t sendTo(const(void)[] buf, Address to) + ptrdiff_t sendTo(const(void)[] buf, in Address to) { return sendTo(buf, SocketFlags.NONE, to); } From 178b6cf1ad90d33d11c749e084e01a282edf7afc Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 20 Jun 2017 01:09:04 +1000 Subject: [PATCH 2/2] (fixup) TestSocket too --- std/socket.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/socket.d b/std/socket.d index 63fd43539a9..5705fb8328d 100644 --- a/std/socket.d +++ b/std/socket.d @@ -3522,8 +3522,8 @@ class UdpSocket: Socket @property @trusted Address localAddress() { assert(0); } @trusted ptrdiff_t send(const(void)[] buf, SocketFlags flags) { assert(0); } @safe ptrdiff_t send(const(void)[] buf) { assert(0); } - @trusted ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags, Address to) { assert(0); } - @safe ptrdiff_t sendTo(const(void)[] buf, Address to) { assert(0); } + @trusted ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags, in Address to) { assert(0); } + @safe ptrdiff_t sendTo(const(void)[] buf, in Address to) { assert(0); } @trusted ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags) { assert(0); } @safe ptrdiff_t sendTo(const(void)[] buf) { assert(0); } @trusted ptrdiff_t receive(void[] buf, SocketFlags flags) { assert(0); }