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:
parent
4958dafdc3
commit
6a2200823c
387 changed files with 6094 additions and 4633 deletions
|
@ -148,7 +148,7 @@ VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
|
|||
retval = SDL_calloc(count, sizeof(VkExtensionProperties));
|
||||
}
|
||||
|
||||
if (!retval) {
|
||||
if (retval == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
|
|||
}
|
||||
|
||||
physicalDevices = SDL_malloc(sizeof(VkPhysicalDevice) * physicalDeviceCount);
|
||||
if (!physicalDevices) {
|
||||
if (physicalDevices == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
goto error;
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
|
|||
}
|
||||
|
||||
displayProperties = SDL_malloc(sizeof(VkDisplayPropertiesKHR) * displayPropertiesCount);
|
||||
if (!displayProperties) {
|
||||
if (displayProperties == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
goto error;
|
||||
}
|
||||
|
@ -313,15 +313,14 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
|
|||
|
||||
/* Get display mode properties for the chosen display */
|
||||
result = vkGetDisplayModePropertiesKHR(physicalDevice, display, &displayModePropertiesCount, NULL);
|
||||
if (result != VK_SUCCESS || displayModePropertiesCount == 0)
|
||||
{
|
||||
if (result != VK_SUCCESS || displayModePropertiesCount == 0) {
|
||||
SDL_SetError("Error enumerating display modes");
|
||||
goto error;
|
||||
}
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Number of display modes: %u", displayModePropertiesCount);
|
||||
|
||||
displayModeProperties = SDL_malloc(sizeof(VkDisplayModePropertiesKHR) * displayModePropertiesCount);
|
||||
if (!displayModeProperties) {
|
||||
if (displayModeProperties == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
goto error;
|
||||
}
|
||||
|
@ -368,7 +367,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
|
|||
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Number of display planes: %u", displayPlanePropertiesCount);
|
||||
|
||||
displayPlaneProperties = SDL_malloc(sizeof(VkDisplayPlanePropertiesKHR) * displayPlanePropertiesCount);
|
||||
if (!displayPlaneProperties) {
|
||||
if (displayPlaneProperties == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
goto error;
|
||||
}
|
||||
|
@ -399,7 +398,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
|
|||
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Number of supported displays for plane %u: %u", i, planeSupportedDisplaysCount);
|
||||
|
||||
planeSupportedDisplays = SDL_malloc(sizeof(VkDisplayKHR) * planeSupportedDisplaysCount);
|
||||
if (!planeSupportedDisplays) {
|
||||
if (planeSupportedDisplays == NULL) {
|
||||
SDL_free(displayPlaneProperties);
|
||||
SDL_OutOfMemory();
|
||||
goto error;
|
||||
|
@ -413,8 +412,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
|
|||
goto error;
|
||||
}
|
||||
|
||||
for (j = 0; j < planeSupportedDisplaysCount && planeSupportedDisplays[j] != display; ++j)
|
||||
{
|
||||
for (j = 0; j < planeSupportedDisplaysCount && planeSupportedDisplays[j] != display; ++j) {
|
||||
}
|
||||
|
||||
SDL_free(planeSupportedDisplays);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue