Cleanup: Remove using-directive from freestyle headers

The header files in freestyle utilize the using-directive at the global
file scope. This is a bad practice as it pollutes the global name space
causing possible ambiguous reference compilation errors. In particular,
the DNA files that are included by freestyle will cause those ambiguous
reference errors when the developers adds a DNA member with a type name
that also exist in the Freestyle name space, such as Curve and possibly
others.

This patch does the minimal work needed to resolve that by moving the
using-directives from the headers into the corresponding translation
units.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10351
This commit is contained in:
2021-02-08 17:28:15 +02:00
parent 048135e2c8
commit 21a2b975b8
216 changed files with 442 additions and 186 deletions

View File

@@ -30,6 +30,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------FEdge methods ----------------------------*/

View File

@@ -37,7 +37,7 @@ extern PyTypeObject FEdge_Type;
/*---------------------------Python BPy_FEdge structure definition----------*/
typedef struct {
BPy_Interface1D py_if1D;
FEdge *fe;
Freestyle::FEdge *fe;
} BPy_FEdge;
///////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -29,6 +29,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------CurvePoint methods ----------------------------*/

View File

@@ -37,7 +37,7 @@ extern PyTypeObject FrsCurve_Type;
/*---------------------------Python BPy_FrsCurve structure definition----------*/
typedef struct {
BPy_Interface1D py_if1D;
Curve *c;
Freestyle::Curve *c;
} BPy_FrsCurve;
///////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -31,6 +31,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------Stroke methods ----------------------------*/

View File

@@ -37,7 +37,7 @@ extern PyTypeObject Stroke_Type;
/*---------------------------Python BPy_Stroke structure definition----------*/
typedef struct {
BPy_Interface1D py_if1D;
Stroke *s;
Freestyle::Stroke *s;
} BPy_Stroke;
///////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -32,6 +32,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------ViewEdge methods ----------------------------*/

View File

@@ -37,7 +37,7 @@ extern PyTypeObject ViewEdge_Type;
/*---------------------------Python BPy_ViewEdge structure definition----------*/
typedef struct {
BPy_Interface1D py_if1D;
ViewEdge *ve;
Freestyle::ViewEdge *ve;
} BPy_ViewEdge;
///////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -28,6 +28,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------Chain methods ----------------------------*/

View File

@@ -37,7 +37,7 @@ extern PyTypeObject Chain_Type;
/*---------------------------Python BPy_Chain structure definition----------*/
typedef struct {
BPy_FrsCurve py_c;
Chain *c;
Freestyle::Chain *c;
} BPy_Chain;
///////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -27,6 +27,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------FEdgeSharp methods ----------------------------*/

View File

@@ -37,7 +37,7 @@ extern PyTypeObject FEdgeSharp_Type;
/*---------------------------Python BPy_FEdgeSharp structure definition----------*/
typedef struct {
BPy_FEdge py_fe;
FEdgeSharp *fes;
Freestyle::FEdgeSharp *fes;
} BPy_FEdgeSharp;
/*---------------------------Python BPy_FEdgeSharp visible prototypes-----------*/

View File

@@ -27,6 +27,8 @@
extern "C" {
#endif
using namespace Freestyle;
///////////////////////////////////////////////////////////////////////////////////////////
/*----------------------FEdgeSmooth methods ----------------------------*/

View File

@@ -38,7 +38,7 @@ extern PyTypeObject FEdgeSmooth_Type;
/*---------------------------Python BPy_FEdgeSmooth structure definition----------*/
typedef struct {
BPy_FEdge py_fe;
FEdgeSmooth *fes;
Freestyle::FEdgeSmooth *fes;
} BPy_FEdgeSmooth;
/*---------------------------Python BPy_FEdgeSmooth visible prototypes-----------*/