Cleanup: use BLI_assert_unreachable in some places
This commit is contained in:
@@ -49,7 +49,7 @@ void convert_to_static_type(const CustomDataType data_type, const Func &func)
|
||||
func(Color4f());
|
||||
break;
|
||||
default:
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ static int attribute_data_type_complexity(const CustomDataType data_type)
|
||||
#endif
|
||||
default:
|
||||
/* Only accept "generic" custom data types used by the attribute system. */
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -341,7 +341,7 @@ static int attribute_domain_priority(const AttributeDomain domain)
|
||||
return 4;
|
||||
default:
|
||||
/* Domain not supported in nodes yet. */
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -703,7 +703,7 @@ bool GeometryComponent::attribute_domain_supported(const AttributeDomain domain)
|
||||
|
||||
int GeometryComponent::attribute_domain_size(const AttributeDomain UNUSED(domain)) const
|
||||
{
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ int MeshComponent::attribute_domain_size(const AttributeDomain domain) const
|
||||
case ATTR_DOMAIN_POLYGON:
|
||||
return mesh_->totpoly;
|
||||
default:
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ GeometryComponent *GeometryComponent::create(GeometryComponentType component_typ
|
||||
case GEO_COMPONENT_TYPE_VOLUME:
|
||||
return new VolumeComponent();
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@ static void write_node_socket_default_value(BlendWriter *writer, bNodeSocket *so
|
||||
case SOCK_CUSTOM:
|
||||
case SOCK_SHADER:
|
||||
case SOCK_GEOMETRY:
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ template<typename T> class VArray {
|
||||
|
||||
virtual Span<T> get_span_impl() const
|
||||
{
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ template<typename T> class VArray {
|
||||
{
|
||||
/* Provide a default implementation, so that subclasses don't have to provide it. This method
|
||||
* should never be called because `is_single_impl` returns false by default. */
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return T();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ static int circle_vert_total(const GeometryNodeMeshCircleFillType fill_type, con
|
||||
case GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN:
|
||||
return verts_num + 1;
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ static int circle_edge_total(const GeometryNodeMeshCircleFillType fill_type, con
|
||||
case GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN:
|
||||
return verts_num * 2;
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ static int circle_corner_total(const GeometryNodeMeshCircleFillType fill_type, c
|
||||
case GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN:
|
||||
return verts_num * 3;
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ static int circle_face_total(const GeometryNodeMeshCircleFillType fill_type, con
|
||||
case GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN:
|
||||
return verts_num;
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ InputSocketRef &NodeTreeRef::find_input_socket(Map<bNode *, NodeRef *> &node_map
|
||||
return *socket;
|
||||
}
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return *node->inputs_[0];
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ OutputSocketRef &NodeTreeRef::find_output_socket(Map<bNode *, NodeRef *> &node_m
|
||||
return *socket;
|
||||
}
|
||||
}
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return *node->outputs_[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void socket_expand_in_mf_network(SocketMFNetworkBuilder &builder)
|
||||
builder.set_constant_value(type, buffer);
|
||||
}
|
||||
else {
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ static const blender::fn::MultiFunction &get_multi_function(
|
||||
return builder.get_not_implemented_fn();
|
||||
}
|
||||
default:
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return builder.get_not_implemented_fn();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ static const blender::fn::MultiFunction &get_multi_function(
|
||||
return fn;
|
||||
}
|
||||
default:
|
||||
BLI_assert(false);
|
||||
BLI_assert_unreachable();
|
||||
return builder.get_not_implemented_fn();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user