Skip to content

Commit

Permalink
Fix narrowing cast errors on Clang 9
Browse files Browse the repository at this point in the history
  • Loading branch information
dapetcu21 committed Oct 6, 2019
1 parent c969c2e commit 622dbc8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions defos/src/defos_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ WinRect defos_get_window_size()
RECT rect;
GetWindowRect(window, &rect);
WinRect result = {
.x = rect.left,
.y = rect.top,
.w = rect.right - rect.left,
.h = rect.bottom - rect.top,
.x = (float)rect.left,
.y = (float)rect.top,
.w = (float)(rect.right - rect.left),
.h = (float)(rect.bottom - rect.top),
};
return result;
}
Expand All @@ -316,10 +316,10 @@ WinRect defos_get_view_size()
ClientToScreen(window, &pos);

WinRect rect = {
.x = pos.x,
.y = pos.y,
.w = wrect.right - wrect.left,
.h = wrect.bottom - wrect.top,
.x = (float)pos.x,
.y = (float)pos.y,
.w = (float)(wrect.right - wrect.left),
.h = (float)(wrect.bottom - wrect.top),
};
return rect;
}
Expand All @@ -329,7 +329,7 @@ WinPoint defos_get_cursor_pos()
POINT point;
GetCursorPos(&point);

WinPoint result = { .x = point.x, .y = point.y };
WinPoint result = { .x = (float)point.x, .y = (float)point.y };
return result;
}

Expand All @@ -341,7 +341,7 @@ WinPoint defos_get_cursor_pos_view()
HWND window = dmGraphics::GetNativeWindowsHWND();
ScreenToClient(window, &point);

WinPoint result = { .x = point.x, .y = point.y };
WinPoint result = { .x = (float)point.x, .y = (float)point.y };
return result;
}

Expand Down

0 comments on commit 622dbc8

Please sign in to comment.