diff --git a/src/Driver/Driver_Mesh.cxx b/src/Driver/Driver_Mesh.cxx index edf91376e..30000d5df 100644 --- a/src/Driver/Driver_Mesh.cxx +++ b/src/Driver/Driver_Mesh.cxx @@ -123,15 +123,15 @@ std::string Driver_Mesh::fixUTF8(const std::string & str ) // how many bytes follow? int len = 0; - if (s[i] >> 5 == 0b110 ) len = 1; - else if (s[i] >> 4 == 0b1110 ) len = 2; - else if (s[i] >> 3 == 0b11110) len = 3; + if (s[i] >> 5 == 0b110 ) len = 1; // todo: binary constants are a GCC extension + else if (s[i] >> 4 == 0b1110 ) len = 2; // todo: binary constants are a GCC extension + else if (s[i] >> 3 == 0b11110) len = 3; // todo: binary constants are a GCC extension else invalid = true; // check the bytes for ( int j = 0; j < len && !invalid; ++j ) - invalid = ( s[i+j+1] >> 6 != 0b10 ); + invalid = ( s[i+j+1] >> 6 != 0b10 ); // todo: binary constants are a GCC extension if ( invalid ) fixed[i] = '?'; diff --git a/src/DriverCGNS/DriverCGNS_Read.cxx b/src/DriverCGNS/DriverCGNS_Read.cxx index 967628af2..08dd9524c 100644 --- a/src/DriverCGNS/DriverCGNS_Read.cxx +++ b/src/DriverCGNS/DriverCGNS_Read.cxx @@ -134,12 +134,12 @@ namespace ids[2] = ids[0] + _sizeX + 1; ids[3] = ids[0] + ( k==_sizeZ ? _sizeX : 1); } - void IEdgeNodes( int i, int j, int k, cgsize_t* ids ) const // edge perpendiculaire to X (2D) + void IEdgeNodes( int i, int j, int /*k*/, cgsize_t* ids ) const // edge perpendiculaire to X (2D) { ids[0] = NodeID( i, j, 0 ); ids[1] = ids[0] + _sizeX; } - void JEdgeNodes( int i, int j, int k, cgsize_t* ids ) const + void JEdgeNodes( int i, int j, int /*k*/, cgsize_t* ids ) const { ids[0] = NodeID( i, j, 0 ); ids[1] = ids[0] + 1; @@ -187,7 +187,7 @@ namespace } gp_XYZ Next() { - gp_XYZ res( _cur[0], _cur[1], _cur[2] ); + gp_XYZ res( _cur[0], _cur[1], _cur[2] ); // todo: _cur can be used uninitialized for ( int i = 0; i < _dim; ++i ) { _cur[i] += _dir[i]; @@ -207,7 +207,7 @@ namespace size *= _dir[i]*(_end[i]-_beg[i]); return size; } - gp_XYZ Begin() const { return gp_XYZ( _beg[0], _beg[1], _beg[2] ); } + gp_XYZ Begin() const { return gp_XYZ( _beg[0], _beg[1], _beg[2] ); } // todo: _beg can be used uninitialized //gp_XYZ End() const { return gp_XYZ( _end[0]-1, _end[1]-1, _end[2]-1 ); } }; @@ -297,7 +297,7 @@ namespace } // fill nodeReplacementMap - TPointRangeIterator rangeIt1( range, _meshDim ); + TPointRangeIterator rangeIt1( range, _meshDim ); // todo: rangeIt1: _end[i], _dir[i], _beg[i], _cur[i] may be used uninitialized TPointRangeIterator rangeIt2( donorRange, _meshDim ); gp_XYZ begin1 = rangeIt1.Begin(), begin2 = rangeIt2.Begin(), index1, index2; if ( &zone2 == this ) @@ -1073,14 +1073,14 @@ Driver_Mesh::Status DriverCGNS_Read::Perform() PGetNodesFun getNodesFun = 0; if ( elemType == SMDSAbs_Face && meshDim == 3 ) switch ( axis ) { - case 0: getNodesFun = & TZoneData::IFaceNodes; - case 1: getNodesFun = & TZoneData::JFaceNodes; - case 2: getNodesFun = & TZoneData::KFaceNodes; + case 0: getNodesFun = & TZoneData::IFaceNodes; break; + case 1: getNodesFun = & TZoneData::JFaceNodes; break; + case 2: getNodesFun = & TZoneData::KFaceNodes; break; } else if ( elemType == SMDSAbs_Edge && meshDim == 2 ) switch ( axis ) { - case 0: getNodesFun = & TZoneData::IEdgeNodes; - case 1: getNodesFun = & TZoneData::JEdgeNodes; + case 0: getNodesFun = & TZoneData::IEdgeNodes; break; + case 1: getNodesFun = & TZoneData::JEdgeNodes; break; } if ( !getNodesFun ) { @@ -1103,14 +1103,14 @@ Driver_Mesh::Status DriverCGNS_Read::Perform() PGetNodesFun getNodesFun = 0; if ( elemType == SMDSAbs_Face ) switch ( axis ) { - case 0: getNodesFun = & TZoneData::IFaceNodes; - case 1: getNodesFun = & TZoneData::JFaceNodes; - case 2: getNodesFun = & TZoneData::KFaceNodes; + case 0: getNodesFun = & TZoneData::IFaceNodes; break; + case 1: getNodesFun = & TZoneData::JFaceNodes; break; + case 2: getNodesFun = & TZoneData::KFaceNodes; break; } else if ( elemType == SMDSAbs_Edge && meshDim == 2 ) switch ( axis ) { - case 0: getNodesFun = & TZoneData::IEdgeNodes; - case 1: getNodesFun = & TZoneData::JEdgeNodes; + case 0: getNodesFun = & TZoneData::IEdgeNodes; break; + case 1: getNodesFun = & TZoneData::JEdgeNodes; break; } if ( !getNodesFun ) { @@ -1129,9 +1129,9 @@ Driver_Mesh::Status DriverCGNS_Read::Perform() PAddElemFun addElemFun = 0; switch ( meshDim ) { - case 1: addElemFun = & add_BAR_2; - case 2: addElemFun = & add_QUAD_4; - case 3: addElemFun = & add_HEXA_8; + case 1: addElemFun = & add_BAR_2; break; + case 2: addElemFun = & add_QUAD_4; break; + case 3: addElemFun = & add_HEXA_8; break; } int elemID = meshInfo.NbElements(); const SMDS_MeshElement* elem = 0; diff --git a/src/DriverGMF/libmesh5.c b/src/DriverGMF/libmesh5.c index 2c889ccc2..e1fe65fb6 100644 --- a/src/DriverGMF/libmesh5.c +++ b/src/DriverGMF/libmesh5.c @@ -78,7 +78,7 @@ typedef struct static int GmfIniFlg=0; static GmfMshSct *GmfMshTab[ MaxMsh + 1 ]; -// see MeshGems/Docs/meshgems_formats_description.pdf +/* see MeshGems/Docs/meshgems_formats_description.pdf */ static const char *GmfKwdFmt[ GmfMaxKwd + 1 ][4] = { {"Reserved", "", "", ""}, {"MeshVersionFormatted", "", "", "i"}, @@ -875,7 +875,7 @@ void GmfSetLin(int MshIdx, int KwdCod, ...) { for(i=0;iSolSiz;i++) if(kwd->fmt[i] == 'r') - fprintf(msh->hdl, "%.15lg ", va_arg(VarArg, double)); + fprintf(msh->hdl, "%.15lg ", va_arg(VarArg, double)); /* todo: ISO C90 does not support the '%lg' gnu_printf format */ else if(kwd->fmt[i] == 'n') { nb_repeat = va_arg(VarArg, int); fprintf(msh->hdl, "%d ", nb_repeat); @@ -936,7 +936,7 @@ void GmfSetLin(int MshIdx, int KwdCod, ...) if(msh->typ & Asc) for(j=0;jSolSiz;j++) - fprintf(msh->hdl, "%.15lg ", DblSolTab[j]); + fprintf(msh->hdl, "%.15lg ", DblSolTab[j]); /* todo: ISO C90 does not support the '%lg' gnu_printf format */ else RecBlk(msh, (unsigned char *)DblSolTab, kwd->NmbWrd); } @@ -1064,7 +1064,7 @@ static int ScaKwdTab(GmfMshSct *msh) { /* Search which kwd code this string is associated with, then get its header and save the current position in file (just before the data) */ - // printf("libmesh ScaKwdTab %s\n", str); + /* printf("libmesh ScaKwdTab %s\n", str); */ for(KwdCod=1; KwdCod<= GmfMaxKwd; KwdCod++) if(!strcmp(str, GmfKwdFmt[ KwdCod ][0])) { @@ -1191,7 +1191,7 @@ static void ExpFmt(GmfMshSct *msh, int KwdCod) i = kwd->SolSiz = kwd->NmbWrd = 0; - while(i < strlen(InpFmt)) + while(i < (int)strlen(InpFmt)) { chr = InpFmt[ i++ ]; diff --git a/src/DriverGMF/libmesh5.h b/src/DriverGMF/libmesh5.h index 6345d1df3..55a9c6d66 100644 --- a/src/DriverGMF/libmesh5.h +++ b/src/DriverGMF/libmesh5.h @@ -18,7 +18,15 @@ /* Defines */ /*----------------------------------------------------------*/ -#include "SMESH_DriverGMF.hxx" +#ifdef WIN32 + #if defined MESHDriverGMF_EXPORTS || defined MeshDriverGMF_EXPORTS + #define MESHDriverGMF_EXPORT __declspec( dllexport ) + #else + #define MESHDriverGMF_EXPORT __declspec( dllimport ) + #endif +#else + #define MESHDriverGMF_EXPORT +#endif #define GmfStrSiz 1024 #define GmfMaxTyp 1000 @@ -33,7 +41,7 @@ #define GmfFloat 1 #define GmfDouble 2 -// see MeshGems/Docs/meshgems_formats_description.pdf +/* see MeshGems/Docs/meshgems_formats_description.pdf */ enum GmfKwdCod { GmfReserved1, \ diff --git a/src/DriverMED/DriverMED_W_Field.cxx b/src/DriverMED/DriverMED_W_Field.cxx index f48223321..197cd1cb8 100644 --- a/src/DriverMED/DriverMED_W_Field.cxx +++ b/src/DriverMED/DriverMED_W_Field.cxx @@ -156,7 +156,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh, else _dblValues.reserve( nbElems * nbComps ); - return nbElems * nbComps; + return nbElems && nbComps; } //================================================================================ diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 9fbaac2ab..052869ab8 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -379,7 +379,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() if ( myAutoDimension && aMeshDimension < 3 ) { SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(); - double aBounds[6]; + double aBounds[6] = {0.,0.,0.,0.,0.,0.}; if(aNodesIter->more()){ const SMDS_MeshNode* aNode = aNodesIter->next(); aBounds[0] = aBounds[1] = aNode->X(); diff --git a/src/MEDWrapper/MED_Algorithm.cxx b/src/MEDWrapper/MED_Algorithm.cxx index 149cb3c5d..c36c53096 100644 --- a/src/MEDWrapper/MED_Algorithm.cxx +++ b/src/MEDWrapper/MED_Algorithm.cxx @@ -28,8 +28,8 @@ static int MYDEBUG = 0; static int MYVALUEDEBUG = 0; #else -static int MYDEBUG = 0; -static int MYVALUEDEBUG = 0; +static int MYDEBUG = 0; // todo: unused in release mode +static int MYVALUEDEBUG = 0; // todo: unused in release mode #endif namespace MED diff --git a/src/MEDWrapper/MED_GaussUtils.cxx b/src/MEDWrapper/MED_GaussUtils.cxx index 2dfdef1af..314b7c558 100644 --- a/src/MEDWrapper/MED_GaussUtils.cxx +++ b/src/MEDWrapper/MED_GaussUtils.cxx @@ -27,8 +27,8 @@ static int MYDEBUG = 0; static int MYVALUEDEBUG = 0; #else -static int MYDEBUG = 0; -static int MYVALUEDEBUG = 0; +static int MYDEBUG = 0; // todo: unused in release mode +static int MYVALUEDEBUG = 0; // todo: unused in release mode #endif namespace MED diff --git a/src/MEDWrapper/MED_Structures.cxx b/src/MEDWrapper/MED_Structures.cxx index a0e91f4a3..aa7777c10 100644 --- a/src/MEDWrapper/MED_Structures.cxx +++ b/src/MEDWrapper/MED_Structures.cxx @@ -352,10 +352,10 @@ namespace MED TGaussInfo::TLess ::operator()(const TGaussInfo& theLeft, const TGaussInfo& theRight) const { - if(!&theLeft) + if(!&theLeft) // todo: address of reference can be assumed always non-null by compiler return true; - if(!&theRight) + if(!&theRight) // todo: address of reference can be assumed always non-null by compiler return false; if(theLeft.myGeom != theRight.myGeom) @@ -644,13 +644,14 @@ namespace MED switch(aDim){ case 3: aCoord[2] = myCoord[aDim*theId+2]; + // fall through case 2: aCoord[1] = myCoord[aDim*theId+1]; - case 1:{ + // fall through + case 1: aCoord[0] = myCoord[aDim*theId]; break; } - } } else { TFloatVector aVecX = this->GetIndexes(0); diff --git a/src/MEDWrapper/MED_Utilities.cxx b/src/MEDWrapper/MED_Utilities.cxx index 97c48e3ee..2c7cf7c4d 100644 --- a/src/MEDWrapper/MED_Utilities.cxx +++ b/src/MEDWrapper/MED_Utilities.cxx @@ -26,7 +26,7 @@ #ifdef _DEBUG_ static int MYDEBUG = 0; #else -static int MYDEBUG = 0; +static int MYDEBUG = 0; // todo: unused in release mode #endif int MED::PrefixPrinter::myCounter = 0; @@ -39,7 +39,7 @@ MED::PrefixPrinter::PrefixPrinter(bool theIsActive): MSG(MYDEBUG,"MED::PrefixPrinter::PrefixPrinter(...)- "<GetMTime(); vtkMTimeType anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime(); diff --git a/src/OBJECT/SMESH_CellLabelActor.cxx b/src/OBJECT/SMESH_CellLabelActor.cxx index a9ba9794a..07275df16 100644 --- a/src/OBJECT/SMESH_CellLabelActor.cxx +++ b/src/OBJECT/SMESH_CellLabelActor.cxx @@ -205,7 +205,7 @@ void SMESH_CellLabelActor::UpdateLabels() void SMESH_CellLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, + unsigned long /*theEvent*/, void* theClientData, void* vtkNotUsed(theCallData)) { diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 4cfee4756..882326963 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -410,7 +410,7 @@ SMESH_DeviceActor aNbCells = 0; for(; anIter != aValues.end(); anIter++){ const Length2D::Value& aValue = *anIter; - int aNode[2] = { + vtkIdType aNode[2] = { myVisualObj->GetNodeVTKId(aValue.myPntId[0]), myVisualObj->GetNodeVTKId(aValue.myPntId[1]) }; @@ -475,7 +475,7 @@ SMESH_DeviceActor aNbCells = 0; for(; anIter != aValues.end(); anIter++){ const MultiConnection2D::Value& aValue = (*anIter).first; - int aNode[2] = { + vtkIdType aNode[2] = { myVisualObj->GetNodeVTKId(aValue.myPntId[0]), myVisualObj->GetNodeVTKId(aValue.myPntId[1]) }; @@ -573,7 +573,7 @@ SMESH_DeviceActor FreeEdges::TBorders::const_iterator anIter = aBorders.begin(); for(; anIter != aBorders.end(); anIter++){ const FreeEdges::Border& aBorder = *anIter; - int aNode[2] = { + vtkIdType aNode[2] = { myVisualObj->GetNodeVTKId(aBorder.myPntId[0]), myVisualObj->GetNodeVTKId(aBorder.myPntId[1]) }; diff --git a/src/OBJECT/SMESH_NodeLabelActor.cxx b/src/OBJECT/SMESH_NodeLabelActor.cxx index e488600ae..4d4afbf41 100644 --- a/src/OBJECT/SMESH_NodeLabelActor.cxx +++ b/src/OBJECT/SMESH_NodeLabelActor.cxx @@ -195,7 +195,7 @@ void SMESH_NodeLabelActor::UpdateLabels() void SMESH_NodeLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, + unsigned long /*theEvent*/, void* theClientData, void* vtkNotUsed(theCallData)) { diff --git a/src/OBJECT/SMESH_ScalarBarActor.cxx b/src/OBJECT/SMESH_ScalarBarActor.cxx index dd57991e8..6ea4849a6 100644 --- a/src/OBJECT/SMESH_ScalarBarActor.cxx +++ b/src/OBJECT/SMESH_ScalarBarActor.cxx @@ -43,9 +43,9 @@ vtkStandardNewMacro(SMESH_ScalarBarActor) -vtkCxxSetObjectMacro(SMESH_ScalarBarActor,LookupTable,vtkScalarsToColors); -vtkCxxSetObjectMacro(SMESH_ScalarBarActor,LabelTextProperty,vtkTextProperty); -vtkCxxSetObjectMacro(SMESH_ScalarBarActor,TitleTextProperty,vtkTextProperty); +vtkCxxSetObjectMacro(SMESH_ScalarBarActor,LookupTable,vtkScalarsToColors) +vtkCxxSetObjectMacro(SMESH_ScalarBarActor,LabelTextProperty,vtkTextProperty) +vtkCxxSetObjectMacro(SMESH_ScalarBarActor,TitleTextProperty,vtkTextProperty) //---------------------------------------------------------------------------- // Instantiate object with 64 maximum colors; 5 labels; %%-#6.3g label diff --git a/src/SMDS/SMDS_ElementFactory.hxx b/src/SMDS/SMDS_ElementFactory.hxx index b45323c7f..86d7408ce 100644 --- a/src/SMDS/SMDS_ElementFactory.hxx +++ b/src/SMDS/SMDS_ElementFactory.hxx @@ -231,7 +231,7 @@ struct _RangeSet * \brief Return ranges of indices (from,to) of elements having a given value */ bool GetIndices( const attr_t theValue, TIndexRanges & theIndices, - const attr_t* theMinValue = 0, const attr_t* theMaxValue = 0) const + const attr_t* /*theMinValue*/ = 0, const attr_t* /*theMaxValue*/ = 0) const { bool isFound = false; diff --git a/src/SMDS/SMDS_MemoryLimit.cxx b/src/SMDS/SMDS_MemoryLimit.cxx index bb3bb3fb8..426d63a92 100644 --- a/src/SMDS/SMDS_MemoryLimit.cxx +++ b/src/SMDS/SMDS_MemoryLimit.cxx @@ -33,7 +33,7 @@ #include #endif -int main (int argc, char ** argv) +int main () { // To better understand what is going on here, consult bug [SALOME platform 0019911] #if !defined WIN32 && !defined __APPLE__ diff --git a/src/SMDS/SMDS_Position.hxx b/src/SMDS/SMDS_Position.hxx index 30c09d93e..7e8dd30d5 100644 --- a/src/SMDS/SMDS_Position.hxx +++ b/src/SMDS/SMDS_Position.hxx @@ -62,7 +62,7 @@ class SMDS_Ptr : public std::unique_ptr< T > SMDS_Ptr( T * pos = (T *) 0, bool isOwner=true ): std::unique_ptr< T >( pos ), myIsOwner( isOwner ) {} - SMDS_Ptr( const SMDS_Ptr& from ) : myIsOwner( from.myIsOwner ) + SMDS_Ptr( const SMDS_Ptr& from ) : std::unique_ptr< T >(), myIsOwner( from.myIsOwner ) { this->swap( const_cast( from )); } SMDS_Ptr& operator=( const SMDS_Ptr& from ) diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index efb682f6b..8da9a287b 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -482,6 +482,7 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool /*withEdges*/) GuessSize[VTK_QUADRATIC_HEXAHEDRON] = nbQuadHexa; GuessSize[VTK_TRIQUADRATIC_HEXAHEDRON] = nbQuadHexa; GuessSize[VTK_HEXAGONAL_PRISM] = nbHexPrism; + (void)GuessSize; // unused in Release mode _downArray[VTK_LINE] ->allocate(nbLineGuess); _downArray[VTK_QUADRATIC_EDGE] ->allocate(nbQuadEdgeGuess); diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index 14c1fbddc..be3370ae0 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -1488,10 +1488,10 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, case QUAD_TETRA: { switch ( minInd ) { - case 0: if( maxInd==4 || maxInd==6 || maxInd==7 ) return true; - case 1: if( maxInd==4 || maxInd==5 || maxInd==8 ) return true; - case 2: if( maxInd==5 || maxInd==6 || maxInd==9 ) return true; - case 3: if( maxInd==7 || maxInd==8 || maxInd==9 ) return true; + case 0: if( maxInd==4 || maxInd==6 || maxInd==7 ) return true; // fall through + case 1: if( maxInd==4 || maxInd==5 || maxInd==8 ) return true; // fall through + case 2: if( maxInd==5 || maxInd==6 || maxInd==9 ) return true; // fall through + case 3: if( maxInd==7 || maxInd==8 || maxInd==9 ) return true; // fall through default:; } break; @@ -1499,14 +1499,14 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, case QUAD_HEXA: { switch ( minInd ) { - case 0: if( maxInd==8 || maxInd==11 || maxInd==16 ) return true; - case 1: if( maxInd==8 || maxInd==9 || maxInd==17 ) return true; - case 2: if( maxInd==9 || maxInd==10 || maxInd==18 ) return true; - case 3: if( maxInd==10 || maxInd==11 || maxInd==19 ) return true; - case 4: if( maxInd==12 || maxInd==15 || maxInd==16 ) return true; - case 5: if( maxInd==12 || maxInd==13 || maxInd==17 ) return true; - case 6: if( maxInd==13 || maxInd==14 || maxInd==18 ) return true; - case 7: if( maxInd==14 || maxInd==15 || maxInd==19 ) return true; + case 0: if( maxInd==8 || maxInd==11 || maxInd==16 ) return true; // fall through + case 1: if( maxInd==8 || maxInd==9 || maxInd==17 ) return true; // fall through + case 2: if( maxInd==9 || maxInd==10 || maxInd==18 ) return true; // fall through + case 3: if( maxInd==10 || maxInd==11 || maxInd==19 ) return true; // fall through + case 4: if( maxInd==12 || maxInd==15 || maxInd==16 ) return true; // fall through + case 5: if( maxInd==12 || maxInd==13 || maxInd==17 ) return true; // fall through + case 6: if( maxInd==13 || maxInd==14 || maxInd==18 ) return true; // fall through + case 7: if( maxInd==14 || maxInd==15 || maxInd==19 ) return true; // fall through default:; } break; @@ -1514,10 +1514,10 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, case QUAD_PYRAM: { switch ( minInd ) { - case 0: if( maxInd==5 || maxInd==8 || maxInd==9 ) return true; - case 1: if( maxInd==5 || maxInd==6 || maxInd==10 ) return true; - case 2: if( maxInd==6 || maxInd==7 || maxInd==11 ) return true; - case 3: if( maxInd==7 || maxInd==8 || maxInd==12 ) return true; + case 0: if( maxInd==5 || maxInd==8 || maxInd==9 ) return true; // fall through + case 1: if( maxInd==5 || maxInd==6 || maxInd==10 ) return true; // fall through + case 2: if( maxInd==6 || maxInd==7 || maxInd==11 ) return true; // fall through + case 3: if( maxInd==7 || maxInd==8 || maxInd==12 ) return true; // fall through case 4: if( maxInd==9 || maxInd==10 || maxInd==11 || maxInd==12 ) return true; default:; } @@ -1526,12 +1526,12 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, case QUAD_PENTA: { switch ( minInd ) { - case 0: if( maxInd==6 || maxInd==8 || maxInd==12 ) return true; - case 1: if( maxInd==6 || maxInd==7 || maxInd==13 ) return true; - case 2: if( maxInd==7 || maxInd==8 || maxInd==14 ) return true; - case 3: if( maxInd==9 || maxInd==11 || maxInd==12 ) return true; - case 4: if( maxInd==9 || maxInd==10 || maxInd==13 ) return true; - case 5: if( maxInd==10 || maxInd==11 || maxInd==14 ) return true; + case 0: if( maxInd==6 || maxInd==8 || maxInd==12 ) return true; // fall through + case 1: if( maxInd==6 || maxInd==7 || maxInd==13 ) return true; // fall through + case 2: if( maxInd==7 || maxInd==8 || maxInd==14 ) return true; // fall through + case 3: if( maxInd==9 || maxInd==11 || maxInd==12 ) return true; // fall through + case 4: if( maxInd==9 || maxInd==10 || maxInd==13 ) return true; // fall through + case 5: if( maxInd==10 || maxInd==11 || maxInd==14 ) return true; // fall through default:; } break; diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index f140187b8..3ee3872eb 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -518,7 +518,7 @@ GeomAbs_Shape SMESH_Algo::Continuity(const TopoDS_Edge& theE1, OCC_CATCH_SIGNALS; return BRepLProp::Continuity(C1, C2, u1, u2, tol, angTol); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } return GeomAbs_C0; } diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 647ff3080..adaf53989 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -1015,10 +1015,10 @@ std::vector< std::string > SMESH_Gen::GetPluginXMLPaths() } // get a separator from rootDir - for ( pos = strlen( rootDir )-1; pos >= 0 && sep.empty(); --pos ) - if ( rootDir[pos] == '/' || rootDir[pos] == '\\' ) + for ( int i = strlen( rootDir )-1; i >= 0 && sep.empty(); --i ) + if ( rootDir[i] == '/' || rootDir[i] == '\\' ) { - sep = rootDir[pos]; + sep = rootDir[i]; break; } #ifdef WIN32 diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 449831b4b..8d6353fd6 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -3843,9 +3843,9 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems, } else { if ( isUPeriodic ) - newUV.SetX( ElCLib::InPeriod( newUV.X(), u1, u2 )); + newUV.SetX( ElCLib::InPeriod( newUV.X(), u1, u2 )); // todo: u may be used unitialized if ( isVPeriodic ) - newUV.SetY( ElCLib::InPeriod( newUV.Y(), v1, v2 )); + newUV.SetY( ElCLib::InPeriod( newUV.Y(), v1, v2 )); // todo: v may be used unitialized // check new UV // if ( posType != SMDS_TOP_3DSPACE ) // dist2 = pNode.SquareDistance( surface->Value( newUV.X(), newUV.Y() )); @@ -6056,6 +6056,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2], if ( nbEdges > 0 ) break; } + // fall through default: { for ( int di = -1; di <= 1; di += 2 ) @@ -7446,6 +7447,7 @@ public: //int& GroupID() const { return const_cast< int& >( myGroupID ); } ComparableElement( const ComparableElement& theSource ) // move copy + : boost::container::flat_set< int >() { ComparableElement& src = const_cast< ComparableElement& >( theSource ); (int_set&) (*this ) = boost::move( src ); @@ -10184,7 +10186,7 @@ namespace // automatically find theAffectedElems for DoubleNodes() if ( SMESH_MeshAlgos::FaceNormal( _elems[1], norm )) avgNorm += norm; - gp_XYZ bordDir( SMESH_NodeXYZ( _nodes[0] ) - SMESH_NodeXYZ( _nodes[1] )); + gp_XYZ bordDir( SMESH_NodeXYZ( _nodes[0] ) - SMESH_NodeXYZ( _nodes[1] )); // todo: compiler complains about zero-size array norm = bordDir ^ avgNorm; } else @@ -11031,7 +11033,7 @@ double SMESH_MeshEditor::OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const try { return n2.AngleWithRef(n1, vref); } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { } return Max( v1.Magnitude(), v2.Magnitude() ); } diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 17c9d9047..9c99e17b6 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -2421,7 +2421,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n11, const SMDS_MeshNode* n12, const int id, - bool force3d) + bool /*force3d*/) { SMESHDS_Mesh * meshDS = GetMeshDS(); SMDS_MeshVolume* elem = 0; @@ -3769,7 +3769,7 @@ namespace { // Structures used by FixQuadraticElements() /*! * \brief Dump QLink and QFace */ - ostream& operator << (ostream& out, const QLink& l) + ostream& operator << (ostream& out, const QLink& l) // todo: unused in release mode { out <<"QLink nodes: " << l.node1()->GetID() << " - " @@ -3777,7 +3777,7 @@ namespace { // Structures used by FixQuadraticElements() << l.node2()->GetID() << endl; return out; } - ostream& operator << (ostream& out, const QFace& f) + ostream& operator << (ostream& out, const QFace& f) // todo: unused in release mode { out <<"QFace nodes: "/*<< &f << " "*/; for ( TIDSortedNodeSet::const_iterator n = f.begin(); n != f.end(); ++n ) @@ -3820,6 +3820,7 @@ namespace { // Structures used by FixQuadraticElements() #ifdef _DEBUG_ _face = face; #endif + (void)face; // unused in release mode } //================================================================================ /*! @@ -4130,7 +4131,7 @@ namespace { // Structures used by FixQuadraticElements() */ //================================================================================ - bool QFace::IsSpoiled(const QLink* bentLink ) const + bool QFace::IsSpoiled(const QLink* bentLink ) const // todo: unused { // code is valid for convex faces only gp_XYZ gc(0,0,0); @@ -4613,7 +4614,7 @@ namespace { // Structures used by FixQuadraticElements() if ( curvNorm * D2 > 0 ) continue; // convex edge } - catch ( Standard_Failure ) + catch ( Standard_Failure& ) { continue; } @@ -4728,7 +4729,7 @@ namespace { // Structures used by FixQuadraticElements() if ( concaveU || concaveV ) concaveFaces.push_back( face ); } - catch ( Standard_Failure ) + catch ( Standard_Failure& ) { concaveFaces.push_back( face ); } @@ -5260,7 +5261,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError, try { gp_Vec x = x01.Normalized() + x12.Normalized(); trsf.SetTransformation( gp_Ax3( gp::Origin(), link1->Normal(), x), gp_Ax3() ); - } catch ( Standard_Failure ) { + } catch ( Standard_Failure& ) { trsf.Invert(); } move.Transform(trsf); diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 453a4c06b..a6e36e0d7 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -177,7 +177,7 @@ int readLine (list & theFields, case '-': // real number case '+': case '.': - isNumber = true; + isNumber = true; // fall through default: // data isNumber = isNumber || ( *theLineBeg >= '0' && *theLineBeg <= '9' ); if ( isNumber ) { @@ -4289,11 +4289,13 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes elem = aMeshDS->AddFace (nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], nodes[5] ); break; } // else do not break but create a polygon + // fall through case 8: if ( !onMeshElements ) {// create a quadratic face elem = aMeshDS->AddFace (nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], nodes[5], nodes[6], nodes[7] ); break; } // else do not break but create a polygon + // fall through default: elem = aMeshDS->AddPolygonalFace( nodes ); } diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 258491579..159c71477 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1408,6 +1408,7 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) loadDependentMeshes(); ComputeSubMeshStateEngine( SUBMESH_LOADED ); //break; + // fall through case CHECK_COMPUTE_STATE: if ( IsMeshComputed() ) _computeState = COMPUTE_OK; @@ -1459,6 +1460,7 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) } break; } + // fall through case COMPUTE: case COMPUTE_SUBMESH: { @@ -1722,6 +1724,7 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) loadDependentMeshes(); ComputeSubMeshStateEngine( SUBMESH_LOADED ); //break; + // fall through case CHECK_COMPUTE_STATE: if ( IsMeshComputed() ) _computeState = COMPUTE_OK; diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index 72b9adaf8..8526c0668 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -745,9 +745,9 @@ namespace //======================================================================= //function : ChangePolyhedronNodes //======================================================================= - inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh, - SMESH::log_array_var& theSeq, - CORBA::Long theId) + inline void ChangePolyhedronNodes (SMDS_Mesh* /*theMesh*/, + SMESH::log_array_var& /*theSeq*/, + CORBA::Long /*theId*/) { // const SMESH::long_array& anIndexes = theSeq[theId].indexes; // CORBA::Long iind = 0, aNbElems = theSeq[theId].number; diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx index e5d480e35..78eed3a23 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx @@ -135,7 +135,7 @@ bool SMESH_NumberFilter::isOk (const SUIT_DataOwner* theDataOwner) const } // Verify number of sub-shapes - if (mySubShapeType == TopAbs_SHAPE); + if (mySubShapeType == TopAbs_SHAPE) return true; TopTools_IndexedMapOfShape aMap; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 818d72326..53780b425 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -2759,7 +2759,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) OCC_CATCH_SIGNALS; SMESH::UpdateView(); } - catch (std::bad_alloc) { // PAL16774 (Crash after display of many groups) + catch (std::bad_alloc&) { // PAL16774 (Crash after display of many groups) SMESH::OnVisuException(); } catch (...) { // PAL16774 (Crash after display of many groups) @@ -2864,7 +2864,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpCreateSubMesh: if ( warnOnGeomModif() ) break; // action forbiden as geometry modified - + // fall through case SMESHOp::OpCreateMesh: case SMESHOp::OpCompute: case SMESHOp::OpComputeSubMesh: diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 27ae2a813..913f25231 100644 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -1732,6 +1732,7 @@ static QList entityTypes( const int theType ) { case SMESH::NODE: typeIds.append( SMDSEntity_Node ); + break; case SMESH::EDGE: typeIds.append( SMDSEntity_Edge ); typeIds.append( SMDSEntity_Quad_Edge ); @@ -3816,6 +3817,7 @@ void SMESHGUI_FilterDlg::onSelectionDone() myTable->SetThreshold(aRow, SMESH::toQStr( grp->GetName() )); myTable->SetID (aRow, anIO->getEntry() ); } + break; } default: // get a GEOM object { diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index d51b928c3..4c88cce9b 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -1152,7 +1152,7 @@ const SMESHGUI_FilterTable* SMESHGUI_FilterLibraryDlg::GetTable() const // name : SMESHGUI_FilterLibraryDlg::onEntityTypeChanged // Purpose : SLOT. Called when entiyt type changed //======================================================================= -void SMESHGUI_FilterLibraryDlg::onEntityTypeChanged(const int theType) +void SMESHGUI_FilterLibraryDlg::onEntityTypeChanged(const int /*theType*/) { if (myLibrary->_is_nil()) return; @@ -1244,6 +1244,7 @@ void SMESHGUI_FilterLibraryDlg::onSelectionDone() case SMESH::FT_BelongToMeshGroup: // get a group name and IOR { myTable->SetThreshold(aRow, anIO->getName() ); + break; } default: // get a GEOM object { diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx index 337f4d20f..4362d0ee1 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx @@ -46,7 +46,7 @@ namespace SMESH { GEOM::GEOM_Gen_var GetGEOMGen( GEOM::GEOM_Object_ptr go ) { - GEOM::GEOM_Gen_ptr gen; + GEOM::GEOM_Gen_ptr gen = GEOM::GEOM_Gen::_nil();; if ( !CORBA::is_nil( go )) gen = go->GetGen(); return gen; diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index f5d5a0e7f..63d4b9d30 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -1621,7 +1621,7 @@ void SMESHGUI_MergeDlg::onSelectKeep() // IDs to groups or vice versa //======================================================================= -void SMESHGUI_MergeDlg::onKeepSourceChanged(int isGroup) +void SMESHGUI_MergeDlg::onKeepSourceChanged(int /*isGroup*/) { KeepList->clear(); SelectKeepButton->click(); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 8e5e6356d..66db3c27f 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -1804,8 +1804,8 @@ void SMESHGUI_ElemInfo::writeInfo( InfoWriter* writer, const QList& ids ) writer->write( SMESHGUI_AddInfo::tr( "TYPE" ), SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ); } int size = group.size(); - if ( size != -1 ); - writer->write( SMESHGUI_AddInfo::tr( "SIZE" ), size ); + if ( size != -1 ) + writer->write( SMESHGUI_AddInfo::tr( "SIZE" ), size ); QColor color = group.color(); if ( color.isValid() ) writer->write( SMESHGUI_AddInfo::tr( "COLOR" ), color.name() ); @@ -1935,7 +1935,7 @@ void SMESHGUI_ElemInfo::writeInfo( InfoWriter* writer, const QList& ids ) writer->write( SMESHGUI_AddInfo::tr( "TYPE" ), SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ); } int size = group.size(); - if ( size != -1 ); + if ( size != -1 ) writer->write( SMESHGUI_AddInfo::tr( "SIZE" ), size ); QColor color = group.color(); if ( color.isValid() ) diff --git a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx index 209a52f64..6f329dd13 100644 --- a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx +++ b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx @@ -35,7 +35,7 @@ SMDS_Mesh* SMESHGUI_PreVisualObj::GetMesh() const return myMesh; } -bool SMESHGUI_PreVisualObj::Update( int theIsClear = true ) +bool SMESHGUI_PreVisualObj::Update( int /*theIsClear*/) { return false; } diff --git a/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx b/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx index 1ddbcf8ec..96d2e4c7c 100644 --- a/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx @@ -101,7 +101,7 @@ void SMESHGUI_PreviewDlg::toDisplaySimulation() { // function : onDisplaySimulation // purpose : //================================================================================= -void SMESHGUI_PreviewDlg::onDisplaySimulation(bool toDisplayPreview) { +void SMESHGUI_PreviewDlg::onDisplaySimulation(bool /*toDisplayPreview*/) { //Empty implementation here } @@ -212,7 +212,7 @@ void SMESHGUI_MultiPreviewDlg::toDisplaySimulation() // function : onDisplaySimulation // purpose : //================================================================================= -void SMESHGUI_MultiPreviewDlg::onDisplaySimulation( bool toDisplayPreview ) +void SMESHGUI_MultiPreviewDlg::onDisplaySimulation( bool /*toDisplayPreview*/ ) { //Empty implementation here } diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index b54dbfbe4..b9b21708f 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -573,7 +573,7 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp() // function : onAngleTextChange() // purpose : //======================================================================= -void SMESHGUI_RevolutionDlg::onAngleTextChange (const QString& theNewText) +void SMESHGUI_RevolutionDlg::onAngleTextChange (const QString& /*theNewText*/) { bool isNumber; SpinBox_Angle->text().toDouble( &isNumber ); diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index 562871ff5..c84dd447e 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -195,7 +195,7 @@ void SMESHGUI_SelectionOp::onActivateObject( int id ) // name : onDeactivateObject // purpose : //================================================================================= -void SMESHGUI_SelectionOp::onDeactivateObject( int id ) +void SMESHGUI_SelectionOp::onDeactivateObject( int /*id*/ ) { removeCustomFilters(); } diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index fe8ad5618..ca6c7293b 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -1243,16 +1243,16 @@ void SMESHGUI_SewingDlg::onMoveBorderEnd(int button) { aPRT.node1 = ( aPRT.node1 + size + dn ) % size; aPRT.node2 = ( aPRT.node2 + size + dn ) % size; - break; } + break; case MOVE_LEFT_2: case MOVE_RIGHT_2: if (( isClosed ) || ( 0 <= aPRT.nodeLast+dn && aPRT.nodeLast+dn < size )) { aPRT.nodeLast = ( aPRT.nodeLast + size + dn ) % size; - break; } + break; default: return; // impossible to move } @@ -1584,8 +1584,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) if (e) newIndices.Add(e->GetID()); - if (!isEvenOneExists) - isEvenOneExists = true; + if (!isEvenOneExists) + isEvenOneExists = true; } mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index 223001a44..f761912cc 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -469,7 +469,7 @@ void SMESHGUI_ShapeByMeshOp::activateSelection() //purpose : SLOT. Called when element type changed. //======================================================================= -void SMESHGUI_ShapeByMeshOp::onTypeChanged (int theType) +void SMESHGUI_ShapeByMeshOp::onTypeChanged (int /*theType*/) { setElementID(""); activateSelection(); diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index 5f2f3ab5b..ee532a7e0 100644 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -172,7 +172,7 @@ QWidget* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent) // name : isValid() // Purpose : Verify validity of input data //======================================================================= -bool SMESHGUI_SingleEditDlg::isValid (const bool theMess) const +bool SMESHGUI_SingleEditDlg::isValid (const bool /*theMess*/) const { int id1, id2; return getNodeIds(myEdge->text(), id1, id2); @@ -333,7 +333,7 @@ static bool findTriangles (const SMDS_MeshNode * theNode1, //function : onTextChange() //purpose : //======================================================================= -void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText) +void SMESHGUI_SingleEditDlg::onTextChange (const QString& /*theNewText*/) { if (myBusy) return; BusyLocker lock(myBusy); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index b148effa1..591ca1ffc 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -793,6 +793,7 @@ namespace SMESH } aStudy->setVisibilityStateForAll(Qtx::HiddenState); } + // fall through default: { if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) { switch (theAction) { @@ -1325,7 +1326,7 @@ namespace SMESH int GetSelected(LightApp_SelectionMgr* theMgr, TColStd_IndexedMapOfInteger& theMap, - const bool theIsElement) + const bool /*theIsElement*/) { theMap.Clear(); SALOME_ListIO selected; theMgr->selectedObjects( selected ); diff --git a/src/SMESHUtils/SMESH_FreeBorders.cxx b/src/SMESHUtils/SMESH_FreeBorders.cxx index b4d464947..e5913cdac 100644 --- a/src/SMESHUtils/SMESH_FreeBorders.cxx +++ b/src/SMESHUtils/SMESH_FreeBorders.cxx @@ -946,7 +946,7 @@ void SMESH_MeshAlgos::FindFreeBorders(SMDS_Mesh& theMesh, ++cnt; bordNodes.resize( cnt + 1 ); - BEdge* beLast; + BEdge* beLast = 0; for ( be = borders[i], cnt = 0; be && cnt < bordNodes.size()-1; be = be->myNext, ++cnt ) @@ -954,6 +954,7 @@ void SMESH_MeshAlgos::FindFreeBorders(SMDS_Mesh& theMesh, bordNodes[ cnt ] = be->myBNode1->Node(); beLast = be; } - bordNodes.back() = beLast->myBNode2->Node(); + if ( beLast ) + bordNodes.back() = beLast->myBNode2->Node(); } } diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index 14c781836..5e51621ec 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -546,7 +546,8 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher { delete _ebbTree[i]; _ebbTree[i] = NULL; } - if ( _nodeSearcher ) delete _nodeSearcher; _nodeSearcher = 0; + if ( _nodeSearcher ) delete _nodeSearcher; + _nodeSearcher = 0; } virtual int FindElementsByPoint(const gp_Pnt& point, SMDSAbs_ElementType type, @@ -1673,7 +1674,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face, try { tgtCS = gp_Ax3( xyz[0], OZ, OX ); } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { return badDistance; } trsf.SetTransformation( tgtCS ); diff --git a/src/SMESHUtils/SMESH_OctreeNode.cxx b/src/SMESHUtils/SMESH_OctreeNode.cxx index a4aa26434..ed65a74b8 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.cxx +++ b/src/SMESHUtils/SMESH_OctreeNode.cxx @@ -116,7 +116,7 @@ Bnd_B3d* SMESH_OctreeNode::buildRootBox() */ //==================================================================================== -const bool SMESH_OctreeNode::isInside ( const gp_XYZ& p, const double precision ) +bool SMESH_OctreeNode::isInside ( const gp_XYZ& p, const double precision ) { if ( precision <= 0.) return !( getBox()->IsOut(p) ); diff --git a/src/SMESHUtils/SMESH_OctreeNode.hxx b/src/SMESHUtils/SMESH_OctreeNode.hxx index 3306dbc31..670843c9e 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.hxx +++ b/src/SMESHUtils/SMESH_OctreeNode.hxx @@ -63,7 +63,7 @@ class SMESHUtils_EXPORT SMESH_OctreeNode : public SMESH_Octree virtual ~SMESH_OctreeNode () {}; // Tells us if Node is inside the current box with the precision "precision" - virtual const bool isInside(const gp_XYZ& p, const double precision = 0.); + virtual bool isInside(const gp_XYZ& p, const double precision = 0.); // Return in Result a list of Nodes potentials to be near Node void AllNodesAround(const SMDS_MeshNode * node, diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index b1baef35c..6aeabfb53 100644 --- a/src/SMESHUtils/SMESH_Offset.cxx +++ b/src/SMESHUtils/SMESH_Offset.cxx @@ -2358,7 +2358,7 @@ namespace */ //================================================================================ - void CutFace::Dump() const + void CutFace::Dump() const // todo: unused in release mode { std::cout << std::endl << "INI F " << myInitFace->GetID() << std::endl; for ( size_t i = 0; i < myLinks.size(); ++i ) @@ -2756,7 +2756,7 @@ namespace // add links connecting internal loops with the boundary ones // find a pair of closest nodes - const SMDS_MeshNode *closestNode1, *closestNode2; + const SMDS_MeshNode *closestNode1 = 0, *closestNode2 = 0; double minDist = 1e100; for ( size_t iE = 0; iE < loop.myLinks.size(); ++iE ) { @@ -2779,10 +2779,12 @@ namespace } } - size_t i = myLinks.size(); - myLinks.resize( i + 2 ); - myLinks[ i ].Set( closestNode1, closestNode2 ); - myLinks[ i+1 ].Set( closestNode2, closestNode1 ); + if ( closestNode1 && closestNode2 ) { + size_t i = myLinks.size(); + myLinks.resize( i + 2 ); + myLinks[ i ].Set( closestNode1, closestNode2 ); + myLinks[ i+1 ].Set( closestNode2, closestNode1 ); + } } return true; diff --git a/src/SMESHUtils/SMESH_PolyLine.cxx b/src/SMESHUtils/SMESH_PolyLine.cxx index bf1b3aa70..9344611d6 100644 --- a/src/SMESHUtils/SMESH_PolyLine.cxx +++ b/src/SMESHUtils/SMESH_PolyLine.cxx @@ -421,7 +421,7 @@ namespace if ( face2 ) polySeg.myFace[ iP ] = face2; else - ;// ?? + {} // todo: ?? for ( int i = 0; i < 3; ++i ) { nodes[ i ] = polySeg.myFace[ iP ]->GetNode( i ); diff --git a/src/SMESHUtils/SMESH_Triangulate.cxx b/src/SMESHUtils/SMESH_Triangulate.cxx index 10a79c750..149ce45b7 100644 --- a/src/SMESHUtils/SMESH_Triangulate.cxx +++ b/src/SMESHUtils/SMESH_Triangulate.cxx @@ -380,7 +380,7 @@ bool Triangulate::triangulate( std::vector< const SMDS_MeshNode*>& nodes, try { axes = gp_Ax2( p0, normal, v01 ); } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { return false; } double factor = 1.0, modulus = normal.Modulus(); diff --git a/src/SMESHUtils/SMESH_TryCatch.cxx b/src/SMESHUtils/SMESH_TryCatch.cxx index 2f9194dfc..1c5044f0c 100644 --- a/src/SMESHUtils/SMESH_TryCatch.cxx +++ b/src/SMESHUtils/SMESH_TryCatch.cxx @@ -30,6 +30,7 @@ void SMESH::throwSalomeEx(const char* txt) void SMESH::doNothing(const char* txt) { + (void)txt; // unused in release mode MESSAGE( txt << " " << __FILE__ << ": " << __LINE__ ); } diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index b28a7ec63..e34874cb0 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -930,8 +930,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand if ( -1 < iGeom && iGeom < nbTypes ) Threshold = SMESH + types[ iGeom ]; #ifdef _DEBUG_ - // is types complete? (compilation failure mains that enum GeometryType changed) - int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1]; + // 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? #endif } if (Type == "SMESH.FT_EntityType") @@ -951,7 +951,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Threshold = SMESH + types[ iGeom ]; #ifdef _DEBUG_ // is 'types' complete? (compilation failure mains that enum EntityType changed) - int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1]; + 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? #endif } } diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 2a1cfebc6..f8d0eb567 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -843,7 +843,7 @@ void BelongToMeshGroup_i::SetGroupID( const char* theID ) // IOR or StoreName std::string BelongToMeshGroup_i::GetGroupID() { if ( myGroup->_is_nil() ) - SMESH::SMESH_GroupBase_var( GetGroup() ); + SMESH::SMESH_GroupBase_var( GetGroup() ); // todo: unnecessary parentheses? if ( !myGroup->_is_nil() ) myID = SMESH_Gen_i::GetORB()->object_to_string( myGroup ); diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 970de12bf..4a751d153 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -295,7 +295,7 @@ GEOM::GEOM_Gen_var SMESH_Gen_i::GetGeomEngine( bool isShaper ) GEOM::GEOM_Gen_var SMESH_Gen_i::GetGeomEngine( GEOM::GEOM_Object_ptr go ) { - GEOM::GEOM_Gen_ptr gen; + GEOM::GEOM_Gen_ptr gen = GEOM::GEOM_Gen::_nil();; if ( !CORBA::is_nil( go )) gen = go->GetGen(); return gen; @@ -550,7 +550,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName hypothesis_i = myHypothesis_i->_this(); int nextId = RegisterObject( hypothesis_i ); if(MYDEBUG) { MESSAGE( "Add hypo to map with id = "<< nextId ); } - else { nextId = 0; } // avoid "unused variable" warning in release mode + else { (void)nextId; } // avoid "unused variable" warning in release mode } return hypothesis_i._retn(); } @@ -580,7 +580,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::createMesh() SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( meshServant->_this() ); int nextId = RegisterObject( mesh ); if(MYDEBUG) { MESSAGE( "Add mesh to map with id = "<< nextId); } - else { nextId = 0; } // avoid "unused variable" warning in release mode + else { (void)nextId; } // avoid "unused variable" warning in release mode return mesh._retn(); } catch (SALOME_Exception& S_ex) { @@ -2094,7 +2094,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, return ok; } } - catch ( std::bad_alloc ) { + catch ( std::bad_alloc& ) { INFOS( "Compute(): lack of memory" ); } catch ( SALOME_Exception& S_ex ) { @@ -2304,7 +2304,7 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh } } } - catch ( std::bad_alloc ) { + catch ( std::bad_alloc& ) { INFOS( "Precompute(): lack of memory" ); } catch ( SALOME_Exception& S_ex ) { @@ -2388,7 +2388,7 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, return nbels._retn(); } } - catch ( std::bad_alloc ) { + catch ( std::bad_alloc& ) { INFOS( "Evaluate(): lack of memory" ); } catch ( SALOME_Exception& S_ex ) { @@ -6278,7 +6278,7 @@ CORBA::Boolean SMESH_Gen_i::IsApplicable ( const char* theAlgoType, SMESH_TRY; std::string aPlatformLibName; - typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char*); + //typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char*); GenericHypothesisCreator_i* aCreator = getHypothesisCreator(theAlgoType, theLibName, aPlatformLibName); if (aCreator) diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 4e37d0726..b1b7202af 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -484,7 +484,7 @@ static void addReference (SALOMEDS::SObject_ptr theSObject, */ //============================================================================= -SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, +SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr /*theSObject*/, CORBA::Object_ptr theIOR, const char* theName) { diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index b4c094ffc..d3fbdc742 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -98,7 +98,8 @@ SMESH_GroupOnFilter_i::SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA, SMESH_GroupBase_i::~SMESH_GroupBase_i() { - if ( myPreMeshInfo ) delete myPreMeshInfo; myPreMeshInfo = NULL; + if ( myPreMeshInfo ) delete myPreMeshInfo; + myPreMeshInfo = NULL; } //======================================================================= diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index f20ffec66..126da31cd 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -193,8 +193,8 @@ namespace MeshEditor_I { //!< Delete theNodeSearcher static void Delete() { - if ( theNodeSearcher ) delete theNodeSearcher; theNodeSearcher = 0; - if ( theElementSearcher ) delete theElementSearcher; theElementSearcher = 0; + if ( theNodeSearcher ) { delete theNodeSearcher; } theNodeSearcher = 0; + if ( theElementSearcher ) { delete theElementSearcher; } theElementSearcher = 0; } typedef map < int, SMESH_subMesh * > TDependsOnMap; //!< The meshod called by submesh: do my main job diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 498a7a74e..5d2c35563 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -3135,7 +3135,7 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theS // register CORBA object for persistence int nextId = _gen_i->RegisterObject( subMesh ); if(MYDEBUG) { MESSAGE( "Add submesh to map with id = "<< nextId); } - else { nextId = 0; } // avoid "unused variable" warning + else { (void)nextId; } // avoid "unused variable" warning // to track changes of GEOM groups if ( subMeshId > 0 ) @@ -5753,7 +5753,7 @@ void SMESH_Mesh_i::CreateGroupServants() // register CORBA object for persistence int nextId = _gen_i->RegisterObject( groupVar ); if(MYDEBUG) { MESSAGE( "Add group to map with id = "<< nextId); } - else { nextId = 0; } // avoid "unused variable" warning in release mode + else { (void)nextId; } // avoid "unused variable" warning in release mode // publishing the groups in the study GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape ); diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx index 29b6d0060..7994cf1f1 100644 --- a/src/SMESH_I/SMESH_NoteBook.cxx +++ b/src/SMESH_I/SMESH_NoteBook.cxx @@ -284,7 +284,7 @@ void SMESH_NoteBook::ReplaceVariables() const char* varIndexPtr = cmdStr.ToCString() + pos; if ( '0' <= *varIndexPtr && *varIndexPtr <= '9' ) varIndex = atoi( varIndexPtr ); - if ( 0 <= 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 const char var0 = vars[varIndex][0]; diff --git a/src/SMESH_I/SMESH_PythonDump.cxx b/src/SMESH_I/SMESH_PythonDump.cxx index a09766949..f8496d870 100644 --- a/src/SMESH_I/SMESH_PythonDump.cxx +++ b/src/SMESH_I/SMESH_PythonDump.cxx @@ -367,7 +367,7 @@ namespace SMESH TPythonDump& TPythonDump:: - operator<<(SMESH::FilterManager_i* theArg) + operator<<(SMESH::FilterManager_i* /*theArg*/) { myStream<<"aFilterManager"; return *this; @@ -448,13 +448,13 @@ namespace SMESH TPythonDump& TPythonDump:: - operator<<(SMESH::Measurements_i* theArg) + operator<<(SMESH::Measurements_i* /*theArg*/) { myStream<<"aMeasurements"; return *this; } - TPythonDump& TPythonDump:: operator<<(SMESH_Gen_i* theArg) + TPythonDump& TPythonDump:: operator<<(SMESH_Gen_i* /*theArg*/) { myStream << SMESHGenName(); return *this; } @@ -671,6 +671,8 @@ namespace SMESH { #ifdef _DEBUG_ std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::endl; +#else + (void)text; // todo: unused in release mode #endif } diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 848d3432a..c44886473 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -443,7 +443,7 @@ namespace // internal utils double a[3]; bool isDone[3]; double size = -1., maxLinkLen; - int jLongest; + int jLongest = 0; //int nbLinks = 0; for ( int i = 1; i <= myPolyTrias->Upper(); ++i ) diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 0d6ec3591..029aed72c 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -2218,6 +2218,8 @@ namespace } #ifdef _DEBUG_ _cellID = cellID; +#else + (void)cellID; // unused in release mode #endif } @@ -2556,7 +2558,7 @@ namespace case 3: // at a corner { _Node& node = _hexNodes[ subEntity - SMESH_Block::ID_FirstV ]; - if ( node.Node() > 0 ) + if ( node.Node() != 0 ) { if ( node._intPoint ) node._intPoint->Add( _eIntPoints[ iP ]->_faceIDs, _eIntPoints[ iP ]->_node ); @@ -3489,7 +3491,7 @@ namespace continue; // perform intersection - E_IntersectPoint* eip, *vip; + E_IntersectPoint* eip, *vip = 0; // todo: vip must be explicitly initialized to avoid warning (see below) for ( int iDirZ = 0; iDirZ < 3; ++iDirZ ) { GridPlanes& planes = pln[ iDirZ ]; @@ -3590,7 +3592,7 @@ namespace vip = _grid->Add( ip ); if ( isInternal && !sameV ) vip->_faceIDs.push_back( _grid->PseudoIntExtFaceID() ); - if ( !addIntersection( vip, hexes, ijk, d000 ) && !sameV ) + if ( !addIntersection( vip, hexes, ijk, d000 ) && !sameV ) // todo: vip must be explicitly initialized to avoid warning (see above) _grid->Remove( vip ); ip._shapeID = edgeID; } @@ -4744,6 +4746,8 @@ namespace cout << "BUG: not shared link. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl << "n1 (" << p1.X() << ", "<< p1.Y() << ", "<< p1.Z() << " )" << endl << "n2 (" << p2.X() << ", "<< p2.Y() << ", "<< p2.Z() << " )" << endl; +#else + (void)link; // unused in release mode #endif return false; } @@ -5394,7 +5398,7 @@ namespace if ( allQuads ) { // set side nodes as this: bottom, top, top, ... - int iTop, iBot; // side indices + int iTop = 0, iBot = 0; // side indices for ( int iS = 0; iS < 6; ++iS ) { if ( vol->_names[ iS ] == SMESH_Block::ID_Fxy0 ) @@ -5890,7 +5894,7 @@ namespace const int eventType, SMESH_subMesh* subMeshOfSolid, SMESH_subMeshEventListenerData* /*data*/, - const SMESH_Hypothesis* hyp = 0) + const SMESH_Hypothesis* /*hyp*/ = 0) { if ( eventType == SMESH_subMesh::COMPUTE_EVENT ) { diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index f537fb5f2..91bdf9218 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -1246,7 +1246,7 @@ bool _QuadFaceGrid::LoadGrid( SMESH_ProxyMesh& mesh ) if ( fIt->next()->NbNodes() % 4 > 0 ) return error("Non-quadrangular mesh faces are not allowed on sides of a composite block"); - bool isProxy, isTmpElem; + bool isProxy = false, isTmpElem = false; if ( faceSubMesh && faceSubMesh->NbElements() > 0 ) { isProxy = dynamic_cast< const SMESH_ProxyMesh::SubMesh* >( faceSubMesh ); @@ -1662,7 +1662,7 @@ bool _QuadFaceGrid::GetNormal( const TopoDS_Vertex& v, gp_Vec& n ) const n = d1u.Crossed( d1v ); return true; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return false; } } diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index c8321c1a0..51907cd9d 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -55,7 +55,7 @@ bool Function::value( const double, double& f ) const try { OCC_CATCH_SIGNALS; f = pow( 10., f ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { f = 0.0; ok = false; } @@ -185,7 +185,7 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) OCC_CATCH_SIGNALS; myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { ok = false; } @@ -217,7 +217,7 @@ bool FunctionExpr::value( const double t, double& f ) const try { OCC_CATCH_SIGNALS; f = myExpr->Expression()->Evaluate( myVars, myValues ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { f = 0.0; ok = false; } @@ -235,7 +235,7 @@ double FunctionExpr::integral( const double a, const double b ) const ( *static_cast( const_cast (this) ), a, b, 20 ); if( _int.IsDone() ) res = _int.Value(); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { res = 0.0; MESSAGE( "Exception in integral calculating" ); } diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index da593c9c3..895763530 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -1141,6 +1141,8 @@ void StdMeshers_FaceSide::dump(const char* msg) const MESSAGE_ADD ( "\tF: "<GetSubShape() ))) continue; + // fall through case TopAbs_FACE: _subM.insert( sm ); if ( !sm->IsEmpty() ) diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 1dfa663e7..08f1210b9 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -226,7 +226,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) OCC_CATCH_SIGNALS; val = pow( 10.0, val ); } - catch(Standard_Failure) { + catch(Standard_Failure&) { throw SALOME_Exception( LOCALIZED( "invalid value")); return; } @@ -319,7 +319,7 @@ bool process( const TCollection_AsciiString& str, int convMode, OCC_CATCH_SIGNALS; myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { parsed_ok = false; } diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index 96f97933c..7dd933b0d 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -798,7 +798,7 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() while(itf->more()) { const SMDS_MeshElement* pE0 = itf->next(); aElementType = pE0->GetType(); - if (!aElementType==SMDSAbs_Face) { + if (aElementType!=SMDSAbs_Face) { continue; } aNbNodes = pE0->NbNodes(); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index b5f1cb6c6..7991bed16 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -557,6 +557,8 @@ namespace { cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ; SMESH_Block::DumpShapeID( i, cout ) << endl; } +#else + (void)p; // unused in release mode #endif } } // namespace @@ -2705,7 +2707,7 @@ bool StdMeshers_Prism_3D::project2dMesh(const TopoDS_Face& theSrcFace, */ //================================================================================ -bool StdMeshers_Prism_3D::setFaceAndEdgesXYZ( const int faceID, const gp_XYZ& params, int z ) +bool StdMeshers_Prism_3D::setFaceAndEdgesXYZ( const int faceID, const gp_XYZ& params, int /*z*/ ) { // find base and top edges of the face enum { BASE = 0, TOP, LEFT, RIGHT }; @@ -4166,7 +4168,9 @@ void StdMeshers_PrismAsBlock::faceGridToPythonDump(const SMESH_Block::TShapeID f << n << ", " << n+1 << ", " << n+nb+2 << ", " << n+nb+1 << "]) " << endl; } - +#else + (void)face; // unused in release mode + (void)nb; // unused in release mode #endif } @@ -4786,6 +4790,8 @@ void StdMeshers_PrismAsBlock::TSideFace::dumpNodes(int nbNodes) const TVerticalEdgeAdaptor* vSide1 = (TVerticalEdgeAdaptor*) VertiCurve(1); cout << "Verti side 1: "; vSide1->dumpNodes(nbNodes); cout << endl; delete hSize0; delete hSize1; delete vSide0; delete vSide1; +#else + (void)nbNodes; // unused in release mode #endif } @@ -4832,6 +4838,8 @@ void StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::dumpNodes(int nbNodes) const cout << (*myNodeColumn)[i]->GetID() << " "; if ( nbNodes < (int) myNodeColumn->size() ) cout << myNodeColumn->back()->GetID(); +#else + (void)nbNodes; // unused in release mode #endif } @@ -4890,6 +4898,8 @@ void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) con side->GetColumns( u , col, col2 ); if ( n != col->second[ i ] ) cout << col->second[ i ]->GetID(); +#else + (void)nbNodes; // unused in release mode #endif } diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 776be581e..3ab3d55a3 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -97,7 +97,7 @@ namespace { return max(theMeshDS[0]->ShapeToIndex(S), theMeshDS[1]->ShapeToIndex(S) ); return long(S.TShape().operator->()); } - void show_shape( TopoDS_Shape v, const char* msg ) // debug + void show_shape( TopoDS_Shape v, const char* msg ) // debug // todo: unused in release mode { if ( v.IsNull() ) cout << msg << " NULL SHAPE" << endl; else if (v.ShapeType() == TopAbs_VERTEX) { @@ -106,7 +106,7 @@ namespace { else { cout << msg << " "; TopAbs::Print((v).ShapeType(),cout) <<" "<& l ) // debug + void show_list( const char* msg, const list< TopoDS_Edge >& l ) // debug // todo: unused in release mode { cout << msg << " "; list< TopoDS_Edge >::const_iterator e = l.begin(); @@ -131,6 +131,8 @@ namespace { show_shape( TopoDS_Shape(), "avoid warning: show_shape() defined but not used"); show_list( "avoid warning: show_list() defined but not used", list< TopoDS_Edge >() ); } +#else + (void)shape; // unused in release mode #endif return false; } diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 4f689c7e9..4ef3b3f67 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -1562,7 +1562,9 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& // mapper changed, no more "mapper puts on a seam edge nodes from 2 edges" if ( isSeam && ! getBoundaryNodes ( sm, tgtFace, u2nodesOnSeam, seamNodes )) - ;//RETURN_BAD_RESULT("getBoundaryNodes() failed"); + { + //RETURN_BAD_RESULT("getBoundaryNodes() failed"); + } SMDS_NodeIteratorPtr nIt = smDS->GetNodes(); while ( nIt->more() ) diff --git a/src/StdMeshers/StdMeshers_Propagation.cxx b/src/StdMeshers/StdMeshers_Propagation.cxx index e8e0c3f25..3ecd623b1 100644 --- a/src/StdMeshers/StdMeshers_Propagation.cxx +++ b/src/StdMeshers/StdMeshers_Propagation.cxx @@ -588,6 +588,7 @@ namespace { clearPropagationChain( subMesh ); } // return; -- hyp is modified any way + // fall through default: //case SMESH_subMesh::MODIF_HYP: // hyp modif // clear mesh in a chain diff --git a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx index 96e54b092..d3b5935d6 100644 --- a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx +++ b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx @@ -223,7 +223,7 @@ bool StdMeshers_QuadrangleParams::SetParametersByMesh(const SMESH_Mesh* theMesh, * \retval bool - true if parameter values have been successfully defined */ //================================================================================ -bool StdMeshers_QuadrangleParams::SetParametersByDefaults(const TDefaults& dflts, +bool StdMeshers_QuadrangleParams::SetParametersByDefaults(const TDefaults& /*dflts*/, const SMESH_Mesh* /*mesh*/) { return true; diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index a0d6119cb..4ecfb7dd8 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -439,7 +439,7 @@ namespace { // find the center and a point most distant from it - double maxDist = 0, normPar; + double maxDist = 0, normPar = 0; gp_XY uv1, uv2; for ( int i = 0; i < 32; ++i ) { diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 77d1d66f1..c6e41cbb2 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -540,7 +540,7 @@ void StdMeshers_Regular_1D::SetEventListener(SMESH_subMesh* subMesh) */ //============================================================================= -void StdMeshers_Regular_1D::SubmeshRestored(SMESH_subMesh* subMesh) +void StdMeshers_Regular_1D::SubmeshRestored(SMESH_subMesh* /*subMesh*/) { } diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index d761b9855..822f1742c 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -5312,7 +5312,9 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data, } // loop on data._edgesOnShape if ( !is1stBlocked ) + { dumpFunctionEnd(); + } if ( closestFace && le ) { @@ -5525,7 +5527,7 @@ void _ViscousBuilder::makeOffsetSurface( _EdgesOnShape& eos, SMESH_MesherHelper& eos._offsetSurf = new ShapeAnalysis_Surface( surf ); } - catch ( Standard_Failure ) + catch ( Standard_Failure& ) { } } @@ -5627,8 +5629,9 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape& eos, << "_InfStep" << infStep << "_" << smooStep ); for ( ; i < eos._edges.size(); ++i ) { - if ( eos._edges[i]->Is( _LayerEdge::MARKED )) + if ( eos._edges[i]->Is( _LayerEdge::MARKED )) { dumpMove( eos._edges[i]->_nodes.back() ); + } } dumpFunctionEnd(); } @@ -7284,7 +7287,7 @@ bool _ViscousBuilder::updateNormals( _SolidData& data, _LayerEdge* edge = e2neIt->first; _LayerEdge& newEdge = e2neIt->second; _EdgesOnShape* eos = data.GetShapeEdges( edge ); - if ( edge->Is( _LayerEdge::BLOCKED && newEdge._maxLen > edge->_len )) + if ( edge->Is( _LayerEdge::BLOCKED ) && newEdge._maxLen > edge->_len ) continue; // Check if a new _normal is OK: @@ -9110,7 +9113,7 @@ gp_XYZ _LayerEdge::smoothAngular() else norm += cross; } - catch (Standard_Failure) { // if |cross| == 0. + catch (Standard_Failure&) { // if |cross| == 0. } } gp_XYZ vec = newPos - pN; diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.hxx b/src/StdMeshers/StdMeshers_ViscousLayers.hxx index be6871576..426257946 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.hxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.hxx @@ -112,7 +112,7 @@ public: * \brief Initialize my parameter values by default parameters. * \retval bool - true if parameter values have been successfully defined */ - virtual bool SetParametersByDefaults(const TDefaults& /*dflts*/, const SMESH_Mesh* theMesh=0) + virtual bool SetParametersByDefaults(const TDefaults& /*dflts*/, const SMESH_Mesh* /*theMesh*/=0) { return false; } static const char* GetHypType() { return "ViscousLayers"; } diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index a088780b3..e4699906c 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -351,7 +351,7 @@ void StdMeshersGUI_DistrPreview::update() try { OCC_CATCH_SIGNALS; replot(); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { } } @@ -397,7 +397,7 @@ bool StdMeshersGUI_DistrPreview::init( const QString& str ) OCC_CATCH_SIGNALS; myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.toLatin1().data() ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { parsed_ok = false; } @@ -435,7 +435,7 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok ) try { OCC_CATCH_SIGNALS; res = myExpr->Expression()->Evaluate( myVars, myValues ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { ok = false; res = 0.0; } @@ -462,7 +462,7 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const // if(v < -7) v = -7.0; v = pow( 10.0, v ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { v = 0.0; ok = false; } diff --git a/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx index cf41b0f1e..8a5b35c7a 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx @@ -355,11 +355,11 @@ void StdMeshersGUI_PropagationHelperWdg::updateList(bool enable) item->setData( Qt::UserRole, -1 ); } else - for ( size_t i = 0; i < myChains.size(); ++i ) + for ( int i = 0; i < (int)myChains.size(); ++i ) { QString text = tr( "CHAIN_NUM_NB_EDGES" ).arg( i+1 ).arg( myChains[i].size() ); item = new QListWidgetItem( text, myListWidget ); - item->setData( Qt::UserRole, (int) i ); + item->setData( Qt::UserRole, i ); } } else @@ -379,8 +379,8 @@ std::vector< int > * StdMeshersGUI_PropagationHelperWdg::getSelectedChain() std::vector< int > * chain = 0; if ( QListWidgetItem * item = myListWidget->currentItem() ) { - size_t i = (size_t) item->data( Qt::UserRole ).toInt(); - if ( 0 <= i && i < myChains.size() ) + int i = item->data( Qt::UserRole ).toInt(); + if ( 0 <= i && i < (int)myChains.size() ) chain = & myChains[i]; } return chain; diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx index 7c0afb232..137371b16 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx @@ -137,7 +137,7 @@ CORBA::Boolean StdMeshers_Deflection1D_i::IsDimSupported( SMESH::Dimension type */ //================================================================================ -std::string StdMeshers_Deflection1D_i::getMethodOfParameter(const int paramIndex, +std::string StdMeshers_Deflection1D_i::getMethodOfParameter(const int /*paramIndex*/, int /*nbVars*/) const { return "SetDeflection"; diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx index 987be1ab2..b406c24bd 100644 --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx @@ -86,7 +86,7 @@ StdMeshers_Hexa_3D_i::~StdMeshers_Hexa_3D_i() */ //============================================================================= -bool StdMeshers_Hexa_3D_i::IsApplicable( const TopoDS_Shape &S, bool toCheckAll, int algoDim ) +bool StdMeshers_Hexa_3D_i::IsApplicable( const TopoDS_Shape &S, bool toCheckAll, int /*algoDim*/ ) { return ::StdMeshers_Hexa_3D::IsApplicable( S, toCheckAll ); } diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx index 909a070a0..cd6b9b66c 100644 --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx @@ -134,7 +134,7 @@ StdMeshers_QuadFromMedialAxis_1D2D_i::~StdMeshers_QuadFromMedialAxis_1D2D_i() //================================================================================ bool StdMeshers_QuadFromMedialAxis_1D2D_i::IsApplicable( const TopoDS_Shape &S, - bool toCheckAll, int algoDim ) + bool toCheckAll, int /*algoDim*/ ) { return ::StdMeshers_QuadFromMedialAxis_1D2D::IsApplicable( S, toCheckAll ); } diff --git a/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx b/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx index 3533a79cf..955dff0f6 100644 --- a/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx @@ -63,7 +63,7 @@ StdMeshers_RadialQuadrangle_1D2D_i::~StdMeshers_RadialQuadrangle_1D2D_i() //----------------------------------------------------------------------------- -bool StdMeshers_RadialQuadrangle_1D2D_i::IsApplicable( const TopoDS_Shape &S, bool toCheckAll, int algoDim ) +bool StdMeshers_RadialQuadrangle_1D2D_i::IsApplicable( const TopoDS_Shape &S, bool toCheckAll, int /*algoDim*/ ) { return ::StdMeshers_RadialQuadrangle_1D2D::IsApplicable( S, toCheckAll ); } diff --git a/src/Tools/MeshCut/MeshCut_Utils.cxx b/src/Tools/MeshCut/MeshCut_Utils.cxx index 0f28f02c6..074381549 100644 --- a/src/Tools/MeshCut/MeshCut_Utils.cxx +++ b/src/Tools/MeshCut/MeshCut_Utils.cxx @@ -437,7 +437,7 @@ int MESHCUT::codeGMSH(std::string type) std::string MESHCUT::floatEnsight(float x) { - char buf[12]; + char buf[20]; string s; if (x < 0.0) sprintf(buf, "%1.5E", x); diff --git a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx index 71e4d5021..5eee6858e 100644 --- a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx +++ b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx @@ -673,6 +673,7 @@ std::vector * MeshJobManager_i::_getResourceNames() { LOG("resource["<GetResourceDefinition(aResourceName); LOG("protocol["<protocol); + (void)resourceDefinition; // unused in release mode } }