mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 18:07:40 +00:00
Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594
This commit is contained in:
parent
14b902faca
commit
5750bcb174
781 changed files with 51659 additions and 55763 deletions
|
@ -79,8 +79,7 @@ int Android_Vulkan_LoadLibrary(_THIS, const char *path)
|
|||
if (extensions == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
for (i = 0; i < extensionCount; i++)
|
||||
{
|
||||
for (i = 0; i < extensionCount; i++) {
|
||||
if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) {
|
||||
hasSurfaceExtension = SDL_TRUE;
|
||||
} else if (SDL_strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) {
|
||||
|
@ -89,12 +88,10 @@ int Android_Vulkan_LoadLibrary(_THIS, const char *path)
|
|||
}
|
||||
SDL_free(extensions);
|
||||
if (!hasSurfaceExtension) {
|
||||
SDL_SetError("Installed Vulkan doesn't implement the "
|
||||
VK_KHR_SURFACE_EXTENSION_NAME " extension");
|
||||
SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension");
|
||||
goto fail;
|
||||
} else if (!hasAndroidSurfaceExtension) {
|
||||
SDL_SetError("Installed Vulkan doesn't implement the "
|
||||
VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "extension");
|
||||
SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "extension");
|
||||
goto fail;
|
||||
}
|
||||
return 0;
|
||||
|
@ -114,9 +111,9 @@ void Android_Vulkan_UnloadLibrary(_THIS)
|
|||
}
|
||||
|
||||
SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS,
|
||||
SDL_Window *window,
|
||||
unsigned *count,
|
||||
const char **names)
|
||||
SDL_Window *window,
|
||||
unsigned *count,
|
||||
const char **names)
|
||||
{
|
||||
static const char *const extensionsForAndroid[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
|
||||
|
@ -126,22 +123,22 @@ SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS,
|
|||
return SDL_FALSE;
|
||||
}
|
||||
return SDL_Vulkan_GetInstanceExtensions_Helper(
|
||||
count, names, SDL_arraysize(extensionsForAndroid),
|
||||
extensionsForAndroid);
|
||||
count, names, SDL_arraysize(extensionsForAndroid),
|
||||
extensionsForAndroid);
|
||||
}
|
||||
|
||||
SDL_bool Android_Vulkan_CreateSurface(_THIS,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
VkSurfaceKHR *surface)
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
VkSurfaceKHR *surface)
|
||||
{
|
||||
SDL_WindowData *windowData = (SDL_WindowData *)window->driverdata;
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
|
||||
(PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr;
|
||||
PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR =
|
||||
(PFN_vkCreateAndroidSurfaceKHR)vkGetInstanceProcAddr(
|
||||
instance,
|
||||
"vkCreateAndroidSurfaceKHR");
|
||||
instance,
|
||||
"vkCreateAndroidSurfaceKHR");
|
||||
VkAndroidSurfaceCreateInfoKHR createInfo;
|
||||
VkResult result;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue