From 7c3e46d432a388f24ad7f64361c00ef47fffa7a2 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 8 Jul 2019 19:25:47 -0400 Subject: [PATCH] new dmd deprecations --- database.d | 10 +++++----- jsvar.d | 38 +++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/database.d b/database.d index 85f5d97..5c61da8 100644 --- a/database.d +++ b/database.d @@ -393,11 +393,11 @@ string escapedVariants(Database db, in string sql, Variant[string] t) { string fixedup; int currentStart = 0; // FIXME: let's make ?? render as ? so we have some escaping capability - foreach(int i, dchar c; sql) { + foreach(i, dchar c; sql) { if(c == '?') { fixedup ~= sql[currentStart .. i]; - int idxStart = i + 1; + int idxStart = cast(int) i + 1; int idxLength; bool isFirst = true; @@ -420,7 +420,7 @@ string escapedVariants(Database db, in string sql, Variant[string] t) { currentStart = idxStart + idxLength; } else { // just leave it there, it might be done on another layer - currentStart = i; + currentStart = cast(int) i; } } } @@ -438,12 +438,12 @@ string escapedVariants(Database db, in string sql, Variant[] t) { string fixedup; int currentIndex; int currentStart = 0; - foreach(int i, dchar c; sql) { + foreach(i, dchar c; sql) { if(c == '?') { fixedup ~= sql[currentStart .. i]; int idx = -1; - currentStart = i + 1; + currentStart = cast(int) i + 1; if((i + 1) < sql.length) { auto n = sql[i + 1]; if(n >= '0' && n <= '9') { diff --git a/jsvar.d b/jsvar.d index 64c8723..32f62a2 100644 --- a/jsvar.d +++ b/jsvar.d @@ -1353,38 +1353,38 @@ struct var { var ret; final switch(v.type) { - case JSON_TYPE.STRING: + case JSONType.string: ret = v.str; break; - case JSON_TYPE.UINTEGER: + case JSONType.uinteger: ret = v.uinteger; break; - case JSON_TYPE.INTEGER: + case JSONType.integer: ret = v.integer; break; - case JSON_TYPE.FLOAT: + case JSONType.float_: ret = v.floating; break; - case JSON_TYPE.OBJECT: + case JSONType.object: ret = var.emptyObject; foreach(k, val; v.object) { ret[k] = var.fromJsonValue(val); } break; - case JSON_TYPE.ARRAY: + case JSONType.array: ret = var.emptyArray; ret._payload._array.length = v.array.length; foreach(idx, item; v.array) { ret._payload._array[idx] = var.fromJsonValue(item); } break; - case JSON_TYPE.TRUE: + case JSONType.true_: ret = true; break; - case JSON_TYPE.FALSE: + case JSONType.false_: ret = false; break; - case JSON_TYPE.NULL: + case JSONType.null_: ret = null; break; } @@ -1405,9 +1405,9 @@ struct var { val = this._payload._boolean; else { if(this._payload._boolean) - val.type = JSON_TYPE.TRUE; + val.type = JSONType.true_; else - val.type = JSON_TYPE.FALSE; + val.type = JSONType.false_; } break; case Type.Object: @@ -1419,9 +1419,9 @@ struct var { } } else { if(_payload._object is null) { - val.type = JSON_TYPE.NULL; + val.type = JSONType.null_; } else { - val.type = JSON_TYPE.OBJECT; + val.type = JSONType.object; foreach(k, v; _payload._object._properties) val.object[k] = v.toJsonValue(); } @@ -1429,19 +1429,19 @@ struct var { break; case Type.String: version(new_std_json) { } else { - val.type = JSON_TYPE.STRING; + val.type = JSONType.string; } val.str = _payload._string; break; case Type.Integral: version(new_std_json) { } else { - val.type = JSON_TYPE.INTEGER; + val.type = JSONType.integer; } val.integer = _payload._integral; break; case Type.Floating: version(new_std_json) { } else { - val.type = JSON_TYPE.FLOAT; + val.type = JSONType.float_; } val.floating = _payload._floating; break; @@ -1456,7 +1456,7 @@ struct var { version(new_std_json) { val = tmp; } else { - val.type = JSON_TYPE.ARRAY; + val.type = JSONType.array; val.array = tmp; } break; @@ -1464,7 +1464,7 @@ struct var { version(new_std_json) val = null; else - val.type = JSON_TYPE.NULL; // ideally we would just skip it entirely... + val.type = JSONType.null_; // ideally we would just skip it entirely... break; } return val; @@ -1504,7 +1504,7 @@ class PrototypeObject { tmp[k] = v.toJsonValue(); val.object = tmp; } else { - val.type = JSON_TYPE.OBJECT; + val.type = JSONType.object; foreach(k, v; this._properties) val.object[k] = v.toJsonValue(); }