[Bf-blender-cvs] [5a7dfe59daf] functions: fix some more warnings

Jacques Lucke noreply at git.blender.org
Tue Aug 27 12:24:49 CEST 2019


Commit: 5a7dfe59daf9560494d131a65778cfc3288b5138
Author: Jacques Lucke
Date:   Tue Aug 27 12:24:25 2019 +0200
Branches: functions
https://developer.blender.org/rB5a7dfe59daf9560494d131a65778cfc3288b5138

fix some more warnings

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

M	source/blender/functions/frontends/data_flow_nodes/mappings/node_inserters.cpp
M	source/blender/functions/functions/constants.cpp
M	source/blender/functions/functions/constants.hpp

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

diff --git a/source/blender/functions/frontends/data_flow_nodes/mappings/node_inserters.cpp b/source/blender/functions/frontends/data_flow_nodes/mappings/node_inserters.cpp
index a484ee72aec..ade7bd7105c 100644
--- a/source/blender/functions/frontends/data_flow_nodes/mappings/node_inserters.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/mappings/node_inserters.cpp
@@ -118,7 +118,7 @@ static SharedFunction &get_float_math_function(int operation)
       return Functions::GET_FN_snap_floats();
     default:
       BLI_assert(false);
-      return *(SharedFunction *)nullptr;
+      return Functions::GET_FN_none();
   }
 }
 
@@ -163,7 +163,7 @@ static SharedFunction &get_vector_math_function(int operation)
       return Functions::GET_FN_reflect_vectors();
     default:
       BLI_assert(false);
-      return *(SharedFunction *)nullptr;
+      return Functions::GET_FN_none();
   }
 }
 
@@ -336,7 +336,7 @@ static SharedFunction &get_compare_function(int operation)
       return Functions::GET_FN_less_than_float();
     default:
       BLI_assert(false);
-      return *(SharedFunction *)nullptr;
+      return Functions::GET_FN_none();
   }
 }
 
@@ -362,7 +362,7 @@ static SharedFunction &get_boolean_function(int operation)
       return Functions::GET_FN_not();
     default:
       BLI_assert(false);
-      return *(SharedFunction *)nullptr;
+      return Functions::GET_FN_none();
   }
 }
 
diff --git a/source/blender/functions/functions/constants.cpp b/source/blender/functions/functions/constants.cpp
index 5ef8f6cd112..ec61d0724cb 100644
--- a/source/blender/functions/functions/constants.cpp
+++ b/source/blender/functions/functions/constants.cpp
@@ -199,5 +199,12 @@ BLI_LAZY_INIT(SharedFunction, GET_FN_output_magenta)
   return get_output_rgba_f_function(rgba_f(1, 0, 1, 1));
 }
 
+BLI_LAZY_INIT(SharedFunction, GET_FN_none)
+{
+  FunctionBuilder builder;
+  auto fn = builder.build("None");
+  return fn;
+}
+
 }  // namespace Functions
 }  // namespace FN
diff --git a/source/blender/functions/functions/constants.hpp b/source/blender/functions/functions/constants.hpp
index 930a3f754f6..e7710597aa7 100644
--- a/source/blender/functions/functions/constants.hpp
+++ b/source/blender/functions/functions/constants.hpp
@@ -19,5 +19,7 @@ SharedFunction &GET_FN_output_float3_1();
 
 SharedFunction &GET_FN_output_magenta();
 
+SharedFunction &GET_FN_none();
+
 }  // namespace Functions
 }  // namespace FN



More information about the Bf-blender-cvs mailing list