Commit 0dc32341 authored by T.J. Corona's avatar T.J. Corona Committed by Kitware Robot
Browse files

Merge topic 'update-metaio'

fc4d903c metaio: update to master
3972c2cc metaio: update to master
f059541f metaio: update to master
8bd5a1ff

 metaio: update to master
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !936
parents a7a1c103 fc4d903c
......@@ -16,7 +16,7 @@ src/doc
License.txt
"
readonly basehash='fc3537673c92fe781cb9ab0242ee95cba2f87b0e' # NEWHASH
readonly basehash='3972c2cc59a575f420dde9ba9e3dd85e52bf34e6' # NEWHASH
extract_source () {
git_archive
......
......@@ -1150,7 +1150,7 @@ M_ReadElements(METAIO_STREAM::ifstream * _fstream, void * _data,
_fstream->seekg(0, METAIO_STREAM::ios::beg);
}
unsigned char* compr = new unsigned char[m_CompressedElementDataSize];
unsigned char* compr = new unsigned char[static_cast<size_t>(m_CompressedElementDataSize)];
_fstream->read((char *)compr, (size_t)m_CompressedElementDataSize);
MET_PerformUncompression(compr, m_CompressedElementDataSize,
......@@ -1171,7 +1171,7 @@ M_ReadElements(METAIO_STREAM::ifstream * _fstream, void * _data,
else
{
_fstream->read((char *)_data, readSize);
int gc = _fstream->gcount();
int gc = static_cast<int>(_fstream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout
......
......@@ -333,7 +333,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaBlob: m_Read: data not read completely"
......@@ -416,7 +416,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
}
......
......@@ -416,7 +416,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaContour: m_Read: data not read completely"
......@@ -554,7 +554,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......@@ -618,7 +618,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaContour: m_Read: data not read completely"
......@@ -718,7 +718,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
}
......
......@@ -469,7 +469,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaLine: m_Read: data not read completely"
......@@ -660,7 +660,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......
......@@ -370,7 +370,7 @@ M_Read(void)
return 0; // end of stream. all was good
}
char c;
if ( ( c = this->m_ReadStream->get() ) != '<' )
if ( ( c = static_cast<char>(this->m_ReadStream->get()) ) != '<' )
{
std::string rest;
std::getline(*this->m_ReadStream, rest);
......@@ -1146,7 +1146,7 @@ bool MetaFEMObject::M_Read_Load(std::string load_name)
}
/** add a new MFCTerm to the lhs */
FEMObjectMFCTerm *mfcTerm = new FEMObjectMFCTerm(elementGN, DOF, Value);
FEMObjectMFCTerm *mfcTerm = new FEMObjectMFCTerm(elementGN, DOF, static_cast<float>(Value));
load->m_LHS.push_back(mfcTerm);
}
......
......@@ -554,7 +554,7 @@ InitializeEssential(int _nDims,
{
m_AutoFreeElementData = true;
MET_SizeOfType(m_ElementType, &i);
m_ElementData = new char[m_Quantity*m_ElementNumberOfChannels*i];
m_ElementData = new char[static_cast<size_t>(m_Quantity*m_ElementNumberOfChannels*i)];
if(m_ElementData == NULL)
{
METAIO_STREAM::cerr << "MetaImage:: M_Allocate:: Insufficient memory"
......@@ -986,7 +986,7 @@ ConvertElementDataTo(MET_ValueEnumType _elementType,
{
int eSize;
MET_SizeOfType(_elementType, &eSize);
void * newElementData = new char[m_Quantity*m_ElementNumberOfChannels*eSize];
void * newElementData = new char[static_cast<size_t>(m_Quantity*m_ElementNumberOfChannels*eSize)];
ElementByteOrderFix();
if(!ElementMinMaxValid())
......@@ -1205,7 +1205,7 @@ CanRead(const char *_headerName) const
char* buf = new char[8001];
inputStream.read(buf,8000);
unsigned long fileSize = inputStream.gcount();
unsigned long fileSize = static_cast<unsigned long>(inputStream.gcount());
buf[fileSize] = 0;
METAIO_STL::string header(buf);
header.resize(fileSize);
......@@ -2525,7 +2525,7 @@ M_ReadElements(METAIO_STREAM::ifstream * _fstream, void * _data,
_fstream->seekg(0, METAIO_STREAM::ios::beg);
}
unsigned char* compr = new unsigned char[m_CompressedDataSize];
unsigned char* compr = new unsigned char[static_cast<size_t>(m_CompressedDataSize)];
M_ReadElementData( _fstream, compr, m_CompressedDataSize );
......@@ -3203,7 +3203,7 @@ M_ReadElementsROI(METAIO_STREAM::ifstream * _fstream, void * _data,
if(subSamplingFactor > 1)
{
unsigned char* subdata = new unsigned char[bytesToRead];
unsigned char* subdata = new unsigned char[static_cast<size_t>(bytesToRead)];
METAIO_STL::streamoff rOff =
MET_UncompressStream(_fstream, seekoff, subdata,
bytesToRead, m_CompressedDataSize,
......@@ -3350,7 +3350,7 @@ M_ReadElementsROI(METAIO_STREAM::ifstream * _fstream, void * _data,
}
else // Binary data
{
char* subdata = new char[elementsToRead*elementNumberOfBytes];
char* subdata = new char[static_cast<size_t>(elementsToRead*elementNumberOfBytes)];
_fstream->read(subdata, size_t(elementsToRead*elementNumberOfBytes));
......
......@@ -330,7 +330,7 @@ M_Read(void)
MET_SizeOfType(m_ElementType, &elementSize);
METAIO_STL::streamsize readSize = m_NPoints*(m_NDims+4)*elementSize;
char* _data = new char[readSize];
char* _data = new char[static_cast<size_t>(readSize)];
m_ReadStream->read((char *)_data, readSize);
METAIO_STL::streamsize gc = m_ReadStream->gcount();
......@@ -411,7 +411,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......
......@@ -315,7 +315,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaLine: m_Read: data not read completely"
......@@ -429,7 +429,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognized characters
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognized characters
}
}
......
......@@ -446,7 +446,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaMesh: m_Read: Points not read completely"
......@@ -569,7 +569,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......@@ -625,7 +625,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaMesh: m_Read: Cells not read completely"
......@@ -695,7 +695,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognized characters
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognized characters
}
}
}
......@@ -747,7 +747,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaMesh: m_Read: Cell Link not read completely"
......@@ -830,7 +830,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognized characters
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognized characters
}
}
}
......@@ -880,7 +880,7 @@ M_Read(void)
char* _data = new char[pointDataSize];
m_ReadStream->read((char *)_data, pointDataSize);
unsigned int gc = m_ReadStream->gcount();
unsigned int gc = static_cast<unsigned int>(m_ReadStream->gcount());
if(gc != pointDataSize)
{
METAIO_STREAM::cout << "MetaMesh: m_Read: PointData not read completely"
......@@ -1046,7 +1046,7 @@ M_Read(void)
char* _celldata = new char[cellDataSize];
m_ReadStream->read((char *)_celldata, cellDataSize);
unsigned int gcCell = m_ReadStream->gcount();
unsigned int gcCell = static_cast<unsigned int>(m_ReadStream->gcount());
if(gcCell != cellDataSize)
{
METAIO_STREAM::cout << "MetaMesh: m_Read: data not read completely"
......
......@@ -1405,7 +1405,7 @@ M_SetupWriteFields(void)
{
mF = new MET_FieldRecordType;
MET_InitWriteField(mF, "CompressedDataSize", MET_UINT,
m_CompressedDataSize);
static_cast<double>(m_CompressedDataSize));
m_Fields.push_back(mF);
}
}
......
......@@ -306,7 +306,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaSurface: m_Read: data not read completely"
......@@ -400,7 +400,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......
......@@ -514,7 +514,7 @@ M_Read(void)
char* _data = new char[parametersDimension*sizeof(double)];
m_ReadStream->read((char *)_data, parametersDimension*sizeof(double));
unsigned int gc = m_ReadStream->gcount();
unsigned int gc = static_cast<unsigned int>(m_ReadStream->gcount());
if(gc != parametersDimension*sizeof(double))
{
METAIO_STREAM::cout << "MetaTransform: m_Read: data not read completely"
......
......@@ -497,7 +497,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaLine: m_Read: data not read completely"
......@@ -705,7 +705,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......
......@@ -402,7 +402,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaLine: m_Read: data not read completely"
......@@ -489,7 +489,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (!m_ReadStream->eof()))
{
c = m_ReadStream->get();// to avoid unrecognize charactere
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognize charactere
}
}
......
......@@ -581,7 +581,7 @@ METAIO_STL::streamoff MET_UncompressStream(METAIO_STREAM::ifstream * stream,
firstchunk = false;
}
unsigned char* outdata = new unsigned char[buffersize];
unsigned char* outdata = new unsigned char[static_cast<size_t>(buffersize)];
d_stream->avail_out = (uInt)( buffersize );
......@@ -597,12 +597,12 @@ METAIO_STL::streamoff MET_UncompressStream(METAIO_STREAM::ifstream * stream,
inputBufferSize = compressedDataSize-zseekpos;
}
unsigned char* inputBuffer = new unsigned char[inputBufferSize];
unsigned char* inputBuffer = new unsigned char[static_cast<size_t>(inputBufferSize)];
stream->seekg(currentPos+zseekpos,METAIO_STREAM::ios::beg);
stream->read((char *)inputBuffer, (size_t)inputBufferSize);
d_stream->next_in = inputBuffer;
d_stream->avail_in = stream->gcount();
d_stream->avail_in = static_cast<int>(stream->gcount());
d_stream->next_out = outdata;
int inflate_error = inflate(d_stream, Z_NO_FLUSH);
......@@ -701,9 +701,9 @@ unsigned char * MET_PerformCompression(const unsigned char * source,
METAIO_STL::streamoff buffer_size = sourceSize;
unsigned char * input_buffer = const_cast<unsigned char *>(source);
unsigned char * output_buffer = new unsigned char[buffer_size];
unsigned char * output_buffer = new unsigned char[static_cast<size_t>(buffer_size)];
compressedData = new unsigned char[buffer_size];
compressedData = new unsigned char[static_cast<size_t>(buffer_size)];
deflateInit(&z, compression_rate);
......@@ -727,7 +727,7 @@ unsigned char * MET_PerformCompression(const unsigned char * source,
// when the output is bigger than the input (true for small images)
if(j+count>=buffer_size)
{
unsigned char* compressedDataTemp = new unsigned char[j+count+1];
unsigned char* compressedDataTemp = new unsigned char[static_cast<size_t>(j+count+1)];
memcpy(compressedDataTemp,compressedData,(size_t)buffer_size);
delete [] compressedData;
compressedData = compressedDataTemp;
......@@ -744,7 +744,7 @@ unsigned char * MET_PerformCompression(const unsigned char * source,
{
if(j+count>=buffer_size)
{
unsigned char* compressedDataTemp = new unsigned char[j+count+1];
unsigned char* compressedDataTemp = new unsigned char[static_cast<size_t>(j+count+1)];
memcpy(compressedDataTemp,compressedData,(size_t)buffer_size);
delete [] compressedData;
compressedData = compressedDataTemp;
......@@ -1022,7 +1022,7 @@ static bool MET_SkipToVal(METAIO_STREAM::istream &fp)
return false;
}
fp.putback(c);
fp.putback(static_cast<char>(c));
return true;
}
......@@ -1066,17 +1066,17 @@ bool MET_Read(METAIO_STREAM::istream &fp,
while(!fp.eof())
{
i = 0;
c = fp.get();
c = static_cast<unsigned char>(fp.get());
while(!fp.eof() && c != MET_SeperatorChar && c != ':'
&& isspace(c))
{
c = fp.get();
c = static_cast<unsigned char>(fp.get());
}
// save name up to separator or end of line
while(!fp.eof() && c != MET_SeperatorChar && c != ':' && c != '\r' && c != '\n' && i<500)
{
s[i++] = c;
c = fp.get();
c = static_cast<unsigned char>(fp.get());
}
if(fp.eof() || i >= 500)
{
......@@ -1118,7 +1118,7 @@ bool MET_Read(METAIO_STREAM::istream &fp,
{
break;
}
c = fp.get();
c = static_cast<unsigned char>(fp.get());
(*fieldIter)->value[0] = (double)c;
fp.getline( s, 500 );
break;
......
......@@ -614,7 +614,7 @@ M_Read(void)
char* _data = new char[readSize];
m_ReadStream->read((char *)_data, readSize);
int gc = m_ReadStream->gcount();
int gc = static_cast<int>(m_ReadStream->gcount());
if(gc != readSize)
{
METAIO_STREAM::cout << "MetaLine: m_Read: data not read completely"
......@@ -950,7 +950,7 @@ M_Read(void)
char c = ' ';
while( (c!='\n') && (m_ReadStream->good()))
{
c = m_ReadStream->get();// to avoid unrecognized characters
c = static_cast<char>(m_ReadStream->get());// to avoid unrecognized characters
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment