From: ageay Date: Thu, 22 Aug 2013 15:56:08 +0000 (+0000) Subject: Unwarningization under Win. X-Git-Tag: B4AnonymousThrow~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f251d37ea22fa5abf059567e3e8c39a5410328f2;p=modules%2Fmed.git Unwarningization under Win. --- diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 3aa679965..fbbd66c75 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -1161,7 +1161,10 @@ void DataArrayDouble::writeVTK(std::ostream& ofs, int indent, const char *nameIn { ofs << " format=\"appended\" offset=\"" << byteArr->getNumberOfTuples() << "\">"; INTERP_KERNEL::AutoPtr tmp(new float[getNbOfElems()]); - std::copy(begin(),end(),(float *)tmp); + float *pt(tmp); + // to make Visual C++ happy : instead of std::copy(begin(),end(),(float *)tmp); + for(const double *src=begin();src!=end();src++,pt++) + *pt=(int)*src; const char *data(reinterpret_cast((float *)tmp)); std::size_t sz(getNbOfElems()*sizeof(float)); byteArr->insertAtTheEnd(data,data+sz); @@ -1346,9 +1349,10 @@ DataArrayInt *DataArrayDouble::convertToIntArr() const DataArrayInt *ret=DataArrayInt::New(); ret->alloc(getNumberOfTuples(),getNumberOfComponents()); std::size_t nbOfVals=getNbOfElems(); - const double *src=getConstPointer(); int *dest=ret->getPointer(); - std::copy(src,src+nbOfVals,dest); + // to make Visual C++ happy : instead of std::copy(src,src+nbOfVals,dest); + for(const double *src=begin();src!=end();src++,dest++) + *dest=(int)*src; ret->copyStringInfoFrom(*this); return ret; }