0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

libobs-d3d11,libobs-opengl,plugins: Remove unneeded cast in switches

Those casts were usually used to workaround switch warnings.
This commit is contained in:
tytan652 2022-08-05 15:08:33 +02:00
parent cf5c68b773
commit 107b2a8f27
6 changed files with 9 additions and 9 deletions

View File

@ -143,7 +143,7 @@ ConvertGSTextureFormatViewLinear(gs_color_format format)
static inline gs_color_format ConvertDXGITextureFormat(DXGI_FORMAT format)
{
switch ((unsigned long)format) {
switch (format) {
case DXGI_FORMAT_A8_UNORM:
return GS_A8;
case DXGI_FORMAT_R8_UNORM:

View File

@ -39,7 +39,7 @@ struct gl_platform {
/* For now, only support basic 32bit formats for graphics output. */
static inline int get_color_format_bits(enum gs_color_format format)
{
switch ((uint32_t)format) {
switch (format) {
case GS_RGBA:
case GS_BGRA:
return 32;
@ -50,7 +50,7 @@ static inline int get_color_format_bits(enum gs_color_format format)
static inline int get_depth_format_bits(enum gs_zstencil_format zsformat)
{
switch ((uint32_t)zsformat) {
switch (zsformat) {
case GS_Z16:
return 16;
case GS_Z24_S8:
@ -62,7 +62,7 @@ static inline int get_depth_format_bits(enum gs_zstencil_format zsformat)
static inline int get_stencil_format_bits(enum gs_zstencil_format zsformat)
{
switch ((uint32_t)zsformat) {
switch (zsformat) {
case GS_Z24_S8:
return 8;
default:

View File

@ -186,7 +186,7 @@ mfxStatus dx9_simple_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
if (FAILED(hr))
return MFX_ERR_LOCK_MEMORY;
switch ((DWORD)desc.Format) {
switch (desc.Format) {
case D3DFMT_NV12:
ptr->Pitch = (mfxU16)locked.Pitch;
ptr->Y = (mfxU8 *)locked.pBits;

View File

@ -35,7 +35,7 @@ static d3d8_data data = {};
static DXGI_FORMAT d3d8_to_dxgi_format(D3DFORMAT format)
{
switch ((unsigned long)format) {
switch (format) {
case D3DFMT_X1R5G5B5:
case D3DFMT_A1R5G5B5:
return DXGI_FORMAT_B5G5R5A1_UNORM;

View File

@ -94,7 +94,7 @@ static void d3d9_free()
static DXGI_FORMAT d3d9_to_dxgi_format(D3DFORMAT format)
{
switch ((unsigned long)format) {
switch (format) {
case D3DFMT_A2B10G10R10:
return DXGI_FORMAT_R10G10B10A2_UNORM;
case D3DFMT_A8R8G8B8:

View File

@ -4,7 +4,7 @@
static inline DXGI_FORMAT strip_dxgi_format_srgb(DXGI_FORMAT format)
{
switch ((unsigned long)format) {
switch (format) {
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
return DXGI_FORMAT_B8G8R8A8_UNORM;
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
@ -18,7 +18,7 @@ static inline DXGI_FORMAT apply_dxgi_format_typeless(DXGI_FORMAT format,
bool allow_srgb_alias)
{
if (allow_srgb_alias) {
switch ((unsigned long)format) {
switch (format) {
case DXGI_FORMAT_B8G8R8A8_UNORM:
return DXGI_FORMAT_B8G8R8A8_TYPELESS;
case DXGI_FORMAT_R8G8B8A8_UNORM: