#18963 Minimize compiler warnings

fix the rest warnings
This commit is contained in:
eap 2020-12-09 22:12:51 +03:00
parent cb55604f37
commit 2f4749af53
33 changed files with 142 additions and 134 deletions

View File

@ -123,15 +123,15 @@ std::string Driver_Mesh::fixUTF8(const std::string & str )
// how many bytes follow? // how many bytes follow?
int len = 0; int len = 0;
if (s[i] >> 5 == 0b110 ) len = 1; // todo: binary constants are a GCC extension if (s[i] >> 5 == 0b110 ) len = 1; // WARNING: binary constants included in C++14
else if (s[i] >> 4 == 0b1110 ) len = 2; // todo: binary constants are a GCC extension else if (s[i] >> 4 == 0b1110 ) len = 2;
else if (s[i] >> 3 == 0b11110) len = 3; // todo: binary constants are a GCC extension else if (s[i] >> 3 == 0b11110) len = 3;
else else
invalid = true; invalid = true;
// check the bytes // check the bytes
for ( int j = 0; j < len && !invalid; ++j ) for ( int j = 0; j < len && !invalid; ++j )
invalid = ( s[i+j+1] >> 6 != 0b10 ); // todo: binary constants are a GCC extension invalid = ( s[i+j+1] >> 6 != 0b10 );
if ( invalid ) if ( invalid )
fixed[i] = '?'; fixed[i] = '?';

View File

@ -165,9 +165,9 @@ namespace
int _beg[3], _end[3], _cur[3], _dir[3], _dim; int _beg[3], _end[3], _cur[3], _dir[3], _dim;
bool _more; bool _more;
public: public:
TPointRangeIterator( const cgsize_t* range, int dim ):_dim(dim) TPointRangeIterator( const cgsize_t* range, int dim ):
_beg{0,0,0}, _end{0,0,0}, _cur{0,0,0}, _dir{0,0,0}, _dim(dim), _more(false)
{ {
_more = false;
for ( int i = 0; i < dim; ++i ) for ( int i = 0; i < dim; ++i )
{ {
_beg[i] = range[i]; _beg[i] = range[i];
@ -178,8 +178,6 @@ namespace
if ( _end[i] - _beg[i] ) if ( _end[i] - _beg[i] )
_more = true; _more = true;
} }
// for ( int i = dim; i < 3; ++i )
// _cur[i] = _beg[i] = _end[i] = _dir[i] = 0;
} }
bool More() const bool More() const
{ {
@ -187,7 +185,7 @@ namespace
} }
gp_XYZ Next() gp_XYZ Next()
{ {
gp_XYZ res( _cur[0], _cur[1], _cur[2] ); // todo: _cur can be used uninitialized gp_XYZ res( _cur[0], _cur[1], _cur[2] );
for ( int i = 0; i < _dim; ++i ) for ( int i = 0; i < _dim; ++i )
{ {
_cur[i] += _dir[i]; _cur[i] += _dir[i];
@ -207,7 +205,7 @@ namespace
size *= _dir[i]*(_end[i]-_beg[i]); size *= _dir[i]*(_end[i]-_beg[i]);
return size; return size;
} }
gp_XYZ Begin() const { return gp_XYZ( _beg[0], _beg[1], _beg[2] ); } // todo: _beg can be used uninitialized gp_XYZ Begin() const { return gp_XYZ( _beg[0], _beg[1], _beg[2] ); }
//gp_XYZ End() const { return gp_XYZ( _end[0]-1, _end[1]-1, _end[2]-1 ); } //gp_XYZ End() const { return gp_XYZ( _end[0]-1, _end[1]-1, _end[2]-1 ); }
}; };
@ -297,7 +295,7 @@ namespace
} }
// fill nodeReplacementMap // fill nodeReplacementMap
TPointRangeIterator rangeIt1( range, _meshDim ); // todo: rangeIt1: _end[i], _dir[i], _beg[i], _cur[i] may be used uninitialized TPointRangeIterator rangeIt1( range, _meshDim );
TPointRangeIterator rangeIt2( donorRange, _meshDim ); TPointRangeIterator rangeIt2( donorRange, _meshDim );
gp_XYZ begin1 = rangeIt1.Begin(), begin2 = rangeIt2.Begin(), index1, index2; gp_XYZ begin1 = rangeIt1.Begin(), begin2 = rangeIt2.Begin(), index1, index2;
if ( &zone2 == this ) if ( &zone2 == this )

View File

@ -875,7 +875,7 @@ void GmfSetLin(int MshIdx, int KwdCod, ...)
{ {
for(i=0;i<kwd->SolSiz;i++) for(i=0;i<kwd->SolSiz;i++)
if(kwd->fmt[i] == 'r') if(kwd->fmt[i] == 'r')
fprintf(msh->hdl, "%.15lg ", va_arg(VarArg, double)); /* todo: ISO C90 does not support the '%lg' gnu_printf format */ fprintf(msh->hdl, "%.15g ", va_arg(VarArg, double)); /* was "%.15lg and warning "ISO C90 does not support the '%lg' gnu_printf format"*/
else if(kwd->fmt[i] == 'n') { else if(kwd->fmt[i] == 'n') {
nb_repeat = va_arg(VarArg, int); nb_repeat = va_arg(VarArg, int);
fprintf(msh->hdl, "%d ", nb_repeat); fprintf(msh->hdl, "%d ", nb_repeat);
@ -936,7 +936,7 @@ void GmfSetLin(int MshIdx, int KwdCod, ...)
if(msh->typ & Asc) if(msh->typ & Asc)
for(j=0;j<kwd->SolSiz;j++) for(j=0;j<kwd->SolSiz;j++)
fprintf(msh->hdl, "%.15lg ", DblSolTab[j]); /* todo: ISO C90 does not support the '%lg' gnu_printf format */ fprintf(msh->hdl, "%.15g ", DblSolTab[j]); /* was " %.15lg " and warning "ISO C90 does not support the '%lg' gnu_printf format" */
else else
RecBlk(msh, (unsigned char *)DblSolTab, kwd->NmbWrd); RecBlk(msh, (unsigned char *)DblSolTab, kwd->NmbWrd);
} }

View File

@ -119,7 +119,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh,
if ( _nbElemsByGeom.size() == 1 ) if ( _nbElemsByGeom.size() == 1 )
_nbElemsByGeom.push_back( std::make_pair( SMDSEntity_0D, 0)); _nbElemsByGeom.push_back( std::make_pair( SMDSEntity_0D, 0));
_nbElemsByGeom.push_back( std::make_pair( SMDSEntity_Node, _nbElemsByGeom.push_back( std::make_pair( SMDSEntity_Node,
nodes.size() + _nbElemsByGeom.back().second )); nodes.size() + _nbElemsByGeom.back().second ));
} }
} }

View File

@ -28,8 +28,8 @@
static int MYDEBUG = 0; static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0; static int MYVALUEDEBUG = 0;
#else #else
static int MYDEBUG = 0; // todo: unused in release mode // static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0; // todo: unused in release mode // static int MYVALUEDEBUG = 0;
#endif #endif
namespace MED namespace MED

View File

@ -27,8 +27,8 @@
static int MYDEBUG = 0; static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0; static int MYVALUEDEBUG = 0;
#else #else
static int MYDEBUG = 0; // todo: unused in release mode // static int MYDEBUG = 0; // unused in release mode
static int MYVALUEDEBUG = 0; // todo: unused in release mode // static int MYVALUEDEBUG = 0; // unused in release mode
#endif #endif
namespace MED namespace MED

View File

@ -26,7 +26,7 @@
#ifdef _DEBUG_ #ifdef _DEBUG_
static int MYDEBUG = 0; static int MYDEBUG = 0;
#else #else
static int MYDEBUG = 0; // todo: unused in release mode //static int MYDEBUG = 0; // unused in release mode
#endif #endif
int MED::PrefixPrinter::myCounter = 0; int MED::PrefixPrinter::myCounter = 0;

View File

@ -38,8 +38,8 @@
static int MYDEBUG = 0; static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0; static int MYVALUEDEBUG = 0;
#else #else
static int MYDEBUG = 0; // todo: unused in release mode // static int MYDEBUG = 0; // unused in release mode
static int MYVALUEDEBUG = 0; // todo: unused in release mode // static int MYVALUEDEBUG = 0; // unused in release mode
#endif #endif
namespace MED namespace MED

View File

@ -1488,10 +1488,10 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
case QUAD_TETRA: case QUAD_TETRA:
{ {
switch ( minInd ) { switch ( minInd ) {
case 0: if( maxInd==4 || maxInd==6 || maxInd==7 ) return true; // fall through case 0: return ( maxInd==4 || maxInd==6 || maxInd==7 );
case 1: if( maxInd==4 || maxInd==5 || maxInd==8 ) return true; // fall through case 1: return ( maxInd==4 || maxInd==5 || maxInd==8 );
case 2: if( maxInd==5 || maxInd==6 || maxInd==9 ) return true; // fall through case 2: return ( maxInd==5 || maxInd==6 || maxInd==9 );
case 3: if( maxInd==7 || maxInd==8 || maxInd==9 ) return true; // fall through case 3: return ( maxInd==7 || maxInd==8 || maxInd==9 );
default:; default:;
} }
break; break;
@ -1499,14 +1499,14 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
case QUAD_HEXA: case QUAD_HEXA:
{ {
switch ( minInd ) { switch ( minInd ) {
case 0: if( maxInd==8 || maxInd==11 || maxInd==16 ) return true; // fall through case 0: return ( maxInd==8 || maxInd==11 || maxInd==16 );
case 1: if( maxInd==8 || maxInd==9 || maxInd==17 ) return true; // fall through case 1: return ( maxInd==8 || maxInd==9 || maxInd==17 );
case 2: if( maxInd==9 || maxInd==10 || maxInd==18 ) return true; // fall through case 2: return ( maxInd==9 || maxInd==10 || maxInd==18 );
case 3: if( maxInd==10 || maxInd==11 || maxInd==19 ) return true; // fall through case 3: return ( maxInd==10 || maxInd==11 || maxInd==19 );
case 4: if( maxInd==12 || maxInd==15 || maxInd==16 ) return true; // fall through case 4: return ( maxInd==12 || maxInd==15 || maxInd==16 );
case 5: if( maxInd==12 || maxInd==13 || maxInd==17 ) return true; // fall through case 5: return ( maxInd==12 || maxInd==13 || maxInd==17 );
case 6: if( maxInd==13 || maxInd==14 || maxInd==18 ) return true; // fall through case 6: return ( maxInd==13 || maxInd==14 || maxInd==18 );
case 7: if( maxInd==14 || maxInd==15 || maxInd==19 ) return true; // fall through case 7: return ( maxInd==14 || maxInd==15 || maxInd==19 );
default:; default:;
} }
break; break;
@ -1514,11 +1514,11 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
case QUAD_PYRAM: case QUAD_PYRAM:
{ {
switch ( minInd ) { switch ( minInd ) {
case 0: if( maxInd==5 || maxInd==8 || maxInd==9 ) return true; // fall through case 0: return ( maxInd==5 || maxInd==8 || maxInd==9 );
case 1: if( maxInd==5 || maxInd==6 || maxInd==10 ) return true; // fall through case 1: return ( maxInd==5 || maxInd==6 || maxInd==10 );
case 2: if( maxInd==6 || maxInd==7 || maxInd==11 ) return true; // fall through case 2: return ( maxInd==6 || maxInd==7 || maxInd==11 );
case 3: if( maxInd==7 || maxInd==8 || maxInd==12 ) return true; // fall through case 3: return ( maxInd==7 || maxInd==8 || maxInd==12 );
case 4: if( maxInd==9 || maxInd==10 || maxInd==11 || maxInd==12 ) return true; case 4: return ( maxInd==9 || maxInd==10 || maxInd==11 || maxInd==12 );
default:; default:;
} }
break; break;
@ -1526,12 +1526,12 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
case QUAD_PENTA: case QUAD_PENTA:
{ {
switch ( minInd ) { switch ( minInd ) {
case 0: if( maxInd==6 || maxInd==8 || maxInd==12 ) return true; // fall through case 0: return ( maxInd==6 || maxInd==8 || maxInd==12 );
case 1: if( maxInd==6 || maxInd==7 || maxInd==13 ) return true; // fall through case 1: return ( maxInd==6 || maxInd==7 || maxInd==13 );
case 2: if( maxInd==7 || maxInd==8 || maxInd==14 ) return true; // fall through case 2: return ( maxInd==7 || maxInd==8 || maxInd==14 );
case 3: if( maxInd==9 || maxInd==11 || maxInd==12 ) return true; // fall through case 3: return ( maxInd==9 || maxInd==11 || maxInd==12 );
case 4: if( maxInd==9 || maxInd==10 || maxInd==13 ) return true; // fall through case 4: return ( maxInd==9 || maxInd==10 || maxInd==13 );
case 5: if( maxInd==10 || maxInd==11 || maxInd==14 ) return true; // fall through case 5: return ( maxInd==10 || maxInd==11 || maxInd==14 );
default:; default:;
} }
break; break;

View File

@ -3629,7 +3629,7 @@ static bool getClosestUV (Extrema_GenExtPS& projector,
{ {
projector.Perform( point ); projector.Perform( point );
if ( projector.IsDone() ) { if ( projector.IsDone() ) {
double u, v, minVal = DBL_MAX; double u = 0, v = 0, minVal = DBL_MAX;
for ( int i = projector.NbExt(); i > 0; i-- ) for ( int i = projector.NbExt(); i > 0; i-- )
if ( projector.SquareDistance( i ) < minVal ) { if ( projector.SquareDistance( i ) < minVal ) {
minVal = projector.SquareDistance( i ); minVal = projector.SquareDistance( i );
@ -7461,10 +7461,10 @@ public:
//int& GroupID() const { return const_cast< int& >( myGroupID ); } //int& GroupID() const { return const_cast< int& >( myGroupID ); }
ComparableElement( const ComparableElement& theSource ) // move copy ComparableElement( const ComparableElement& theSource ) // move copy
: boost::container::flat_set< int >() : int_set()
{ {
ComparableElement& src = const_cast< ComparableElement& >( theSource ); ComparableElement& src = const_cast< ComparableElement& >( theSource );
(int_set&) (*this ) = boost::move( src ); (int_set&) (*this ) = std::move( src );
myElem = src.myElem; myElem = src.myElem;
mySumID = src.mySumID; mySumID = src.mySumID;
myGroupID = src.myGroupID; myGroupID = src.myGroupID;
@ -10200,7 +10200,7 @@ namespace // automatically find theAffectedElems for DoubleNodes()
if ( SMESH_MeshAlgos::FaceNormal( _elems[1], norm )) if ( SMESH_MeshAlgos::FaceNormal( _elems[1], norm ))
avgNorm += norm; avgNorm += norm;
gp_XYZ bordDir( SMESH_NodeXYZ( _nodes[0] ) - SMESH_NodeXYZ( _nodes[1] )); // todo: compiler complains about zero-size array gp_XYZ bordDir( SMESH_NodeXYZ( this->_nodes[0] ) - SMESH_NodeXYZ( this->_nodes[1] ));
norm = bordDir ^ avgNorm; norm = bordDir ^ avgNorm;
} }
else else

View File

@ -3769,7 +3769,7 @@ namespace { // Structures used by FixQuadraticElements()
/*! /*!
* \brief Dump QLink and QFace * \brief Dump QLink and QFace
*/ */
ostream& operator << (ostream& out, const QLink& l) // todo: unused in release mode ostream& operator << (ostream& out, const QLink& l)
{ {
out <<"QLink nodes: " out <<"QLink nodes: "
<< l.node1()->GetID() << " - " << l.node1()->GetID() << " - "
@ -3777,7 +3777,7 @@ namespace { // Structures used by FixQuadraticElements()
<< l.node2()->GetID() << endl; << l.node2()->GetID() << endl;
return out; return out;
} }
ostream& operator << (ostream& out, const QFace& f) // todo: unused in release mode ostream& operator << (ostream& out, const QFace& f)
{ {
out <<"QFace nodes: "/*<< &f << " "*/; out <<"QFace nodes: "/*<< &f << " "*/;
for ( TIDSortedNodeSet::const_iterator n = f.begin(); n != f.end(); ++n ) for ( TIDSortedNodeSet::const_iterator n = f.begin(); n != f.end(); ++n )
@ -3791,7 +3791,7 @@ namespace { // Structures used by FixQuadraticElements()
//================================================================================ //================================================================================
/*! /*!
* \brief Construct QFace from QLinks * \brief Construct QFace from QLinks
*/ */
//================================================================================ //================================================================================
@ -3808,7 +3808,7 @@ namespace { // Structures used by FixQuadraticElements()
gp_Vec v1( XYZ( l1->node2()), XYZ( l1->node1())); gp_Vec v1( XYZ( l1->node2()), XYZ( l1->node1()));
gp_Vec v2( XYZ( l2->node1()), XYZ( l2->node2())); gp_Vec v2( XYZ( l2->node1()), XYZ( l2->node2()));
if ( l1->node1() != l2->node1() && l1->node2() != l2->node2() ) if ( l1->node1() != l2->node1() && l1->node2() != l2->node2() )
v1.Reverse(); v1.Reverse();
_normal += v1 ^ v2; _normal += v1 ^ v2;
} }
double normSqSize = _normal.SquareMagnitude(); double normSqSize = _normal.SquareMagnitude();
@ -3819,8 +3819,9 @@ namespace { // Structures used by FixQuadraticElements()
#ifdef _DEBUG_ #ifdef _DEBUG_
_face = face; _face = face;
#endif #else
(void)face; // unused in release mode (void)face; // unused in release mode
#endif
} }
//================================================================================ //================================================================================
/*! /*!
@ -5506,10 +5507,12 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
volExp.Set( *pentIt, /*ignoreCentralNodes=*/false ); volExp.Set( *pentIt, /*ignoreCentralNodes=*/false );
} }
} }
#ifdef _DEBUG_
// avoid warning: defined but not used operator<<() if ( false )
SMESH_Comment() << *links.begin() << *faces.begin(); // avoid warning: defined but not used operator<<()
#endif SMESH_Comment() << *links.begin() << *faces.begin();
return;
} }
//================================================================================ //================================================================================

View File

@ -745,34 +745,34 @@ namespace
//======================================================================= //=======================================================================
//function : ChangePolyhedronNodes //function : ChangePolyhedronNodes
//======================================================================= //=======================================================================
inline void ChangePolyhedronNodes (SMDS_Mesh* /*theMesh*/, inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh,
SMESH::log_array_var& /*theSeq*/, SMESH::log_array_var& theSeq,
CORBA::Long /*theId*/) CORBA::Long theId)
{ {
// const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
// CORBA::Long iind = 0, aNbElems = theSeq[theId].number; CORBA::Long iind = 0, aNbElems = theSeq[theId].number;
// for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++)
// { {
// // find element // find element
// const SMDS_MeshElement* elem = FindElement(theMesh, anIndexes[iind++]); const SMDS_MeshElement* elem = FindElement(theMesh, anIndexes[iind++]);
// // nb nodes // nb nodes
// int nbNodes = anIndexes[iind++]; int nbNodes = anIndexes[iind++];
// // nodes // nodes
// std::vector<const SMDS_MeshNode*> aNodes (nbNodes); std::vector<const SMDS_MeshNode*> aNodes (nbNodes);
// for (int iNode = 0; iNode < nbNodes; iNode++) { for (int iNode = 0; iNode < nbNodes; iNode++) {
// aNodes[iNode] = FindNode(theMesh, anIndexes[iind++]); aNodes[iNode] = FindNode(theMesh, anIndexes[iind++]);
// } }
// // nb faces // nb faces
// int nbFaces = anIndexes[iind++]; int nbFaces = anIndexes[iind++];
// // quantities // quantities
// std::vector<int> quantities (nbFaces); std::vector<int> quantities (nbFaces);
// for (int iFace = 0; iFace < nbFaces; iFace++) { for (int iFace = 0; iFace < nbFaces; iFace++) {
// quantities[iFace] = anIndexes[iind++]; quantities[iFace] = anIndexes[iind++];
// } }
// // change // change
// theMesh->ChangePolyhedronNodes(elem, aNodes, quantities); theMesh->ChangePolyhedronNodes(elem, aNodes, quantities);
// } }
} }
} }

View File

@ -3728,7 +3728,7 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList<int>& th
//======================================================================= //=======================================================================
SMESH::Filter::Criterion SMESHGUI_FilterDlg::createCriterion() SMESH::Filter::Criterion SMESHGUI_FilterDlg::createCriterion()
{ {
SMESH::Filter::Criterion aCriterion; SMESH::Filter::Criterion aCriterion;
aCriterion.Type = SMESH::FT_Undefined; aCriterion.Type = SMESH::FT_Undefined;
aCriterion.Compare = SMESH::FT_Undefined; aCriterion.Compare = SMESH::FT_Undefined;
@ -3751,7 +3751,7 @@ SMESH::Filter::Criterion SMESHGUI_FilterDlg::createCriterion()
void SMESHGUI_FilterDlg::onSelectionDone() void SMESHGUI_FilterDlg::onSelectionDone()
{ {
const SALOME_ListIO& aList = mySelector->StoredIObjects(); const SALOME_ListIO& aList = mySelector->StoredIObjects();
if ( myMesh->_is_nil() && aList.Extent()>0 ) if ( myMesh->_is_nil() && aList.Extent() > 0 )
{ {
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(aList.First()); myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(aList.First());
if ( !(myMesh->_is_nil()) ) { if ( !(myMesh->_is_nil()) ) {

View File

@ -1555,7 +1555,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true ); aViewWindow->highlight( myActor->getIO(), true, true );
if (send == LineEdit1) if (send == LineEdit1)
myOk1 = true; myOk1 = true;
else if (send == LineEdit2) else if (send == LineEdit2)
@ -1577,22 +1577,22 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool isEvenOneExists = false; bool atLeastOneExists = false;
for (int i = 0; i < aListId.count(); i++) { for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e) if (e)
{
newIndices.Add(e->GetID()); newIndices.Add(e->GetID());
atLeastOneExists = true;
if (!isEvenOneExists) }
isEvenOneExists = true;
} }
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true ); aViewWindow->highlight( myActor->getIO(), true, true );
if (isEvenOneExists) { if (atLeastOneExists) {
if (send == LineEdit1) if (send == LineEdit1)
myOk1 = true; myOk1 = true;
else if(send == LineEdit4) else if(send == LineEdit4)

View File

@ -226,6 +226,6 @@ SMESHGUI_EXPORT
SMESHGUI_EXPORT SMESHGUI_EXPORT
bool NoSmeshActors(SUIT_ViewWindow *theWnd=nullptr); bool NoSmeshActors(SUIT_ViewWindow *theWnd=nullptr);
}; }
#endif // SMESHGUI_VTKUTILS_H #endif // SMESHGUI_VTKUTILS_H

View File

@ -1130,8 +1130,8 @@ bool SMESH_Block::findUVByHalfDivision( const gp_Pnt& thePoint,
//================================================================================ //================================================================================
/*! /*!
* \brief Finds parameters corresponding to a given UV of a given face by searching * \brief Find parameters corresponding to a given UV of a given face by searching
* around the starting solution * around the starting solution
* \param [in] theUV - the UV to locate * \param [in] theUV - the UV to locate
* \param [in] tface - the face * \param [in] tface - the face
* \param [in,out] theParams - the starting parameters to improve * \param [in,out] theParams - the starting parameters to improve

View File

@ -101,10 +101,10 @@ class SMESH_OrientedIndexer : public SMESH_Indexer
public: public:
enum OriFlags //!< transformation types enum OriFlags //!< transformation types
{ {
REV_X = 1, REV_Y = 2, SWAP_XY = 4, MAX_ORI = REV_X|REV_Y|SWAP_XY NO_TRSF = 0, REV_X = 1, REV_Y = 2, SWAP_XY = 4, MAX_ORI = REV_X|REV_Y|SWAP_XY
}; };
SMESH_OrientedIndexer( const SMESH_Indexer& indexer, const int oriFlags ): SMESH_OrientedIndexer( const SMESH_Indexer& indexer, const int oriFlags = NO_TRSF):
TFather( indexer._xSize, indexer._ySize ), TFather( indexer._xSize, indexer._ySize ),
_xRevFun( (oriFlags & REV_X) ? & reverse : & lazy ), _xRevFun( (oriFlags & REV_X) ? & reverse : & lazy ),
_yRevFun( (oriFlags & REV_Y) ? & reverse : & lazy ), _yRevFun( (oriFlags & REV_Y) ? & reverse : & lazy ),

View File

@ -418,8 +418,10 @@ namespace
*/ */
//================================================================================ //================================================================================
void bndSegsToMesh( const vector< vector< BndSeg > >& /*bndSegsPerEdge*/ ) void bndSegsToMesh( const vector< vector< BndSeg > >& bndSegsPerEdge )
{ {
if ( bndSegsPerEdge.empty() )
return;
#ifdef _MYDEBUG_ #ifdef _MYDEBUG_
if ( !getenv("bndSegsToMesh")) return; if ( !getenv("bndSegsToMesh")) return;
map< const TVDVertex *, int > v2Node; map< const TVDVertex *, int > v2Node;

View File

@ -2022,6 +2022,8 @@ namespace SMESH_MeshAlgos
#ifdef _DEBUG_ #ifdef _DEBUG_
std::cerr << "BAD tria" << std::endl; std::cerr << "BAD tria" << std::endl;
cf.Dump(); cf.Dump();
#else
if ( i < 0 ) cf.Dump(); // avoid "CutFace::Dump() unused in release mode"
#endif #endif
continue; continue;
} }
@ -2358,7 +2360,7 @@ namespace
*/ */
//================================================================================ //================================================================================
void CutFace::Dump() const // todo: unused in release mode void CutFace::Dump() const
{ {
std::cout << std::endl << "INI F " << myInitFace->GetID() << std::endl; std::cout << std::endl << "INI F " << myInitFace->GetID() << std::endl;
for ( size_t i = 0; i < myLinks.size(); ++i ) for ( size_t i = 0; i < myLinks.size(); ++i )
@ -2779,12 +2781,10 @@ namespace
} }
} }
if ( closestNode1 && closestNode2 ) { size_t i = myLinks.size();
size_t i = myLinks.size(); myLinks.resize( i + 2 );
myLinks.resize( i + 2 ); myLinks[ i ].Set( closestNode1, closestNode2 );
myLinks[ i ].Set( closestNode1, closestNode2 ); myLinks[ i+1 ].Set( closestNode2, closestNode1 );
myLinks[ i+1 ].Set( closestNode2, closestNode1 );
}
} }
return true; return true;

View File

@ -359,7 +359,7 @@ namespace
{ {
SMESH_MeshAlgos::PolySegment& polySeg = mySegments[ iSeg ]; SMESH_MeshAlgos::PolySegment& polySeg = mySegments[ iSeg ];
if ( ( polySeg.myXYZ[0] - polySeg.myXYZ[1] ).SquareModulus() == 0 ) if (( polySeg.myXYZ[0] - polySeg.myXYZ[1] ).SquareModulus() == 0 )
{ {
myPaths[ iSeg ].AddPoint( polySeg.myXYZ[0] ); myPaths[ iSeg ].AddPoint( polySeg.myXYZ[0] );
myPaths[ iSeg ].AddPoint( polySeg.myXYZ[1] ); myPaths[ iSeg ].AddPoint( polySeg.myXYZ[1] );

View File

@ -931,7 +931,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
Threshold = SMESH + types[ iGeom ]; Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_ #ifdef _DEBUG_
// is types complete? (compilation failure means that enum GeometryType changed) // is types complete? (compilation failure means that enum GeometryType changed)
int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1]; // _asrt[1] may be used uninitialized => replace this with static_assert? static_assert( sizeof(types) / sizeof(const char*) == nbTypes,
"Update names of GeometryType's!!!" );
#endif #endif
} }
if (Type == "SMESH.FT_EntityType") if (Type == "SMESH.FT_EntityType")
@ -951,7 +952,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
Threshold = SMESH + types[ iGeom ]; Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_ #ifdef _DEBUG_
// is 'types' complete? (compilation failure means that enum EntityType changed) // is 'types' complete? (compilation failure means that enum EntityType changed)
int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1]; // _asrt[1] may be used uninitialized => replace this with static_assert? static_assert( sizeof(types) / sizeof(const char*) == nbTypes,
"Update names of EntityType's!!!" );
#endif #endif
} }
} }

View File

@ -843,7 +843,7 @@ void BelongToMeshGroup_i::SetGroupID( const char* theID ) // IOR or StoreName
std::string BelongToMeshGroup_i::GetGroupID() std::string BelongToMeshGroup_i::GetGroupID()
{ {
if ( myGroup->_is_nil() ) if ( myGroup->_is_nil() )
SMESH::SMESH_GroupBase_var( GetGroup() ); // todo: unnecessary parentheses? SMESH::SMESH_GroupBase_var( GetGroup() ); // decref the returned pointer
if ( !myGroup->_is_nil() ) if ( !myGroup->_is_nil() )
myID = SMESH_Gen_i::GetORB()->object_to_string( myGroup ); myID = SMESH_Gen_i::GetORB()->object_to_string( myGroup );

View File

@ -6346,7 +6346,6 @@ CORBA::Boolean SMESH_Gen_i::IsApplicable ( const char* theAlgoType,
SMESH_TRY; SMESH_TRY;
std::string aPlatformLibName; std::string aPlatformLibName;
//typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char*);
GenericHypothesisCreator_i* aCreator = GenericHypothesisCreator_i* aCreator =
getHypothesisCreator(theAlgoType, theLibName, aPlatformLibName); getHypothesisCreator(theAlgoType, theLibName, aPlatformLibName);
if (aCreator) if (aCreator)

View File

@ -286,7 +286,7 @@ void SMESH_NoteBook::ReplaceVariables()
varIndex = atoi( varIndexPtr ); varIndex = atoi( varIndexPtr );
if ( 0 <= (int)varIndex && varIndex < vars.size() && !vars[varIndex].empty() ) if ( 0 <= (int)varIndex && varIndex < vars.size() && !vars[varIndex].empty() )
{ {
// replace '$VarIndex$' either by var name of var value // replace '$VarIndex$' either by var name or var value
const char var0 = vars[varIndex][0]; const char var0 = vars[varIndex][0];
const bool isValue = (( '0' <= var0 && var0 <= '9' ) || var0 == '-'); const bool isValue = (( '0' <= var0 && var0 <= '9' ) || var0 == '-');
if ( isValue ) // remove TVar::Quote() as well if ( isValue ) // remove TVar::Quote() as well

View File

@ -672,7 +672,7 @@ namespace SMESH
#ifdef _DEBUG_ #ifdef _DEBUG_
std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::endl; std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::endl;
#else #else
(void)text; // todo: unused in release mode (void)text; // unused in release mode
#endif #endif
} }

View File

@ -127,7 +127,7 @@ bool StdMeshers_BlockRenumber::IsSolidIncluded( SMESH_Mesh& mesh,
//======================================================================= //=======================================================================
SMESH_ComputeErrorPtr StdMeshers_BlockRenumber::CheckHypothesis(SMESH_Mesh& aMesh, SMESH_ComputeErrorPtr StdMeshers_BlockRenumber::CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape) const const TopoDS_Shape& /*shape*/) const
{ {
SMESH_Comment errorTxt; SMESH_Comment errorTxt;
for ( size_t i = 0; i < _blockCS.size() && errorTxt.empty(); ++i ) for ( size_t i = 0; i < _blockCS.size() && errorTxt.empty(); ++i )
@ -313,7 +313,7 @@ namespace boost {
//======================================================================= //=======================================================================
template<class Archive> template<class Archive>
void serialize(Archive & ar, StdMeshers_BlockCS & blockCS, const unsigned int version) void serialize(Archive & ar, StdMeshers_BlockCS & blockCS, const unsigned int /*version*/)
{ {
ar & blockCS._solid; ar & blockCS._solid;
ar & blockCS._vertex000; ar & blockCS._vertex000;

View File

@ -86,14 +86,14 @@ public:
* \param theShape - the geometry of interest * \param theShape - the geometry of interest
* \retval bool - true if parameter values have been successfully defined * \retval bool - true if parameter values have been successfully defined
*/ */
bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape) override bool SetParametersByMesh(const SMESH_Mesh* /*mesh*/, const TopoDS_Shape& /*shape*/) override
{ return false; } { return false; }
/*! /*!
* \brief Initialize my parameter values by default parameters. * \brief Initialize my parameter values by default parameters.
* \retval bool - true if parameter values have been successfully defined * \retval bool - true if parameter values have been successfully defined
*/ */
bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0) override bool SetParametersByDefaults(const TDefaults& /*dflts*/, const SMESH_Mesh* /*mesh*/=0) override
{ return false; } { return false; }
public: public:
@ -115,7 +115,7 @@ public:
// Persistence: define both input and output at once // Persistence: define both input and output at once
friend class boost::serialization::access; friend class boost::serialization::access;
template<class Archive> void serialize( Archive & ar, const unsigned int version ) template<class Archive> void serialize( Archive & ar, const unsigned int /*version*/ )
{ {
ar & _blockCS; ar & _blockCS;
} }

View File

@ -2563,7 +2563,7 @@ namespace
case 3: // at a corner case 3: // at a corner
{ {
_Node& node = _hexNodes[ subEntity - SMESH_Block::ID_FirstV ]; _Node& node = _hexNodes[ subEntity - SMESH_Block::ID_FirstV ];
if ( node.Node() != 0 ) if ( node.Node() )
{ {
if ( node._intPoint ) if ( node._intPoint )
node._intPoint->Add( _eIntPoints[ iP ]->_faceIDs, _eIntPoints[ iP ]->_node ); node._intPoint->Add( _eIntPoints[ iP ]->_faceIDs, _eIntPoints[ iP ]->_node );
@ -3503,7 +3503,7 @@ namespace
continue; continue;
// perform intersection // perform intersection
E_IntersectPoint* eip, *vip = 0; // todo: vip must be explicitly initialized to avoid warning (see below) E_IntersectPoint* eip, *vip = 0;
for ( int iDirZ = 0; iDirZ < 3; ++iDirZ ) for ( int iDirZ = 0; iDirZ < 3; ++iDirZ )
{ {
GridPlanes& planes = pln[ iDirZ ]; GridPlanes& planes = pln[ iDirZ ];
@ -3604,7 +3604,7 @@ namespace
vip = _grid->Add( ip ); vip = _grid->Add( ip );
if ( isInternal && !sameV ) if ( isInternal && !sameV )
vip->_faceIDs.push_back( _grid->PseudoIntExtFaceID() ); vip->_faceIDs.push_back( _grid->PseudoIntExtFaceID() );
if ( !addIntersection( vip, hexes, ijk, d000 ) && !sameV ) // todo: vip must be explicitly initialized to avoid warning (see above) if ( !addIntersection( vip, hexes, ijk, d000 ) && !sameV )
_grid->Remove( vip ); _grid->Remove( vip );
ip._shapeID = edgeID; ip._shapeID = edgeID;
} }

View File

@ -44,6 +44,7 @@
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <Bnd_B3d.hxx>
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx> #include <Standard_Failure.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
@ -61,10 +62,9 @@
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <list> #include <list>
#include <numeric>
#include <set> #include <set>
#include <vector> #include <vector>
#include <numeric>
#include <Bnd_B3d.hxx>
using namespace std; using namespace std;

View File

@ -55,7 +55,6 @@
#include "Utils_ExceptHandlers.hxx" #include "Utils_ExceptHandlers.hxx"
#include <cstddef> #include <cstddef>
#include <numeric> #include <numeric>
typedef SMESH_Comment TComm; typedef SMESH_Comment TComm;

View File

@ -123,17 +123,19 @@ namespace {
bool storeShapeForDebug(const TopoDS_Shape& shape) bool storeShapeForDebug(const TopoDS_Shape& shape)
{ {
bool toShow;
#ifdef _DEBUG_ #ifdef _DEBUG_
const char* type[] ={"COMPOUND","COMPSOLID","SOLID","SHELL","FACE","WIRE","EDGE","VERTEX"}; const char* type[] ={"COMPOUND","COMPSOLID","SOLID","SHELL","FACE","WIRE","EDGE","VERTEX"};
BRepTools::Write( shape, SMESH_Comment("/tmp/") << type[shape.ShapeType()] << "_" BRepTools::Write( shape, SMESH_Comment("/tmp/") << type[shape.ShapeType()] << "_"
<< shape.TShape().operator->() << ".brep"); << shape.TShape().operator->() << ".brep");
if ( !theMeshDS[0] ) { toShow = !theMeshDS[0]; // no show
show_shape( TopoDS_Shape(), "avoid warning: show_shape() defined but not used"); #else
toShow = theMeshDS[0]; // no show
#endif
if ( toShow ) {
show_shape( shape, "avoid warning: show_shape() defined but not used");
show_list( "avoid warning: show_list() defined but not used", list< TopoDS_Edge >() ); show_list( "avoid warning: show_list() defined but not used", list< TopoDS_Edge >() );
} }
#else
(void)shape; // unused in release mode
#endif
return false; return false;
} }
@ -540,8 +542,10 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
// b) find association of a couple of vertices and recall self. // b) find association of a couple of vertices and recall self.
// //
#ifdef _DEBUG_
theMeshDS[0] = theMesh1->GetMeshDS(); // debug theMeshDS[0] = theMesh1->GetMeshDS(); // debug
theMeshDS[1] = theMesh2->GetMeshDS(); theMeshDS[1] = theMesh2->GetMeshDS();
#endif
// ================================================================================= // =================================================================================
// 1) Is it the case of associating a group member -> another group? (PAL16202, 16203) // 1) Is it the case of associating a group member -> another group? (PAL16202, 16203)

View File

@ -487,7 +487,7 @@ void StdMeshersGUI_BlockRenumberCreator::onRemoveBtnClick()
*/ */
//================================================================================ //================================================================================
bool StdMeshersGUI_BlockRenumberCreator::checkParams( QString& msg ) const bool StdMeshersGUI_BlockRenumberCreator::checkParams( QString& /*msg*/ ) const
{ {
return true; return true;
} }

View File

@ -123,8 +123,9 @@ StdMeshers::blockcs_array* StdMeshers_BlockRenumber_i::GetBlocksOrientation()
*/ */
//================================================================================ //================================================================================
bool StdMeshers_BlockRenumber_i::getObjectsDependOn( std::vector< std::string > & entryArray, bool
std::vector< int > & subIDArray ) const StdMeshers_BlockRenumber_i::getObjectsDependOn( std::vector< std::string > & entryArray,
std::vector< int > & /*subIDArray*/ ) const
{ {
const std::vector< StdMeshers_BlockCS >& bcsVec = const std::vector< StdMeshers_BlockCS >& bcsVec =
const_cast<StdMeshers_BlockRenumber_i*>(this)->GetImpl()->GetBlocksOrientation(); const_cast<StdMeshers_BlockRenumber_i*>(this)->GetImpl()->GetBlocksOrientation();
@ -145,7 +146,7 @@ bool StdMeshers_BlockRenumber_i::getObjectsDependOn( std::vector< std::string >
//================================================================================ //================================================================================
bool StdMeshers_BlockRenumber_i::setObjectsDependOn( std::vector< std::string > & entryArray, bool StdMeshers_BlockRenumber_i::setObjectsDependOn( std::vector< std::string > & entryArray,
std::vector< int > & subIDArray ) std::vector< int > & /*subIDArray*/ )
{ {
std::vector< StdMeshers_BlockCS > bcsVec( entryArray.size() / 3 ); std::vector< StdMeshers_BlockCS > bcsVec( entryArray.size() / 3 );
for ( size_t i = 0; i + 2 < entryArray.size(); i += 3 ) for ( size_t i = 0; i + 2 < entryArray.size(); i += 3 )