diff --git a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc index 280db898fe8..ae3044485bd 100644 --- a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc +++ b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc @@ -25,7 +25,7 @@ using nodes::SocketDeclaration; static bool is_field_socket_type(const bNodeSocket &socket) { - return nodes::socket_type_supports_fields((eNodeSocketDatatype)socket.typeinfo->type); + return nodes::socket_type_supports_fields(eNodeSocketDatatype(socket.typeinfo->type)); } static bool all_dangling_reroutes(const Span sockets) diff --git a/source/blender/compositor/intern/shader_node.cc b/source/blender/compositor/intern/shader_node.cc index 7af8adf4ff2..772edffeaf8 100644 --- a/source/blender/compositor/intern/shader_node.cc +++ b/source/blender/compositor/intern/shader_node.cc @@ -73,7 +73,7 @@ static void populate_gpu_node_stack(DSocket socket, GPUNodeStack &stack) zero_v4(stack.vec); stack.sockettype = socket->type; - stack.type = gpu_type_from_socket_type(static_cast(socket->type)); + stack.type = gpu_type_from_socket_type(eNodeSocketDatatype(socket->type)); stack.hasinput = socket->is_logically_linked(); stack.hasoutput = socket->is_logically_linked(); diff --git a/source/blender/editors/space_node/link_drag_search.cc b/source/blender/editors/space_node/link_drag_search.cc index 595ff36e67e..81bdd6c3992 100644 --- a/source/blender/editors/space_node/link_drag_search.cc +++ b/source/blender/editors/space_node/link_drag_search.cc @@ -183,8 +183,8 @@ static void search_link_ops_for_asset_metadata(const bNodeTree &node_tree, if (socket_type == nullptr) { continue; } - eNodeSocketDatatype from = (eNodeSocketDatatype)socket.type; - eNodeSocketDatatype to = (eNodeSocketDatatype)socket_type->type; + eNodeSocketDatatype from = eNodeSocketDatatype(socket.type); + eNodeSocketDatatype to = eNodeSocketDatatype(socket_type->type); if (socket.in_out == SOCK_OUT) { std::swap(from, to); } diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index e127566ba74..161b2bb1c57 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -2490,14 +2490,14 @@ void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node) if (!node_to_insert->is_reroute()) { /* Ignore main sockets when the types don't match. */ if (best_input != nullptr && ntree.typeinfo->validate_link != nullptr && - !ntree.typeinfo->validate_link(static_cast(old_link->fromsock->type), - static_cast(best_input->type))) + !ntree.typeinfo->validate_link(eNodeSocketDatatype(old_link->fromsock->type), + eNodeSocketDatatype(best_input->type))) { best_input = nullptr; } if (best_output != nullptr && ntree.typeinfo->validate_link != nullptr && - !ntree.typeinfo->validate_link(static_cast(best_output->type), - static_cast(old_link->tosock->type))) + !ntree.typeinfo->validate_link(eNodeSocketDatatype(best_output->type), + eNodeSocketDatatype(old_link->tosock->type))) { best_output = nullptr; } @@ -2550,7 +2550,7 @@ void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node) static int get_main_socket_priority(const bNodeSocket *socket) { - switch ((eNodeSocketDatatype)socket->type) { + switch (eNodeSocketDatatype(socket->type)) { case SOCK_CUSTOM: return 0; case SOCK_BOOLEAN: diff --git a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc index b1c2c21ba47..2ee987e38e1 100644 --- a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc +++ b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc @@ -55,8 +55,8 @@ static void node_label(const bNodeTree * /*tree*/, static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { - if (!params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_BOOLEAN)) + if (!params.node_tree().typeinfo->validate_link(eNodeSocketDatatype(params.other_socket().type), + SOCK_BOOLEAN)) { return; } diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc index 2e433d02812..49886ea56b2 100644 --- a/source/blender/nodes/function/nodes/node_fn_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_compare.cc @@ -77,7 +77,7 @@ static void node_update(bNodeTree *ntree, bNode *node) LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) { bke::node_set_socket_availability( - *ntree, *socket, socket->type == (eNodeSocketDatatype)data->data_type); + *ntree, *socket, socket->type == eNodeSocketDatatype(data->data_type)); } bke::node_set_socket_availability( diff --git a/source/blender/nodes/function/nodes/node_fn_hash_value.cc b/source/blender/nodes/function/nodes/node_fn_hash_value.cc index 02f0273d03f..95606c2c643 100644 --- a/source/blender/nodes/function/nodes/node_fn_hash_value.cc +++ b/source/blender/nodes/function/nodes/node_fn_hash_value.cc @@ -43,7 +43,7 @@ static void node_init(bNodeTree * /*tree*/, bNode *node) static const mf::MultiFunction *get_multi_function(const bNode &bnode) { - const eNodeSocketDatatype socket_type = static_cast(bnode.custom1); + const eNodeSocketDatatype socket_type = eNodeSocketDatatype(bnode.custom1); static auto exec_preset = mf::build::exec_presets::AllSpanOrSingle(); diff --git a/source/blender/nodes/function/nodes/node_fn_match_string.cc b/source/blender/nodes/function/nodes/node_fn_match_string.cc index f2e5b0de47c..faf124bed75 100644 --- a/source/blender/nodes/function/nodes/node_fn_match_string.cc +++ b/source/blender/nodes/function/nodes/node_fn_match_string.cc @@ -101,8 +101,8 @@ static void node_build_multi_function(NodeMultiFunctionBuilder &builder) static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { if (params.in_out() == SOCK_IN) { - if (params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_STRING)) + if (params.node_tree().typeinfo->validate_link(eNodeSocketDatatype(params.other_socket().type), + SOCK_STRING)) { for (const EnumPropertyItem *item = rna_enum_node_match_string_items; item->identifier != nullptr; diff --git a/source/blender/nodes/shader/materialx/node_parser.cc b/source/blender/nodes/shader/materialx/node_parser.cc index 318f898b2f6..9d68091ee06 100644 --- a/source/blender/nodes/shader/materialx/node_parser.cc +++ b/source/blender/nodes/shader/materialx/node_parser.cc @@ -31,7 +31,7 @@ NodeItem NodeParser::compute_full() { NodeItem res = empty(); - if (socket_out_ && !NodeItem::is_convertible((eNodeSocketDatatype)socket_out_->type, to_type_)) { + if (socket_out_ && !NodeItem::is_convertible(eNodeSocketDatatype(socket_out_->type), to_type_)) { return res; } diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc index d46d906505c..d5b45681dc1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_math.cc @@ -43,8 +43,8 @@ class SocketSearchOp { static void sh_node_math_gather_link_searches(GatherLinkSearchOpParams ¶ms) { - if (!params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_FLOAT)) + if (!params.node_tree().typeinfo->validate_link(eNodeSocketDatatype(params.other_socket().type), + SOCK_FLOAT)) { return; } diff --git a/source/blender/nodes/shader/nodes/node_shader_mix.cc b/source/blender/nodes/shader/nodes/node_shader_mix.cc index 6494feba15d..d66287b99bd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mix.cc @@ -150,7 +150,7 @@ static void sh_node_mix_label(const bNodeTree * /*ntree*/, static int sh_node_mix_ui_class(const bNode *node) { const NodeShaderMix &storage = node_storage(*node); - const eNodeSocketDatatype data_type = static_cast(storage.data_type); + const eNodeSocketDatatype data_type = eNodeSocketDatatype(storage.data_type); switch (data_type) { case SOCK_VECTOR: @@ -165,7 +165,7 @@ static int sh_node_mix_ui_class(const bNode *node) static void sh_node_mix_update(bNodeTree *ntree, bNode *node) { const NodeShaderMix &storage = node_storage(*node); - const eNodeSocketDatatype data_type = static_cast(storage.data_type); + const eNodeSocketDatatype data_type = eNodeSocketDatatype(storage.data_type); bNodeSocket *sock_factor = static_cast(node->inputs.first); bNodeSocket *sock_factor_vec = static_cast(sock_factor->next); @@ -374,7 +374,7 @@ static int gpu_shader_mix(GPUMaterial *mat, const bool is_vector_mode = storage.data_type == SOCK_VECTOR; const int blend_type = storage.blend_type; const char *name = gpu_shader_get_name( - (eNodeSocketDatatype)storage.data_type, is_non_uniform, blend_type); + eNodeSocketDatatype(storage.data_type), is_non_uniform, blend_type); if (name == nullptr) { return 0; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc index ac5ac40da27..c437010378f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc @@ -291,8 +291,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.outputs); return; } - if (params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_FLOAT)) + if (params.node_tree().typeinfo->validate_link(eNodeSocketDatatype(params.other_socket().type), + SOCK_FLOAT)) { params.add_item(IFACE_("Vector"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("ShaderNodeTexSky"); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc index fd2415361c4..1a41e48033a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc @@ -52,8 +52,8 @@ class SocketSearchOp { static void sh_node_vector_math_gather_link_searches(GatherLinkSearchOpParams ¶ms) { - if (!params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_VECTOR)) + if (!params.node_tree().typeinfo->validate_link(eNodeSocketDatatype(params.other_socket().type), + SOCK_VECTOR)) { return; }