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
@@ -333,13 +333,11 @@ static unsigned int traverse_path_from_component_index(struct hlsl_ctx *ctx,
|
||||
}
|
||||
index -= field_comp_count;
|
||||
}
|
||||
assert(0);
|
||||
return 0;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,8 +464,7 @@ struct hlsl_type *hlsl_get_element_type_from_path_index(struct hlsl_ctx *ctx, co
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return NULL;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,8 +583,7 @@ unsigned int hlsl_type_component_count(const struct hlsl_type *type)
|
||||
return 1;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1590,7 +1586,7 @@ static void dump_ir_constant(struct vkd3d_string_buffer *buffer, const struct hl
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
}
|
||||
if (type->dimx != 1)
|
||||
|
Reference in New Issue
Block a user