Remove some warnings and fix indentation

This commit is contained in:
eap 2021-03-12 19:14:26 +03:00
parent 7745fdb726
commit bfa9ca6ac6
15 changed files with 101 additions and 100 deletions

View File

@ -76,7 +76,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
}
fprintf(stdout, "%d noeuds\n", myMesh->NbNodes());
fprintf(stdout, "%ld noeuds\n", myMesh->NbNodes());
/****************************************************************************
* LECTURE DES ELEMENTS *
****************************************************************************/

View File

@ -70,7 +70,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
SCRUTE(nb_of_volumes);
//fprintf(stdout, "%d %d\n", nbNodes, nbCells);
fprintf(aFileId, "%d %d\n", nbNodes, nbCells);
fprintf(aFileId, "%ld %ld\n", nbNodes, nbCells);
/****************************************************************************
* ECRITURE DES NOEUDS *
@ -107,7 +107,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID );
fprintf(aFileId, "%ld ", nodeID );
}
fprintf(aFileId, "\n");
}
@ -123,7 +123,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID );
fprintf(aFileId, "%ld ", nodeID );
}
fprintf(aFileId, "\n");
}
@ -158,7 +158,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID );
fprintf(aFileId, "%ld ", nodeID );
}
fprintf(aFileId, "\n");

View File

@ -417,7 +417,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
if ( _makeRequiredGroups )
{
const int kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift },
const smIdType kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift },
{ GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift },
{ GmfRequiredTriangles, SMDSAbs_Face, triaIDShift },
{ GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }
@ -429,9 +429,9 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
};
for ( int i = 0; i < 4; ++i )
{
int gmfKwd = kes[i][0];
int gmfKwd = FromIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
int shift = kes[i][2];
smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd))
{
const int newID = *groupIDs.rbegin() + 1;
@ -454,7 +454,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
if ( _makeFaultGroups )
{
const int kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift },
const smIdType kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift },
{ GmfFault_BadShape, SMDSAbs_Face, triaIDShift },
{ GmfFault_Overlap, SMDSAbs_Face, triaIDShift },
{ GmfFault_Inter, SMDSAbs_Face, triaIDShift },
@ -472,9 +472,9 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
};
for ( int i = 0; i < 7; ++i )
{
int gmfKwd = kes[i][0];
int gmfKwd = FromIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
int shift = kes[i][2];
smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd))
{
const int newID = *groupIDs.rbegin() + 1;

View File

@ -35,7 +35,8 @@ typedef std::list<SMESHDS_GroupBase*> TGroupList;
class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh
{
public:
virtual Status Perform();
virtual Status Perform() override;
void AddGroup(SMESHDS_GroupBase* theGroup) { myGroups.push_back(theGroup); }

View File

@ -4237,7 +4237,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
if ( grImpl )
{
CORBA::String_var objStr = GetORB()->object_to_string( grImpl->_this() );
smIdType anId = myStudyContext->findId( string( objStr.in() ) );
int anId = myStudyContext->findId( string( objStr.in() ) );
char grpName[ 30 ];
sprintf( grpName, "Group %d %d", anId, grImpl->GetLocalID() );
SMESHDS_GroupBase* aGrpBaseDS = grImpl->GetGroupDS();
@ -4294,7 +4294,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
#endif
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
CORBA::String_var hypdata = myImpl->SaveTo();
smIdType id = myStudyContext->findId( string( objStr.in() ));
int id = myStudyContext->findId( string( objStr.in() ));
// for each hypothesis create HDF group basing on its id
char hypGrpName[30];
@ -4362,7 +4362,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
#endif
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
CORBA::String_var hypdata = myImpl->SaveTo();
smIdType id = myStudyContext->findId( string( objStr.in() ) );
int id = myStudyContext->findId( string( objStr.in() ) );
// for each algorithm create HDF group basing on its id
char hypGrpName[30];
@ -4405,7 +4405,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
SMESH_Mesh_i* myImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( myMesh ).in() );
if ( myImpl ) {
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
smIdType id = myStudyContext->findId( string( objStr.in() ) );
int id = myStudyContext->findId( string( objStr.in() ) );
::SMESH_Mesh& myLocMesh = myImpl->GetImpl();
SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
bool hasShape = myLocMesh.HasShapeToMesh();
@ -4524,7 +4524,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
//string myRefOnObject = myRefOnHyp->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnHyp );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
smIdType id = myStudyContext->findId( string( objStr.in() ) );
int id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char hypName[ 30 ], hypId[ 30 ];
@ -4568,7 +4568,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
//string myRefOnObject = myRefOnAlgo->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
smIdType id = myStudyContext->findId( string( objStr.in() ) );
int id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char algoName[ 30 ], algoId[ 30 ];
@ -4659,7 +4659,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
{
SMESH::SMESH_subMesh_var mySubMesh = SMESH::SMESH_subMesh::_narrow( anSubObject ) ;
CORBA::String_var objStr = GetORB()->object_to_string( anSubObject );
smIdType subid = myStudyContext->findId( string( objStr.in() ) );
int subid = myStudyContext->findId( string( objStr.in() ) );
// for each mesh open the HDF group basing on its id
char submeshGrpName[ 30 ];
@ -4698,7 +4698,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
//string myRefOnObject = myRefOnHyp->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnHyp );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
smIdType id = myStudyContext->findId( string( objStr.in() ) );
int id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char hypName[ 30 ], hypId[ 30 ];
@ -4735,7 +4735,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
//string myRefOnObject = myRefOnAlgo->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
smIdType id = myStudyContext->findId( string( objStr.in() ) );
int id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char algoName[ 30 ], algoId[ 30 ];
@ -4864,7 +4864,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
continue;
CORBA::String_var objStr = GetORB()->object_to_string( aSubObject );
smIdType anId = myStudyContext->findId( string( objStr.in() ) );
int anId = myStudyContext->findId( string( objStr.in() ) );
// For each group, create a dataset named "Group <group_persistent_id>"
// and store the group's user name into it
@ -5330,7 +5330,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
// myImpl->LoadFrom( hypdata.c_str() );
hypDataList.push_back( make_pair( myImpl, hypdata ));
CORBA::String_var iorString = GetORB()->object_to_string( myHyp );
smIdType newId = myStudyContext->findId( iorString.in() );
int newId = myStudyContext->findId( iorString.in() );
myStudyContext->mapOldToNew( id, newId );
}
else
@ -5434,7 +5434,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
//myImpl->LoadFrom( hypdata.c_str() );
hypDataList.push_back( make_pair( myImpl, hypdata ));
CORBA::String_var iorString = GetORB()->object_to_string( myHyp );
smIdType newId = myStudyContext->findId( iorString.in() );
int newId = myStudyContext->findId( iorString.in() );
myStudyContext->mapOldToNew( id, newId );
}
else
@ -5475,7 +5475,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
meshGroupList.push_back( make_pair( myNewMeshImpl, aTopGroup ));
CORBA::String_var iorString = GetORB()->object_to_string( myNewMesh );
smIdType newId = myStudyContext->findId( iorString.in() );
int newId = myStudyContext->findId( iorString.in() );
myStudyContext->mapOldToNew( id, newId );
// ouv : NPAL12872
@ -5578,7 +5578,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
// get mesh old id
CORBA::String_var iorString = GetORB()->object_to_string( myNewMeshImpl->_this() );
smIdType newId = myStudyContext->findId( iorString.in() );
int newId = myStudyContext->findId( iorString.in() );
int meshOldId = myStudyContext->getOldId( newId );
// try to find mesh data dataset
@ -5730,7 +5730,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
if ( aSubMesh->_is_nil() )
continue;
string iorSubString = GetORB()->object_to_string( aSubMesh );
smIdType newSubId = myStudyContext->findId( iorSubString );
int newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
}
}
@ -5923,7 +5923,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
continue;
string iorSubString = GetORB()->object_to_string( aNewGroup );
smIdType newSubId = myStudyContext->findId( iorSubString );
int newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
SMESH_GroupBase_i* aGroupImpl = SMESH::DownCast< SMESH_GroupBase_i*>( aNewGroup );
@ -6192,7 +6192,7 @@ char* SMESH_Gen_i::IORToLocalPersistentID( SALOMEDS::SObject_ptr /*theSObject*/,
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::IORToLocalPersistentID" );
if ( myStudyContext && strcmp( IORString, "" ) != 0 ) {
smIdType anId = myStudyContext->findId( IORString );
int anId = myStudyContext->findId( IORString );
if ( anId ) {
if(MYDEBUG) MESSAGE( "VSR " << anId )
char strId[ 20 ];

View File

@ -622,7 +622,7 @@ SMESH::smIdType_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
const SMESH_SequenceOfElemPtr& aSeq = getEditor().GetLastCreatedNodes();
myLastCreatedNodes->length( aSeq.size() );
for ( smIdType i = 0; i < aSeq.size(); i++)
for ( size_t i = 0; i < aSeq.size(); i++)
myLastCreatedNodes[i] = aSeq[i]->GetID();
return myLastCreatedNodes._retn();
@ -644,7 +644,7 @@ SMESH::smIdType_array* SMESH_MeshEditor_i::GetLastCreatedElems()
const SMESH_SequenceOfElemPtr& aSeq = getEditor().GetLastCreatedElems();
myLastCreatedElems->length( aSeq.size() );
for ( smIdType i = 0; i < aSeq.size(); i++ )
for ( size_t i = 0; i < aSeq.size(); i++ )
myLastCreatedElems[i] = aSeq[i]->GetID();
return myLastCreatedElems._retn();
@ -1275,7 +1275,7 @@ SMESH_MeshEditor_i::Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObje
SMESH::smIdType_array_var newElems = new SMESH::smIdType_array;
newElems->length( elems0D.size() );
TIDSortedElemSet::iterator eIt = elems0D.begin();
for ( smIdType i = 0; i < elems0D.size(); ++i, ++eIt )
for ( size_t i = 0; i < elems0D.size(); ++i, ++eIt )
newElems[ i ] = (*eIt)->GetID();
SMESH::SMESH_GroupBase_var groupToFill;
@ -4575,7 +4575,7 @@ SMESH::smIdType_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double
SMDSAbs_ElementType( type ),
foundElems);
res->length( foundElems.size() );
for ( smIdType i = 0; i < foundElems.size(); ++i )
for ( size_t i = 0; i < foundElems.size(); ++i )
res[i] = foundElems[i]->GetID();
return res._retn();
@ -4646,7 +4646,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID
SMDSAbs_ElementType( type ),
foundElems);
res->length( foundElems.size() );
for ( smIdType i = 0; i < foundElems.size(); ++i )
for ( size_t i = 0; i < foundElems.size(); ++i )
res[i] = foundElems[i]->GetID();
return res._retn();

View File

@ -2483,7 +2483,7 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top( const gp_Trsf & bottomToTopTrsf
// Fill myBotToColumnMap
int zSize = myBlock.VerticalSize();
size_t zSize = myBlock.VerticalSize();
TNodeNodeMap::const_iterator bN_tN = n2nMapPtr->begin();
for ( ; bN_tN != n2nMapPtr->end(); ++bN_tN )
{
@ -2555,7 +2555,7 @@ bool StdMeshers_Prism_3D::projectBottomToTop( const gp_Trsf & bottom
// Fill myBotToColumnMap
int zSize = myBlock.VerticalSize();
size_t zSize = myBlock.VerticalSize();
Prism_3D::TNode prevTNode;
SMDS_NodeIteratorPtr nIt = botSMDS->GetNodes();
while ( nIt->more() )
@ -3910,7 +3910,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper,
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
}
if ( !faceColumns.empty() && (int)faceColumns.begin()->second.size() != VerticalSize() )
if ( !faceColumns.empty() && faceColumns.begin()->second.size() != VerticalSize() )
return error(COMPERR_BAD_INPUT_MESH, "Different 'vertical' discretization");
// edge columns
@ -4226,7 +4226,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> &
const Prism_3D::TPrismTopo& prism) const
{
const bool itTopMeshed = !SubMesh( ID_BOT_FACE )->IsEmpty();
const int zSize = VerticalSize();
const size_t zSize = VerticalSize();
if ( zSize < 3 && !itTopMeshed ) return true;
trsf.resize( zSize - 1 );
@ -4273,7 +4273,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> &
gp_Ax3 cs0 = getLayerCoordSys(0, columns, xCol );
//double dist0 = cs0.Location().Distance( gpXYZ( (*columns[0])[0]));
toCs0.SetTransformation( cs0 );
for ( int z = 1; z < zSize; ++z )
for ( size_t z = 1; z < zSize; ++z )
{
gp_Ax3 csZ = getLayerCoordSys(z, columns, xCol );
//double distZ = csZ.Location().Distance( gpXYZ( (*columns[0])[z]));
@ -5614,7 +5614,7 @@ bool StdMeshers_Sweeper::ComputeNodesOnStraight()
int botTriaNodes[3], topTriaNodes[3];
bool checkUV = true;
int nbInternalNodes = myIntColumns.size();
size_t nbInternalNodes = myIntColumns.size();
myBotDelaunay->InitTraversal( nbInternalNodes );
while (( botNode = myBotDelaunay->NextNode( botBC, botTriaNodes )))
@ -5763,7 +5763,7 @@ bool StdMeshers_Sweeper::findDelaunayTriangles()
TopBotTriangles tbTrias;
bool checkUV = true;
int nbInternalNodes = myIntColumns.size();
size_t nbInternalNodes = myIntColumns.size();
myTopBotTriangles.resize( nbInternalNodes );
myBotDelaunay->InitTraversal( nbInternalNodes );

View File

@ -1531,7 +1531,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
if ( theConsiderMesh )
{
const size_t nbSegments = std::max( faceSide.NbPoints()-1, faceSide.NbSegments() );
const smIdType nbSegments = std::max( faceSide.NbPoints()-1, faceSide.NbSegments() );
if ( nbSegments < nbCorners )
return error(COMPERR_BAD_INPUT_MESH, TComm("Too few boundary nodes: ") << nbSegments);
}

View File

@ -1097,7 +1097,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
double parI = par0 + ( par1 - par0 ) * r;
Params.InsertBefore( i, parI );
auto it = nbsegs.begin();
auto incr_it = i - 2 + iDiap;
smIdType incr_it = i - 2 + iDiap;
nbsegs.insert( it + incr_it, nbSegPerDiap );
}
nbsegs[ i-2 + nbDiapason - 1 ] = nbSegPerDiap + nbTot % nbDiapason;