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:
Marcelo Matus 2006-02-23 21:43:33 +00:00
commit a2c99f619d
6 changed files with 34 additions and 23 deletions

View file

@ -28,10 +28,10 @@ SWIG_AsWCharPtrAndSize(PyObject *obj, wchar_t **cptr, size_t *psize, int *alloc)
} else {
swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor();
if (pwchar_descriptor) {
wchar_t * vptr = 0;
if (SWIG_ConvertPtr(obj, (void**)&vptr, pwchar_descriptor, 0) == SWIG_OK) {
if (cptr) *cptr = vptr;
if (psize) *psize = vptr ? (wcslen(vptr) + 1) : 0;
void * vptr = 0;
if (SWIG_ConvertPtr(obj, &vptr, pwchar_descriptor, 0) == SWIG_OK) {
if (cptr) *cptr = (wchar_t *)vptr;
if (psize) *psize = vptr ? (wcslen((wchar_t *)vptr) + 1) : 0;
return SWIG_OK;
}
}