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@8885 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5944accd5f
commit
b92bf84691
1 changed files with 4 additions and 4 deletions
|
|
@ -24,10 +24,10 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
|||
} else {
|
||||
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
||||
if (pchar_descriptor) {
|
||||
char* vptr = 0;
|
||||
if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
|
||||
if (cptr) *cptr = vptr;
|
||||
if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
|
||||
void* vptr = 0;
|
||||
if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
|
||||
if (cptr) *cptr = (char *)vptr;
|
||||
if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
|
||||
if (alloc) *alloc = SWIG_OLDOBJ;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue