diff --git a/cgi.d b/cgi.d index 7a732bb..6682338 100644 --- a/cgi.d +++ b/cgi.d @@ -981,7 +981,7 @@ class Cgi { immutable(string[string]) get; immutable(string[string]) post; immutable(string[string]) cookies; - immutable(UploadedFile)[string] files; + immutable(UploadedFile[string]) files; // Use these if you expect multiple items submitted with the same name. btw, assert(get[name] is getArray[name][$-1); should pass. Same for post and cookies. // the order of the arrays is the order the data arrives diff --git a/dom.d b/dom.d index 21f7099..1ea0e67 100644 --- a/dom.d +++ b/dom.d @@ -2399,7 +2399,7 @@ class Document { // found something in either branch... if(idx != -1) { // read till a quote or about 12 chars, whichever comes first... - int end = idx; + auto end = idx; while(end < dataAsBytes.length && dataAsBytes[end] != '"' && end - idx < 12) end++; @@ -4018,7 +4018,7 @@ class StyleSheet { } // unbelievable. -int indexOfBytes(immutable(ubyte)[] haystack, immutable(ubyte)[] needle) { +sizediff_t indexOfBytes(immutable(ubyte)[] haystack, immutable(ubyte)[] needle) { auto found = std.algorithm.find(haystack, needle); if(found.length == 0) return -1; diff --git a/html.d b/html.d index 308ac8b..3bee9e8 100644 --- a/html.d +++ b/html.d @@ -777,7 +777,7 @@ class CssAtRule : CssPart { string content; - override CssPart clone() const { + override CssAtRule clone() const { auto n = new CssAtRule(); n.content = content; return n; @@ -897,7 +897,7 @@ class CssRule : CssPart { // note: does not include the ending semicolon string content; - override CssPart clone() const { + override CssRule clone() const { auto n = new CssRule(); n.content = content; return n; diff --git a/web.d b/web.d index 8ecd15b..a8163ff 100644 --- a/web.d +++ b/web.d @@ -1500,7 +1500,9 @@ private string[] parameterNamesOfImpl (alias func) () string toHtml(T)(T a) { string ret; - static if(is(T : Document)) { + static if(is(T == typeof(null))) + ret = null; + else static if(is(T : Document)) { if(a is null) ret = null; else @@ -1547,7 +1549,9 @@ JSONValue toJsonValue(T, R = ApiProvider)(T a, string formatToStringAs = null, R if(is(R : ApiProvider)) { JSONValue val; - static if(is(T == JSONValue)) { + static if(is(T == typeof(null))) { + val.type = JSON_TYPE.NULL; + } else static if(is(T == JSONValue)) { val = a; } else static if(__traits(compiles, val = a.makeJsonValue())) { val = a.makeJsonValue(); @@ -1568,8 +1572,6 @@ JSONValue toJsonValue(T, R = ApiProvider)(T a, string formatToStringAs = null, R val.type = JSON_TYPE.FLOAT; val.floating = to!real(a); static assert(0); - } else static if(is(T == void*)) { - val.type = JSON_TYPE.NULL; } else static if(isPointer!(T)) { if(a is null) { val.type = JSON_TYPE.NULL;