Commit 5eef802c authored by hkrishna's avatar hkrishna

fixes to tautological-compare warnings

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23668 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1aa51cfe
......@@ -1440,7 +1440,7 @@ avtCaleFileFormat::GetCycleFromFilename(const char *f) const
j = 0;
for ( i = n-1 ; i >= 0 ; i-- )
for ( i = n ; i-- > 0 ;)
{
if ((f[i] >= '0') && (f[i] <= '9'))
{
......
......@@ -1585,7 +1585,7 @@ avtCaleHDF5FileFormat::GetCycleFromFilename(const char *f) const
j = 0;
for ( i = n-1 ; i >= 0 ; i-- )
for ( i = n ; i-- > 0 ;)
{
if ((f[i] >= '0') && (f[i] <= '9'))
{
......
......@@ -220,7 +220,7 @@ DDCMDHeader::DDCMDHeader(const std::string &fname, const std::string &subname)
std::string filename(fname + "/" + subname + "#000000");
char header[4096];
headerLength = Read(filename, 4096, header);
if(headerLength < 0)
if(headerLength <= 0) ///TODO: headerLength < 0 will never be true setting <= 0 as 0 size file is also bad
EXCEPTION1(InvalidFilesException, fname);
//
......
......@@ -104,7 +104,7 @@ H5NIMROD_read_attrib (hid_t parent_id,
return H5NIMROD_ERR;
nelem = H5Sget_simple_extent_npoints (space_id);
if (nelem < 0)
if (nelem <= 0) ///TODO: changing to <= instead of < as it will never get called
return H5NIMROD_ERR;
type_id = _normalize_h5_type (mytype);
......
......@@ -839,7 +839,7 @@ avtM3DFileFormat::ReadAttribute( hid_t parentID, const char *attr, void *value )
return false;
hsize_t nelem = H5Sget_simple_extent_npoints( spaceID );
if ( nelem < 0 )
if ( nelem <= 0 ) ///TODO: changed to <= from < 0 if 0 elements are possible this would be incorrect
return false;
hid_t typeID = NormalizeH5Type( attrType );
......
......@@ -382,7 +382,7 @@ int ExpressionParserTokenManager::jjMoveNfa_0(int startState, int curPos)
}
} while(i != startsAt);
}
else if (curChar < 128)
else //if (curChar < 128) ///TODO: curChar will always be true <--
{
int64 l = ((int64)1LL) << (curChar & 077);
//MatchLoop2: do
......@@ -487,7 +487,7 @@ int ExpressionParserTokenManager::jjMoveNfa_0(int startState, int curPos)
default : break;
}
} while(i != startsAt);
}
}/* TODO: this code is not getting called due to the above logic always being true
else
{
//int i2 = (curChar & 0xff) >> 6;
......@@ -500,7 +500,7 @@ int ExpressionParserTokenManager::jjMoveNfa_0(int startState, int curPos)
default : break;
}
} while(i != startsAt);
}
}*/
if (kind != 0x7fffffff)
{
jjmatchedKind = kind;
......
......@@ -85,7 +85,7 @@ VsStaggeredField<TYPE>::setDataPtr(const TYPE* dataPtr,
this->oriCellDimProd[this->numTopoDims - 1] = 1;
this->newCellDimProd.resize(this->numTopoDims);
this->newCellDimProd[this->numTopoDims - 1] = 1;
for (size_t i = this->numTopoDims - 2; i >= 0; --i) {
for (int i = this->numTopoDims - 2; i >= 0; --i) {
this->oriCellDimProd[i] = this->oriCellDimProd[i + 1] * this->oriCellDims[i + 1];
this->newCellDimProd[i] = this->newCellDimProd[i + 1] * this->newCellDims[i + 1];
}
......
......@@ -590,7 +590,7 @@ vtkDataSet* avtVsFileFormat::getUniformMesh(VsUniformMesh* uniformMesh,
//OLD: uniformMesh->getMeshDataDims(numCells); // Number of cells NOT nodes
uniformMesh->getCellDims(numCells);
if (numCells.size() < 0) {
if (numCells.size() <= 0) { ///TODO: are number of cells allow to be 0?
std::ostringstream msg;
msg << CLASSFUNCLINE << " "
<< "Could not get dimensions of the uniform mesh.";
......@@ -793,7 +793,7 @@ avtVsFileFormat::getRectilinearMesh(VsRectilinearMesh* rectilinearMesh,
//rectilinearMesh->getMeshDataDims(numNodes); // Number of nodes NOT cells
rectilinearMesh->getCellDims(numNodes);
if (numNodes.size() < 0) {
if (numNodes.size() <= 0) { ///TODO: are number of cells allow to be zero?
std::ostringstream msg;
msg << CLASSFUNCLINE << " "
<< "Could not get dimensions of the rectilinear mesh.";
......@@ -1126,7 +1126,7 @@ vtkDataSet* avtVsFileFormat::getStructuredMesh(VsStructuredMesh* structuredMesh,
std::vector<int> numNodes;
structuredMesh->getCellDims(numNodes);// Number of nodes NOT cells.
if (numNodes.size() < 0) {
if (numNodes.size() <= 0) { ///TODO: < 0 can never happen, but can size be equal to zero?
std::ostringstream msg;
msg << CLASSFUNCLINE << " "
<< "Could not get dimensions of the structured mesh.";
......
......@@ -960,7 +960,7 @@ void LataFilter::release_cached_operator(const Domain_Id& id)
void LataOptions::extract_path_basename(const char * s, Nom & path_prefix, Nom & basename)
{
size_t i;
for (i=strlen(s)-1;i>=0;i--)
for (i=strlen(s);i-- >0;)
if ((s[i]==PATH_SEPARATOR) ||(s[i]=='\\'))
break;
path_prefix = "";
......
......@@ -94,7 +94,7 @@ BigEntier memory_size(const ArrOfBit & tab)
void split_path_filename(const char *s, Nom & path, Nom & filename)
{
size_t i;
for (i=strlen(s)-1;i>=0;i--)
for (i=strlen(s);i-- > 0;)
if ((s[i]==PATH_SEPARATOR) || (s[i]=='\\'))
break;
path = "";
......
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