[Bf-blender-cvs] [b61fce82f9b] functions: more consistent naming in C wrappers
Jacques Lucke
noreply at git.blender.org
Thu Jun 6 11:33:52 CEST 2019
Commit: b61fce82f9b72e92bff6103b9ceffa163ef9f2d6
Author: Jacques Lucke
Date: Thu Jun 6 11:33:46 2019 +0200
Branches: functions
https://developer.blender.org/rBb61fce82f9b72e92bff6103b9ceffa163ef9f2d6
more consistent naming in C wrappers
===================================================================
M source/blender/functions/backends/dependencies/dependencies-c.cpp
M source/blender/functions/backends/tuple_call/tuple_call-c.cpp
M source/blender/functions/core/core-c.cpp
M source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.cpp
M source/blender/functions/types/tuple_access-c.cpp
M source/blender/simulations/playground.cpp
===================================================================
diff --git a/source/blender/functions/backends/dependencies/dependencies-c.cpp b/source/blender/functions/backends/dependencies/dependencies-c.cpp
index d4087d8afbf..2c78d1253a2 100644
--- a/source/blender/functions/backends/dependencies/dependencies-c.cpp
+++ b/source/blender/functions/backends/dependencies/dependencies-c.cpp
@@ -2,10 +2,10 @@
using namespace FN;
-void FN_function_update_dependencies(FnFunction fn, struct DepsNodeHandle *deps_node)
+void FN_function_update_dependencies(FnFunction fn_c, struct DepsNodeHandle *deps_node)
{
- Function *fn_ = unwrap(fn);
- const DependenciesBody *body = fn_->body<DependenciesBody>();
+ Function *fn = unwrap(fn_c);
+ const DependenciesBody *body = fn->body<DependenciesBody>();
if (body) {
Dependencies dependencies;
body->dependencies(dependencies);
diff --git a/source/blender/functions/backends/tuple_call/tuple_call-c.cpp b/source/blender/functions/backends/tuple_call/tuple_call-c.cpp
index 009a6e1614b..684226796d2 100644
--- a/source/blender/functions/backends/tuple_call/tuple_call-c.cpp
+++ b/source/blender/functions/backends/tuple_call/tuple_call-c.cpp
@@ -2,15 +2,15 @@
using namespace FN;
-void FN_tuple_call_invoke(FnTupleCallBody body,
- FnTuple fn_in,
- FnTuple fn_out,
+void FN_tuple_call_invoke(FnTupleCallBody body_c,
+ FnTuple fn_in_c,
+ FnTuple fn_out_c,
const char *caller_info)
{
- Tuple &fn_in_ = *unwrap(fn_in);
- Tuple &fn_out_ = *unwrap(fn_out);
- TupleCallBody *body_ = unwrap(body);
- BLI_assert(fn_in_.all_initialized());
+ Tuple &fn_in = *unwrap(fn_in_c);
+ Tuple &fn_out = *unwrap(fn_out_c);
+ TupleCallBody *body = unwrap(body_c);
+ BLI_assert(fn_in.all_initialized());
/* setup stack */
ExecutionStack stack;
@@ -18,51 +18,54 @@ void FN_tuple_call_invoke(FnTupleCallBody body,
stack.push(&caller_frame);
ExecutionContext ctx(stack);
- body_->call__setup_stack(fn_in_, fn_out_, ctx);
- BLI_assert(fn_out_.all_initialized());
+ body->call__setup_stack(fn_in, fn_out, ctx);
+ BLI_assert(fn_out.all_initialized());
}
-FnTupleCallBody FN_tuple_call_get(FnFunction fn)
+FnTupleCallBody FN_tuple_call_get(FnFunction fn_c)
{
- return wrap(unwrap(fn)->body<TupleCallBody>());
+ return wrap(unwrap(fn_c)->body<TupleCallBody>());
}
-FnTuple FN_tuple_for_input(FnTupleCallBody body)
+FnTuple FN_tuple_for_input(FnTupleCallBody body_c)
{
- auto tuple = new Tuple(unwrap(body)->meta_in());
+ auto tuple = new Tuple(unwrap(body_c)->meta_in());
return wrap(tuple);
}
-FnTuple FN_tuple_for_output(FnTupleCallBody body)
+FnTuple FN_tuple_for_output(FnTupleCallBody body_c)
{
- auto tuple = new Tuple(unwrap(body)->meta_out());
+ auto tuple = new Tuple(unwrap(body_c)->meta_out());
return wrap(tuple);
}
-void FN_tuple_free(FnTuple tuple)
+void FN_tuple_free(FnTuple tuple_c)
{
- delete unwrap(tuple);
+ delete unwrap(tuple_c);
}
-uint fn_tuple_stack_prepare_size(FnTupleCallBody body_)
+uint fn_tuple_stack_prepare_size(FnTupleCallBody body_c)
{
- TupleCallBody *body = unwrap(body_);
+ TupleCallBody *body = unwrap(body_c);
return body->meta_in()->size_of_full_tuple() + body->meta_out()->size_of_full_tuple();
}
-void fn_tuple_prepare_stack(FnTupleCallBody body_, void *buffer, FnTuple *fn_in_, FnTuple *fn_out_)
+void fn_tuple_prepare_stack(FnTupleCallBody body_c,
+ void *buffer,
+ FnTuple *fn_in_c,
+ FnTuple *fn_out_c)
{
- TupleCallBody *body = unwrap(body_);
+ TupleCallBody *body = unwrap(body_c);
char *buf = (char *)buffer;
char *buf_in = buf + 0;
char *buf_out = buf + body->meta_in()->size_of_full_tuple();
Tuple::ConstructInBuffer(body->meta_in(), buf_in);
Tuple::ConstructInBuffer(body->meta_out(), buf_out);
- *fn_in_ = wrap((Tuple *)buf_in);
- *fn_out_ = wrap((Tuple *)buf_out);
+ *fn_in_c = wrap((Tuple *)buf_in);
+ *fn_out_c = wrap((Tuple *)buf_out);
}
-void fn_tuple_destruct(FnTuple tuple)
+void fn_tuple_destruct(FnTuple tuple_c)
{
- unwrap(tuple)->~Tuple();
+ unwrap(tuple_c)->~Tuple();
}
diff --git a/source/blender/functions/core/core-c.cpp b/source/blender/functions/core/core-c.cpp
index d59d0147e39..5cfd4a26710 100644
--- a/source/blender/functions/core/core-c.cpp
+++ b/source/blender/functions/core/core-c.cpp
@@ -2,62 +2,62 @@
using namespace FN;
-void FN_function_free(FnFunction fn)
+void FN_function_free(FnFunction fn_c)
{
- unwrap(fn)->decref();
+ unwrap(fn_c)->decref();
}
-bool FN_function_has_signature(FnFunction fn, FnType *inputs, FnType *outputs)
+bool FN_function_has_signature(FnFunction fn_c, FnType *inputs_c, FnType *outputs_c)
{
uint input_amount;
uint output_amount;
- for (input_amount = 0; inputs[input_amount]; input_amount++) {
+ for (input_amount = 0; inputs_c[input_amount]; input_amount++) {
}
- for (output_amount = 0; outputs[output_amount]; output_amount++) {
+ for (output_amount = 0; outputs_c[output_amount]; output_amount++) {
}
- if (FN_input_amount(fn) != input_amount)
+ if (FN_input_amount(fn_c) != input_amount)
return false;
- if (FN_output_amount(fn) != output_amount)
+ if (FN_output_amount(fn_c) != output_amount)
return false;
for (uint i = 0; i < input_amount; i++) {
- if (!FN_input_has_type(fn, i, inputs[i]))
+ if (!FN_input_has_type(fn_c, i, inputs_c[i]))
return false;
}
for (uint i = 0; i < output_amount; i++) {
- if (!FN_output_has_type(fn, i, outputs[i]))
+ if (!FN_output_has_type(fn_c, i, outputs_c[i]))
return false;
}
return true;
}
-uint FN_input_amount(FnFunction fn)
+uint FN_input_amount(FnFunction fn_c)
{
- return unwrap(fn)->input_amount();
+ return unwrap(fn_c)->input_amount();
}
-uint FN_output_amount(FnFunction fn)
+uint FN_output_amount(FnFunction fn_c)
{
- return unwrap(fn)->output_amount();
+ return unwrap(fn_c)->output_amount();
}
-bool FN_input_has_type(FnFunction fn, uint index, FnType type)
+bool FN_input_has_type(FnFunction fn_c, uint index, FnType type_c)
{
- Type *type1 = unwrap(fn)->input_type(index).ptr();
- Type *type2 = unwrap(type);
+ Type *type1 = unwrap(fn_c)->input_type(index).ptr();
+ Type *type2 = unwrap(type_c);
return type1 == type2;
}
-bool FN_output_has_type(FnFunction fn, uint index, FnType type)
+bool FN_output_has_type(FnFunction fn_c, uint index, FnType type_c)
{
- Type *type1 = unwrap(fn)->output_type(index).ptr();
- Type *type2 = unwrap(type);
+ Type *type1 = unwrap(fn_c)->output_type(index).ptr();
+ Type *type2 = unwrap(type_c);
return type1 == type2;
}
-void FN_function_print(FnFunction fn)
+void FN_function_print(FnFunction fn_c)
{
- Function *function = unwrap(fn);
- function->print();
+ Function *fn = unwrap(fn_c);
+ fn->print();
}
diff --git a/source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.cpp b/source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.cpp
index 77ad365960d..c40276a0822 100644
--- a/source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.cpp
@@ -17,7 +17,7 @@ FnFunction FN_tree_to_function(bNodeTree *btree)
return wrap(fn_ptr);
}
-FnFunction FN_function_get_with_signature(bNodeTree *btree, FnType *inputs, FnType *outputs)
+FnFunction FN_function_get_with_signature(bNodeTree *btree, FnType *inputs_c, FnType *outputs_c)
{
if (btree == NULL) {
return NULL;
@@ -27,7 +27,7 @@ FnFunction FN_function_get_with_signature(bNodeTree *btree, FnType *inputs, FnTy
if (fn == NULL) {
return NULL;
}
- else if (FN_function_has_signature(fn, inputs, outputs)) {
+ else if (FN_function_has_signature(fn, inputs_c, outputs_c)) {
return fn;
}
else {
diff --git a/source/blender/functions/types/tuple_access-c.cpp b/source/blender/functions/types/tuple_access-c.cpp
index cdfddaf0a17..d41b3a8f28c 100644
--- a/source/blender/functions/types/tuple_access-c.cpp
+++ b/source/blender/functions/types/tuple_access-c.cpp
@@ -3,44 +3,44 @@
using namespace FN;
using namespace FN::Types;
-void FN_tuple_set_float(FnTuple tuple, uint index, float value)
+void FN_tuple_set_float(FnTuple tuple_c, uint index, float value)
{
- unwrap(tuple)->set<float>(index, value);
+ unwrap(tuple_c)->set<float>(index, value);
}
-float FN_tuple_get_float(FnTuple tuple, uint index)
+float FN_tuple_get_float(FnTuple tuple_c, uint index)
{
- return unwrap(tuple)->get<float>(index);
+ return unwrap(tuple_c)->get<float>(index);
}
-void FN_tuple_set_int32(FnTuple tuple, uint index, int32_t value)
+void FN_tuple_set_int32(FnTuple tuple_c, uint index, int32_t value)
{
- unwrap(tuple)->set<int32_t>(index, value);
+ unwrap(tuple_c)->set<int32_t>(index, value);
}
-int32_t FN_tuple_get_int32(FnTuple tuple, uint index)
+int32_t FN_tuple_get_int32(FnTuple tuple_c, uint index)
{
- return unwrap(tuple)->get<int32_t>(index);
+ return unwrap(tuple_c)->get<int32_t>(index);
}
-void FN_tuple_set_fvec3(FnTuple tuple, uint index, float value[3])
+void FN_tuple_set_fvec3(FnTuple tuple_c, uint index, float value[3])
{
- unwrap(tuple)->set<Vector>(index, *(Vector *)value);
+ unwrap(tuple_c)->set<Vector>(index, *(Vector *)value);
}
-void FN_tuple_get_fvec3(FnTuple tuple, uint index, float dst[3])
+void FN_tuple_get_fvec3(FnTuple tuple_c, uint index, float dst[3])
{
- *(Vector *)dst = unwrap(tuple)->get<Vector>(index);
+ *(Vector *)dst = unwrap(tuple_c)->get<Vector>(index);
}
-FnFloatList FN_tuple_relocate_out_float_list(FnTuple tuple, uint index)
+FnFloatList FN_tuple_relocate_out_float_list(FnTuple tuple_c, uint index)
{
- auto list = unwrap(tuple)->relocate_out<SharedFloatList>(index);
+ auto list = unwrap(tuple_c)->relocate_out<SharedFloatList>(index);
return wrap(list.extract_ptr());
}
-FnFVec3List FN_tuple_relocate_out_fvec3_list(FnTuple tuple, uint index)
+FnFVec3List FN_tuple_relocate_out_fvec3_list(FnTuple tuple_c, uint index)
{
- auto list = unwrap(tuple)->relocate_out<SharedFVec3List>(index);
+ auto list = unwrap(tuple_c)->relocate_
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list