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
@@ -79,8 +79,7 @@ static bool fold_cast(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, struct
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return false;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
|
||||
switch (dst->node.data_type->base_type)
|
||||
@@ -104,12 +103,8 @@ static bool fold_cast(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, struct
|
||||
|
||||
case HLSL_TYPE_BOOL:
|
||||
/* Casts to bool should have already been lowered. */
|
||||
assert(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return false;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -248,8 +243,7 @@ static bool fold_nequal(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return false;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
|
||||
dst->value[k].u *= ~0u;
|
||||
|
Reference in New Issue
Block a user