mirror of https://github.com/adamdruppe/arsd.git
dmd warnings (thanks ketmar)
This commit is contained in:
parent
fa257c076d
commit
90b3b083de
2
cgi.d
2
cgi.d
|
@ -496,7 +496,7 @@ class Cgi {
|
||||||
flushDelegate = _flush;
|
flushDelegate = _flush;
|
||||||
auto getenv = delegate string(string var) {
|
auto getenv = delegate string(string var) {
|
||||||
if(env is null)
|
if(env is null)
|
||||||
return .getenv(var);
|
return std.process.environment.get(var);
|
||||||
auto e = var in env;
|
auto e = var in env;
|
||||||
if(e is null)
|
if(e is null)
|
||||||
return null;
|
return null;
|
||||||
|
|
7
color.d
7
color.d
|
@ -887,7 +887,12 @@ body {
|
||||||
sorted ~= ColorUse(color, count);
|
sorted ~= ColorUse(color, count);
|
||||||
|
|
||||||
uses = null;
|
uses = null;
|
||||||
sorted = sorted.sort;
|
version(no_phobos)
|
||||||
|
sorted = sorted.sort;
|
||||||
|
else {
|
||||||
|
import std.algorithm : sort;
|
||||||
|
sort(sorted);
|
||||||
|
}
|
||||||
|
|
||||||
ubyte[Color] paletteAssignments;
|
ubyte[Color] paletteAssignments;
|
||||||
foreach(idx, entry; palette)
|
foreach(idx, entry; palette)
|
||||||
|
|
|
@ -48,33 +48,27 @@ string htmlToText(string html, bool wantWordWrap = true, int wrapAmount = 74) {
|
||||||
ele.innerText = "*" ~ ele.innerText ~ "*";
|
ele.innerText = "*" ~ ele.innerText ~ "*";
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "i":
|
case "i":
|
||||||
case "em":
|
case "em":
|
||||||
ele.innerText = "/" ~ ele.innerText ~ "/";
|
ele.innerText = "/" ~ ele.innerText ~ "/";
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "u":
|
case "u":
|
||||||
ele.innerText = "_" ~ ele.innerText ~ "_";
|
ele.innerText = "_" ~ ele.innerText ~ "_";
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "h1":
|
case "h1":
|
||||||
ele.innerText = "\r" ~ ele.innerText ~ "\n" ~ repeat("=", ele.innerText.length) ~ "\r";
|
ele.innerText = "\r" ~ ele.innerText ~ "\n" ~ repeat("=", ele.innerText.length) ~ "\r";
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "h2":
|
case "h2":
|
||||||
ele.innerText = "\r" ~ ele.innerText ~ "\n" ~ repeat("-", ele.innerText.length) ~ "\r";
|
ele.innerText = "\r" ~ ele.innerText ~ "\n" ~ repeat("-", ele.innerText.length) ~ "\r";
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "h3":
|
case "h3":
|
||||||
ele.innerText = "\r" ~ ele.innerText.toUpper ~ "\r";
|
ele.innerText = "\r" ~ ele.innerText.toUpper ~ "\r";
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "td":
|
case "td":
|
||||||
case "p":
|
case "p":
|
||||||
/*
|
/*
|
||||||
|
@ -96,7 +90,6 @@ string htmlToText(string html, bool wantWordWrap = true, int wrapAmount = 74) {
|
||||||
}
|
}
|
||||||
ele.stripOut();
|
ele.stripOut();
|
||||||
goto again;
|
goto again;
|
||||||
break;
|
|
||||||
case "ol":
|
case "ol":
|
||||||
case "ul":
|
case "ul":
|
||||||
ele.innerHTML = "\r" ~ ele.innerHTML ~ "\r";
|
ele.innerHTML = "\r" ~ ele.innerHTML ~ "\r";
|
||||||
|
|
5
http.d
5
http.d
|
@ -113,7 +113,7 @@ struct UriParts {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpResponse httpRequest(string method, string uri, const(ubyte)[] content = null, string[string] cookies = null, string headers[] = null) {
|
HttpResponse httpRequest(string method, string uri, const(ubyte)[] content = null, string[string] cookies = null, string[] headers = null) {
|
||||||
import std.socket;
|
import std.socket;
|
||||||
|
|
||||||
auto u = UriParts(uri);
|
auto u = UriParts(uri);
|
||||||
|
@ -181,7 +181,7 @@ HttpResponse httpRequest(string method, string uri, const(ubyte)[] content = nul
|
||||||
of the parameters are the caller's responsibility. Content-Length is added automatically,
|
of the parameters are the caller's responsibility. Content-Length is added automatically,
|
||||||
but YOU must give Content-Type!
|
but YOU must give Content-Type!
|
||||||
*/
|
*/
|
||||||
HttpResponse doHttpRequestOnHelpers(void delegate(string) write, char[] delegate() read, string method, string uri, const(ubyte)[] content = null, string[string] cookies = null, string headers[] = null, bool https = false)
|
HttpResponse doHttpRequestOnHelpers(void delegate(string) write, char[] delegate() read, string method, string uri, const(ubyte)[] content = null, string[string] cookies = null, string[] headers = null, bool https = false)
|
||||||
in {
|
in {
|
||||||
assert(method == "POST" || method == "GET");
|
assert(method == "POST" || method == "GET");
|
||||||
}
|
}
|
||||||
|
@ -354,7 +354,6 @@ body {
|
||||||
break;
|
break;
|
||||||
case 3: // reading footers
|
case 3: // reading footers
|
||||||
goto done; // FIXME
|
goto done; // FIXME
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|
2
http2.d
2
http2.d
|
@ -528,10 +528,8 @@ class HttpRequest {
|
||||||
data = data[a+1 .. $];
|
data = data[a+1 .. $];
|
||||||
bodyReadingState.chunkedState = 0;
|
bodyReadingState.chunkedState = 0;
|
||||||
goto start_over;
|
goto start_over;
|
||||||
break;
|
|
||||||
case 3: // reading footers
|
case 3: // reading footers
|
||||||
goto done; // FIXME
|
goto done; // FIXME
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
28
jsvar.d
28
jsvar.d
|
@ -168,7 +168,7 @@ writeln(interpret("x*x + 3*x;", var(["x":3])));
|
||||||
};
|
};
|
||||||
|
|
||||||
// call D defined functions in script
|
// call D defined functions in script
|
||||||
globals.func = (var a, var b) { writeln("Hello, world! You are : ", a, " and ", b); };
|
globals.func = (var a, var b) { writeln("Hello, world! You are : ", a, " and ", b); };
|
||||||
|
|
||||||
globals.ex = () { throw new ScriptRuntimeException("test", 1); };
|
globals.ex = () { throw new ScriptRuntimeException("test", 1); };
|
||||||
|
|
||||||
|
@ -613,7 +613,7 @@ struct var {
|
||||||
this._type = Type.String;
|
this._type = Type.String;
|
||||||
this._payload._string = to!string(t);
|
this._payload._string = to!string(t);
|
||||||
} else static if((is(T == class) || is(T == struct) || isAssociativeArray!T)) {
|
} else static if((is(T == class) || is(T == struct) || isAssociativeArray!T)) {
|
||||||
this,_type = Type.Object;
|
this._type = Type.Object;
|
||||||
auto obj = new PrototypeObject();
|
auto obj = new PrototypeObject();
|
||||||
this._payload._object = obj;
|
this._payload._object = obj;
|
||||||
|
|
||||||
|
@ -748,9 +748,8 @@ struct var {
|
||||||
if(this._object !is null)
|
if(this._object !is null)
|
||||||
return this._object.toString();
|
return this._object.toString();
|
||||||
return "null";
|
return "null";
|
||||||
}
|
} else
|
||||||
|
return T.init;
|
||||||
return T.init;
|
|
||||||
case Type.Integral:
|
case Type.Integral:
|
||||||
static if(isFloatingPoint!T || isIntegral!T)
|
static if(isFloatingPoint!T || isIntegral!T)
|
||||||
return to!T(this._payload._integral);
|
return to!T(this._payload._integral);
|
||||||
|
@ -766,11 +765,12 @@ struct var {
|
||||||
else
|
else
|
||||||
return T.init;
|
return T.init;
|
||||||
case Type.String:
|
case Type.String:
|
||||||
static if(__traits(compiles, to!T(this._payload._string)))
|
static if(__traits(compiles, to!T(this._payload._string))) {
|
||||||
try {
|
try {
|
||||||
return to!T(this._payload._string);
|
return to!T(this._payload._string);
|
||||||
} catch (Exception e) {}
|
} catch (Exception e) { return T.init; }
|
||||||
return T.init;
|
} else
|
||||||
|
return T.init;
|
||||||
case Type.Array:
|
case Type.Array:
|
||||||
import std.range;
|
import std.range;
|
||||||
auto pl = this._payload._array;
|
auto pl = this._payload._array;
|
||||||
|
@ -786,16 +786,15 @@ struct var {
|
||||||
foreach(item; pl)
|
foreach(item; pl)
|
||||||
ret ~= item.get!(getType);
|
ret ~= item.get!(getType);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
} else
|
||||||
|
return T.init;
|
||||||
// is it sane to translate anything else?
|
// is it sane to translate anything else?
|
||||||
|
|
||||||
return T.init;
|
|
||||||
case Type.Function:
|
case Type.Function:
|
||||||
static if(isSomeString!T)
|
static if(isSomeString!T)
|
||||||
return "<function>";
|
return "<function>";
|
||||||
|
else
|
||||||
|
return T.init;
|
||||||
// FIXME: we just might be able to do better for both of these
|
// FIXME: we just might be able to do better for both of these
|
||||||
return T.init;
|
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1091,7 +1090,6 @@ struct var {
|
||||||
}
|
}
|
||||||
|
|
||||||
return _arrayPrototype;
|
return _arrayPrototype;
|
||||||
break;
|
|
||||||
case Type.Function:
|
case Type.Function:
|
||||||
assert(_functionPrototype._type == Type.Object);
|
assert(_functionPrototype._type == Type.Object);
|
||||||
if(_functionPrototype._payload._object is null) {
|
if(_functionPrototype._payload._object is null) {
|
||||||
|
@ -1099,7 +1097,6 @@ struct var {
|
||||||
}
|
}
|
||||||
|
|
||||||
return _functionPrototype;
|
return _functionPrototype;
|
||||||
break;
|
|
||||||
case Type.String:
|
case Type.String:
|
||||||
assert(_stringPrototype._type == Type.Object);
|
assert(_stringPrototype._type == Type.Object);
|
||||||
if(_stringPrototype._payload._object is null) {
|
if(_stringPrototype._payload._object is null) {
|
||||||
|
@ -1107,7 +1104,6 @@ struct var {
|
||||||
}
|
}
|
||||||
|
|
||||||
return _stringPrototype;
|
return _stringPrototype;
|
||||||
break;
|
|
||||||
case Type.Object:
|
case Type.Object:
|
||||||
if(_payload._object)
|
if(_payload._object)
|
||||||
return _payload._object._prototype;
|
return _payload._object._prototype;
|
||||||
|
|
2
png.d
2
png.d
|
@ -1719,7 +1719,7 @@ immutable(ubyte)[] unfilter(ubyte filterType, in ubyte[] data, in ubyte[] previo
|
||||||
foreach(i; 0 .. arr.length) {
|
foreach(i; 0 .. arr.length) {
|
||||||
auto prev = i < bpp ? 0 : arr[i - bpp];
|
auto prev = i < bpp ? 0 : arr[i - bpp];
|
||||||
arr[i] += cast(ubyte)
|
arr[i] += cast(ubyte)
|
||||||
std.math.floor( cast(int) (prev + previousLine[i]) / 2);
|
/*std.math.floor*/( cast(int) (prev + previousLine[i]) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return assumeUnique(arr);
|
return assumeUnique(arr);
|
||||||
|
|
6
script.d
6
script.d
|
@ -1471,7 +1471,6 @@ Expression parsePart(MyTokenStreamHere)(ref MyTokenStreamHere tokens) {
|
||||||
obj.elements[key.str] = value;
|
obj.elements[key.str] = value;
|
||||||
|
|
||||||
goto moreKeys;
|
goto moreKeys;
|
||||||
break;
|
|
||||||
case "function":
|
case "function":
|
||||||
tokens.requireNextToken(ScriptToken.Type.symbol, "(");
|
tokens.requireNextToken(ScriptToken.Type.symbol, "(");
|
||||||
|
|
||||||
|
@ -1969,7 +1968,7 @@ Expression parseExpression(MyTokenStreamHere)(ref MyTokenStreamHere tokens, bool
|
||||||
ret = parseAddend(tokens);
|
ret = parseAddend(tokens);
|
||||||
} else {
|
} else {
|
||||||
assert(0);
|
assert(0);
|
||||||
return null;
|
// return null;
|
||||||
// throw new ScriptCompileException("Parse error, unexpected end of input when reading expression", token.lineNumber);
|
// throw new ScriptCompileException("Parse error, unexpected end of input when reading expression", token.lineNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2140,13 +2139,12 @@ Expression parseStatement(MyTokenStreamHere)(ref MyTokenStreamHere tokens, strin
|
||||||
// whatever else keyword or operator related is actually illegal here
|
// whatever else keyword or operator related is actually illegal here
|
||||||
throw new ScriptCompileException("Parse error, unexpected " ~ token.str, token.lineNumber);
|
throw new ScriptCompileException("Parse error, unexpected " ~ token.str, token.lineNumber);
|
||||||
}
|
}
|
||||||
break;
|
// break;
|
||||||
case ScriptToken.Type.identifier:
|
case ScriptToken.Type.identifier:
|
||||||
case ScriptToken.Type.string:
|
case ScriptToken.Type.string:
|
||||||
case ScriptToken.Type.int_number:
|
case ScriptToken.Type.int_number:
|
||||||
case ScriptToken.Type.float_number:
|
case ScriptToken.Type.float_number:
|
||||||
return parseExpression(tokens);
|
return parseExpression(tokens);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
|
@ -1681,7 +1681,7 @@ version(Windows) {
|
||||||
int biYPelsPerMeter;
|
int biYPelsPerMeter;
|
||||||
uint biClrUsed;
|
uint biClrUsed;
|
||||||
uint biClrImportant;
|
uint biClrImportant;
|
||||||
RGBQUAD biColors[colorCount];
|
RGBQUAD[colorCount] biColors;
|
||||||
/* Pixels:
|
/* Pixels:
|
||||||
Uint8 pixels[]
|
Uint8 pixels[]
|
||||||
*/
|
*/
|
||||||
|
@ -4300,7 +4300,7 @@ struct XKeymapEvent
|
||||||
Bool send_event; /* true if this came from a SendEvent request */
|
Bool send_event; /* true if this came from a SendEvent request */
|
||||||
Display *display; /* Display the event was read from */
|
Display *display; /* Display the event was read from */
|
||||||
Window window;
|
Window window;
|
||||||
byte key_vector[32];
|
byte[32] key_vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct XExposeEvent
|
struct XExposeEvent
|
||||||
|
@ -4563,9 +4563,9 @@ struct XClientMessageEvent
|
||||||
Atom message_type;
|
Atom message_type;
|
||||||
int format;
|
int format;
|
||||||
union Data{
|
union Data{
|
||||||
byte b[20];
|
byte[20] b;
|
||||||
short s[10];
|
short[10] s;
|
||||||
arch_ulong l[5];
|
arch_ulong[5] l;
|
||||||
}
|
}
|
||||||
Data data;
|
Data data;
|
||||||
|
|
||||||
|
@ -4638,7 +4638,7 @@ union XEvent{
|
||||||
XMappingEvent xmapping;
|
XMappingEvent xmapping;
|
||||||
XErrorEvent xerror;
|
XErrorEvent xerror;
|
||||||
XKeymapEvent xkeymap;
|
XKeymapEvent xkeymap;
|
||||||
arch_ulong pad[24];
|
arch_ulong[24] pad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4942,6 +4942,10 @@ struct Visual
|
||||||
void XSetWMName(Display*, Window, XTextProperty*);
|
void XSetWMName(Display*, Window, XTextProperty*);
|
||||||
|
|
||||||
enum Atom XA_STRING = 31;
|
enum Atom XA_STRING = 31;
|
||||||
|
enum Atom XA_ATOM = 4;
|
||||||
|
enum int PropModeAppend = 2;
|
||||||
|
enum int PropModeReplace = 0;
|
||||||
|
enum int PropModePrepend = 1;
|
||||||
|
|
||||||
|
|
||||||
} else version (OSXCocoa) {
|
} else version (OSXCocoa) {
|
||||||
|
|
17
sqlite.d
17
sqlite.d
|
@ -138,9 +138,10 @@ class Sqlite : Database {
|
||||||
}
|
}
|
||||||
|
|
||||||
string error(){
|
string error(){
|
||||||
|
import core.stdc.string : strlen;
|
||||||
char* mesg = sqlite3_errmsg(db);
|
char* mesg = sqlite3_errmsg(db);
|
||||||
char[] m;
|
char[] m;
|
||||||
sizediff_t a = std.c.string.strlen(mesg);
|
sizediff_t a = strlen(mesg);
|
||||||
m.length = a;
|
m.length = a;
|
||||||
for(int v = 0; v < a; v++)
|
for(int v = 0; v < a; v++)
|
||||||
m[v] = mesg[v];
|
m[v] = mesg[v];
|
||||||
|
@ -160,8 +161,9 @@ class Sqlite : Database {
|
||||||
int exec(string sql, void delegate (char[][char[]]) onEach = null) {
|
int exec(string sql, void delegate (char[][char[]]) onEach = null) {
|
||||||
char* mesg;
|
char* mesg;
|
||||||
if(sqlite3_exec(db, toStringz(sql), &callback, &onEach, &mesg) != SQLITE_OK) {
|
if(sqlite3_exec(db, toStringz(sql), &callback, &onEach, &mesg) != SQLITE_OK) {
|
||||||
|
import core.stdc.string : strlen;
|
||||||
char[] m;
|
char[] m;
|
||||||
sizediff_t a = std.c.string.strlen(mesg);
|
sizediff_t a = strlen(mesg);
|
||||||
m.length = a;
|
m.length = a;
|
||||||
for(int v = 0; v < a; v++)
|
for(int v = 0; v < a; v++)
|
||||||
m[v] = mesg[v];
|
m[v] = mesg[v];
|
||||||
|
@ -281,8 +283,9 @@ struct Statement {
|
||||||
|
|
||||||
columnNames.length = count;
|
columnNames.length = count;
|
||||||
for(int a = 0; a < count; a++){
|
for(int a = 0; a < count; a++){
|
||||||
|
import core.stdc.string : strlen;
|
||||||
char* str = sqlite3_column_name(s, a);
|
char* str = sqlite3_column_name(s, a);
|
||||||
sizediff_t l = std.c.string.strlen(str);
|
sizediff_t l = strlen(str);
|
||||||
columnNames[a].length = l;
|
columnNames[a].length = l;
|
||||||
for(int b = 0; b < l; b++)
|
for(int b = 0; b < l; b++)
|
||||||
columnNames[a][b] = str[b];
|
columnNames[a][b] = str[b];
|
||||||
|
@ -332,7 +335,8 @@ struct Statement {
|
||||||
char* str = sqlite3_column_text(s, a);
|
char* str = sqlite3_column_text(s, a);
|
||||||
char[] st;
|
char[] st;
|
||||||
|
|
||||||
sizediff_t l = std.c.string.strlen(str);
|
import core.stdc.string : strlen;
|
||||||
|
sizediff_t l = strlen(str);
|
||||||
st.length = l;
|
st.length = l;
|
||||||
for(int aa = 0; aa < l; aa++)
|
for(int aa = 0; aa < l; aa++)
|
||||||
st[aa] = str[aa];
|
st[aa] = str[aa];
|
||||||
|
@ -621,15 +625,16 @@ extern(C) int callback(void* cb, int howmany, char** text, char** columns){
|
||||||
|
|
||||||
|
|
||||||
char[][char[]] row;
|
char[][char[]] row;
|
||||||
|
import core.stdc.string : strlen;
|
||||||
|
|
||||||
for(int a = 0; a < howmany; a++){
|
for(int a = 0; a < howmany; a++){
|
||||||
sizediff_t b = std.c.string.strlen(columns[a]);
|
sizediff_t b = strlen(columns[a]);
|
||||||
char[] buf;
|
char[] buf;
|
||||||
buf.length = b;
|
buf.length = b;
|
||||||
for(int c = 0; c < b; c++)
|
for(int c = 0; c < b; c++)
|
||||||
buf[c] = columns[a][c];
|
buf[c] = columns[a][c];
|
||||||
|
|
||||||
sizediff_t d = std.c.string.strlen(text[a]);
|
sizediff_t d = strlen(text[a]);
|
||||||
char[] t;
|
char[] t;
|
||||||
t.length = d;
|
t.length = d;
|
||||||
for(int c = 0; c < d; c++)
|
for(int c = 0; c < d; c++)
|
||||||
|
|
|
@ -157,8 +157,8 @@ import std.file;
|
||||||
alias uint stbtt_uint32;
|
alias uint stbtt_uint32;
|
||||||
alias int stbtt_int32;
|
alias int stbtt_int32;
|
||||||
|
|
||||||
alias char stbtt__check_size32[(stbtt_int32.sizeof)==4 ? 1 : -1];
|
alias char[(stbtt_int32.sizeof)==4 ? 1 : -1] stbtt__check_size32;
|
||||||
alias char stbtt__check_size16[(stbtt_int16.sizeof)==2 ? 1 : -1];
|
alias char[(stbtt_int16.sizeof)==2 ? 1 : -1] stbtt__check_size16;
|
||||||
|
|
||||||
static import core.stdc.stdlib;
|
static import core.stdc.stdlib;
|
||||||
alias STBTT_sort = core.stdc.stdlib.qsort;
|
alias STBTT_sort = core.stdc.stdlib.qsort;
|
||||||
|
@ -508,7 +508,7 @@ int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint)
|
||||||
return 0;
|
return 0;
|
||||||
} else if (format == 2) {
|
} else if (format == 2) {
|
||||||
assert(0); // @TODO: high-byte mapping for japanese/chinese/korean
|
assert(0); // @TODO: high-byte mapping for japanese/chinese/korean
|
||||||
return 0;
|
//return 0;
|
||||||
} else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges
|
} else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges
|
||||||
stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1;
|
stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1;
|
||||||
stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1;
|
stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1;
|
||||||
|
@ -581,7 +581,7 @@ int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint)
|
||||||
}
|
}
|
||||||
// @TODO
|
// @TODO
|
||||||
assert(0);
|
assert(0);
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices)
|
int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices)
|
||||||
|
@ -806,7 +806,7 @@ int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_verte
|
||||||
stbtt_uint16 flags, gidx;
|
stbtt_uint16 flags, gidx;
|
||||||
int comp_num_verts = 0, i;
|
int comp_num_verts = 0, i;
|
||||||
stbtt_vertex* comp_verts = null, tmp = null;
|
stbtt_vertex* comp_verts = null, tmp = null;
|
||||||
float mtx[6] = [1,0,0,1,0,0];
|
float[6] mtx = [1,0,0,1,0,0];
|
||||||
float m, n;
|
float m, n;
|
||||||
|
|
||||||
flags = ttSHORT(comp); comp+=2;
|
flags = ttSHORT(comp); comp+=2;
|
||||||
|
@ -1231,7 +1231,7 @@ static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcou
|
||||||
e[n].invert = 0;
|
e[n].invert = 0;
|
||||||
if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) {
|
if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) {
|
||||||
e[n].invert = 1;
|
e[n].invert = 1;
|
||||||
a=j,b=k;
|
a=j;b=k;
|
||||||
}
|
}
|
||||||
e[n].x0 = p[a].x * scale_x + shift_x;
|
e[n].x0 = p[a].x * scale_x + shift_x;
|
||||||
e[n].y0 = p[a].y * y_scale_inv * vsubsample + shift_y;
|
e[n].y0 = p[a].y * y_scale_inv * vsubsample + shift_y;
|
||||||
|
@ -1321,7 +1321,7 @@ stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float o
|
||||||
++n;
|
++n;
|
||||||
start = num_points;
|
start = num_points;
|
||||||
|
|
||||||
x = vertices[i].x, y = vertices[i].y;
|
x = vertices[i].x; y = vertices[i].y;
|
||||||
stbtt__add_point(points, num_points++, x,y);
|
stbtt__add_point(points, num_points++, x,y);
|
||||||
break;
|
break;
|
||||||
case STBTT_vline:
|
case STBTT_vline:
|
||||||
|
@ -1333,7 +1333,7 @@ stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float o
|
||||||
vertices[i].cx, vertices[i].cy,
|
vertices[i].cx, vertices[i].cy,
|
||||||
vertices[i].x, vertices[i].y,
|
vertices[i].x, vertices[i].y,
|
||||||
objspace_flatness_squared, 0);
|
objspace_flatness_squared, 0);
|
||||||
x = vertices[i].x, y = vertices[i].y;
|
x = vertices[i].x; y = vertices[i].y;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1483,7 +1483,7 @@ extern int stbtt_BakeFontBitmap(const ubyte *data, int offset, // font location
|
||||||
gw = x1-x0;
|
gw = x1-x0;
|
||||||
gh = y1-y0;
|
gh = y1-y0;
|
||||||
if (x + gw + 1 >= pw)
|
if (x + gw + 1 >= pw)
|
||||||
y = bottom_y, x = 1; // advance to next row
|
{ y = bottom_y; x = 1; } // advance to next row
|
||||||
if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row
|
if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row
|
||||||
return -i;
|
return -i;
|
||||||
assert(x+gw < pw);
|
assert(x+gw < pw);
|
||||||
|
|
|
@ -1650,7 +1650,6 @@ struct RealTimeConsoleInput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [InputEvent(PasteEvent(data))];
|
return [InputEvent(PasteEvent(data))];
|
||||||
break;
|
|
||||||
case "\033[M":
|
case "\033[M":
|
||||||
// mouse event
|
// mouse event
|
||||||
auto buttonCode = nextRaw() - 32;
|
auto buttonCode = nextRaw() - 32;
|
||||||
|
@ -1714,7 +1713,6 @@ struct RealTimeConsoleInput {
|
||||||
m.modifierState = modifiers;
|
m.modifierState = modifiers;
|
||||||
|
|
||||||
return [InputEvent(m)];
|
return [InputEvent(m)];
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
// look it up in the termcap key database
|
// look it up in the termcap key database
|
||||||
auto cap = terminal.findSequenceInTermcap(sequence);
|
auto cap = terminal.findSequenceInTermcap(sequence);
|
||||||
|
|
13
web.d
13
web.d
|
@ -372,7 +372,13 @@ class ApiProvider : WebDotDBaseType {
|
||||||
return; // not doing checks
|
return; // not doing checks
|
||||||
|
|
||||||
void fail() {
|
void fail() {
|
||||||
throw new PermissionDeniedException("CSRF token test failed");
|
throw new PermissionDeniedException("CSRF token test failed " ~ to!string(cgi.postArray));
|
||||||
|
/*
|
||||||
|
~ "::::::"~cgi.post[
|
||||||
|
tokenInfo["key"]
|
||||||
|
] ~ " != " ~
|
||||||
|
tokenInfo["token"]);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// expiration is handled by the session itself expiring (in the Session class)
|
// expiration is handled by the session itself expiring (in the Session class)
|
||||||
|
@ -2763,9 +2769,10 @@ string formatAs(T, R)(T ret, string format, R api = null, JSONValue* returnValue
|
||||||
returnValue.str = retstr;
|
returnValue.str = retstr;
|
||||||
break;
|
break;
|
||||||
case "string": // FIXME: this is the most expensive part of the compile! Two seconds in one of my apps.
|
case "string": // FIXME: this is the most expensive part of the compile! Two seconds in one of my apps.
|
||||||
static if(is(typeof(ret) == string))
|
static if(is(typeof(ret) == string)) {
|
||||||
returnValue.str = ret;
|
returnValue.str = ret;
|
||||||
else
|
break;
|
||||||
|
} else
|
||||||
/+
|
/+
|
||||||
static if(__traits(compiles, to!string(ret))) {
|
static if(__traits(compiles, to!string(ret))) {
|
||||||
retstr = to!string(ret);
|
retstr = to!string(ret);
|
||||||
|
|
Loading…
Reference in New Issue