summaryrefslogtreecommitdiff
path: root/fluid/nodes/Function_Node.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2026-01-04 20:43:26 +0100
committerMatthias Melcher <github@matthiasm.com>2026-01-04 20:43:34 +0100
commit7306b66d99fb529d65ddda1ea8e093454d7005e1 (patch)
tree13803f53b2e921985abe54804b8d9131c46b9c3d /fluid/nodes/Function_Node.cxx
parent811a188bbf276841365f2ad4b11197f5820fe571 (diff)
Fluid: Add automated MergeBack
Diffstat (limited to 'fluid/nodes/Function_Node.cxx')
-rw-r--r--fluid/nodes/Function_Node.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/fluid/nodes/Function_Node.cxx b/fluid/nodes/Function_Node.cxx
index 42c3f3996..66e425533 100644
--- a/fluid/nodes/Function_Node.cxx
+++ b/fluid/nodes/Function_Node.cxx
@@ -1226,8 +1226,6 @@ DeclBlock_Node::DeclBlock_Node()
Destructor.
*/
DeclBlock_Node::~DeclBlock_Node() {
- if (after)
- ::free((void*)after);
}
/**
@@ -1253,7 +1251,7 @@ Node *DeclBlock_Node::make(Strategy strategy) {
DeclBlock_Node *o = new DeclBlock_Node();
o->name("#if 1");
o->write_map_ = CODE_IN_SOURCE;
- o->after = fl_strdup("#endif");
+ o->end_code_ = "#endif";
o->add(anchor, strategy);
o->factory = this;
return o;
@@ -1272,7 +1270,7 @@ void DeclBlock_Node::write_properties(fld::io::Project_Writer &f) {
if (write_map_ != CODE_IN_SOURCE)
f.write_string("map %d", write_map_);
f.write_string("after");
- f.write_word(after);
+ f.write_word(end_code().c_str());
}
/**
@@ -1286,7 +1284,7 @@ void DeclBlock_Node::read_property(fld::io::Project_Reader &f, const char *c) {
} else if(!strcmp(c,"map")) {
write_map_ = (int)atol(f.read_word());
} else if (!strcmp(c,"after")) {
- storestring(f.read_word(),after);
+ end_code(f.read_word());
} else {
Node::read_property(f, c);
}
@@ -1317,12 +1315,11 @@ void DeclBlock_Node::write_static(fld::io::Code_Writer& f) {
Write the \b after static code to the source file, and to the header file if declared public.
*/
void DeclBlock_Node::write_static_after(fld::io::Code_Writer& f) {
- const char* c = after;
- if (c && *c) {
+ if (!end_code().empty()) {
if (write_map_ & STATIC_IN_HEADER)
- f.write_h("%s\n", c);
+ f.write_h("%s\n", end_code().c_str());
if (write_map_ & STATIC_IN_SOURCE)
- f.write_c("%s\n", c);
+ f.write_c("%s\n", end_code().c_str());
}
}
@@ -1344,12 +1341,11 @@ void DeclBlock_Node::write_code1(fld::io::Code_Writer& f) {
Write the \b after code to the source file, and to the header file if declared public.
*/
void DeclBlock_Node::write_code2(fld::io::Code_Writer& f) {
- const char* c = after;
- if (c && *c) {
+ if (!end_code().empty()) {
if (write_map_ & CODE_IN_HEADER)
- f.write_h("%s\n", c);
+ f.write_h("%s\n", end_code().c_str());
if (write_map_ & CODE_IN_SOURCE)
- f.write_c("%s\n", c);
+ f.write_c("%s\n", end_code().c_str());
}
}