[Bf-blender-cvs] [2237982] depsgraph_refactor: Depsgraph: Use plain const char* for nodes typeinfo
Sergey Sharybin
noreply at git.blender.org
Wed Apr 1 17:20:19 CEST 2015
Commit: 2237982435c3dcd8605aa1fada84c9ad07648ca2
Author: Sergey Sharybin
Date: Wed Apr 1 20:12:38 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB2237982435c3dcd8605aa1fada84c9ad07648ca2
Depsgraph: Use plain const char* for nodes typeinfo
===================================================================
M source/blender/depsgraph/intern/depsgraph_debug.cpp
M source/blender/depsgraph/intern/depsgraph_intern.h
M source/blender/depsgraph/intern/depsnode.cpp
M source/blender/depsgraph/intern/depsnode.h
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cpp b/source/blender/depsgraph/intern/depsgraph_debug.cpp
index 91c4fcc..1033926 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cpp
@@ -756,7 +756,7 @@ static string get_component_name(eDepsNode_Type type, const string &name = "")
return string(factory->tname());
}
else {
- return factory->tname() + " | " + name;
+ return string(factory->tname()) + " | " + name;
}
}
diff --git a/source/blender/depsgraph/intern/depsgraph_intern.h b/source/blender/depsgraph/intern/depsgraph_intern.h
index c0da2a2..55ea70b 100644
--- a/source/blender/depsgraph/intern/depsgraph_intern.h
+++ b/source/blender/depsgraph/intern/depsgraph_intern.h
@@ -90,7 +90,7 @@ DepsNode *DEG_copy_node(DepsgraphCopyContext *dcc, const DepsNode *src);
struct DepsNodeFactory {
virtual eDepsNode_Type type() const = 0;
virtual eDepsNode_Class tclass() const = 0;
- virtual const string &tname() const = 0;
+ virtual const char *tname() const = 0;
virtual DepsNode *create_node(const ID *id, const string &subdata, const string &name) const = 0;
virtual DepsNode *copy_node(DepsgraphCopyContext *dcc, const DepsNode *copy) const = 0;
@@ -100,7 +100,7 @@ template <class NodeType>
struct DepsNodeFactoryImpl : public DepsNodeFactory {
eDepsNode_Type type() const { return NodeType::typeinfo.type; }
eDepsNode_Class tclass() const { return NodeType::typeinfo.tclass; }
- const string &tname() const { return NodeType::typeinfo.tname; }
+ const char *tname() const { return NodeType::typeinfo.tname; }
DepsNode *create_node(const ID *id, const string &subdata, const string &name) const
{
diff --git a/source/blender/depsgraph/intern/depsnode.cpp b/source/blender/depsgraph/intern/depsnode.cpp
index c06db09..75c967b 100644
--- a/source/blender/depsgraph/intern/depsnode.cpp
+++ b/source/blender/depsgraph/intern/depsnode.cpp
@@ -48,7 +48,7 @@ extern "C" {
/* Add ------------------------------------------------ */
-DepsNode::TypeInfo::TypeInfo(eDepsNode_Type type, const string &tname)
+DepsNode::TypeInfo::TypeInfo(eDepsNode_Type type, const char *tname)
{
this->type = type;
if (type == DEPSNODE_TYPE_OPERATION)
diff --git a/source/blender/depsgraph/intern/depsnode.h b/source/blender/depsgraph/intern/depsnode.h
index 7050826..39f449e 100644
--- a/source/blender/depsgraph/intern/depsnode.h
+++ b/source/blender/depsgraph/intern/depsnode.h
@@ -48,11 +48,11 @@ struct OperationDepsNode;
struct DepsNode {
/* Helper class for static typeinfo in subclasses. */
struct TypeInfo {
- TypeInfo(eDepsNode_Type type, const string &tname);
+ TypeInfo(eDepsNode_Type type, const char *tname);
eDepsNode_Type type;
eDepsNode_Class tclass;
- string tname;
+ const char *tname;
};
/* Identifier - mainly for debugging purposes. */
More information about the Bf-blender-cvs
mailing list