reduce the aliasing warnings (when compiling with CFLAGS='-O2 -Wstrict-aliasing=2') to the minimum, ie, enums and pointer to functions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8883 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
220a0ad055
commit
a2c99f619d
6 changed files with 34 additions and 23 deletions
|
|
@ -12,10 +12,10 @@
|
|||
SWIGINTERN int
|
||||
SWIG_AsValFilePtr(PyObject *obj, FILE **val) {
|
||||
static swig_type_info* desc = 0;
|
||||
FILE *ptr = 0;
|
||||
void *vptr = 0;
|
||||
if (!desc) desc = SWIG_TypeQuery("FILE *");
|
||||
if ((SWIG_ConvertPtr(obj,(void **)(&ptr), desc, 0)) == SWIG_OK) {
|
||||
if (val) *val = ptr;
|
||||
if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) {
|
||||
if (val) *val = (FILE *)vptr;
|
||||
return SWIG_OK;
|
||||
}
|
||||
if (PyFile_Check(obj)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue