Clang-Tidy fixes (#6725)

This commit is contained in:
Pierre Wendling 2022-12-01 16:07:03 -05:00 committed by GitHub
parent c2ce44bead
commit 3c501b963d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
184 changed files with 1312 additions and 1154 deletions

View file

@ -699,9 +699,9 @@ static int D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rec
switch (rotation) {
case DXGI_MODE_ROTATION_IDENTITY:
outRect->left = sdlRect->x;
outRect->right = sdlRect->x + sdlRect->w;
outRect->right = (LONG)sdlRect->x + sdlRect->w;
outRect->top = sdlRect->y;
outRect->bottom = sdlRect->y + sdlRect->h;
outRect->bottom = (LONG)sdlRect->y + sdlRect->h;
if (includeViewportOffset) {
outRect->left += viewport->x;
outRect->right += viewport->x;
@ -711,7 +711,7 @@ static int D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rec
break;
case DXGI_MODE_ROTATION_ROTATE270:
outRect->left = sdlRect->y;
outRect->right = sdlRect->y + sdlRect->h;
outRect->right = (LONG)sdlRect->y + sdlRect->h;
outRect->top = viewport->w - sdlRect->x - sdlRect->w;
outRect->bottom = viewport->w - sdlRect->x;
break;
@ -725,7 +725,7 @@ static int D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rec
outRect->left = viewport->h - sdlRect->y - sdlRect->h;
outRect->right = viewport->h - sdlRect->y;
outRect->top = sdlRect->x;
outRect->bottom = sdlRect->x + sdlRect->h;
outRect->bottom = (LONG)sdlRect->x + sdlRect->h;
break;
default:
return SDL_SetError("The physical display is in an unknown or unsupported rotation");
@ -932,7 +932,7 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
#endif
} else {
result = D3D11_CreateSwapChain(renderer, w, h);
if (FAILED(result)) {
if (FAILED(result) || data->swapChain == NULL) {
goto done;
}
}
@ -1299,7 +1299,7 @@ static int D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Tex
dst = textureMemory.pData;
length = w * bpp;
if (length == pitch && length == textureMemory.RowPitch) {
SDL_memcpy(dst, src, length * h);
SDL_memcpy(dst, src, (size_t)length * h);
} else {
if (length > (UINT)pitch) {
length = pitch;
@ -1450,7 +1450,7 @@ static int D3D11_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture,
}
textureData->locked_rect = *rect;
*pixels =
(void *)((Uint8 *)textureData->pixels + rect->y * textureData->pitch +
(void *)(textureData->pixels + rect->y * textureData->pitch +
rect->x * SDL_BYTESPERPIXEL(texture->format));
*pitch = textureData->pitch;
return 0;
@ -1521,7 +1521,7 @@ static void D3D11_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
if (textureData->yuv || textureData->nv12) {
const SDL_Rect *rect = &textureData->locked_rect;
void *pixels =
(void *)((Uint8 *)textureData->pixels + rect->y * textureData->pitch +
(void *)(textureData->pixels + rect->y * textureData->pitch +
rect->x * SDL_BYTESPERPIXEL(texture->format));
D3D11_UpdateTexture(renderer, texture, rect, pixels, textureData->pitch);
return;