diff --git a/source/image_loader.d b/source/image_loader.d index 8881591..de7e446 100644 --- a/source/image_loader.d +++ b/source/image_loader.d @@ -139,7 +139,7 @@ FIBITMAP* pixmapToFibitmap(Pixmap pixmap) FreeImage_SetTagLength(tag, 1); FreeImage_SetTagValue(tag, &dismet); FreeImage_SetMetadata(FIMD_ANIMATION, img, "DisposalMethod", tag); - uint colors = pixmap.palette.length / 3; + uint colors = cast(uint)(pixmap.palette.length / 3); RGBQUAD* palette = FreeImage_GetPalette(img); for (uint c = 0; c < colors; c++) { diff --git a/source/lua_api/fs.d b/source/lua_api/fs.d index ed68a75..dedf1c4 100644 --- a/source/lua_api/fs.d +++ b/source/lua_api/fs.d @@ -85,7 +85,7 @@ void registerFunctions(Program program) extern (C) int fs_write(lua_State* L) @trusted { auto filename = to!string(lua_tostring(L, 1)); - uint len; + size_t len; auto str = lua_tolstring(L, 2, &len); lua_getglobal(L, "__program"); auto prog = cast(Program*) lua_touserdata(L, -1); diff --git a/source/lua_api/view.d b/source/lua_api/view.d index 0fad255..61a577e 100644 --- a/source/lua_api/view.d +++ b/source/lua_api/view.d @@ -108,7 +108,7 @@ void registerFunctions(Program program) throw new Exception("Invalid viewport!"); prog.activeViewport = prog.viewports[cast(uint) vpID]; } - uint id = countUntil(prog.viewports, prog.activeViewport); + uint id = cast(uint) countUntil(prog.viewports, prog.activeViewport); if (id < 1) lua_pushnil(L); else diff --git a/source/machine.d b/source/machine.d index 323fd91..0726bd2 100644 --- a/source/machine.d +++ b/source/machine.d @@ -253,7 +253,7 @@ class Machine */ int getScreenIndex(Viewport screen) { - return countUntil(this.screens, screen); + return cast(int) countUntil(this.screens, screen); } /** @@ -267,7 +267,7 @@ class Machine while (index < 0) index += this.screens.length; if (index >= this.screens.length) - index = this.screens.length - 1; + index = cast(int) this.screens.length - 1; this.screens = this.screens.remove(i); this.screens = this.screens[0 .. index] ~ [cast(Screen) screen] ~ this.screens[index .. $]; } diff --git a/source/sample.d b/source/sample.d index 26c3aa6..a55bb25 100644 --- a/source/sample.d +++ b/source/sample.d @@ -89,7 +89,7 @@ class Sample uint[] i; auto f = File(filename, "wb"); f.rawWrite("RIFF"); - i = [36 + this.data.length]; + i = [36 + cast(uint) this.data.length]; f.rawWrite(i); f.rawWrite("WAVE"); f.rawWrite("fmt "); @@ -102,7 +102,7 @@ class Sample s = [1, 8]; f.rawWrite(s); f.rawWrite("data"); - i = [this.data.length]; + i = [cast(uint) this.data.length]; f.rawWrite(i); b.length = this.data.length; for (uint n = 0; n < b.length; n++) diff --git a/source/viewport.d b/source/viewport.d index 0005cd3..e5e4649 100644 --- a/source/viewport.d +++ b/source/viewport.d @@ -85,7 +85,7 @@ class Viewport */ int getViewportIndex(Viewport vp) { - return countUntil(this.children, vp); + return cast(int) countUntil(this.children, vp); } /** @@ -99,7 +99,7 @@ class Viewport while (index < 0) index += this.children.length; if (index >= this.children.length) - index = this.children.length - 1; + index = cast(int) this.children.length - 1; this.children = this.children.remove(i); this.children = this.children[0 .. index] ~ vp ~ this.children[index .. $]; }