fix -Wcast-function-type

This commit is contained in:
wmayer
2018-08-19 13:11:08 +02:00
parent 557fee3dc6
commit 68f6c82eb1
9 changed files with 42 additions and 6 deletions

View File

@@ -28,6 +28,11 @@
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wself-assign"
#elif defined (__GNUC__)
# pragma GCC diagnostic push
# if __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wcast-function-type"
# endif
#endif
namespace Swig_1_3_25 {
#include "swigpyrun_1.3.25.h"
@@ -35,5 +40,7 @@ namespace Swig_1_3_25 {
}
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined (__GNUC__)
# pragma GCC diagnostic pop
#endif

View File

@@ -28,6 +28,11 @@
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wself-assign"
#elif defined (__GNUC__)
# pragma GCC diagnostic push
# if __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wcast-function-type"
# endif
#endif
namespace Swig_1_3_33 {
#define SWIG_PYTHON_NO_BUILD_NONE
@@ -36,5 +41,7 @@ namespace Swig_1_3_33 {
}
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined (__GNUC__)
# pragma GCC diagnostic pop
#endif

View File

@@ -28,6 +28,11 @@
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wself-assign"
#elif defined (__GNUC__)
# pragma GCC diagnostic push
# if __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wcast-function-type"
# endif
#endif
namespace Swig_1_3_36 {
#define SWIG_PYTHON_NO_BUILD_NONE
@@ -36,5 +41,7 @@ namespace Swig_1_3_36 {
}
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined (__GNUC__)
# pragma GCC diagnostic pop
#endif

View File

@@ -28,6 +28,11 @@
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wself-assign"
#elif defined (__GNUC__)
# pragma GCC diagnostic push
# if __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wcast-function-type"
# endif
#endif
namespace Swig_1_3_38 {
#define SWIG_PYTHON_NO_BUILD_NONE
@@ -36,5 +41,7 @@ namespace Swig_1_3_38 {
}
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined (__GNUC__)
# pragma GCC diagnostic pop
#endif

View File

@@ -28,6 +28,11 @@
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wself-assign"
#elif defined (__GNUC__)
# pragma GCC diagnostic push
# if __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wcast-function-type"
# endif
#endif
namespace Swig_1_3_40 {
#define SWIG_PYTHON_NO_BUILD_NONE
@@ -36,5 +41,7 @@ namespace Swig_1_3_40 {
}
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined (__GNUC__)
# pragma GCC diagnostic pop
#endif

View File

@@ -159,7 +159,7 @@ namespace Py
)
{
ext_meth_def.ml_name = const_cast<char *>( _name );
ext_meth_def.ml_meth = reinterpret_cast<method_varargs_call_handler_t>( _handler );
ext_meth_def.ml_meth = reinterpret_cast<method_varargs_call_handler_t>(reinterpret_cast<void (*) (void)>(_handler));
ext_meth_def.ml_flags = METH_VARARGS|METH_KEYWORDS;
ext_meth_def.ml_doc = const_cast<char *>( _doc );

View File

@@ -159,7 +159,7 @@ namespace Py
)
{
ext_meth_def.ml_name = const_cast<char *>( _name );
ext_meth_def.ml_meth = reinterpret_cast<method_varargs_call_handler_t>( _handler );
ext_meth_def.ml_meth = reinterpret_cast<method_varargs_call_handler_t>(reinterpret_cast<void (*) (void)>(_handler));
ext_meth_def.ml_flags = METH_VARARGS|METH_KEYWORDS;
ext_meth_def.ml_doc = const_cast<char *>( _doc );

View File

@@ -148,7 +148,7 @@ static const PyMethodDef areaOverrides[] = {
"of this Area is used if section mode is 'Workplane'.",
},
{
"setDefaultParams",(PyCFunction)areaSetParams, METH_VARARGS|METH_KEYWORDS|METH_STATIC,
"setDefaultParams",reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>(areaSetParams)), METH_VARARGS|METH_KEYWORDS|METH_STATIC,
"setDefaultParams(key=value...):\n"
"Static method to set the default parameters of all following Path.Area, plus the following\n"
"additional parameters.\n"
@@ -158,13 +158,13 @@ static const PyMethodDef areaOverrides[] = {
"getDefaultParams(): Static method to return the current default parameters."
},
{
"abort",(PyCFunction)areaAbort, METH_VARARGS|METH_KEYWORDS|METH_STATIC,
"abort",reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>(areaAbort)), METH_VARARGS|METH_KEYWORDS|METH_STATIC,
"abort(aborting=True): Static method to abort any ongoing operation\n"
"\nTo ensure no stray abortion is left in the previous operation, it is advised to manually clear\n"
"the aborting flag by calling abort(False) before starting a new operation.",
},
{
"getParamsDesc",(PyCFunction)areaGetParamsDesc, METH_VARARGS|METH_KEYWORDS|METH_STATIC,
"getParamsDesc",reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>(areaGetParamsDesc)), METH_VARARGS|METH_KEYWORDS|METH_STATIC,
"getParamsDesc(as_string=False): Returns a list of supported parameters and their descriptions.\n"
"\n* as_string: if False, then return a dictionary of documents of all supported parameters."
},

View File

@@ -351,10 +351,11 @@ PyTypeObject @self.export.Name@::Type = {
PyMethodDef @self.export.Name@::Methods[] = {
+ for i in self.export.Methode:
{"@i.Name@",
(PyCFunction) staticCallback_@i.Name@,
+ if i.Keyword:
reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( staticCallback_@i.Name@ )),
METH_VARARGS|METH_KEYWORDS,
= else:
reinterpret_cast<PyCFunction>( staticCallback_@i.Name@ ),
METH_VARARGS,
-
"@i.Documentation.UserDocu.replace('\\n','\\\\n')@"