Skip to content

Commit

Permalink
fix Coverity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 22, 2016
1 parent 63ad264 commit 4ba5388
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Mod/Part/App/Attacher.cpp
Expand Up @@ -1577,41 +1577,42 @@ AttachEngineLine *AttachEngineLine::copy() const
Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement origPlacement) const
{
eMapMode mmode = this->mapMode;
if (mmode == mmDeactivated)
throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled

//modes that are mirrors of attacher3D:
bool bReUsed = true;
Base::Placement presuperPlacement;
switch(mmode){
case mmDeactivated:
throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled
case mm1AxisX:
mmode = mmObjectYZ;
break;
break;
case mm1AxisY:
mmode = mmObjectXZ;
break;
break;
case mm1AxisZ:
mmode = mmObjectXY;
break;
break;
case mm1AxisCurv:
mmode = mmRevolutionSection;
//the line should go along Y, not Z
presuperPlacement.setRotation(
Base::Rotation( Base::Vector3d(0.0,0.0,1.0),
Base::Vector3d(0.0,1.0,0.0) )
);
break;
break;
case mm1Binormal:
mmode = mmFrenetTN;
break;
break;
case mm1Normal:
mmode = mmFrenetTB;
break;
break;
case mm1Tangent:
mmode = mmNormalToPath;
break;
break;
default:
bReUsed = false;
break;
}

Base::Placement plm;
Expand Down Expand Up @@ -1640,7 +1641,7 @@ Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement ori
switch (mmode) {
case mmDeactivated:
//should have been filtered out already!
break;
break;
case mm1AxisInertia1:
case mm1AxisInertia2:
case mm1AxisInertia3:{
Expand Down Expand Up @@ -1845,12 +1846,12 @@ AttachEnginePoint *AttachEnginePoint::copy() const
Base::Placement AttachEnginePoint::calculateAttachedPlacement(Base::Placement origPlacement) const
{
eMapMode mmode = this->mapMode;
if (mmode == mmDeactivated)
throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled

//modes that are mirrors of attacher3D:
bool bReUsed = true;
switch(mmode){
case mmDeactivated:
throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled
case mm0Origin:
mmode = mmObjectXY;
break;
Expand Down

0 comments on commit 4ba5388

Please sign in to comment.