]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
warning hunting in swig
authorgeay <anthony.geay@cea.fr>
Tue, 25 Feb 2014 11:10:49 +0000 (12:10 +0100)
committergeay <anthony.geay@cea.fr>
Tue, 25 Feb 2014 11:10:49 +0000 (12:10 +0100)
src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i
src/MEDCoupling_Swig/MEDCouplingMemArray.i

index 2b58e63660ab4f1538b415b54388c1b14d608728..4b890dc50d3c470a10aa51c490608719811fb991 100644 (file)
@@ -270,7 +270,9 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype
         {
           ret->useArray(reinterpret_cast<const T *>(data),true,ParaMEDMEM::C_DEALLOC,sz0,sz1);
           PyObject *ref=PyWeakref_NewRef(reinterpret_cast<PyObject *>(eltOwning),NULL);
-          void **objs=new void *[2]; objs[0]=ref; objs[1]=(void*) ParaMEDMEM::MemArray<T>::CDeallocator;
+          typename ParaMEDMEM::MemArray<T>::Deallocator tmp(ParaMEDMEM::MemArray<T>::CDeallocator);
+          void **tmp2(reinterpret_cast<void**>(&tmp));
+          void **objs=new void *[2]; objs[0]=ref; objs[1]=*tmp2;
           mma.setParameterForDeallocator(objs);
           mma.setSpecificDeallocator(numarrdeal);
         }
@@ -368,13 +370,15 @@ PyObject *ToNumPyArray(MCData *self, int npyObjectType, const char *MCDataStr)
   npy_intp dim[2];
   dim[0]=(npy_intp)self->getNumberOfTuples(); dim[1]=nbComp;
   const T *bg=self->getConstPointer();
-  PyObject *ret=PyArray_SimpleNewFromData(nbDims,dim,npyObjectType,const_cast<T *>(bg));
+  PyObject *ret(PyArray_SimpleNewFromData(nbDims,dim,npyObjectType,const_cast<T *>(bg)));
   if(mem.isDeallocatorCalled())
     {
       if(mem.getDeallocator()!=numarrdeal)
         {// case for the first call of toNumPyArray
-          PyObject *ref=PyWeakref_NewRef(ret,NULL);
-          void **objs=new void *[2]; objs[0]=ref; objs[1]=(void*) mem.getDeallocator();
+          PyObject *ref(PyWeakref_NewRef(ret,NULL));
+          typename ParaMEDMEM::MemArray<T>::Deallocator tmp(mem.getDeallocator());
+          void **tmp2(reinterpret_cast<void**>(&tmp));
+          void **objs=new void *[2]; objs[0]=reinterpret_cast<void*>(ref); objs[1]=*tmp2;
           mem.setParameterForDeallocator(objs);
           mem.setSpecificDeallocator(numarrdeal);
           return ret;
index cbca5915eccefdc761a5a4bd9614078d47b31e24..dbdc40bec13a41ffc9aad345f0a97f2389b34ba7 100644 (file)
@@ -697,6 +697,7 @@ namespace ParaMEDMEM
 #endif
         else
           throw INTERP_KERNEL::Exception(msg.c_str());
+        throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
       }
    
       DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
@@ -2704,6 +2705,7 @@ namespace ParaMEDMEM
 #endif
         else
           throw INTERP_KERNEL::Exception(msg.c_str());
+        throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
       }
 
       DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)