Code style fixes, etc.

Reference PR #6345.
This commit is contained in:
Ryan C. Gordon
2022-11-16 12:53:48 -05:00
parent ec58a817ef
commit 389ffab733
5 changed files with 32 additions and 24 deletions

View File

@@ -739,18 +739,22 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b
/* rcClient stores the size of the inner window, while rcWindow stores the outer size relative to the top-left
* screen position; so the top/left values of rcClient are always {0,0} and bottom/right are {height,width} */
if (!GetClientRect(hwnd, &rcClient))
SDL_SetError("GetClientRect() failed, error %08X", (unsigned int)GetLastError());
if (!GetWindowRect(hwnd, &rcWindow))
SDL_SetError("GetWindowRect() failed, error %08X", (unsigned int)GetLastError());
if (!GetClientRect(hwnd, &rcClient)) {
return SDL_SetError("GetClientRect() failed, error %08X", (unsigned int)GetLastError());
}
if (!GetWindowRect(hwnd, &rcWindow)) {
return SDL_SetError("GetWindowRect() failed, error %08X", (unsigned int)GetLastError());
}
/* convert the top/left values to make them relative to
* the window; they will end up being slightly negative */
ptDiff.y = rcWindow.top;
ptDiff.x = rcWindow.left;
if (!ScreenToClient(hwnd, &ptDiff))
SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError());
if (!ScreenToClient(hwnd, &ptDiff)) {
return SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError());
}
rcWindow.top = ptDiff.y;
rcWindow.left = ptDiff.x;
@@ -760,8 +764,9 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b
ptDiff.y = rcWindow.bottom;
ptDiff.x = rcWindow.right;
if (!ScreenToClient(hwnd, &ptDiff))
SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError());
if (!ScreenToClient(hwnd, &ptDiff)) {
return SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError());
}
rcWindow.bottom = ptDiff.y;
rcWindow.right = ptDiff.x;