Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix more GCC warnings.
  • Loading branch information
f3nix authored and wwmayer committed Feb 18, 2017
1 parent bc525a4 commit 7e42975
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/3rdParty/salomesmesh/src/SMDS/SMDS_VolumeTool.cpp
Expand Up @@ -1307,7 +1307,7 @@ int SMDS_VolumeTool::GetOppFaceIndex( int faceIndex ) const
case 15:
if ( faceIndex == 0 || faceIndex == 1 )
ind = 1 - faceIndex;
break;
break;
case 8:
case 12:
if ( faceIndex <= 1 ) // top or bottom
Expand Down
11 changes: 9 additions & 2 deletions src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp
Expand Up @@ -445,8 +445,15 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
: _mesh(&mesh),_meshPartIt(elemIt),_ebbTree(0),_nodeSearcher(0),_tolerance(tol),_outerFacesFound(false) {}
virtual ~SMESH_ElementSearcherImpl()
{
if ( _ebbTree ) delete _ebbTree; _ebbTree = 0;
if ( _nodeSearcher ) delete _nodeSearcher; _nodeSearcher = 0;
if ( _ebbTree )
delete _ebbTree;

_ebbTree = 0;

if ( _nodeSearcher )
delete _nodeSearcher;

_nodeSearcher = 0;
}
virtual int FindElementsByPoint(const gp_Pnt& point,
SMDSAbs_ElementType type,
Expand Down
22 changes: 11 additions & 11 deletions src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
Expand Up @@ -11634,18 +11634,18 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
vector<int> orderDom = itn->second;
vector<vtkIdType> orderedNodes;
for (int idom = 0; idom <orderDom.size(); idom++)
orderedNodes.push_back( nodeDomains[node][orderDom[idom]] );
SMDS_MeshFace* face = this->GetMeshDS()->AddFaceFromVtkIds(orderedNodes);

stringstream grpname;
grpname << "m2j_";
grpname << 0 << "_" << 0;
int idg;
string namegrp = grpname.str();
if (!mapOfJunctionGroups.count(namegrp))
orderedNodes.push_back( nodeDomains[node][orderDom[idom]] );
SMDS_MeshFace* face = this->GetMeshDS()->AddFaceFromVtkIds(orderedNodes);

stringstream grpname;
grpname << "m2j_";
grpname << 0 << "_" << 0;
int idg;
string namegrp = grpname.str();
if (!mapOfJunctionGroups.count(namegrp))
mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Face, namegrp.c_str(), idg);
SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
if (sgrp)
SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
if (sgrp)
sgrp->Add(face->GetID());
}

Expand Down
4 changes: 2 additions & 2 deletions src/Gui/Quarter/QuarterWidgetP.cpp
Expand Up @@ -86,8 +86,8 @@ QuarterWidgetP::QuarterWidgetP(QuarterWidget * masterptr, const QGLWidget * shar
clearzbuffer(true),
clearwindow(true),
addactions(true),
contextmenu(NULL),
device_pixel_ratio(1.0)
device_pixel_ratio(1.0),
contextmenu(NULL)
{
this->cachecontext = findCacheContext(masterptr, sharewidget);

Expand Down
11 changes: 8 additions & 3 deletions src/Mod/Mesh/App/Core/Triangulation.cpp
Expand Up @@ -377,7 +377,10 @@ bool EarClippingTriangulator::Triangulate::Process(const std::vector<Base::Vecto
m++;

/* remove v from remaining polygon */
for(s=v,t=v+1;t<nv;s++,t++) V[s] = V[t]; nv--;
for(s=v,t=v+1;t<nv;s++,t++)
V[s] = V[t];

nv--;

/* resest error detection counter */
count = 2*nv;
Expand Down Expand Up @@ -536,8 +539,10 @@ struct Vertex2d_EqualTo : public std::binary_function<const Base::Vector3f&, co
bool operator()(const Base::Vector3f& p, const Base::Vector3f& q) const
{
if (fabs(p.x - q.x) < MeshDefinitions::_fMinPointDistanceD1
&& fabs(p.y - q.y) < MeshDefinitions::_fMinPointDistanceD1)
return true; return false;
&& fabs(p.y - q.y) < MeshDefinitions::_fMinPointDistanceD1)
return true;

return false;
}
};
}
Expand Down
24 changes: 12 additions & 12 deletions src/Mod/Path/libarea/AreaClipper.cpp
Expand Up @@ -347,19 +347,19 @@ static void SetFromResult( CCurve& curve, TPolygon& p, bool reverse = true )
if(CArea::m_clipper_clean_distance >= Point::tolerance)
CleanPolygon(p,CArea::m_clipper_clean_distance);

for(unsigned int j = 0; j < p.size(); j++)
{
const IntPoint &pt = p[j];
DoubleAreaPoint dp(pt);
CVertex vertex(0, Point(dp.X / CArea::m_units, dp.Y / CArea::m_units), Point(0.0, 0.0));
if(reverse)curve.m_vertices.push_front(vertex);
else curve.m_vertices.push_back(vertex);
}
// make a copy of the first point at the end
if(reverse)curve.m_vertices.push_front(curve.m_vertices.back());
else curve.m_vertices.push_back(curve.m_vertices.front());
for(unsigned int j = 0; j < p.size(); j++)
{
const IntPoint &pt = p[j];
DoubleAreaPoint dp(pt);
CVertex vertex(0, Point(dp.X / CArea::m_units, dp.Y / CArea::m_units), Point(0.0, 0.0));
if(reverse)curve.m_vertices.push_front(vertex);
else curve.m_vertices.push_back(vertex);
}
// make a copy of the first point at the end
if(reverse)curve.m_vertices.push_front(curve.m_vertices.back());
else curve.m_vertices.push_back(curve.m_vertices.front());

if(CArea::m_fit_arcs)curve.FitArcs();
if(CArea::m_fit_arcs)curve.FitArcs();
}

static void SetFromResult( CArea& area, TPolyPolygon& pp, bool reverse = true )
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Robot/App/kdl_cp/path_roundedcomposite.cpp
Expand Up @@ -189,7 +189,8 @@ void Path_RoundedComposite::GetCurrentSegmentLocation(double s,
Path_RoundedComposite::~Path_RoundedComposite() {
if (aggregate)
delete orient;
delete comp;

delete comp;
}


Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Robot/App/kdl_cp/velocityprofile_trap.cpp
Expand Up @@ -97,7 +97,8 @@ void VelocityProfile_Trap::SetProfileDuration(
double factor = duration/newduration;
if (factor > 1)
return; // do not exceed max
a2*=factor;

a2*=factor;
a3*=factor*factor;
b2*=factor;
b3*=factor*factor;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Robot/App/kdl_cp/velocityprofile_traphalf.cpp
Expand Up @@ -106,7 +106,7 @@ void VelocityProfile_TrapHalf::SetProfileDuration(
if ( factor > 1 )
return;

double s = sign(endpos-startpos);
double s = sign(endpos-startpos);
double tmp = 2.0*s*(endpos-startpos)/maxvel;
double v = s*maxvel;
duration = newduration;
Expand Down
16 changes: 8 additions & 8 deletions src/Mod/Sketcher/App/SketchObject.cpp
Expand Up @@ -3217,15 +3217,15 @@ int SketchObject::ExposeInternalGeometry(int GeoId)
this->addConstraints(icon);

for (std::vector<Part::Geometry *>::iterator it=igeo.begin(); it != igeo.end(); ++it)
if (*it)
if (*it)
delete *it;
for (std::vector<Constraint *>::iterator it=icon.begin(); it != icon.end(); ++it)
if (*it)
delete *it;
icon.clear();
igeo.clear();

for (std::vector<Constraint *>::iterator it=icon.begin(); it != icon.end(); ++it)
if (*it)
delete *it;

icon.clear();
igeo.clear();

return incrgeo; //number of added elements
}
Expand Down

0 comments on commit 7e42975

Please sign in to comment.