Additional cleanup exposed by building with a C++ compiler

This commit is contained in:
Sam Lantinga
2024-08-25 21:32:29 -07:00
parent f08ac438ed
commit 00c409cff8
26 changed files with 84 additions and 120 deletions

View File

@@ -1286,7 +1286,7 @@ static bool IsSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormat format)
return false;
}
static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormat format)
static SDL_PixelFormat GetClosestSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormat format)
{
int i;
@@ -1405,7 +1405,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
return NULL;
}
} else {
int closest_format;
SDL_PixelFormat closest_format;
SDL_PropertiesID native_props = SDL_CreateProperties();
if (!texture_is_fourcc_and_target) {

View File

@@ -492,7 +492,7 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in
int is8bit, angle90;
SDL_BlendMode blendmode;
Uint32 colorkey = 0;
int colorKeyAvailable = false;
bool colorKeyAvailable = false;
double sangleinv, cangleinv;
// Sanity check
@@ -538,7 +538,7 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in
SDL_GetSurfaceBlendMode(src, &blendmode);
if (colorKeyAvailable == true) {
if (colorKeyAvailable) {
// If available, the colorkey will be used to discard the pixels that are outside of the rotated area.
SDL_SetSurfaceColorKey(rz_dst, true, colorkey);
SDL_FillSurfaceRect(rz_dst, NULL, colorkey);

View File

@@ -2165,7 +2165,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
swapchainCreateInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
swapchainCreateInfo.preTransform = rendererData->surfaceCapabilities.currentTransform;
swapchainCreateInfo.compositeAlpha = (renderer->window->flags & SDL_WINDOW_TRANSPARENT) ? 0 : VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
swapchainCreateInfo.compositeAlpha = (renderer->window->flags & SDL_WINDOW_TRANSPARENT) ? (VkCompositeAlphaFlagBitsKHR)0 : VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
swapchainCreateInfo.presentMode = presentMode;
swapchainCreateInfo.clipped = VK_TRUE;
swapchainCreateInfo.oldSwapchain = rendererData->swapchain;