diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-04-17 07:37:08 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-04-17 09:37:08 +0400 |
commit | 77b37fa4615dc1e8d5656259744f0e8a1634e258 (patch) | |
tree | 4c1e9e8580156da0a65ac4fe11dbef82f6281327 /source/blender/freestyle/intern/python | |
parent | 5d4a6a94ef40f8ae8c49d8fd8fc65384324cb03c (diff) |
Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 3).
(See commit e1771e72fbbf828dbf5bed871b814288389f3611 for more detail of
the problem).
Made changes to intern/view_map/Interface0D.h and intern/python/Director.h to
avoid #include <Python.h> and keep non-Python header files independent of it.
Diffstat (limited to 'source/blender/freestyle/intern/python')
-rw-r--r-- | source/blender/freestyle/intern/python/Director.cpp | 24 | ||||
-rw-r--r-- | source/blender/freestyle/intern/python/Director.h | 14 |
2 files changed, 15 insertions, 23 deletions
diff --git a/source/blender/freestyle/intern/python/Director.cpp b/source/blender/freestyle/intern/python/Director.cpp index ed98bfee63f..f03aa0bcc97 100644 --- a/source/blender/freestyle/intern/python/Director.cpp +++ b/source/blender/freestyle/intern/python/Director.cpp @@ -74,7 +74,7 @@ int Director_BPy_BinaryPredicate0D___call__(BinaryPredicate0D *bp0D, Interface0D Py_XDECREF(arg2); return -1; } - PyObject *result = PyObject_CallMethod(bp0D->py_bp0D, (char *)"__call__", (char *)"OO", arg1, arg2); + PyObject *result = PyObject_CallMethod((PyObject *)bp0D->py_bp0D, (char *)"__call__", (char *)"OO", arg1, arg2); Py_DECREF(arg1); Py_DECREF(arg2); if (!result) @@ -101,7 +101,7 @@ int Director_BPy_BinaryPredicate1D___call__(BinaryPredicate1D *bp1D, Interface1D Py_XDECREF(arg2); return -1; } - PyObject *result = PyObject_CallMethod(bp1D->py_bp1D, (char *)"__call__", (char *)"OO", arg1, arg2); + PyObject *result = PyObject_CallMethod((PyObject *)bp1D->py_bp1D, (char *)"__call__", (char *)"OO", arg1, arg2); Py_DECREF(arg1); Py_DECREF(arg2); if (!result) @@ -124,7 +124,7 @@ int Director_BPy_UnaryPredicate0D___call__(UnaryPredicate0D *up0D, Interface0DIt PyObject *arg = BPy_Interface0DIterator_from_Interface0DIterator(if0D_it, 0); if (!arg) return -1; - PyObject *result = PyObject_CallMethod(up0D->py_up0D, (char *)"__call__", (char *)"O", arg); + PyObject *result = PyObject_CallMethod((PyObject *)up0D->py_up0D, (char *)"__call__", (char *)"O", arg); Py_DECREF(arg); if (!result) return -1; @@ -146,7 +146,7 @@ int Director_BPy_UnaryPredicate1D___call__(UnaryPredicate1D *up1D, Interface1D& PyObject *arg = Any_BPy_Interface1D_from_Interface1D(if1D); if (!arg) return -1; - PyObject *result = PyObject_CallMethod(up1D->py_up1D, (char *)"__call__", (char *)"O", arg); + PyObject *result = PyObject_CallMethod((PyObject *)up1D->py_up1D, (char *)"__call__", (char *)"O", arg); Py_DECREF(arg); if (!result) return -1; @@ -168,7 +168,7 @@ int Director_BPy_StrokeShader_shade(StrokeShader *ss, Stroke& s) PyObject *arg = BPy_Stroke_from_Stroke(s); if (!arg) return -1; - PyObject *result = PyObject_CallMethod(ss->py_ss, (char *)"shade", (char *)"O", arg); + PyObject *result = PyObject_CallMethod((PyObject *)ss->py_ss, (char *)"shade", (char *)"O", arg); Py_DECREF(arg); if (!result) return -1; @@ -183,7 +183,7 @@ int Director_BPy_ChainingIterator_init(ChainingIterator *c_it) PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_c_it) not initialized"); return -1; } - PyObject *result = PyObject_CallMethod(c_it->py_c_it, (char *)"init", NULL); + PyObject *result = PyObject_CallMethod((PyObject *)c_it->py_c_it, (char *)"init", NULL); if (!result) return -1; Py_DECREF(result); @@ -199,7 +199,7 @@ int Director_BPy_ChainingIterator_traverse(ChainingIterator *c_it, AdjacencyIter PyObject *arg = BPy_AdjacencyIterator_from_AdjacencyIterator(a_it); if (!arg) return -1; - PyObject *result = PyObject_CallMethod(c_it->py_c_it, (char *)"traverse", (char *)"O", arg); + PyObject *result = PyObject_CallMethod((PyObject *)c_it->py_c_it, (char *)"traverse", (char *)"O", arg); Py_DECREF(arg); if (!result) return -1; @@ -219,12 +219,13 @@ int Director_BPy_ChainingIterator_traverse(ChainingIterator *c_it, AdjacencyIter } // BPy_UnaryFunction{0D,1D}: __call__ -int Director_BPy_UnaryFunction0D___call__(void *uf0D, PyObject *obj, Interface0DIterator& if0D_it) +int Director_BPy_UnaryFunction0D___call__(void *uf0D, void *py_uf0D, Interface0DIterator& if0D_it) { - if (!obj) { // internal error + if (!py_uf0D) { // internal error PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_uf0D) not initialized"); return -1; } + PyObject *obj = (PyObject *)py_uf0D; PyObject *arg = BPy_Interface0DIterator_from_Interface0DIterator(if0D_it, 0); if (!arg) return -1; @@ -277,12 +278,13 @@ int Director_BPy_UnaryFunction0D___call__(void *uf0D, PyObject *obj, Interface0D return 0; } -int Director_BPy_UnaryFunction1D___call__(void *uf1D, PyObject *obj, Interface1D& if1D) +int Director_BPy_UnaryFunction1D___call__(void *uf1D, void *py_uf1D, Interface1D& if1D) { - if (!obj) { // internal error + if (!py_uf1D) { // internal error PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_uf1D) not initialized"); return -1; } + PyObject *obj = (PyObject *)py_uf1D; PyObject *arg = Any_BPy_Interface1D_from_Interface1D(if1D); if (!arg) return -1; diff --git a/source/blender/freestyle/intern/python/Director.h b/source/blender/freestyle/intern/python/Director.h index d58a51b65b2..40576c0ec2c 100644 --- a/source/blender/freestyle/intern/python/Director.h +++ b/source/blender/freestyle/intern/python/Director.h @@ -41,16 +41,6 @@ class StrokeShader; using namespace Freestyle; -#ifdef __cplusplus -extern "C" { -#endif - -#include <Python.h> - -#ifdef __cplusplus -} -#endif - // BinaryPredicate0D: __call__ int Director_BPy_BinaryPredicate0D___call__(BinaryPredicate0D *bp0D, Interface0D& i1, Interface0D& i2); @@ -58,8 +48,8 @@ int Director_BPy_BinaryPredicate0D___call__(BinaryPredicate0D *bp0D, Interface0D int Director_BPy_BinaryPredicate1D___call__(BinaryPredicate1D *bp1D, Interface1D& i1, Interface1D& i2); // UnaryFunction{0D,1D}: __call__ -int Director_BPy_UnaryFunction0D___call__(void *uf0D, PyObject *obj, Interface0DIterator& if0D_it); -int Director_BPy_UnaryFunction1D___call__(void *uf1D, PyObject *obj, Interface1D& if1D); +int Director_BPy_UnaryFunction0D___call__(void *uf0D, void *py_uf0D, Interface0DIterator& if0D_it); +int Director_BPy_UnaryFunction1D___call__(void *uf1D, void *py_uf1D, Interface1D& if1D); // UnaryPredicate0D: __call__ int Director_BPy_UnaryPredicate0D___call__(UnaryPredicate0D *up0D, Interface0DIterator& if0D_it); |