more safer by default warning silencing

This commit is contained in:
Adam D. Ruppe 2024-09-15 09:21:01 -04:00
parent d67fae5b1f
commit c13a8cd2e5
2 changed files with 10 additions and 10 deletions

4
core.d
View file

@ -4950,7 +4950,7 @@ class DirectoryWatcher {
ubyte[] buffer; ubyte[] buffer;
extern(Windows) extern(Windows)
static void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped) { static void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped) @system {
typeof(this) rr = cast(typeof(this)) (cast(void*) lpOverlapped - typeof(this).overlapped.offsetof); typeof(this) rr = cast(typeof(this)) (cast(void*) lpOverlapped - typeof(this).overlapped.offsetof);
// dwErrorCode // dwErrorCode
@ -5239,7 +5239,7 @@ mixin template OverlappedIoRequest(Response, LowLevelOperation) {
OVERLAPPED overlapped; OVERLAPPED overlapped;
extern(Windows) extern(Windows)
static void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped) { static void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped) @system {
typeof(this) rr = cast(typeof(this)) (cast(void*) lpOverlapped - typeof(this).overlapped.offsetof); typeof(this) rr = cast(typeof(this)) (cast(void*) lpOverlapped - typeof(this).overlapped.offsetof);
rr.response = typeof(rr.response)(SystemErrorCode(dwErrorCode), rr.llo.buffer[0 .. dwNumberOfBytesTransferred]); rr.response = typeof(rr.response)(SystemErrorCode(dwErrorCode), rr.llo.buffer[0 .. dwNumberOfBytesTransferred]);

View file

@ -6288,7 +6288,7 @@ http://msdn.microsoft.com/en-us/library/windows/desktop/ms649016%28v=vs.85%29.as
the receiver may never be called if the clipboard is empty or unavailable the receiver may never be called if the clipboard is empty or unavailable
gets plain text from the clipboard. gets plain text from the clipboard.
+/ +/
void getClipboardText(SimpleWindow clipboardOwner, void delegate(in char[]) receiver) { void getClipboardText(SimpleWindow clipboardOwner, void delegate(in char[]) receiver) @system {
version(Windows) { version(Windows) {
HWND hwndOwner = clipboardOwner ? clipboardOwner.impl.hwnd : null; HWND hwndOwner = clipboardOwner ? clipboardOwner.impl.hwnd : null;
if(OpenClipboard(hwndOwner) == 0) if(OpenClipboard(hwndOwner) == 0)
@ -7109,7 +7109,7 @@ version(Windows) {
// global hotkey helper function // global hotkey helper function
/// Platform-specific for Windows. Registers a global hotkey. Returns a registration ID. See [GlobalHotkeyManager] for Linux. Maybe some day I will merge these. /// Platform-specific for Windows. Registers a global hotkey. Returns a registration ID. See [GlobalHotkeyManager] for Linux. Maybe some day I will merge these.
int registerHotKey(SimpleWindow window, UINT modifiers, UINT vk, void delegate() handler) { int registerHotKey(SimpleWindow window, UINT modifiers, UINT vk, void delegate() handler) @system {
__gshared int hotkeyId = 0; __gshared int hotkeyId = 0;
int id = ++hotkeyId; int id = ++hotkeyId;
if(!RegisterHotKey(window.impl.hwnd, id, modifiers, vk)) if(!RegisterHotKey(window.impl.hwnd, id, modifiers, vk))
@ -10257,7 +10257,7 @@ abstract class Gradient : Sprite {
} }
version(Windows) version(Windows)
final void forEachPixel(scope Color delegate(int x, int y) dg) { final void forEachPixel(scope Color delegate(int x, int y) dg) @system {
auto ptr = rawData; auto ptr = rawData;
foreach(j; 0 .. _height) foreach(j; 0 .. _height)
foreach(i; 0 .. _width) { foreach(i; 0 .. _width) {
@ -12904,7 +12904,7 @@ version(Windows) {
final: final:
Color getPixel(int x, int y) { Color getPixel(int x, int y) @system {
auto itemsPerLine = ((cast(int) width * 3 + 3) / 4) * 4; auto itemsPerLine = ((cast(int) width * 3 + 3) / 4) * 4;
// remember, bmps are upside down // remember, bmps are upside down
auto offset = itemsPerLine * (height - y - 1) + x * 3; auto offset = itemsPerLine * (height - y - 1) + x * 3;
@ -12921,7 +12921,7 @@ version(Windows) {
return c; return c;
} }
void setPixel(int x, int y, Color c) { void setPixel(int x, int y, Color c) @system {
auto itemsPerLine = ((cast(int) width * 3 + 3) / 4) * 4; auto itemsPerLine = ((cast(int) width * 3 + 3) / 4) * 4;
// remember, bmps are upside down // remember, bmps are upside down
auto offset = itemsPerLine * (height - y - 1) + x * 3; auto offset = itemsPerLine * (height - y - 1) + x * 3;
@ -12936,7 +12936,7 @@ version(Windows) {
rawData[offset + 3] = c.a; rawData[offset + 3] = c.a;
} }
void convertToRgbaBytes(ubyte[] where) { void convertToRgbaBytes(ubyte[] where) @system {
assert(where.length == this.width * this.height * 4); assert(where.length == this.width * this.height * 4);
auto itemsPerLine = ((cast(int) width * 3 + 3) / 4) * 4; auto itemsPerLine = ((cast(int) width * 3 + 3) / 4) * 4;
@ -12963,7 +12963,7 @@ version(Windows) {
} }
} }
void setFromRgbaBytes(in ubyte[] what) { void setFromRgbaBytes(in ubyte[] what) @system {
assert(what.length == this.width * this.height * 4); assert(what.length == this.width * this.height * 4);
auto itemsPerLine = enableAlpha ? (width * 4) : (((cast(int) width * 3 + 3) / 4) * 4); auto itemsPerLine = enableAlpha ? (width * 4) : (((cast(int) width * 3 + 3) / 4) * 4);
@ -21914,7 +21914,7 @@ class FilesDropHandler : GenericDropHandlerBase {
else throw new NotYetImplementedException(); else throw new NotYetImplementedException();
} }
private void translator(scope ubyte[] data) { private void translator(scope ubyte[] data) @system {
version(X11) { version(X11) {
char[] listString = cast(char[]) data; char[] listString = cast(char[]) data;
char[][16] buffer; char[][16] buffer;