[Bf-blender-cvs] [be5c59f09af] functions: cleanup api a bit

Jacques Lucke noreply at git.blender.org
Sun Feb 10 20:25:18 CET 2019


Commit: be5c59f09afa7602f0e68e904d52c99f132d0a71
Author: Jacques Lucke
Date:   Wed Jan 23 17:41:54 2019 +0100
Branches: functions
https://developer.blender.org/rBbe5c59f09afa7602f0e68e904d52c99f132d0a71

cleanup api a bit

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

M	source/blender/functions/FN_functions.h
M	source/blender/functions/intern/c_wrapper.cpp
M	source/blender/modifiers/intern/MOD_functiondeform.c

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

diff --git a/source/blender/functions/FN_functions.h b/source/blender/functions/FN_functions.h
index 603f26a4548..a0dc893325e 100644
--- a/source/blender/functions/FN_functions.h
+++ b/source/blender/functions/FN_functions.h
@@ -12,19 +12,6 @@ typedef struct OpaqueFnType *FnTypeRef;
 typedef struct OpaqueFnInputs *FnInputsRef;
 typedef struct OpaqueFnOutputs *FnOutputsRef;
 
-/* Split ownership of the function. */
-void FN_function_copy_ref(FunctionRef fn);
-
-/* Tag the function as unused by the caller. */
-void FN_function_free_ref(FunctionRef fn);
-
-
-/* Raw function pointer to call when the function should be executed. */
-void *FN_function_get_pointer(FunctionRef fn);
-
-/* Pass into the function as first argument. */
-void *FN_function_get_settings(FunctionRef fn);
-
 /* Call a function with the given input.
  * The function output will be written into fn_out.
  * Returns true on success. */
@@ -37,9 +24,6 @@ FnInputsRef FN_inputs_new(FunctionRef fn);
 /* Free a set of function inputs. */
 void FN_inputs_free(FnInputsRef fn_in);
 
-/* Set a funtion input by name. Returns true on success. */
-bool FN_inputs_set_name(FnInputsRef fn_in, const char *name, void *src);
-
 /* Set a function input by index. Returns true on success. */
 void FN_inputs_set_index(FnInputsRef fn_in, uint index, void *src);
 
@@ -50,9 +34,6 @@ FnOutputsRef FN_outputs_new(FunctionRef fn);
 /* Free a set of output functions. */
 void FN_outputs_free(FnOutputsRef fn_out);
 
-/* Extract the result of an executed function by name. */
-void FN_outputs_get_name(FnOutputsRef fn_out, const char *name, void *dst);
-
 /* Extract the result of an executed function by index. */
 void FN_outputs_get_index(FnOutputsRef fn_out, uint index, void *dst);
 
diff --git a/source/blender/functions/intern/c_wrapper.cpp b/source/blender/functions/intern/c_wrapper.cpp
index d7703c13b11..f6e1b5ca0ff 100644
--- a/source/blender/functions/intern/c_wrapper.cpp
+++ b/source/blender/functions/intern/c_wrapper.cpp
@@ -18,6 +18,16 @@ FnOutputsRef FN_outputs_new(FunctionRef fn)
 	return (FnOutputsRef)new FN::Outputs(*(FN::Function *)fn);
 }
 
+void FN_inputs_free(FnInputsRef fn_in)
+{
+	delete (FN::Inputs *)fn_in;
+}
+
+void FN_outputs_free(FnOutputsRef fn_out)
+{
+	delete (FN::Outputs *)fn_out;
+}
+
 void FN_inputs_set_index(FnInputsRef fn_in, uint index, void *src)
 {
 	((FN::Inputs *)fn_in)->set(index, src);
diff --git a/source/blender/modifiers/intern/MOD_functiondeform.c b/source/blender/modifiers/intern/MOD_functiondeform.c
index a62f2ec2ed3..6bfff5f987e 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform.c
+++ b/source/blender/modifiers/intern/MOD_functiondeform.c
@@ -73,6 +73,9 @@ static void deformVerts(
 
 	clock_t end = clock();
 	printf("Time taken: %f s\n", (float)(end - start) / (float)CLOCKS_PER_SEC);
+
+	FN_inputs_free(fn_in);
+	FN_outputs_free(fn_out);
 }



More information about the Bf-blender-cvs mailing list