Commit 8bd5a1ff authored by Kitware Robot's avatar Kitware Robot Committed by T.J. Corona
Browse files

metaio: update to master

Code extracted from:

    https://github.com/Kitware/MetaIO.git

at commit e55aeb64b239b077af2629625d9ff315915745f2.
parent fc353767
......@@ -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);
}
......
......@@ -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);
......
......@@ -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
}
}
......
......@@ -602,7 +602,7 @@ METAIO_STL::streamoff MET_UncompressStream(METAIO_STREAM::ifstream * stream,
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);
......@@ -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