Commit db843ead authored by Jan Möbius's avatar Jan Möbius

Various cppcheck errors



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@16343 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 50914d19
......@@ -76,7 +76,7 @@ public:
* again, so after this method has been called, assumptions about the state of the values
* in memory are no longer valid. */
void rollBack(void){
if(memory.size()){
if( !memory.empty() ){
for(size_t i=0;i<memory.size();i++){
for(int j=0;j<blockSize;j++){
memory[i][j].~T();
......
......@@ -57,7 +57,7 @@ template< int Degree > inline bool LeftOverlap( unsigned int depth , int offset
template< int Degree > inline bool RightOverlap( unsigned int depth , int offset )
{
offset <<= 1;
int r = 1<<(depth+1);
// int r = 1<<(depth+1);
if( Degree & 1 ) return (offset > 2-1-Degree) && (offset < 2+1+Degree );
else return (offset > 2-2-Degree) && (offset < 2+ Degree );
}
......
......@@ -746,7 +746,6 @@ Real Octree< Degree >::SplatOrientedPoint( const Point3D<Real>& position , const
double dx;
Point3D<Real> n;
TreeOctNode* temp;
int cnt=0;
double width;
Point3D< Real > myCenter;
Real myWidth;
......@@ -932,15 +931,15 @@ int Octree<Degree>::setTree( char* fileName , int maxDepth , int minDepth ,
TreeOctNode::NeighborKey3 neighborKey;
neighborKey.set( maxDepth );
PointStream< Real >* pointStream;
char* ext = " ";
if ( !strcasecmp( ext , "bnpts" ) ) pointStream = new BinaryPointStream< Real >( fileName );
else pointStream = new ASCIIPointStream< Real >( fileName );
delete[] ext;
const char ext[] = " ";
if ( !strcasecmp( &ext[0] , "bnpts" ) ) pointStream = new BinaryPointStream< Real >( fileName );
else pointStream = new ASCIIPointStream< Real >( fileName );
tree.setFullDepth( _minDepth );
// Read through once to get the center and scale
{
double t = Time();
//double t = Time();
Point3D< Real > p , n;
while( pointStream->nextPoint( p , n ) )
{
......@@ -2521,7 +2520,7 @@ int Octree<Degree>::_SolveFixedDepthMatrix( int depth , const SortedTreeNodes& s
myRadius = 2*radius-Real(0.5);
myRadius = int(myRadius-ROUND_EPS)+ROUND_EPS;
myRadius2 = Real(radius+ROUND_EPS-0.5);
// myRadius2 = Real(radius+ROUND_EPS-0.5);
d = depth-startingDepth;
if( _boundaryType==0 ) d++;
std::vector< int > subDimension( sNodes.nodeCount[d+1]-sNodes.nodeCount[d] );
......@@ -4209,7 +4208,7 @@ int Octree< Degree >::GetEdgeLoops( std::vector< std::pair< RootInfo , RootInfo
std::pair< RootInfo , RootInfo > e , temp;
loops.clear();
while( edges.size() )
while( !edges.empty() )
{
std::vector< std::pair< RootInfo , RootInfo > > front , back;
e = edges[0];
......
......@@ -602,7 +602,7 @@ inline void AtomicIncrement( volatile float* ptr , float addend )
for( ;; )
{
_oldValue = _newValue;
newValue += addend;
//newValue += addend; Commented out as it was useless
_newValue = InterlockedCompareExchange( (LONG*) ptr , _newValue , _oldValue );
if( _newValue==_oldValue ) break;
}
......@@ -616,7 +616,7 @@ inline void AtomicIncrement( volatile double* ptr , double addend )
do
{
_oldValue = _newValue;
newValue += addend;
//newValue += addend;
_newValue = InterlockedCompareExchange64( (LONGLONG*) ptr , _newValue , _oldValue );
}
while( _newValue!=_oldValue );
......
......@@ -74,7 +74,7 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter )
m_parameter = _parameter;
double t;
double tt=Time();
// double tt=Time();
Real isoValue = 0;
Octree<2> tree;
......@@ -125,6 +125,7 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter )
_mesh.clear();
mesh.resetIterator();
DumpOutput( "Time for Iso: %f\n" , Time()-t );
......@@ -136,8 +137,7 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter )
int nr_vertices=int(mesh.outOfCorePointCount()+mesh.inCorePoints.size());
// int nr_vertices=int(mesh.outOfCorePointCount()+mesh.inCorePoints.size());
int nr_faces=mesh.polygonCount();
mesh.resetIterator();
......
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