fix a few compil warnings and a Coverity warning.

This commit is contained in:
jean-pierre charras 2020-08-10 17:49:30 +02:00
parent 0a1d8c1aaa
commit 23a5b0ca5f
3 changed files with 18 additions and 21 deletions

View File

@ -72,6 +72,8 @@ TRANSLINE::TRANSLINE()
m_parameters[MURC_PRM] = 1.0; m_parameters[MURC_PRM] = 1.0;
m_Name = nullptr; m_Name = nullptr;
ang_l = 0.0; // Electrical length in angle ang_l = 0.0; // Electrical length in angle
len = 0.0; // length of line
er_eff = 1.0; // effective dielectric constant
Init(); Init();
} }

View File

@ -674,8 +674,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildModuleList( std::vector<RefDesInfo>& aBadRefD
int errorcount = 0; int errorcount = 0;
unsigned int backstartrefdes; unsigned int backstartrefdes;
size_t firstnum = 0;
size_t firstnum, changearraysize;
m_FrontModules.clear(); m_FrontModules.clear();
m_BackModules.clear(); m_BackModules.clear();
@ -798,7 +797,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildModuleList( std::vector<RefDesInfo>& aBadRefD
LogChangePlan(); LogChangePlan();
changearraysize = m_ChangeArray.size(); size_t changearraysize = m_ChangeArray.size();
for( size_t i = 0; i < changearraysize; i++ ) //Scan through for duplicates if update or skip for( size_t i = 0; i < changearraysize; i++ ) //Scan through for duplicates if update or skip
{ {

View File

@ -607,15 +607,12 @@ void POINT_EDITOR::updateItem() const
} }
else else
{ {
double tan = mid.y / static_cast<double>( mid.x );
double tmp = mid.x;
// Circle : x^2 + y^2 = R ^ 2 // Circle : x^2 + y^2 = R ^ 2
// In this coordinate system, the angular position of the cursor is (r, theta) // In this coordinate system, the angular position of the cursor is (r, theta)
// The line coming from the center of the circle is y = start.y / start.x * x // The line coming from the center of the circle is y = start.y / start.x * x
// The intersection fulfills : x^2 = R^2 / ( 1 + ( start.y / start.x ) ^ 2 ) // The intersection fulfills : x^2 = R^2 / ( 1 + ( start.y / start.x ) ^ 2 )
tmp = sqrt( sqRadius double tmp = sqrt( sqRadius /
/ ( ( 1.0 ( ( 1.0 + mid.y / static_cast<double>( mid.x ) * mid.y
+ mid.y / static_cast<double>( mid.x ) * mid.y
/ static_cast<double>( mid.x ) ) ) ); / static_cast<double>( mid.x ) ) ) );
// Move to the correct quadrant // Move to the correct quadrant
tmp = mid.x > 0 ? tmp : -tmp; tmp = mid.x > 0 ? tmp : -tmp;
@ -691,7 +688,6 @@ void POINT_EDITOR::updateItem() const
double R = v1.EuclideanNorm(); double R = v1.EuclideanNorm();
bool transformCircle = false; bool transformCircle = false;
bool invertY = ( v2.y < 0 );
/* p2 /* p2
* X*** * X***