-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
/*!
* Returns an integer value characterizing \a this array, which is useful for a quick
- * comparison of many instances of DataArrayInt.
- * \return int - the hash value.
+ * comparison of many instances of DataArrayChar.
+ * \return mcIdType - the hash value.
* \throw If \a this is not allocated.
*/
-int DataArrayChar::getHashCode() const
+mcIdType DataArrayChar::getHashCode() const
{
checkAllocated();
std::size_t nbOfElems=getNbOfElems();
- int ret=nbOfElems*65536;
- int delta=3;
+ std::size_t ret=nbOfElems*65536;
+ std::size_t delta=3;
if(nbOfElems>48)
delta=nbOfElems/8;
- int ret0=0;
+ mcIdType ret0=0;
const char *pt=begin();
for(std::size_t i=0;i<nbOfElems;i+=delta)
ret0+=pt[i];
- return ret+ret0;
+ return ToIdType(ret)+ret0;
}
/*!
}
/*!
- * Creates a new DataArrayInt and assigns all (textual and numerical) data of \a this
+ * Creates a new DataArrayIdType and assigns all (textual and numerical) data of \a this
* array to the new one.
- * \return DataArrayInt * - the new instance of DataArrayChar.
+ * \return DataArrayIdType * - the new instance of DataArrayChar.
*/
DataArrayInt *DataArrayChar::convertToIntArr() const
{
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayChar::isUniform : must be applied on DataArrayChar with only one component, you can call 'rearrange' method before !");
- int nbOfTuples=getNumberOfTuples();
+ mcIdType nbOfTuples=getNumberOfTuples();
const char *w=getConstPointer();
const char *end2=w+nbOfTuples;
for(;w!=end2;w++)
throw INTERP_KERNEL::Exception("DataArrayChar::meldWith : DataArrayChar pointer in input is NULL !");
checkAllocated();
other->checkAllocated();
- int nbOfTuples=getNumberOfTuples();
+ mcIdType nbOfTuples=getNumberOfTuples();
if(nbOfTuples!=other->getNumberOfTuples())
throw INTERP_KERNEL::Exception("DataArrayChar::meldWith : mismatch of number of tuples !");
- int nbOfComp1=getNumberOfComponents();
- int nbOfComp2=other->getNumberOfComponents();
+ std::size_t nbOfComp1=getNumberOfComponents();
+ std::size_t nbOfComp2=other->getNumberOfComponents();
char *newArr=(char *)malloc(nbOfTuples*(nbOfComp1+nbOfComp2)*sizeof(char));
char *w=newArr;
const char *inp1=getConstPointer();
const char *inp2=other->getConstPointer();
- for(int i=0;i<nbOfTuples;i++,inp1+=nbOfComp1,inp2+=nbOfComp2)
+ for(mcIdType i=0;i<nbOfTuples;i++,inp1+=nbOfComp1,inp2+=nbOfComp2)
{
w=std::copy(inp1,inp1+nbOfComp1,w);
w=std::copy(inp2,inp2+nbOfComp2,w);
}
- useArray(newArr,true,C_DEALLOC,nbOfTuples,nbOfComp1+nbOfComp2);
- std::vector<int> compIds(nbOfComp2);
- for(int i=0;i<nbOfComp2;i++)
+ useArray(newArr,true,DeallocType::C_DEALLOC,nbOfTuples,nbOfComp1+nbOfComp2);
+ std::vector<std::size_t> compIds(nbOfComp2);
+ for(std::size_t i=0;i<nbOfComp2;i++)
compIds[i]=nbOfComp1+i;
copyPartOfStringInfoFrom2(compIds,*other);
}
/*!
- * Creates a new DataArrayChar containing IDs (indices) of tuples holding value equal to a
+ * Creates a new DataArrayIdType containing IDs (indices) of tuples holding value equal to a
* given one.
* \param [in] val - the value to find within \a this.
- * \return DataArrayChar * - a new instance of DataArrayChar. The caller is to delete this
+ * \return DataArrayIdType * - a new instance of DataArrayIdType. The caller is to delete this
* array using decrRef() as it is no more needed.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayChar::findIdsEqual(char val) const
+DataArrayIdType *DataArrayChar::findIdsEqual(char val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayChar::findIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
const char *cptr=getConstPointer();
- MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
- int nbOfTuples=getNumberOfTuples();
- for(int i=0;i<nbOfTuples;i++,cptr++)
+ MCAuto<DataArrayIdType> ret(DataArrayIdType::New()); ret->alloc(0,1);
+ mcIdType nbOfTuples=getNumberOfTuples();
+ for(mcIdType i=0;i<nbOfTuples;i++,cptr++)
if(*cptr==val)
ret->pushBackSilent(i);
return ret.retn();
}
/*!
- * Creates a new DataArrayChar containing IDs (indices) of tuples holding value \b not
+ * Creates a new DataArrayIdType containing IDs (indices) of tuples holding value \b not
* equal to a given one.
* \param [in] val - the value to ignore within \a this.
* \return DataArrayChar * - a new instance of DataArrayChar. The caller is to delete this
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayChar::findIdsNotEqual(char val) const
+DataArrayIdType *DataArrayChar::findIdsNotEqual(char val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayChar::findIdsNotEqual : the array must have only one component, you can call 'rearrange' method before !");
const char *cptr=getConstPointer();
- MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
- int nbOfTuples=getNumberOfTuples();
- for(int i=0;i<nbOfTuples;i++,cptr++)
+ MCAuto<DataArrayIdType> ret(DataArrayIdType::New()); ret->alloc(0,1);
+ mcIdType nbOfTuples=getNumberOfTuples();
+ for(mcIdType i=0;i<nbOfTuples;i++,cptr++)
if(*cptr!=val)
ret->pushBackSilent(i);
return ret.retn();
* This method differs from DataArrayChar::findIdFirstEqualTuple in that the position is internal raw data is not considered here contrary to DataArrayChar::findIdFirstEqualTuple.
* \sa DataArrayChar::findIdFirstEqualTuple
*/
-int DataArrayChar::findIdSequence(const std::vector<char>& vals) const
+mcIdType DataArrayChar::findIdSequence(const std::vector<char>& vals) const
{
checkAllocated();
- int nbOfCompo=getNumberOfComponents();
- if(nbOfCompo!=1)
+ if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayChar::findIdSequence : works only for DataArrayChar instance with one component !");
const char *cptr=getConstPointer();
std::size_t nbOfVals=getNbOfElems();
const char *loc=std::search(cptr,cptr+nbOfVals,vals.begin(),vals.end());
if(loc!=cptr+nbOfVals)
- return std::distance(cptr,loc);
+ return ToIdType(std::distance(cptr,loc));
return -1;
}
* \return tuple id where \b tupl is. -1 if no such tuple exists in \b this.
* \sa DataArrayChar::findIdSequence.
*/
-int DataArrayChar::findIdFirstEqualTuple(const std::vector<char>& tupl) const
+mcIdType DataArrayChar::findIdFirstEqualTuple(const std::vector<char>& tupl) const
{
checkAllocated();
- int nbOfCompo=getNumberOfComponents();
+ std::size_t nbOfCompo=getNumberOfComponents();
if(nbOfCompo==0)
throw INTERP_KERNEL::Exception("DataArrayChar::findIdFirstEqualTuple : 0 components in 'this' !");
- if(nbOfCompo!=(int)tupl.size())
+ if(nbOfCompo!=tupl.size())
{
std::ostringstream oss; oss << "DataArrayChar::findIdFirstEqualTuple : 'this' contains " << nbOfCompo << " components and searching for a tuple of length " << tupl.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
if(std::distance(cptr,work)%nbOfCompo!=0)
work++;
else
- return std::distance(cptr,work)/nbOfCompo;
+ return ToIdType(std::distance(cptr,work)/nbOfCompo);
}
}
return -1;
* If not any tuple contains \b value -1 is returned.
* \sa DataArrayChar::presenceOfValue
*/
-int DataArrayChar::findIdFirstEqual(char value) const
+mcIdType DataArrayChar::findIdFirstEqual(char value) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayChar::presenceOfValue : the array must have only one component, you can call 'rearrange' method before !");
const char *cptr=getConstPointer();
- int nbOfTuples=getNumberOfTuples();
+ mcIdType nbOfTuples=getNumberOfTuples();
const char *ret=std::find(cptr,cptr+nbOfTuples,value);
if(ret!=cptr+nbOfTuples)
- return std::distance(cptr,ret);
+ return ToIdType(std::distance(cptr,ret));
return -1;
}
* If not any tuple contains one of the values contained in 'vals' false is returned.
* \sa DataArrayChar::presenceOfValue
*/
-int DataArrayChar::findIdFirstEqual(const std::vector<char>& vals) const
+mcIdType DataArrayChar::findIdFirstEqual(const std::vector<char>& vals) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::presenceOfValue : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::findIdFirstEqual : the array must have only one component, you can call 'rearrange' method before !");
std::set<char> vals2(vals.begin(),vals.end());
const char *cptr=getConstPointer();
- int nbOfTuples=getNumberOfTuples();
+ mcIdType nbOfTuples=getNumberOfTuples();
for(const char *w=cptr;w!=cptr+nbOfTuples;w++)
if(vals2.find(*w)!=vals2.end())
- return std::distance(cptr,w);
+ return ToIdType(std::distance(cptr,w));
return -1;
}
* \param [in] vmax end of range. This value is \b not included in range.
* \return a newly allocated data array that the caller should deal with.
*/
-DataArrayInt *DataArrayChar::findIdsInRange(char vmin, char vmax) const
+DataArrayIdType *DataArrayChar::findIdsInRange(char vmin, char vmax) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayChar::findIdsInRange : this must have exactly one component !");
const char *cptr=getConstPointer();
- MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
- int nbOfTuples=getNumberOfTuples();
- for(int i=0;i<nbOfTuples;i++,cptr++)
+ MCAuto<DataArrayIdType> ret=DataArrayIdType::New(); ret->alloc(0,1);
+ mcIdType nbOfTuples=getNumberOfTuples();
+ for(mcIdType i=0;i<nbOfTuples;i++,cptr++)
if(*cptr>=vmin && *cptr<vmax)
ret->pushBackSilent(i);
return ret.retn();
/*!
* Returns a new DataArrayChar by concatenating two given arrays, so that (1) the number
- * of tuples in the result array is <em> a1->getNumberOfTuples() + a2->getNumberOfTuples() -
- * offsetA2</em> and (2)
+ * of tuples in the result array is <em> a1->getNumberOfTuples() + a2->getNumberOfTuples() </em> and (2)
* the number of component in the result array is same as that of each of given arrays.
- * First \a offsetA2 tuples of \a a2 are skipped and thus are missing from the result array.
* Info on components is copied from the first of the given arrays. Number of components
* in the given arrays must be the same.
* \param [in] a1 - an array to include in the result array.
* \param [in] a2 - another array to include in the result array.
- * \param [in] offsetA2 - number of tuples of \a a2 to skip.
* \return DataArrayChar * - the new instance of DataArrayChar.
* The caller is to delete this result array using decrRef() as it is no more
* needed.
if(a.empty())
throw INTERP_KERNEL::Exception("DataArrayChar::Aggregate : input list must be NON EMPTY !");
std::vector<const DataArrayChar *>::const_iterator it=a.begin();
- int nbOfComp=(*it)->getNumberOfComponents();
- int nbt=(*it++)->getNumberOfTuples();
- for(int i=1;it!=a.end();it++,i++)
+ std::size_t nbOfComp((*it)->getNumberOfComponents());
+ mcIdType nbt=(*it++)->getNumberOfTuples();
+ for(;it!=a.end();it++)
{
if((*it)->getNumberOfComponents()!=nbOfComp)
throw INTERP_KERNEL::Exception("DataArrayChar::Aggregate : Nb of components mismatch for array aggregation !");
for(it=a.begin();it!=a.end();it++)
(*it)->checkAllocated();
it=a.begin();
- int nbOfTuples=(*it)->getNumberOfTuples();
- std::vector<int> nbc(a.size());
+ mcIdType nbOfTuples=(*it)->getNumberOfTuples();
+ std::vector<std::size_t> nbc(a.size());
std::vector<const char *> pts(a.size());
nbc[0]=(*it)->getNumberOfComponents();
pts[0]=(*it++)->getConstPointer();
- for(int i=1;it!=a.end();it++,i++)
+ for(std::size_t i=1;it!=a.end();it++,i++)
{
if(nbOfTuples!=(*it)->getNumberOfTuples())
throw INTERP_KERNEL::Exception("DataArrayChar::meld : mismatch of number of tuples !");
nbc[i]=(*it)->getNumberOfComponents();
pts[i]=(*it)->getConstPointer();
}
- int totalNbOfComp=std::accumulate(nbc.begin(),nbc.end(),0);
+ std::size_t totalNbOfComp=std::accumulate(nbc.begin(),nbc.end(),(std::size_t)0);
DataArrayChar *ret=a[0]->buildEmptySpecializedDAChar();
ret->alloc(nbOfTuples,totalNbOfComp);
char *retPtr=ret->getPointer();
- for(int i=0;i<nbOfTuples;i++)
- for(int j=0;j<(int)a.size();j++)
+ for(mcIdType i=0;i<nbOfTuples;i++)
+ for(std::size_t j=0;j<a.size();j++)
{
retPtr=std::copy(pts[j],pts[j]+nbc[j],retPtr);
pts[j]+=nbc[j];
}
- int k=0;
- for(int i=0;i<(int)a.size();i++)
- for(int j=0;j<nbc[i];j++,k++)
+ std::size_t k=0;
+ for(std::size_t i=0;i<a.size();i++)
+ for(std::size_t j=0;j<nbc[i];j++,k++)
ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j));
return ret;
}
void DataArrayByte::reprWithoutNameStream(std::ostream& stream) const
{
DataArray::reprWithoutNameStream(stream);
- if(_mem.reprHeader(getNumberOfComponents(),stream))
+ if(_mem.reprHeader(ToIdType(getNumberOfComponents()),stream))
{
const char *data=begin();
- int nbOfTuples=getNumberOfTuples();
- int nbCompo=getNumberOfComponents();
- for(int i=0;i<nbOfTuples;i++,data+=nbCompo)
+ mcIdType nbOfTuples=getNumberOfTuples();
+ std::size_t nbCompo=getNumberOfComponents();
+ for(mcIdType i=0;i<nbOfTuples;i++,data+=nbCompo)
{
stream << "Tuple #" << i << " : ";
std::copy(data,data+nbCompo,std::ostream_iterator<int>(stream," "));//it is not a bug int here not char because it is not ASCII here contrary to DataArrayAsciiChar
void DataArrayByte::reprZipWithoutNameStream(std::ostream& stream) const
{
DataArray::reprWithoutNameStream(stream);
- _mem.reprZip(getNumberOfComponents(),stream);
+ _mem.reprZip(ToIdType(getNumberOfComponents()),stream);
}
void DataArrayByte::reprCppStream(const std::string& varName, std::ostream& stream) const
{
- int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
+ mcIdType nbTuples=getNumberOfTuples();
+ std::size_t nbComp=getNumberOfComponents();
const char *data=getConstPointer();
stream << "DataArrayByte *" << varName << "=DataArrayByte::New();" << std::endl;
if(nbTuples*nbComp>=1)
stream << "DataArrayByte C++ instance at " << this << ". ";
if(isAllocated())
{
- int nbOfCompo=(int)_info_on_compo.size();
+ std::size_t nbOfCompo=_info_on_compo.size();
if(nbOfCompo>=1)
{
- int nbOfTuples=getNumberOfTuples();
+ mcIdType nbOfTuples=getNumberOfTuples();
stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl;
reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR);
}
void DataArrayByte::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const
{
const char *data=begin();
- int nbOfTuples=getNumberOfTuples();
- int nbOfCompo=(int)_info_on_compo.size();
+ mcIdType nbOfTuples=getNumberOfTuples();
+ std::size_t nbOfCompo=_info_on_compo.size();
std::ostringstream oss2; oss2 << "[";
std::string oss2Str(oss2.str());
bool isFinished=true;
- for(int i=0;i<nbOfTuples && isFinished;i++)
+ for(mcIdType i=0;i<nbOfTuples && isFinished;i++)
{
if(nbOfCompo>1)
{
oss2 << "(";
- for(int j=0;j<nbOfCompo;j++,data++)
+ for(std::size_t j=0;j<nbOfCompo;j++,data++)
{
oss2 << (int)*data;
if(j!=nbOfCompo-1) oss2 << ", ";
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayByte::toVectorOfBool : this method can be used only if this has one component !");
- int nbt(getNumberOfTuples());
+ mcIdType nbt(getNumberOfTuples());
std::vector<bool> ret(nbt,false);
const char *pt(begin());
- for(int i=0;i<nbt;i++,pt++)
+ for(mcIdType i=0;i<nbt;i++,pt++)
if(*pt!=0)
ret[i]=true;
return ret;
return 0;
}
-DataArrayByteTuple::DataArrayByteTuple(char *pt, int nbOfComp):_pt(pt),_nb_of_compo(nbOfComp)
+DataArrayByteTuple::DataArrayByteTuple(char *pt, std::size_t nbOfComp):_pt(pt),_nb_of_compo(nbOfComp)
{
}
std::string DataArrayByteTuple::repr() const
{
std::ostringstream oss; oss << "(";
- for(int i=0;i<_nb_of_compo-1;i++)
+ for(std::size_t i=0;i<_nb_of_compo-1;i++)
oss << (int)_pt[i] << ", ";
oss << _pt[_nb_of_compo-1] << ")";
return oss.str();
* This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or
* \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem.
*/
-DataArrayByte *DataArrayByteTuple::buildDAByte(int nbOfTuples, int nbOfCompo) const
+DataArrayByte *DataArrayByteTuple::buildDAByte(std::size_t nbOfTuples, std::size_t nbOfCompo) const
{
if((_nb_of_compo==nbOfCompo && nbOfTuples==1) || (_nb_of_compo==nbOfTuples && nbOfCompo==1))
{
{
std::size_t lgth=st.length();
if(lgth==0)
- throw INTERP_KERNEL::Exception("DataArrayAsciiChar contructor with string ! Size of input string is null !");
+ throw INTERP_KERNEL::Exception("DataArrayAsciiChar constructor with string ! Size of input string is null !");
alloc(1,lgth);
std::copy(st.begin(),st.begin()+lgth,getPointer());
}
DataArrayAsciiChar::DataArrayAsciiChar(const std::vector<std::string>& vst, char defaultChar)
{
if(vst.empty())
- throw INTERP_KERNEL::Exception("DataArrayAsciiChar contructor with vector of strings ! Empty array !");
+ throw INTERP_KERNEL::Exception("DataArrayAsciiChar constructor with vector of strings ! Empty array !");
std::size_t nbCompo=0;
for(std::vector<std::string>::const_iterator it=vst.begin();it!=vst.end();it++)
nbCompo=std::max(nbCompo,(*it).length());
if(nbCompo==0)
- throw INTERP_KERNEL::Exception("DataArrayAsciiChar contructor with vector of strings ! All strings in not empty vector are empty !");
- int nbTuples=(int)vst.size();
- alloc(nbTuples,(int)nbCompo);
+ throw INTERP_KERNEL::Exception("DataArrayAsciiChar constructor with vector of strings ! All strings in not empty vector are empty !");
+ std::size_t nbTuples=vst.size();
+ alloc(nbTuples,nbCompo);
char *pt=getPointer();
- for(int i=0;i<nbTuples;i++,pt+=nbCompo)
+ for(std::size_t i=0;i<nbTuples;i++,pt+=nbCompo)
{
const std::string& tmp=vst[i];
std::size_t sz=tmp.length();
void DataArrayAsciiChar::reprWithoutNameStream(std::ostream& stream) const
{
DataArray::reprWithoutNameStream(stream);
- if(_mem.reprHeader(getNumberOfComponents(),stream))
+ if(_mem.reprHeader(ToIdType(getNumberOfComponents()),stream))
{
const char *data=begin();
- int nbOfTuples=getNumberOfTuples();
- int nbCompo=getNumberOfComponents();
- for(int i=0;i<nbOfTuples;i++,data+=nbCompo)
+ mcIdType nbOfTuples=getNumberOfTuples();
+ std::size_t nbCompo=getNumberOfComponents();
+ for(mcIdType i=0;i<nbOfTuples;i++,data+=nbCompo)
{
stream << "Tuple #" << i << " : \"";
std::copy(data,data+nbCompo,std::ostream_iterator<char>(stream));
void DataArrayAsciiChar::reprCppStream(const std::string& varName, std::ostream& stream) const
{
- int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
+ mcIdType nbTuples=getNumberOfTuples();
+ std::size_t nbComp=getNumberOfComponents();
const char *data=getConstPointer();
stream << "DataArrayAsciiChar *" << varName << "=DataArrayAsciiChar::New();" << std::endl;
if(nbTuples*nbComp>=1)
stream << "DataArrayAsciiChar C++ instance at " << this << ". ";
if(isAllocated())
{
- int nbOfCompo=(int)_info_on_compo.size();
+ std::size_t nbOfCompo=_info_on_compo.size();
if(nbOfCompo>=1)
{
- int nbOfTuples=getNumberOfTuples();
+ mcIdType nbOfTuples=getNumberOfTuples();
stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl;
reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR);
}
void DataArrayAsciiChar::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const
{
const char *data=begin();
- int nbOfTuples=getNumberOfTuples();
- int nbOfCompo=(int)_info_on_compo.size();
+ mcIdType nbOfTuples=getNumberOfTuples();
+ std::size_t nbOfCompo=_info_on_compo.size();
std::ostringstream oss2; oss2 << "[";
std::string oss2Str(oss2.str());
bool isFinished=true;
- for(int i=0;i<nbOfTuples && isFinished;i++)
+ for(mcIdType i=0;i<nbOfTuples && isFinished;i++)
{
bool isAscii=true;
- for(int j=0;j<nbOfCompo;j++)
+ for(std::size_t j=0;j<nbOfCompo;j++)
if(data[j]<32) isAscii=false;
if(isAscii)
{
oss2 << "\'";
- for(int j=0;j<nbOfCompo;j++,data++)
+ for(std::size_t j=0;j<nbOfCompo;j++,data++)
oss2 << *data;
oss2 << "\'";
}
else
{
oss2 << "(";
- for(int j=0;j<nbOfCompo;j++,data++)
+ for(std::size_t j=0;j<nbOfCompo;j++,data++)
{
oss2 << (int)*data;
if(j!=nbOfCompo-1) oss2 << ", ";
return 0;
}
-DataArrayAsciiCharTuple::DataArrayAsciiCharTuple(char *pt, int nbOfComp):_pt(pt),_nb_of_compo(nbOfComp)
+DataArrayAsciiCharTuple::DataArrayAsciiCharTuple(char *pt, std::size_t nbOfComp):_pt(pt),_nb_of_compo(nbOfComp)
{
}
* This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or
* \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem.
*/
-DataArrayAsciiChar *DataArrayAsciiCharTuple::buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const
+DataArrayAsciiChar *DataArrayAsciiCharTuple::buildDAAsciiChar(std::size_t nbOfTuples, std::size_t nbOfCompo) const
{
if((_nb_of_compo==nbOfCompo && nbOfTuples==1) || (_nb_of_compo==nbOfTuples && nbOfCompo==1))
{