Use consistent style for pointer declarations and casts

This commit is contained in:
Sam Lantinga
2025-06-18 09:26:51 -07:00
parent 390fe65323
commit d7939abf42
105 changed files with 339 additions and 346 deletions

View File

@@ -1512,7 +1512,7 @@ static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index)
static bool GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D12Resource **texture)
{
IUnknown *unknown = (IUnknown*)SDL_GetPointerProperty(props, name, NULL);
IUnknown *unknown = (IUnknown *)SDL_GetPointerProperty(props, name, NULL);
if (unknown) {
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
HRESULT result = unknown->QueryInterface(D3D_GUID(SDL_IID_ID3D12Resource), (void **)texture);

View File

@@ -48,10 +48,10 @@ void ApplyColorMod(void *dest, void *source, int pitch, int width, int height, S
}
}
void ApplyFlip(void* dest, void* source, int pitch, int width, int height, SDL_FlipMode flip)
void ApplyFlip(void *dest, void *source, int pitch, int width, int height, SDL_FlipMode flip)
{
TUint16* src_pixels = static_cast<TUint16*>(source);
TUint16* dst_pixels = static_cast<TUint16*>(dest);
TUint16 *src_pixels = static_cast<TUint16 *>(source);
TUint16 *dst_pixels = static_cast<TUint16 *>(dest);
for (int y = 0; y < height; ++y)
{
@@ -75,10 +75,10 @@ void ApplyFlip(void* dest, void* source, int pitch, int width, int height, SDL_F
}
}
void ApplyRotation(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle)
void ApplyRotation(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle)
{
TUint16* src_pixels = static_cast<TUint16*>(source);
TUint16* dst_pixels = static_cast<TUint16*>(dest);
TUint16 *src_pixels = static_cast<TUint16 *>(source);
TUint16 *dst_pixels = static_cast<TUint16 *>(dest);
TFixed cos_angle = 0;
TFixed sin_angle = 0;
@@ -117,10 +117,10 @@ void ApplyRotation(void* dest, void* source, int pitch, int width, int height, T
}
}
void ApplyScale(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y)
void ApplyScale(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y)
{
TUint16* src_pixels = static_cast<TUint16*>(source);
TUint16* dst_pixels = static_cast<TUint16*>(dest);
TUint16 *src_pixels = static_cast<TUint16 *>(source);
TUint16 *dst_pixels = static_cast<TUint16 *>(dest);
for (int y = 0; y < height; ++y)
{

View File

@@ -24,9 +24,9 @@
#include <3dtypes.h>
void ApplyColorMod(void* dest, void* source, int pitch, int width, int height, SDL_FColor color);
void ApplyFlip(void* dest, void* source, int pitch, int width, int height, SDL_FlipMode flip);
void ApplyRotation(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle);
void ApplyScale(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y);
void ApplyColorMod(void *dest, void *source, int pitch, int width, int height, SDL_FColor color);
void ApplyFlip(void *dest, void *source, int pitch, int width, int height, SDL_FlipMode flip);
void ApplyRotation(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle);
void ApplyScale(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y);
#endif // ngage_video_render_ops_hpp

View File

@@ -1607,7 +1607,7 @@ static VkSemaphore VULKAN_CreateSemaphore(VULKAN_RenderData *rendererData)
return semaphore;
}
static bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, int extensionsToCheck, const char* const* extNames)
static bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, int extensionsToCheck, const char * const *extNames)
{
uint32_t extensionCount;
bool foundExtensions = true;
@@ -2364,7 +2364,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
}
// Create descriptor pools - start by allocating one per swapchain image, let it grow if more are needed
rendererData->descriptorPools = (VkDescriptorPool **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VkDescriptorPool*));
rendererData->descriptorPools = (VkDescriptorPool **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VkDescriptorPool *));
rendererData->numDescriptorPools = (uint32_t *)SDL_calloc(rendererData->swapchainImageCount, sizeof(uint32_t));
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
// Start by just allocating one pool, it will grow if needed
@@ -2394,7 +2394,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
}
// Upload buffers
rendererData->uploadBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer*));
rendererData->uploadBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer *));
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
rendererData->uploadBuffers[i] = (VULKAN_Buffer *)SDL_calloc(SDL_VULKAN_NUM_UPLOAD_BUFFERS, sizeof(VULKAN_Buffer));
}
@@ -2402,7 +2402,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
rendererData->currentUploadBuffer = (int *)SDL_calloc(rendererData->swapchainImageCount, sizeof(int));
// Constant buffers
rendererData->constantBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer*));
rendererData->constantBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer *));
rendererData->numConstantBuffers = (uint32_t *)SDL_calloc(rendererData->swapchainImageCount, sizeof(uint32_t));
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
// Start with just allocating one, will grow if needed
@@ -3939,7 +3939,7 @@ static bool VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cm
return true;
}
static SDL_Surface* VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect)
static SDL_Surface *VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect)
{
VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal;
VkImage backBuffer;