Commit 63167235 authored by ghweber's avatar ghweber
Browse files

Merge from 2.3RC: Fix another BOV compile time issue.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@16052 18c085ea-50e0-402c-830e-de6fd14e8384
parent be856af5
......@@ -1652,6 +1652,10 @@ avtBOVFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// Replaced dynamic headerLength array with fixed maxHeaderLength array and
// added check whether header can be read.
//
// Gunther H. Weber, Wed Aug 31 10:19:21 PDT 2011
// Yet another fix for compiler issue. Since headerLen is unsigned short,
// reserve maximum possible length as buffer and skip test.
//
// ****************************************************************************
void
......@@ -1690,7 +1694,7 @@ avtBOVFileFormat::ReadTOC(void)
BroadcastBool(error);
EXCEPTION1(InvalidFilesException, fname);
}
short headerLength;
unsigned short headerLength;
ifile.read(reinterpret_cast<char*>(&headerLength), 2);
if (ifile.bad())
{
......@@ -1699,19 +1703,12 @@ avtBOVFileFormat::ReadTOC(void)
BroadcastBool(error);
}
#ifdef WORDS_BIGENDIAN
short tmp;
unsigned short tmp;
int16_Reverse_Endian(headerLength, reinterpret_cast<char*>(&tmp));
headerLength = tmp;
#endif
const int maxHeaderLength = 32768;
if (headerLength > maxHeaderLength)
{
debug1 << "Internal error: Header too long for buffer." << std::endl;
bool error=true;
BroadcastBool(error);
EXCEPTION1(InvalidFilesException, fname);
}
char header[maxHeaderLength];
// headerLength is "unsigned short" and thus always less than or equal 65535
char header[65535];
file_pattern = filenames[0]; // Filename is the same
byteOffset = 10 + headerLength; // Skip header when reading data
ifile.read(header, headerLength);
......
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