mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-17 23:31:45 +00:00
Cleanup add brace (#6545)
* Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line
This commit is contained in:
@@ -302,7 +302,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre
|
||||
|
||||
/* Allocate the window data */
|
||||
data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
|
||||
if (!data) {
|
||||
if (data == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
data->window = window;
|
||||
@@ -839,8 +839,7 @@ WIN_RaiseWindow(_THIS, SDL_Window * window)
|
||||
DWORD dwCurID = 0u;
|
||||
|
||||
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
|
||||
if(bForce)
|
||||
{
|
||||
if (bForce) {
|
||||
hCurWnd = GetForegroundWindow();
|
||||
dwMyID = GetCurrentThreadId();
|
||||
dwCurID = GetWindowThreadProcessId(hCurWnd, NULL);
|
||||
@@ -850,8 +849,7 @@ WIN_RaiseWindow(_THIS, SDL_Window * window)
|
||||
SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
||||
}
|
||||
SetForegroundWindow(hwnd);
|
||||
if (bForce)
|
||||
{
|
||||
if (bForce) {
|
||||
AttachThreadInput(dwCurID, dwMyID, FALSE);
|
||||
SetFocus(hwnd);
|
||||
SetActiveWindow(hwnd);
|
||||
@@ -1058,7 +1056,7 @@ WIN_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size)
|
||||
filename_utf8 = WIN_StringToUTF8(data->ICMFileName);
|
||||
if (filename_utf8) {
|
||||
iccProfileData = SDL_LoadFile(filename_utf8, size);
|
||||
if (!iccProfileData) {
|
||||
if (iccProfileData == NULL) {
|
||||
SDL_SetError("Could not open ICC profile");
|
||||
}
|
||||
SDL_free(filename_utf8);
|
||||
@@ -1240,7 +1238,7 @@ void WIN_OnWindowEnter(_THIS, SDL_Window * window)
|
||||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
|
||||
if (!data || !data->hwnd) {
|
||||
if (data == NULL || !data->hwnd) {
|
||||
/* The window wasn't fully initialized */
|
||||
return;
|
||||
}
|
||||
@@ -1398,8 +1396,9 @@ WIN_ClientPointToSDL(const SDL_Window *window, int *x, int *y)
|
||||
const SDL_WindowData *data = ((SDL_WindowData *)window->driverdata);
|
||||
const SDL_VideoData *videodata = data->videodata;
|
||||
|
||||
if (!videodata->dpi_scaling_enabled)
|
||||
if (!videodata->dpi_scaling_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
*x = MulDiv(*x, 96, data->scaling_dpi);
|
||||
*y = MulDiv(*y, 96, data->scaling_dpi);
|
||||
@@ -1416,8 +1415,9 @@ WIN_ClientPointFromSDL(const SDL_Window *window, int *x, int *y)
|
||||
const SDL_WindowData *data = ((SDL_WindowData *)window->driverdata);
|
||||
const SDL_VideoData *videodata = data->videodata;
|
||||
|
||||
if (!videodata->dpi_scaling_enabled)
|
||||
if (!videodata->dpi_scaling_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
*x = MulDiv(*x, data->scaling_dpi, 96);
|
||||
*y = MulDiv(*y, data->scaling_dpi, 96);
|
||||
|
Reference in New Issue
Block a user