fix warnings of DMD2.071

This commit is contained in:
Vadim Lopatin 2016-04-11 10:24:45 +03:00
parent 2f39fd8891
commit 0f61a1d355
12 changed files with 23 additions and 0 deletions

View File

@ -1138,12 +1138,15 @@ class EditableContent {
static alias isDigit = std.uni.isNumber;
static bool isAlpha(dchar ch) pure nothrow {
static import std.uni;
return std.uni.isAlpha(ch) || ch == '_';
}
static bool isAlNum(dchar ch) pure nothrow {
static import std.uni;
return isDigit(ch) || isAlpha(ch);
}
static bool isLowerAlpha(dchar ch) pure nothrow {
static import std.uni;
return std.uni.isLower(ch) || ch == '_';
}
static alias isUpperAlpha = std.uni.isUpper;

View File

@ -592,6 +592,7 @@ struct ButtonDetails {
/// update for button down
void down(short x, short y, ushort flags) {
static import std.datetime;
//Log.d("Button down ", x, ",", y, " _downTs=", _downTs, " _upTs=", _upTs);
long oldDownTs = _downTs;
_downX = x;
@ -605,6 +606,7 @@ struct ButtonDetails {
}
/// update for button up
void up(short x, short y, ushort flags) {
static import std.datetime;
//Log.d("Button up ", x, ",", y, " _downTs=", _downTs, " _upTs=", _upTs);
_doubleClick = false;
_upTs = std.datetime.Clock.currStdTime;
@ -613,6 +615,7 @@ struct ButtonDetails {
@property bool isDown() { return _downTs != 0 && _upTs == 0; }
/// returns button down state duration in hnsecs (1/10000 of second).
@property int downDuration() {
static import std.datetime;
if (_downTs == 0)
return 0;
if (_downTs != 0 && _upTs != 0)
@ -724,6 +727,7 @@ class MouseEvent {
}
/// construct mouse event from data
this (MouseAction a, MouseButton b, ushort f, short x, short y, short wheelDelta = 0) {
static import std.datetime;
_eventTimestamp = std.datetime.Clock.currStdTime;
_action = a;
_button = b;

View File

@ -55,6 +55,7 @@ enum LogLevel : int {
/// Returns timestamp in milliseconds since 1970 UTC similar to Java System.currentTimeMillis()
@property long currentTimeMillis() {
static import std.datetime;
return std.datetime.Clock.currStdTime / 10000;
}

View File

@ -1630,12 +1630,15 @@ final class Setting {
throw new Exception("JSON parsing error in (" ~ to!string(line) ~ ":" ~ to!string(col) ~ ") " ~ context ~ ": " ~ msg);
}
static bool isAlpha(char ch) {
static import std.ascii;
return std.ascii.isAlpha(ch) || ch == '_';
}
static bool isAlNum(char ch) {
static import std.ascii;
return std.ascii.isAlphaNum(ch) || ch == '_';
}
@property char skipSpaces() {
static import std.ascii;
for(;pos < json.length;pos++) {
char ch = json[pos];
if (!std.ascii.isWhite(ch))
@ -1866,6 +1869,7 @@ final class Setting {
}
private Setting parseJSON(ref JsonParser parser) {
static import std.ascii;
char ch = parser.skipSpaces;
if (ch == '\"') {
this = parser.parseString;

View File

@ -473,6 +473,7 @@ wstring fromWStringz(const(wchar) * s) {
Uppercase unicode character.
*/
deprecated dchar dcharToUpper(dchar ch) {
static import std.uni;
return std.uni.toUpper(ch);
}

View File

@ -39,6 +39,7 @@ import dlangui.graphics.scene.effect;
derelict.util.exception.ShouldThrow gl3MissingSymFunc( string symName ) {
import std.algorithm : equal;
static import derelict.util.exception;
foreach(s; ["glGetError", "glShaderSource", "glCompileShader",
"glGetShaderiv", "glGetShaderInfoLog", "glGetString",
"glCreateProgram", "glUseProgram", "glDeleteProgram",

View File

@ -53,6 +53,7 @@ import std.conv : to;
/// load and decode image from file to ColorDrawBuf, returns null if loading or decoding is failed
ColorDrawBuf loadImage(string filename) {
static import std.file;
try {
immutable ubyte[] data = cast(immutable ubyte[])std.file.read(filename);
return loadImage(data, filename);

View File

@ -251,6 +251,7 @@ struct AutoParams {
this.bumpMapping = bumpMapping;
}
string defs() {
import std.conv : to;
char[] buf;
if (directionalLightCount) {
buf ~= "DIRECTIONAL_LIGHT_COUNT ";

View File

@ -445,6 +445,7 @@ class Window : CustomEventTarget {
static immutable int PERFORMANCE_LOGGING_THRESHOLD_MS = 20;
void onDraw(DrawBuf buf) {
static import std.datetime;
try {
bool needDraw = false;
bool needLayout = false;

View File

@ -184,6 +184,7 @@ version (Windows) {
/// initialize logging (for win32 - to file ui.log, for other platforms - stderr; log level is TRACE for debug builds, and WARN for release builds)
extern (C) void initLogs() {
static import std.stdio;
version (Windows) {
debug {
Log.setFileLogger(new std.stdio.File("ui.log", "w"));

View File

@ -306,6 +306,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
/// override to add custom items on left panel
protected void updateLeftPaneWidth() {
import std.conv : to;
_iconsWidth = _showIcons ? _iconsPaneWidth : 0;
_foldingWidth = _showFolding ? _foldingPaneWidth : 0;
_modificationMarksWidth = _showModificationMarks ? _modificationMarksPaneWidth : 0;
@ -369,6 +370,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
}
protected void drawLeftPaneLineNumbers(DrawBuf buf, Rect rc, int line) {
import std.conv : to;
buf.fillRect(rc, _leftPaneLineNumberBackgroundColor);
if (line < 0)
return;
@ -2842,6 +2844,7 @@ class LogWidget : EditBox {
/// append lines to the end of text
void appendText(dstring text) {
import std.array : split;
if (text.length == 0)
return;
dstring[] lines = text.split("\n");

View File

@ -147,6 +147,7 @@ class MenuItem {
/// get hotkey character from label (e.g. 'F' for item labeled "&File"), 0 if no hotkey
dchar getHotkey() {
static import std.uni;
dstring s = label;
dchar ch = 0;
for (int i = 0; i < s.length - 1; i++) {
@ -160,6 +161,7 @@ class MenuItem {
/// find subitem by hotkey character, returns subitem index, -1 if not found
int findSubitemByHotkey(dchar ch) {
static import std.uni;
if (!ch)
return -1;
ch = std.uni.toUpper(ch);