Commit 6a63712f authored by hkrishna's avatar hkrishna

warning fixes for databases directory

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23666 18c085ea-50e0-402c-830e-de6fd14e8384
parent 4559cd1b
......@@ -43,7 +43,8 @@
#include <AMRPluginInfo.h>
#include <visit-config.h>
extern "C" DBP_EXPORT const char *AMRVisItPluginVersion = VISIT_VERSION;
//extern "C" DBP_EXPORT const char *AMRVisItPluginVersion = VISIT_VERSION;
VISIT_PLUGIN_VERSION(AMR,DBP_EXPORT)
// ****************************************************************************
// Function: GetGeneralInfo
......
......@@ -80,7 +80,7 @@ AMRreader::getInfo( const char* filename )
}
hsize_t nobjs;
herr_t err = H5Gget_num_objs( file_id, &nobjs );
herr_t err = H5Gget_num_objs( file_id, &nobjs ); (void) err;
debug2 << "nobjs in " << filename << " is " << nobjs << "\n";
for( hsize_t i=0; i<nobjs; i++ )
{
......@@ -88,7 +88,7 @@ AMRreader::getInfo( const char* filename )
if( type == H5G_GROUP )
{
char name[1000];
ssize_t l= H5Gget_objname_by_idx( file_id, i, name, 1000 );
ssize_t l= H5Gget_objname_by_idx( file_id, i, name, 1000 ); (void)l;
hid_t gid = H5Gopen1( file_id, name );
......
......@@ -170,7 +170,7 @@ AMRreaderWithLevels::MakeOctTree()
first_subdivide8(xMin, yMin, zMin, xMax, yMax, zMax, p.key, maxLevels);
// Make a map of bid to key.
for(int i = 0; i < patches.size(); ++i)
for(size_t i = 0; i < patches.size(); ++i)
blkkey2bid[patches[i].key] = i;
}
......
......@@ -48,7 +48,7 @@ float JwlEOS::T_from_r_e( float r, float e )
float JwlEOS::a_from_r_e( float r, float e )
{
float ri,r1i,r2i,c1,c2,p,d1,d2,d3,a;
float ri,r1i,r2i,c1,c2,d1,d2,d3,a;
ri = 1./r;
r1i= R1 * ri;
r2i= R2 * ri;
......
......@@ -275,7 +275,7 @@ avtAMRFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
#ifdef DO_DOMAIN_NESTING
avtStructuredDomainNesting *dn = new avtStructuredDomainNesting(nblks, nLevels);
dn->SetNumDimensions(3);
int ratios[3];
int ratios[3]; (void) ratios;
bool *levelCSset = new bool[nLevels];
for(int level = 0; level < nLevels; ++level)
{
......@@ -376,7 +376,7 @@ avtAMRFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
}
#ifdef DEBUG_PRINT
debug1 << "Block " << bid << " child patches: ";
for(int q = 0; q < childPatches.size(); ++q)
for(size_t q = 0; q < childPatches.size(); ++q)
debug1 << childPatches[q] << ", ";
debug1 << endl;
#endif
......@@ -843,7 +843,7 @@ avtAMRFileFormat::GetVar(int domain, const char *name)
int np,ne;
GetReader()->GetInterfaceSizes( &np, &ne );
int vid,cmp,sz;
int vid,cmp=0,sz; ///TODO: check on fix for uninitialized vars
if( varname.compare("u velocity")==0 )
{
vid=AMRreaderInterface::i_velo;
......@@ -1057,7 +1057,7 @@ avtAMRFileFormat::GetAuxiliaryData(const char *var, int domain,
GetReader()->GetBlockDimensions(dom, blkdim);
float xs[3]= {0.f,0.f,0.f}, dx[3]= {0.f,0.f,0.f};
int ierr = GetReader()->GetBlockMesh(dom, xs, dx);
int ierr = GetReader()->GetBlockMesh(dom, xs, dx); (void) ierr;
double extents[6];
extents[0] = xs[0];
......
......@@ -200,7 +200,7 @@ avtAMRTestFileFormat::PopulateDomainNesting()
dn->SetLevelCellSizes(level, cs);
}
int iChildPatch = 0;
//int iChildPatch = 0;
for (int patch = 0; patch < totalPatches; patch++)
{
//
......
......@@ -65,7 +65,7 @@ reverse_endian(const T &data)
// Rearrange the bytes.
unsigned char *dest = (unsigned char *)&retval;
unsigned char *src = (unsigned char *)&data + sizeof(T) - 1;
for(int i = 0; i < sizeof(T); ++i)
for(size_t i = 0; i < sizeof(T); ++i)
*dest++ = *src--;
return retval;
......@@ -87,7 +87,7 @@ reverse_endian(const T &data)
DSRObject::DSRObject()
{
unsigned char *cptr = (unsigned char *)&data;
for(int i = 0; i < sizeof(dsr); ++i)
for(size_t i = 0; i < sizeof(dsr); ++i)
*cptr++ = 0;
reverseEndian = false;
}
......
......@@ -81,7 +81,7 @@ reverse_endian(const T &data)
// Rearrange the bytes.
unsigned char *dest = (unsigned char *)&retval;
unsigned char *src = (unsigned char *)&data + sizeof(T) - 1;
for(int i = 0; i < sizeof(T); ++i)
for(size_t i = 0; i < sizeof(T); ++i)
*dest++ = *src--;
return retval;
......@@ -377,8 +377,11 @@ avtANALYZEFileFormat::GetVar(const char *varname)
if(fileInformation.ReversedEndian())
{
short *end = data + ntuples;
while(data < end)
*data++ = reverse_endian(*data);
while(data < end) {
/// TODO: check on sequence-point warning fix
///*data++ = reverse_endian(*data);
*data = reverse_endian(*data); data++;
}
}
}
}
......@@ -397,8 +400,11 @@ avtANALYZEFileFormat::GetVar(const char *varname)
if(fileInformation.ReversedEndian())
{
int *end = data + ntuples;
while(data < end)
*data++ = reverse_endian(*data);
while(data < end) {
/// TODO: check on sequence-point warning fix
///*data++ = reverse_endian(*data);
*data = reverse_endian(*data); data++;
}
}
}
}
......@@ -417,8 +423,11 @@ avtANALYZEFileFormat::GetVar(const char *varname)
if(fileInformation.ReversedEndian())
{
float *end = data + ntuples;
while(data < end)
*data++ = reverse_endian(*data);
while(data < end) {
/// TODO: check on sequence-point warning fix
///*data++ = reverse_endian(*data);
*data = reverse_endian(*data); data++;
}
}
}
}
......
......@@ -360,7 +360,7 @@ avtAUXFileFileFormat::ReadFile()
}
fileBuf = new char[fileSize];
if (fread((void *)fileBuf, 1, fileSize, fd) != fileSize)
if (fread((void *)fileBuf, 1, fileSize, fd) != (size_t)fileSize)
{
fclose(fd);
delete [] fileBuf;
......
......@@ -78,7 +78,7 @@ AdvDataSet::VarInfo::CheckFormat(int &ncomps) const
}
}
int nTypes = 0;
int lastIndex = 0;
//int lastIndex = 0;
for(int i = 0; i < nSupportedTypes; ++i)
{
if(typeCount[i] > 0)
......@@ -249,7 +249,7 @@ AdvDataSet::GetMesh(AdvDocFile *f, int d, AdvDataSet::AdvElementType elementType
const char *mName = "AdvDataSet::GetMesh: ";
// Get this domain.
int domain = domainToSubDomain[d];
//int domain = domainToSubDomain[d];
AdvDocument *doc = 0;
......
......@@ -97,7 +97,7 @@ MshData::Open(const std::string &filename)
// Read the connectivity
//
int iconn[10];
vtkIdType conn[10];
//vtkIdType conn[10];
ifile.getline(line, 1024);
int nNodesPerCell = sscanf(line, "%d %d %d %d %d %d %d %d %d %d",
&iconn[0], &iconn[1], &iconn[2], &iconn[3], &iconn[4],
......@@ -115,6 +115,7 @@ MshData::Open(const std::string &filename)
debug4 << mName << "cellType = " << cellType << endl;
#ifndef MDSERVER
vtkIdType conn[10];
vtkIdType *connectivity = new vtkIdType[nNodesPerCell * nCells];
for(int n = 0; n < nNodesPerCell; ++n)
connectivity[n] = (vtkIdType)iconn[n];
......@@ -369,7 +370,7 @@ MshData::ReleaseData()
vtkDataSet *
MshData::GetMesh(int domain)
{
if(domain >= 0 && domain < domains.size())
if(domain >= 0 && (size_t)domain < domains.size())
{
domains[domain]->Register(NULL);
return domains[domain];
......
......@@ -1731,7 +1731,7 @@ void avtBATLFileFormat::ReadProcessorNumbers()
hsize_t procnum_ndims = H5Sget_simple_extent_dims(procnumSpaceId,
procnum_dims,NULL);
debug5 << "ReadProcessorNumbers Marker 3" << endl;
if (procnum_ndims != 1 || procnum_dims[0] != numBlocks)
if (procnum_ndims != 1 || procnum_dims[0] != (hsize_t)numBlocks)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -1796,7 +1796,7 @@ void avtBATLFileFormat::ReadMortonOrdering()
hsize_t mortonidx_ndims = H5Sget_simple_extent_dims(mortonidxSpaceId,
mortonidx_dims,NULL);
debug5 << "ReadMortonOrdering Marker 3" << endl;
if (mortonidx_ndims != 1 || mortonidx_dims[0] != numBlocks)
if (mortonidx_ndims != 1 || mortonidx_dims[0] != (hsize_t)numBlocks)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -1860,8 +1860,8 @@ void avtBATLFileFormat::ReadCoordinates()
hsize_t coordinates_ndims = H5Sget_simple_extent_dims(coordinatesSpaceId, coordinates_dims, NULL);
if (coordinates_ndims != 2 ||
coordinates_dims[0] != numBlocks ||
coordinates_dims[1] != dimension)
coordinates_dims[0] != (hsize_t)numBlocks ||
coordinates_dims[1] != (hsize_t)dimension)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -1936,8 +1936,8 @@ void avtBATLFileFormat::ReadBlockExtents()
hsize_t bbox_dims[3];
hsize_t bbox_ndims = H5Sget_simple_extent_dims(bboxSpaceId, bbox_dims, NULL);
if (bbox_ndims != 3 ||
bbox_dims[0] != numBlocks ||
bbox_dims[1] != dimension ||
bbox_dims[0] != (hsize_t)numBlocks ||
bbox_dims[1] != (hsize_t)dimension ||
bbox_dims[2] != 2)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
......@@ -2010,7 +2010,7 @@ void avtBATLFileFormat::ReadRefinementLevels()
hsize_t refinement_ndims = H5Sget_simple_extent_dims(refinementSpaceId,
refinement_dims,NULL);
debug5 << "ReadRefinementLevels Marker 3" << endl;
if (refinement_ndims != 1 || refinement_dims[0] != numBlocks)
if (refinement_ndims != 1 || refinement_dims[0] != (hsize_t)numBlocks)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -2081,7 +2081,7 @@ void avtBATLFileFormat::ReadSimulationParameters(hid_t fileId)
integerParams_dims,NULL);
debug5 << "ReadSimulationParameters Marker 3" << endl;
int numParams = 16;
if (integerParams_ndims != 1 || integerParams_dims[0] != numParams)
if (integerParams_ndims != 1 || integerParams_dims[0] != (hsize_t)numParams)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -2243,7 +2243,7 @@ void avtBATLFileFormat::ReadSimulationParameters(hid_t fileId)
realParams_dims,NULL);
debug5 << "ReadSimulationParameters Marker 12" << endl;
numParams = 7;
if (realParams_ndims != 1 || realParams_dims[0] != numParams)
if (realParams_ndims != 1 || realParams_dims[0] != (hsize_t)numParams)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -2600,8 +2600,8 @@ void avtBATLFileFormat::DetermineGlobalLogicalExtentsForAllBlocks()
hsize_t minLogicalExtents_ndims = H5Sget_simple_extent_dims(minLogicalExtentsSpaceId, minLogicalExtents_dims, NULL);
debug5 << "DetermineGlobalLogicalExtentsForAllBlocks Marker 3" << endl;
if (minLogicalExtents_ndims != 2 ||
minLogicalExtents_dims[0] != numBlocks ||
minLogicalExtents_dims[1] != logicalDimension)
minLogicalExtents_dims[0] != (hsize_t)numBlocks ||
minLogicalExtents_dims[1] != (hsize_t)logicalDimension)
{
EXCEPTION1(InvalidFilesException, filename.c_str());
}
......@@ -2928,7 +2928,7 @@ avtBATLFileFormat::GetAuxiliaryData(const char *var, int dom,
hsize_t extr_dims[2];
hsize_t extr_ndims = H5Sget_simple_extent_dims(extrSpaceId, extr_dims, NULL);
if (extr_ndims != 2 ||
extr_dims[0] != numBlocks ||
extr_dims[0] != (hsize_t)numBlocks ||
extr_dims[1] != 2)
{
EXCEPTION1(InvalidFilesException, varstr.c_str());
......
......@@ -524,7 +524,7 @@ ReadBricklet(FILE *fp, T *dest, const long long *full_size,
for(long long y = start[1]; y < end[1]; ++y)
{
// Read in a line of data in x.
fread((void *)ptr, sizeof(T), nxelem, fp);
size_t result = fread((void *)ptr, sizeof(T), nxelem, fp); (void) result;
ptr += nxelem;
// Seek to the next line
......@@ -967,7 +967,7 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
// Determine the unit_size, which is the size of the data in the file,
// and allocate the return VTK object.
//
long long unit_size;
long long unit_size = 0; /* TODO: check on fix for uninitialized variable */
vtkDataArray *rv = 0;
if(dataFormat == ByteData)
{
......@@ -1214,7 +1214,7 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
{
debug4 << mName << "Reversing endian for shorts" << endl;
short *buff = (short *) rv->GetVoidPointer(0);
for (long long i = 0 ; i < ntotal ; i++)
for (unsigned long long i = 0 ; i < ntotal ; i++)
{
int tmp;
int16_Reverse_Endian(buff[i], (unsigned char *) &tmp);
......@@ -1225,7 +1225,7 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
{
debug4 << mName << "Reversing endian for ints" << endl;
int *buff = (int *) rv->GetVoidPointer(0);
for (long long i = 0 ; i < ntotal ; i++)
for (unsigned long long i = 0 ; i < ntotal ; i++)
{
int tmp;
int32_Reverse_Endian(buff[i], (unsigned char *) &tmp);
......@@ -1236,7 +1236,7 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
{
debug4 << mName << "Reversing endian for floats" << endl;
float *buff = (float *) rv->GetVoidPointer(0);
for (long long i = 0 ; i < ntotal ; i++)
for (unsigned long long i = 0 ; i < ntotal ; i++)
{
float tmp;
float32_Reverse_Endian(buff[i], (unsigned char *) &tmp);
......@@ -1247,7 +1247,7 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
{
debug4 << mName << "Reversing endian for doubles" << endl;
double *buff = (double *) rv->GetVoidPointer(0);
for (long long i = 0 ; i < ntotal ; i++)
for (unsigned long long i = 0 ; i < ntotal ; i++)
{
double tmp;
double64_Reverse_Endian(buff[i], (unsigned char *) &tmp);
......@@ -1591,7 +1591,7 @@ avtBOVFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
{
long long nx = full_size[0] / bricklet_size[0];
long long ny = full_size[1] / bricklet_size[1];
long long nz = full_size[2] / bricklet_size[2];
//long long nz = full_size[2] / bricklet_size[2];
long long z_off = i / (nx*ny);
long long y_off = (i % (nx*ny)) / nx;
long long x_off = i % nx;
......@@ -1826,9 +1826,9 @@ avtBOVFileFormat::ReadTOC(void)
}
char *currPos = header + 1;
bool readDescr = false;
bool readShape = false;
bool readFortranOrder = false;
//bool readDescr = false;
//bool readShape = false;
//bool readFortranOrder = false;
bool fortranOrder = false;
while (*currPos)
......@@ -1939,7 +1939,7 @@ avtBOVFileFormat::ReadTOC(void)
}
++currPos;
}
readDescr = true;
//readDescr = true;
}
else if (strcmp(key, "fortran_order") == 0)
{
......@@ -1971,7 +1971,7 @@ avtBOVFileFormat::ReadTOC(void)
}
++currPos;
}
readFortranOrder = true;
//readFortranOrder = true;
}
else if (strcmp(key, "shape") == 0)
{
......@@ -2040,7 +2040,7 @@ avtBOVFileFormat::ReadTOC(void)
}
++currPos;
}
readShape = true;
//readShape = true;
}
else
{
......@@ -2100,7 +2100,7 @@ avtBOVFileFormat::ReadTOC(void)
else if (strcmp(line, "DATA_FILE:") == 0)
{
line += strlen("DATA_FILE:") + 1;
int len = strlen(line);
//int len = strlen(line);
file_pattern = line;
}
else if (strcmp(line, "DATA_SIZE:") == 0)
......@@ -2151,7 +2151,7 @@ avtBOVFileFormat::ReadTOC(void)
else if (strcmp(line, "VARIABLE:") == 0)
{
line += strlen("VARIABLE:") + 1;
int len = strlen(line);
//int len = strlen(line);
varname = line;
}
else if (strcmp(line, "HAS_BOUNDARY:") == 0)
......
......@@ -9,7 +9,8 @@
void BoxLibHelper::InitializeBoxLib()
{
int dummyArgC = 1;
char *dummyArgV[] = { "visit" };
char dummyArgVisit[] = "visit";
char *dummyArgV[] = { dummyArgVisit };
char **argv = dummyArgV; // Avoid implicit type conversion
BoxLib::Initialize(dummyArgC, argv);
}
......@@ -353,8 +353,6 @@ AVTBOXLIBFILEFORMAT::ActivateTimestep(void)
void
AVTBOXLIBFILEFORMAT::InitializeReader(void)
{
int i;
if (initializedReader)
return;
......@@ -373,7 +371,7 @@ AVTBOXLIBFILEFORMAT::InitializeReader(void)
//
int count = 0;
int level = 0;
for (i = 0; i < multifabFilenames.size(); ++i)
for (size_t i = 0; i < multifabFilenames.size(); ++i)
{
VisMF *vmf = GetVisMF(i);
int cnt = vmf->nComp();
......@@ -420,7 +418,7 @@ AVTBOXLIBFILEFORMAT::InitializeReader(void)
// want to expose as scalar variables, since we are using them elsewhere.
//
varUsedElsewhere.clear();
for (i = 0 ; i < nVars ; i++)
for (int i = 0 ; i < nVars ; i++)
{
varUsedElsewhere.push_back(false);
}
......@@ -429,9 +427,9 @@ AVTBOXLIBFILEFORMAT::InitializeReader(void)
// Find any materials
//
nMaterials = 0;
for (i = 0; i < nVars; ++i)
for (int i = 0; i < nVars; ++i)
{
int val = 0;
//int val = 0;
if (varNames[i].find("frac") == 0)
{
varUsedElsewhere[i] = true;
......@@ -443,9 +441,9 @@ AVTBOXLIBFILEFORMAT::InitializeReader(void)
}
if (nMaterials == 0)
{
for (i = 0; i < nVars; ++i)
for (int i = 0; i < nVars; ++i)
{
int val = 0;
//int val = 0;
if (varNames[i].find("vf_") == 0)
{
varUsedElsewhere[i] = true;
......@@ -464,7 +462,7 @@ AVTBOXLIBFILEFORMAT::InitializeReader(void)
//
nVectors = 0;
vectorNames.clear();
for (i = 0; i < nVars; ++i)
for (int i = 0; i < nVars; ++i)
{
int id2 = -1;
#if BL_SPACEDIM==3
......@@ -1255,7 +1253,7 @@ AVTBOXLIBFILEFORMAT::GetVar(int patch, const char *var_name)
if (local_patch >= patchesPerLevel[level])
EXCEPTION2(BadDomainException, patch, patchesPerLevel[level]);
int varIndex;
size_t varIndex;
for (varIndex = 0; varIndex < varNames.size(); ++varIndex)
if (varNames[varIndex] == var_name)
break;
......@@ -1397,12 +1395,12 @@ AVTBOXLIBFILEFORMAT::GetVectorVar(int patch, const char *var_name)
if (local_patch >= patchesPerLevel[level])
EXCEPTION2(BadDomainException, patch, patchesPerLevel[level]);
int vectIndex;
size_t vectIndex;
for (vectIndex = 0; vectIndex < vectorNames.size(); ++vectIndex)
if (vectorNames[vectIndex] == var_name)
break;
if (vectIndex > nVectors)
if (vectIndex > (size_t)nVectors)
EXCEPTION1(InvalidVariableException, var_name);
// Get the data for the components (in FArrayBoxes).
......@@ -1920,7 +1918,7 @@ AVTBOXLIBFILEFORMAT::CalculateDomainNesting(void)
#endif
vector<int> list;
coarse_levels.GetElementsListFromRange(min, max, list);
for (int i = 0 ; i < list.size() ; i++)
for (size_t i = 0 ; i < list.size() ; i++)
{
int candidate = coarse_start + list[i];
if (logIMax[patch] < logIMin[candidate])
......@@ -2271,7 +2269,7 @@ SwapEntries(std::vector<int> &clearlist, int t, int s)
void
AVTBOXLIBFILEFORMAT::FreeUpResources()
{
int i, j;
size_t i, j;
initializedReader = false;
......@@ -2280,19 +2278,23 @@ AVTBOXLIBFILEFORMAT::FreeUpResources()
// to sort out the duplicates (this can happen when we access a variable
// as a component of a vector and then later as a scalar).
//
int num_entries = clearlist.size() / 3;
size_t num_entries = clearlist.size() / 3;
for (i = 0 ; i < num_entries ; i++)
{
for (j = i+1 ; j < num_entries ; j++)
{
if (clearlist[3*i] > clearlist[3*j])
SwapEntries(clearlist, i, j);
else if (clearlist[3*i] == clearlist[3*j])
if (clearlist[3*i+1] > clearlist[3*j+1])
else if (clearlist[3*i] == clearlist[3*j]) {
if (clearlist[3*i+1] > clearlist[3*j+1]) {
SwapEntries(clearlist, i, j);
else if (clearlist[3*i+1] == clearlist[3*j+1])
if (clearlist[3*i+2] > clearlist[3*j+2])
}
else if (clearlist[3*i+1] == clearlist[3*j+1]) {
if (clearlist[3*i+2] > clearlist[3*j+2]) {
SwapEntries(clearlist, i, j);
}
}
}
}
}
......@@ -2417,10 +2419,10 @@ static void EatUpWhiteSpace(ifstream &in)
static int VSSearch(const vector<string> &v, const string &s)
{
int i;
size_t i;
for (i = 0; i < v.size(); ++i)
if (v[i] == s)
return i;
return (int)i;
return -1;
}
......
This diff is collapsed.
......@@ -11,8 +11,7 @@
#define VERBOSE_DEBUG
const static char * FICHIER_U__C_SCCS_ID = "%Z% DSSI/SNEC/LDDC %M% %I% %G%";
//const static char * FICHIER_U__C_SCCS_ID = "%Z% DSSI/SNEC/LDDC %M% %I% %G%";
#include "FichierU.h"
#include <string.h>
......@@ -73,7 +72,7 @@ FichierU::FichierU(const string& fileName, ifstream* istr, long offset, long tai
{
case 0x07 :
{
DEBUG_OUT(<<"format binaire #"<<(void*)(int)c<<endl);
DEBUG_OUT(<<"format binaire #"<<(void*)(size_t)c<<endl);
long fsize;
if (taille != 0)
{
......@@ -175,7 +174,7 @@ FichierU::FichierU(const string& fileName, ifstream* istr, long offset, long tai
else { BAD_FIELD(" in object list"); }
}
if(_nbMat==-1) _nbMat = (int)_matNames.size();
else if( _nbMat!=_matNames.size() )
else if( _nbMat!= (int) _matNames.size() )
{
cerr<<"Attention! "<<_nbMat<<"materiaux annoncs, mais seulement "<<_matNames.size()<<" dcris"<<endl;
}
......@@ -431,12 +430,16 @@ float FichierU::readBinaryFloat(const char* data, int dataSize, int &ptr)
if(!_endian)
{
char tmp[4];
tmp[0] = buf[3];
tmp[1] = buf[2];
tmp[2] = buf[1];
tmp[3] = buf[0];
return *(float*)(tmp);
union {
char tmp[4];
float ftmp;
} a;
a.tmp[0] = buf[3];
a.tmp[1] = buf[2];
a.tmp[2] = buf[1];
a.tmp[3] = buf[0];
return a.ftmp; //*(float*)(tmp);
}
else
{
......
......@@ -12,7 +12,7 @@ Modifications history :
*/