[Bf-blender-cvs] [95538552a8b] refactor-idprop-ui-data: Remove curly braces

Hans Goudey noreply at git.blender.org
Thu Aug 5 21:01:50 CEST 2021


Commit: 95538552a8b9344550f06cd0c292994609d1a130
Author: Hans Goudey
Date:   Thu Aug 5 12:55:19 2021 -0500
Branches: refactor-idprop-ui-data
https://developer.blender.org/rB95538552a8b9344550f06cd0c292994609d1a130

Remove curly braces

===================================================================

M	source/blender/modifiers/intern/MOD_nodes.cc

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 9707cf01fa4..f6283dd44f7 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -383,27 +383,21 @@ static IDProperty *id_property_create_from_socket(const bNodeSocket &socket)
 static bool id_property_type_matches_socket(const bNodeSocket &socket, const IDProperty &property)
 {
   switch (socket.type) {
-    case SOCK_FLOAT: {
+    case SOCK_FLOAT:
       return ELEM(property.type, IDP_FLOAT, IDP_DOUBLE);
-    }
-    case SOCK_INT: {
+    case SOCK_INT:
       return property.type == IDP_INT;
-    }
-    case SOCK_VECTOR: {
+    case SOCK_VECTOR:
       return property.type == IDP_ARRAY && property.subtype == IDP_FLOAT && property.len == 3;
-    }
-    case SOCK_BOOLEAN: {
+    case SOCK_BOOLEAN:
       return property.type == IDP_INT;
-    }
-    case SOCK_STRING: {
+    case SOCK_STRING:
       return property.type == IDP_STRING;
-    }
     case SOCK_OBJECT:
     case SOCK_COLLECTION:
     case SOCK_TEXTURE:
-    case SOCK_MATERIAL: {
+    case SOCK_MATERIAL:
       return property.type == IDP_ID;
-    }
   }
   BLI_assert_unreachable();
   return false;
@@ -414,7 +408,7 @@ static void init_socket_cpp_value_from_property(const IDProperty &property,
                                                 void *r_value)
 {
   switch (socket_value_type) {
-    case SOCK_FLOAT: {
+    case SOCK_FLOAT:
       if (property.type == IDP_FLOAT) {
         *(float *)r_value = IDP_Float(&property);
       }
@@ -422,47 +416,38 @@ static void init_socket_cpp_value_from_property(const IDProperty &property,
         *(float *)r_value = (float)IDP_Double(&property);
       }
       break;
-    }
-    case SOCK_INT: {
+    case SOCK_INT:
       *(int *)r_value = IDP_Int(&property);
       break;
-    }
-    case SOCK_VECTOR: {
+    case SOCK_VECTOR:
       copy_v3_v3((float *)r_value, (const float *)IDP_Array(&property));
       break;
-    }
-    case SOCK_BOOLEAN: {
+    case SOCK_BOOLEAN:
       *(bool *)r_value = IDP_Int(&property) != 0;
       break;
-    }
-    case SOCK_STRING: {
+    case SOCK_STRING:
       new (r_value) std::string(IDP_String(&property));
       break;
-    }
-    case SOCK_OBJECT: {
+    case SOCK_OBJECT:
       ID *id = IDP_Id(&property);
       Object *object = (id && GS(id->name) == ID_OB) ? (Object *)id : nullptr;
       *(Object **)r_value = object;
       break;
-    }
-    case SOCK_COLLECTION: {
+    case SOCK_COLLECTION:
       ID *id = IDP_Id(&property);
       Collection *collection = (id && GS(id->name) == ID_GR) ? (Collection *)id : nullptr;
       *(Collection **)r_value = collection;
       break;
-    }
-    case SOCK_TEXTURE: {
+    case SOCK_TEXTURE:
       ID *id = IDP_Id(&property);
       Tex *texture = (id && GS(id->name) == ID_TE) ? (Tex *)id : nullptr;
       *(Tex **)r_value = texture;
       break;
-    }
-    case SOCK_MATERIAL: {
+    case SOCK_MATERIAL:
       ID *id = IDP_Id(&property);
       Material *material = (id && GS(id->name) == ID_MA) ? (Material *)id : nullptr;
       *(Material **)r_value = material;
       break;
-    }
     default:
       BLI_assert_unreachable();
       break;



More information about the Bf-blender-cvs mailing list