mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d: Add a macro to mark unreachable code.
This should silence warnings about some branches non returning any value without requiring additional "return 0" statement or similar. Also, in theory this might enable to compiler to optimize the program a little bit more, though that's unlikely to have any measurable effect.
This commit is contained in:
committed by
Alexandre Julliard
parent
56b2f56b86
commit
d5fd309ef8
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +02:00
Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/11
@@ -159,8 +159,7 @@ static D3DXPARAMETER_CLASS sm1_class(const struct hlsl_type *type)
|
||||
return D3DXPC_VECTOR;
|
||||
default:
|
||||
ERR("Invalid class %#x.\n", type->type);
|
||||
assert(0);
|
||||
return 0;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,6 +192,7 @@ static D3DXPARAMETER_TYPE sm1_base_type(const struct hlsl_type *type)
|
||||
return D3DXPT_SAMPLER;
|
||||
default:
|
||||
ERR("Invalid dimension %#x.\n", type->sampler_dim);
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
break;
|
||||
case HLSL_TYPE_STRING:
|
||||
@@ -212,6 +212,7 @@ static D3DXPARAMETER_TYPE sm1_base_type(const struct hlsl_type *type)
|
||||
return D3DXPT_TEXTURE;
|
||||
default:
|
||||
ERR("Invalid dimension %#x.\n", type->sampler_dim);
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
break;
|
||||
case HLSL_TYPE_VERTEXSHADER:
|
||||
@@ -219,10 +220,8 @@ static D3DXPARAMETER_TYPE sm1_base_type(const struct hlsl_type *type)
|
||||
case HLSL_TYPE_VOID:
|
||||
return D3DXPT_VOID;
|
||||
default:
|
||||
assert(0);
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct hlsl_type *get_array_type(const struct hlsl_type *type)
|
||||
|
||||
Reference in New Issue
Block a user