mirror of https://github.com/adamdruppe/arsd.git
more x64 and warning fixes
This commit is contained in:
parent
ddc47b90a2
commit
4a57064709
|
@ -162,7 +162,7 @@ string escapedVariants(Database db, in string sql, Variant[] t) {
|
|||
string fixedup;
|
||||
int currentIndex;
|
||||
int currentStart = 0;
|
||||
foreach(i, dchar c; sql) {
|
||||
foreach(int i, dchar c; sql) {
|
||||
if(c == '?') {
|
||||
fixedup ~= sql[currentStart .. i];
|
||||
|
||||
|
@ -321,7 +321,7 @@ string fixupSqlForDataObjectUse(string sql) {
|
|||
string[] tableNames;
|
||||
|
||||
string piece = sql;
|
||||
int idx;
|
||||
sizediff_t idx;
|
||||
while((idx = piece.indexOf("JOIN")) != -1) {
|
||||
auto start = idx + 5;
|
||||
auto i = start;
|
||||
|
|
4
dom.d
4
dom.d
|
@ -2467,6 +2467,7 @@ class Document {
|
|||
parentChain = [];
|
||||
|
||||
if(pos >= data.length)
|
||||
{
|
||||
if(strict) {
|
||||
throw new MarkupError("Gone over the input (is there no root element?), chain: " ~ to!string(parentChain));
|
||||
} else {
|
||||
|
@ -2475,6 +2476,7 @@ class Document {
|
|||
else
|
||||
return Ele(4); // signal emptiness upstream
|
||||
}
|
||||
}
|
||||
|
||||
if(data[pos] != '<') {
|
||||
return Ele(0, readTextNode(), null);
|
||||
|
@ -2701,10 +2703,12 @@ class Document {
|
|||
root = r.element;
|
||||
|
||||
if(root is null)
|
||||
{
|
||||
if(strict)
|
||||
assert(0, "empty document should be impossible in strict mode");
|
||||
else
|
||||
parse(`<html><head></head><body></body></html>`); // fill in a dummy document in loose mode since that's what browsers do
|
||||
}
|
||||
|
||||
if(0&&sawImproperNesting) {
|
||||
// in loose mode, we can see some bad nesting. It's hard to fix above though
|
||||
|
|
22
html.d
22
html.d
|
@ -740,7 +740,7 @@ string translateJavascriptSourceWithDToStandardScript(string src)() {
|
|||
+/
|
||||
|
||||
abstract class CssPart {
|
||||
string toString() const;
|
||||
override string toString() const;
|
||||
CssPart clone() const;
|
||||
}
|
||||
|
||||
|
@ -799,7 +799,7 @@ class CssRuleSet : CssPart {
|
|||
css = css[idx .. $];
|
||||
int braceCount = 0;
|
||||
string content;
|
||||
int f = css.length;
|
||||
size_t f = css.length;
|
||||
foreach(i, c; css) {
|
||||
if(c == '{')
|
||||
braceCount++;
|
||||
|
@ -823,7 +823,7 @@ class CssRuleSet : CssPart {
|
|||
string[] selectors;
|
||||
CssPart[] contents;
|
||||
|
||||
CssRuleSet clone() const {
|
||||
override CssRuleSet clone() const {
|
||||
auto n = new CssRuleSet();
|
||||
n.selectors = selectors.dup;
|
||||
n.contents = contents.dup;
|
||||
|
@ -930,7 +930,7 @@ CssPart[] lexCss(string css) {
|
|||
|
||||
auto beginningOfBlock = css.indexOf("{");
|
||||
if(beginningOfBlock == -1 || endOfStatement < beginningOfBlock)
|
||||
p = new CssRule(css, endOfStatement);
|
||||
p = new CssRule(css, cast(int) endOfStatement);
|
||||
else
|
||||
p = new CssRuleSet(css);
|
||||
}
|
||||
|
@ -947,11 +947,12 @@ CssPart[] lexCss(string css) {
|
|||
string cssToString(in CssPart[] css) {
|
||||
string ret;
|
||||
foreach(c; css) {
|
||||
if(ret.length)
|
||||
if(ret.length) {
|
||||
if(ret[$ -1] == '}')
|
||||
ret ~= "\n\n";
|
||||
else
|
||||
ret ~= "\n";
|
||||
}
|
||||
ret ~= c.toString();
|
||||
}
|
||||
|
||||
|
@ -1100,13 +1101,10 @@ class MacroExpander {
|
|||
args = args[1 .. $];
|
||||
dstring returned;
|
||||
|
||||
int iterations = args.length;
|
||||
size_t iterations = args.length;
|
||||
if(m.args.length != 0)
|
||||
iterations = (args.length + m.args.length - 1) / m.args.length;
|
||||
|
||||
if(iterations < 0)
|
||||
iterations = 0;
|
||||
|
||||
foreach(i; 0 .. iterations) {
|
||||
returned ~= expandMacro(m, args);
|
||||
if(m.args.length < args.length)
|
||||
|
@ -1151,7 +1149,7 @@ class MacroExpander {
|
|||
|
||||
// the replacement goes
|
||||
// src[0 .. startingSliceForReplacement] ~ new ~ src[endingSliceForReplacement .. $];
|
||||
int startingSliceForReplacement, endingSliceForReplacement;
|
||||
sizediff_t startingSliceForReplacement, endingSliceForReplacement;
|
||||
|
||||
dstring functionName;
|
||||
dstring[] arguments;
|
||||
|
@ -1160,7 +1158,7 @@ class MacroExpander {
|
|||
startingSliceForReplacement = idx;
|
||||
// idx++; // because the star in UTF 8 is two characters. FIXME: hack -- not needed thx to dstrings
|
||||
auto possibility = src[idx + 1 .. $];
|
||||
int argsBegin;
|
||||
size_t argsBegin;
|
||||
|
||||
bool found = false;
|
||||
foreach(i, c; possibility) {
|
||||
|
@ -1217,7 +1215,7 @@ class MacroExpander {
|
|||
goto doReplacement;
|
||||
|
||||
// actually parsing the arguments
|
||||
int currentArgumentStarting = argsBegin + 1;
|
||||
size_t currentArgumentStarting = argsBegin + 1;
|
||||
|
||||
int open;
|
||||
|
||||
|
|
4
rtud.d
4
rtud.d
|
@ -102,7 +102,7 @@ int openNetworkFd(string host, ushort port) {
|
|||
|
||||
void writeToFd(int fd, string s) {
|
||||
again:
|
||||
int num = linux.write(fd, s.ptr, s.length);
|
||||
auto num = linux.write(fd, s.ptr, s.length);
|
||||
if(num < 0)
|
||||
throw new Exception("couldn't write");
|
||||
if(num == 0)
|
||||
|
@ -150,7 +150,7 @@ int handleListenerGateway(Cgi cgi, string channelPrefix) {
|
|||
string[4096] buffer;
|
||||
|
||||
for(;;) {
|
||||
int num = linux.read(f, buffer.ptr, buffer.length);
|
||||
auto num = linux.read(f, buffer.ptr, buffer.length);
|
||||
if(num < 0)
|
||||
throw new Exception("read error");
|
||||
if(num == 0)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../../dimage/simpleaudio.d
|
|
@ -943,7 +943,7 @@ version(X11) {
|
|||
|
||||
void drawText(int x, int y, int x2, int y2, string text) {
|
||||
foreach(line; text.split("\n")) {
|
||||
XDrawString(display, d, gc, x, y + 12, line.ptr, line.length);
|
||||
XDrawString(display, d, gc, x, y + 12, line.ptr, cast(int) line.length);
|
||||
y += 16;
|
||||
}
|
||||
}
|
||||
|
@ -996,11 +996,11 @@ version(X11) {
|
|||
|
||||
if(backgroundIsNotTransparent) {
|
||||
swapColors();
|
||||
XFillPolygon(display, d, gc, points.ptr, points.length, PolygonShape.Complex, CoordMode.CoordModeOrigin);
|
||||
XFillPolygon(display, d, gc, points.ptr, cast(int) points.length, PolygonShape.Complex, CoordMode.CoordModeOrigin);
|
||||
swapColors();
|
||||
}
|
||||
if(foregroundIsNotTransparent) {
|
||||
XDrawLines(display, d, gc, points.ptr, points.length, CoordMode.CoordModeOrigin);
|
||||
XDrawLines(display, d, gc, points.ptr, cast(int) points.length, CoordMode.CoordModeOrigin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
web.d
2
web.d
|
@ -1463,7 +1463,7 @@ string toJson(T)(T a) {
|
|||
/// like toHtml - it makes a json value of any given type.
|
||||
|
||||
/// It can be used generically, or it can be passed an ApiProvider so you can do a secondary custom
|
||||
/// format. (it calls api.formatAs!(type)(typeRequestString). Why would you want that? Maybe
|
||||
/// format. (it calls api.formatAs!(type)(typeRequestString)). Why would you want that? Maybe
|
||||
/// your javascript wants to do work with a proper object,but wants to append it to the document too.
|
||||
/// Asking for json with secondary format = html means the server will provide both to you.
|
||||
|
||||
|
|
Loading…
Reference in New Issue