From cfb136120d8c521c575c10704815e27a1fcedc9c Mon Sep 17 00:00:00 2001 From: Trass3r Date: Sat, 10 Dec 2011 13:53:19 +0100 Subject: [PATCH] x64 fixes --- database.d | 6 +----- netman.d | 14 +++++++------- web.d | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/database.d b/database.d index 63e2b7f..032594a 100644 --- a/database.d +++ b/database.d @@ -36,9 +36,7 @@ interface Database { } else if (arg == typeid(long) || arg == typeid(const(long)) || arg == typeid(immutable(long))) { long e = va_arg!long(_argptr); a = to!string(e); - } else if (arg == typeid(void*)) { - void* e = va_arg!(void*)(_argptr); - assert(e is null, "can only pass null pointer"); + } else if (arg == typeid(null)) { a = null; } else assert(0, "invalid type " ~ arg.toString ); @@ -463,8 +461,6 @@ class DataObject { auto e = va_arg!(long)(_argptr); a = to!string(e); } else if (arg == typeid(null)) { - auto e = va_arg!(void*)(_argptr); - assert(e is null, "can only pass null pointer"); a = null; } else assert(0, "invalid type " ~ arg.toString ); diff --git a/netman.d b/netman.d index 9c7f850..97821bf 100644 --- a/netman.d +++ b/netman.d @@ -87,7 +87,7 @@ class NetworkManager { } - int numActiveConnections(){ + size_t numActiveConnections(){ return connections.length; } @@ -220,8 +220,8 @@ setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, on.sizeof); if(connection.writeBufferLength > 0) if(FD_ISSET(connection.socket, &writefs)){ auto b = connection.writeBuffer[connection.writeBufferPosition..(connection.writeBufferPosition+connection.writeBufferLength)]; - //int num = send(connection.socket, b.ptr, b.length, 0); - int num = write(connection.socket, b.ptr, b.length); + //auto num = send(connection.socket, b.ptr, b.length, 0); + auto num = write(connection.socket, b.ptr, b.length); if(num < 0) throw new ConnectionException("send", connection); @@ -234,13 +234,13 @@ setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, on.sizeof); connection.timeOfLastActivity = now; } if(FD_ISSET(connection.socket, &rdfs)){ - int s = connection.readBufferPosition + connection.readBufferLength; + size_t s = connection.readBufferPosition + connection.readBufferLength; s += 1024; if(connection.readBuffer.length < s) connection.readBuffer.length = s; - //int size = recv(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024, 0); + //auto size = recv(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024, 0); //std.stdio.writefln("read buffer length: %s", connection.readBufferLength); - int size = read(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024); + auto size = read(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024); if(size == 0){ connection.disconnectQueued = true; connection.reason = "size == 0"; @@ -372,7 +372,7 @@ class Connection { if(socket < 0) throw new ConnectionException("cannot write to a closed connection", this); - int newEnd = writeBufferPosition + writeBufferLength + data.length; + size_t newEnd = writeBufferPosition + writeBufferLength + data.length; if(newEnd >= writeBuffer.length) writeBuffer.length = newEnd; diff --git a/web.d b/web.d index c0a70e1..4e82d1f 100644 --- a/web.d +++ b/web.d @@ -1084,7 +1084,7 @@ void run(Provider)(Cgi cgi, Provider instantiation, size_t pathInfoStartingPoint form = doc.requireSelector!Form("form"); } else { - Parameter[] params = cast(Parameter[]) (cast() *fun).parameters.dup; + Parameter[] params = (cast(Parameter[])fun.parameters).dup; foreach(i, p; fun.parameters) { string value = ""; if(p.name in cgi.get)