Cleanup: use nested namespaces

This commit is contained in:
2020-07-03 14:25:20 +02:00
parent 5fbf70b0d0
commit 395b294b61
35 changed files with 70 additions and 140 deletions

View File

@@ -32,8 +32,7 @@
#include "BKE_node_tree_ref.hh" #include "BKE_node_tree_ref.hh"
namespace blender { namespace blender::bke {
namespace bke {
class DSocket; class DSocket;
class DInputSocket; class DInputSocket;
@@ -494,7 +493,6 @@ inline Span<const DGroupInput *> DerivedNodeTree::group_inputs() const
return group_inputs_.as_span(); return group_inputs_.as_span();
} }
} // namespace bke } // namespace blender::bke
} // namespace blender
#endif /* __BKE_DERIVED_NODE_TREE_HH__ */ #endif /* __BKE_DERIVED_NODE_TREE_HH__ */

View File

@@ -58,8 +58,7 @@
#include "RNA_access.h" #include "RNA_access.h"
namespace blender { namespace blender::bke {
namespace bke {
class SocketRef; class SocketRef;
class InputSocketRef; class InputSocketRef;
@@ -441,7 +440,6 @@ inline bNodeTree *NodeTreeRef::btree() const
return btree_; return btree_;
} }
} // namespace bke } // namespace blender::bke
} // namespace blender
#endif /* __BKE_NODE_TREE_REF_HH__ */ #endif /* __BKE_NODE_TREE_REF_HH__ */

View File

@@ -20,8 +20,7 @@
#define UNINITIALIZED_ID UINT32_MAX #define UNINITIALIZED_ID UINT32_MAX
namespace blender { namespace blender::bke {
namespace bke {
static const NodeTreeRef &get_tree_ref(NodeTreeRefMap &node_tree_refs, bNodeTree *btree) static const NodeTreeRef &get_tree_ref(NodeTreeRefMap &node_tree_refs, bNodeTree *btree)
{ {
@@ -439,5 +438,4 @@ std::string DerivedNodeTree::to_dot() const
return digraph.to_dot_string(); return digraph.to_dot_string();
} }
} // namespace bke } // namespace blender::bke
} // namespace blender

View File

@@ -18,8 +18,7 @@
#include "BLI_dot_export.hh" #include "BLI_dot_export.hh"
namespace blender { namespace blender::bke {
namespace bke {
NodeTreeRef::NodeTreeRef(bNodeTree *btree) : btree_(btree) NodeTreeRef::NodeTreeRef(bNodeTree *btree) : btree_(btree)
{ {
@@ -175,5 +174,4 @@ std::string NodeTreeRef::to_dot() const
return digraph.to_dot_string(); return digraph.to_dot_string();
} }
} // namespace bke } // namespace blender::bke
} // namespace blender

View File

@@ -164,8 +164,7 @@ void *BKE_simulation_add(Main *bmain, const char *name)
return simulation; return simulation;
} }
namespace blender { namespace blender::bke {
namespace bke {
static MutableSpan<float3> get_particle_positions(ParticleSimulationState *state) static MutableSpan<float3> get_particle_positions(ParticleSimulationState *state)
{ {
@@ -259,8 +258,7 @@ static void simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulatio
} }
} }
} // namespace bke } // namespace blender::bke
} // namespace blender
void BKE_simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulation *simulation) void BKE_simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulation *simulation)
{ {

View File

@@ -34,8 +34,7 @@
#include <optional> #include <optional>
#include <sstream> #include <sstream>
namespace blender { namespace blender::dot {
namespace dot {
class Graph; class Graph;
class DirectedGraph; class DirectedGraph;
@@ -283,7 +282,6 @@ class NodeWithSocketsRef {
} }
}; };
} // namespace dot } // namespace blender::dot
} // namespace blender
#endif /* __BLI_DOT_EXPORT_HH__ */ #endif /* __BLI_DOT_EXPORT_HH__ */

View File

@@ -19,8 +19,7 @@
#include "BLI_string_ref.hh" #include "BLI_string_ref.hh"
namespace blender { namespace blender ::dot {
namespace dot {
enum class Attr_rankdir { enum class Attr_rankdir {
LeftToRight, LeftToRight,
@@ -119,7 +118,6 @@ inline StringRef dirType_to_string(Attr_dirType value)
return ""; return "";
} }
} // namespace dot } // namespace blender::dot
} // namespace blender
#endif /* __BLI_DOT_EXPORT_ATTRIBUTE_ENUMS_HH__ */ #endif /* __BLI_DOT_EXPORT_ATTRIBUTE_ENUMS_HH__ */

View File

@@ -18,8 +18,7 @@
#include "BLI_dot_export.hh" #include "BLI_dot_export.hh"
namespace blender { namespace blender::dot {
namespace dot {
/* Graph Building /* Graph Building
************************************************/ ************************************************/
@@ -301,5 +300,4 @@ NodeWithSocketsRef::NodeWithSocketsRef(Node &node,
node_->set_shape(Attr_shape::Rectangle); node_->set_shape(Attr_shape::Rectangle);
} }
} // namespace dot } // namespace blender::dot
} // namespace blender

View File

@@ -26,8 +26,7 @@
#include "FN_spans.hh" #include "FN_spans.hh"
namespace blender { namespace blender::fn {
namespace fn {
/** /**
* Depending on the use case, the referenced data might have a different structure. More * Depending on the use case, the referenced data might have a different structure. More
@@ -203,7 +202,6 @@ class GVArraySpan : public VArraySpanBase<void> {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_ARRAY_SPANS_HH__ */ #endif /* __FN_ARRAY_SPANS_HH__ */

View File

@@ -33,8 +33,7 @@
#include "BLI_utility_mixins.hh" #include "BLI_utility_mixins.hh"
#include "BLI_vector_set.hh" #include "BLI_vector_set.hh"
namespace blender { namespace blender::fn {
namespace fn {
class AttributesInfo; class AttributesInfo;
@@ -242,7 +241,6 @@ class MutableAttributesRef {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_ATTRIBUTES_REF_HH__ */ #endif /* __FN_ATTRIBUTES_REF_HH__ */

View File

@@ -70,8 +70,7 @@
#include "BLI_math_base.h" #include "BLI_math_base.h"
#include "BLI_string_ref.hh" #include "BLI_string_ref.hh"
namespace blender { namespace blender::fn {
namespace fn {
class CPPType { class CPPType {
public: public:
@@ -720,8 +719,7 @@ static std::unique_ptr<const CPPType> create_cpp_type(StringRef name, const T &d
return std::unique_ptr<const CPPType>(type); return std::unique_ptr<const CPPType>(type);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender
#define MAKE_CPP_TYPE(IDENTIFIER, TYPE_NAME) \ #define MAKE_CPP_TYPE(IDENTIFIER, TYPE_NAME) \
static TYPE_NAME default_value_##IDENTIFIER; \ static TYPE_NAME default_value_##IDENTIFIER; \

View File

@@ -26,8 +26,7 @@
#include "FN_cpp_type.hh" #include "FN_cpp_type.hh"
namespace blender { namespace blender::fn {
namespace fn {
extern const CPPType &CPPType_bool; extern const CPPType &CPPType_bool;
@@ -44,7 +43,6 @@ extern const CPPType &CPPType_Color4b;
extern const CPPType &CPPType_string; extern const CPPType &CPPType_string;
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_CPP_TYPES_HH__ */ #endif /* __FN_CPP_TYPES_HH__ */

View File

@@ -35,8 +35,7 @@
#include "BLI_linear_allocator.hh" #include "BLI_linear_allocator.hh"
#include "BLI_utility_mixins.hh" #include "BLI_utility_mixins.hh"
namespace blender { namespace blender::fn {
namespace fn {
template<typename T> class GVectorArrayRef; template<typename T> class GVectorArrayRef;
@@ -202,7 +201,6 @@ template<typename T> class GVectorArrayRef {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_GENERIC_VECTOR_ARRAY_HH__ */ #endif /* __FN_GENERIC_VECTOR_ARRAY_HH__ */

View File

@@ -48,8 +48,7 @@
#include "FN_multi_function_context.hh" #include "FN_multi_function_context.hh"
#include "FN_multi_function_params.hh" #include "FN_multi_function_params.hh"
namespace blender { namespace blender::fn {
namespace fn {
class MultiFunction { class MultiFunction {
private: private:
@@ -102,7 +101,6 @@ inline MFParamsBuilder::MFParamsBuilder(const class MultiFunction &fn, uint min_
extern const MultiFunction &dummy_multi_function; extern const MultiFunction &dummy_multi_function;
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_HH__ */ #endif /* __FN_MULTI_FUNCTION_HH__ */

View File

@@ -27,8 +27,7 @@
#include "FN_multi_function.hh" #include "FN_multi_function.hh"
namespace blender { namespace blender::fn {
namespace fn {
/** /**
* Generates a multi-function with the following parameters: * Generates a multi-function with the following parameters:
@@ -226,7 +225,6 @@ template<typename T> class CustomMF_Constant : public MultiFunction {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_BUILDER_HH__ */ #endif /* __FN_MULTI_FUNCTION_BUILDER_HH__ */

View File

@@ -29,8 +29,7 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
namespace blender { namespace blender::fn {
namespace fn {
class MFContextBuilder { class MFContextBuilder {
}; };
@@ -42,7 +41,6 @@ class MFContext {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_CONTEXT_HH__ */ #endif /* __FN_MULTI_FUNCTION_CONTEXT_HH__ */

View File

@@ -27,8 +27,7 @@
#include "FN_cpp_type.hh" #include "FN_cpp_type.hh"
namespace blender { namespace blender::fn {
namespace fn {
class MFDataType { class MFDataType {
public: public:
@@ -121,7 +120,6 @@ inline bool operator!=(const MFDataType &a, const MFDataType &b)
return !(a == b); return !(a == b);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_DATA_TYPE_HH__ */ #endif /* __FN_MULTI_FUNCTION_DATA_TYPE_HH__ */

View File

@@ -46,8 +46,7 @@
#include "BLI_vector_set.hh" #include "BLI_vector_set.hh"
namespace blender { namespace blender::fn {
namespace fn {
class MFNode; class MFNode;
class MFFunctionNode; class MFFunctionNode;
@@ -489,7 +488,6 @@ inline uint MFNetwork::max_socket_id() const
return socket_or_null_by_id_.size() - 1; return socket_or_null_by_id_.size() - 1;
} }
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_NETWORK_HH__ */ #endif /* __FN_MULTI_FUNCTION_NETWORK_HH__ */

View File

@@ -23,8 +23,7 @@
#include "FN_multi_function_network.hh" #include "FN_multi_function_network.hh"
namespace blender { namespace blender::fn {
namespace fn {
class MFNetworkEvaluationStorage; class MFNetworkEvaluationStorage;
@@ -60,7 +59,6 @@ class MFNetworkEvaluator : public MultiFunction {
Span<const MFInputSocket *> remaining_outputs) const; Span<const MFInputSocket *> remaining_outputs) const;
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_NETWORK_EVALUATION_HH__ */ #endif /* __FN_MULTI_FUNCTION_NETWORK_EVALUATION_HH__ */

View File

@@ -35,8 +35,7 @@
#include "FN_multi_function_data_type.hh" #include "FN_multi_function_data_type.hh"
namespace blender { namespace blender::fn {
namespace fn {
class MFParamType { class MFParamType {
public: public:
@@ -159,7 +158,6 @@ inline bool operator!=(const MFParamType &a, const MFParamType &b)
return !(a == b); return !(a == b);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_PARAM_TYPE_HH__ */ #endif /* __FN_MULTI_FUNCTION_PARAM_TYPE_HH__ */

View File

@@ -29,8 +29,7 @@
#include "FN_generic_vector_array.hh" #include "FN_generic_vector_array.hh"
#include "FN_multi_function_signature.hh" #include "FN_multi_function_signature.hh"
namespace blender { namespace blender::fn {
namespace fn {
class MFParamsBuilder { class MFParamsBuilder {
private: private:
@@ -233,7 +232,6 @@ class MFParams {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_PARAMS_HH__ */ #endif /* __FN_MULTI_FUNCTION_PARAMS_HH__ */

View File

@@ -28,8 +28,7 @@
#include "BLI_vector.hh" #include "BLI_vector.hh"
namespace blender { namespace blender::fn {
namespace fn {
struct MFSignature { struct MFSignature {
std::string function_name; std::string function_name;
@@ -160,7 +159,6 @@ class MFSignatureBuilder {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_MULTI_FUNCTION_SIGNATURE_HH__ */ #endif /* __FN_MULTI_FUNCTION_SIGNATURE_HH__ */

View File

@@ -43,8 +43,7 @@
#include "FN_cpp_type.hh" #include "FN_cpp_type.hh"
namespace blender { namespace blender::fn {
namespace fn {
/** /**
* A generic span. It behaves just like a blender::Span<T>, but the type is only known at run-time. * A generic span. It behaves just like a blender::Span<T>, but the type is only known at run-time.
@@ -398,7 +397,6 @@ class GVSpan : public VSpanBase<void> {
} }
}; };
} // namespace fn } // namespace blender::fn
} // namespace blender
#endif /* __FN_SPANS_HH__ */ #endif /* __FN_SPANS_HH__ */

View File

@@ -16,8 +16,7 @@
#include "FN_attributes_ref.hh" #include "FN_attributes_ref.hh"
namespace blender { namespace blender::fn {
namespace fn {
AttributesInfoBuilder::~AttributesInfoBuilder() AttributesInfoBuilder::~AttributesInfoBuilder()
{ {
@@ -68,5 +67,4 @@ AttributesInfo::~AttributesInfo()
} }
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -21,8 +21,7 @@
#include "BLI_float3.hh" #include "BLI_float3.hh"
#include "BLI_float4x4.hh" #include "BLI_float4x4.hh"
namespace blender { namespace blender::fn {
namespace fn {
MAKE_CPP_TYPE(bool, bool) MAKE_CPP_TYPE(bool, bool)
@@ -39,5 +38,4 @@ MAKE_CPP_TYPE(Color4b, blender::Color4b)
MAKE_CPP_TYPE(string, std::string) MAKE_CPP_TYPE(string, std::string)
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -16,8 +16,7 @@
#include "FN_multi_function.hh" #include "FN_multi_function.hh"
namespace blender { namespace blender::fn {
namespace fn {
class DummyMultiFunction : public MultiFunction { class DummyMultiFunction : public MultiFunction {
public: public:
@@ -36,5 +35,4 @@ class DummyMultiFunction : public MultiFunction {
static DummyMultiFunction dummy_multi_function_; static DummyMultiFunction dummy_multi_function_;
const MultiFunction &dummy_multi_function = dummy_multi_function_; const MultiFunction &dummy_multi_function = dummy_multi_function_;
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -17,8 +17,7 @@
#include "BLI_dot_export.hh" #include "BLI_dot_export.hh"
#include "FN_multi_function_network.hh" #include "FN_multi_function_network.hh"
namespace blender { namespace blender::fn {
namespace fn {
MFNetwork::~MFNetwork() MFNetwork::~MFNetwork()
{ {
@@ -274,5 +273,4 @@ std::string MFNetwork::to_dot() const
return digraph.to_dot_string(); return digraph.to_dot_string();
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -39,8 +39,7 @@
#include "BLI_stack.hh" #include "BLI_stack.hh"
namespace blender { namespace blender::fn {
namespace fn {
struct Value; struct Value;
@@ -1059,5 +1058,4 @@ GVArraySpan MFNetworkEvaluationStorage::get_vector_input__single(const MFInputSo
/** \} */ /** \} */
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -22,8 +22,7 @@
#include "BLI_array.hh" #include "BLI_array.hh"
namespace blender { namespace blender::fn {
namespace fn {
TEST(virtual_array_span, EmptyConstructor) TEST(virtual_array_span, EmptyConstructor)
{ {
@@ -145,5 +144,4 @@ TEST(generic_virtual_array_span, IsSingleArray2)
EXPECT_FALSE(converted.is_single_array()); EXPECT_FALSE(converted.is_single_array());
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -20,8 +20,7 @@
#include "testing/testing.h" #include "testing/testing.h"
namespace blender { namespace blender::fn {
namespace fn {
TEST(attributes_info, BuildEmpty) TEST(attributes_info, BuildEmpty)
{ {
@@ -110,5 +109,4 @@ TEST(mutable_attributes_ref, ComplexTest)
EXPECT_EQ(ids[2], 100); EXPECT_EQ(ids[2], 100);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -18,8 +18,7 @@
#include "FN_cpp_type.hh" #include "FN_cpp_type.hh"
namespace blender { namespace blender::fn {
namespace fn {
static const int default_constructed_value = 1; static const int default_constructed_value = 1;
static const int copy_constructed_value = 2; static const int copy_constructed_value = 2;
@@ -306,5 +305,4 @@ TEST(cpp_type, FillUninitialized)
EXPECT_EQ(buffer2[9], 0); EXPECT_EQ(buffer2[9], 0);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -19,8 +19,7 @@
#include "testing/testing.h" #include "testing/testing.h"
namespace blender { namespace blender::fn {
namespace fn {
TEST(generic_vector_array, Constructor) TEST(generic_vector_array, Constructor)
{ {
@@ -114,5 +113,4 @@ TEST(generic_vector_array, Extend)
EXPECT_EQ(ref[0][0], 3); EXPECT_EQ(ref[0][0], 3);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -21,8 +21,7 @@
#include "FN_multi_function_network.hh" #include "FN_multi_function_network.hh"
#include "FN_multi_function_network_evaluation.hh" #include "FN_multi_function_network_evaluation.hh"
namespace blender { namespace blender::fn {
namespace fn {
TEST(multi_function_network, Test1) TEST(multi_function_network, Test1)
{ {
@@ -266,5 +265,4 @@ TEST(multi_function_network, Test2)
} }
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -20,8 +20,7 @@
#include "FN_multi_function.hh" #include "FN_multi_function.hh"
#include "FN_multi_function_builder.hh" #include "FN_multi_function_builder.hh"
namespace blender { namespace blender::fn {
namespace fn {
class AddFunction : public MultiFunction { class AddFunction : public MultiFunction {
public: public:
@@ -330,5 +329,4 @@ TEST(multi_function, CustomMF_Constant)
EXPECT_EQ(outputs[3], 42); EXPECT_EQ(outputs[3], 42);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender

View File

@@ -19,8 +19,7 @@
#include "FN_cpp_types.hh" #include "FN_cpp_types.hh"
#include "FN_spans.hh" #include "FN_spans.hh"
namespace blender { namespace blender::fn {
namespace fn {
TEST(generic_span, TypeConstructor) TEST(generic_span, TypeConstructor)
{ {
@@ -227,5 +226,4 @@ TEST(generic_virtual_span, SingleConstructor)
EXPECT_EQ(converted[2], 5); EXPECT_EQ(converted[2], 5);
} }
} // namespace fn } // namespace blender::fn
} // namespace blender