Commit 69b7c2a1 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio

Removed some spurious float casts

(explanation: float is implicitly promoted to double anyway, it's only useful
for storage; also a fp variable forces conversion of other int in the expression
without needing a cast)
Typo fixes in some comments 'floatting' -> 'floating' :D
parent 2be09ba9
...@@ -238,7 +238,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -238,7 +238,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 49 ); ln = Mm2mils( 49 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 25 )) * iusPerMil; pos.x = (refx - Mm2mils( 25 )) * iusPerMil;
pos.y = (refy - Mm2mils( 7.5 )) * iusPerMil; pos.y = (refy - Mm2mils( 7.5 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -354,7 +354,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -354,7 +354,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 119 ); ln = Mm2mils( 119 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 60 )) * iusPerMil; pos.x = (refx - Mm2mils( 60 )) * iusPerMil;
pos.y = (refy - Mm2mils( 47.5 )) * iusPerMil; pos.y = (refy - Mm2mils( 47.5 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -371,7 +371,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -371,7 +371,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 22 ); ln = Mm2mils( 22 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil; pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil;
pos.y = (refy - Mm2mils( 27.5 )) * iusPerMil; pos.y = (refy - Mm2mils( 27.5 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -388,7 +388,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -388,7 +388,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 22 ); ln = Mm2mils( 22 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil; pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil;
pos.y = (refy - Mm2mils( 22.5 )) * iusPerMil; pos.y = (refy - Mm2mils( 22.5 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -405,7 +405,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -405,7 +405,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 22 ); ln = Mm2mils( 22 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil; pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil;
pos.y = (refy - Mm2mils( 2.5 )) * iusPerMil; pos.y = (refy - Mm2mils( 2.5 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -485,7 +485,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -485,7 +485,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 109 ); ln = Mm2mils( 109 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 65 )) * iusPerMil; pos.x = (refx - Mm2mils( 65 )) * iusPerMil;
pos.y = (refy - Mm2mils( 7.5 )) * iusPerMil; pos.y = (refy - Mm2mils( 7.5 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -589,7 +589,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -589,7 +589,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 69 ); ln = Mm2mils( 69 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx + Mm2mils( 35 )) * iusPerMil; pos.x = (refx + Mm2mils( 35 )) * iusPerMil;
pos.y = (refy + Mm2mils( 7 )) * iusPerMil; pos.y = (refy + Mm2mils( 7 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
...@@ -642,7 +642,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -642,7 +642,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil; lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
ln = Mm2mils( 69 ); ln = Mm2mils( 69 );
if( lnMsg > ln ) if( lnMsg > ln )
sz.x *= float( ln ) / lnMsg; sz.x *= double( ln ) / lnMsg;
pos.x = (refx - Mm2mils( 7 )) * iusPerMil; pos.x = (refx - Mm2mils( 7 )) * iusPerMil;
pos.y = (refy + Mm2mils( 35 )) * iusPerMil; pos.y = (refy + Mm2mils( 35 )) * iusPerMil;
plotter->Text( pos, plotClr, plotter->Text( pos, plotClr,
......
...@@ -71,8 +71,8 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -71,8 +71,8 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
wxRect DrawArea; wxRect DrawArea;
BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen(); BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
/* scale is the ratio resolution/internal units */ // scale is the ratio resolution/internal units
float scale = 82.0 / 1000.0 / (double) screen->MilsToIuScalar(); double scale = 82.0 / 1000.0 / (double) screen->MilsToIuScalar();
if( screen->IsBlockActive() ) if( screen->IsBlockActive() )
{ {
......
...@@ -223,8 +223,8 @@ static bool engStrToDouble( wxString aStr, double* aDouble ) ...@@ -223,8 +223,8 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
multiplier = 1e12; multiplier = 1e12;
break; break;
case 'R': case 'R':
case '.': // floatting point separator case '.': // floating point separator
case ',': // floatting point separator (some languages) case ',': // floating point separator (some languages)
default: default:
multiplier = 1; multiplier = 1;
break; break;
...@@ -262,7 +262,7 @@ static bool engStrToDouble( wxString aStr, double* aDouble ) ...@@ -262,7 +262,7 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
break; break;
} }
LOCALE_IO dummy; // set to C floatting point standard LOCALE_IO dummy; // set to C floating point standard
valueStr.ToDouble( aDouble ); valueStr.ToDouble( aDouble );
*aDouble *= multiplier; *aDouble *= multiplier;
......
...@@ -653,12 +653,12 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event ) ...@@ -653,12 +653,12 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
%.3f)</b> conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ), %.3f)</b> conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
GetChars( stringCurrPinNum ), GetChars( stringCurrPinNum ),
GetChars( curr_pin->GetName() ), GetChars( curr_pin->GetName() ),
(float) curr_pin->GetPosition().x / 1000.0, curr_pin->GetPosition().x / 1000.0,
(float) -curr_pin->GetPosition().y / 1000.0, -curr_pin->GetPosition().y / 1000.0,
GetChars( stringPinNum ), GetChars( stringPinNum ),
GetChars( Pin->GetName() ), GetChars( Pin->GetName() ),
(float) Pin->GetPosition().x / 1000.0, Pin->GetPosition().x / 1000.0,
(float) -Pin->GetPosition().y / 1000.0 ); -Pin->GetPosition().y / 1000.0 );
if( m_component->GetPartCount() > 1 ) if( m_component->GetPartCount() > 1 )
{ {
...@@ -696,8 +696,8 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event ) ...@@ -696,8 +696,8 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
msg.Printf( _( "<b>Off grid pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>" ), msg.Printf( _( "<b>Off grid pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>" ),
GetChars( stringPinNum ), GetChars( stringPinNum ),
GetChars( Pin->GetName() ), GetChars( Pin->GetName() ),
(float) Pin->GetPosition().x / 1000.0, Pin->GetPosition().x / 1000.0,
(float) -Pin->GetPosition().y / 1000.0 ); -Pin->GetPosition().y / 1000.0 );
if( m_component->GetPartCount() > 1 ) if( m_component->GetPartCount() > 1 )
{ {
......
...@@ -418,8 +418,8 @@ void GERBVIEW_FRAME::Liste_D_Codes() ...@@ -418,8 +418,8 @@ void GERBVIEW_FRAME::Liste_D_Codes()
Line.Printf( wxT( "tool %2.2d: D%2.2d V %2.4f H %2.4f %s" ), Line.Printf( wxT( "tool %2.2d: D%2.2d V %2.4f H %2.4f %s" ),
jj, jj,
pt_D_code->m_Num_Dcode, pt_D_code->m_Num_Dcode,
(float) pt_D_code->m_Size.y / scale, pt_D_code->m_Size.y / scale,
(float) pt_D_code->m_Size.x / scale, pt_D_code->m_Size.x / scale,
D_CODE::ShowApertureType( pt_D_code->m_Shape ) D_CODE::ShowApertureType( pt_D_code->m_Shape )
); );
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* We cannot use wxConfigBase->Write for a double, because * We cannot use wxConfigBase->Write for a double, because
* this function uses a format with very few digits in mantissa, * this function uses a format with very few digits in mantissa,
* and truncation issues are frequent. * and truncation issues are frequent.
* We use here a better floatting format. * We use here a better floating format.
* *
* Note: prior to 2.9.1, the separator was localized, and after, uses * Note: prior to 2.9.1, the separator was localized, and after, uses
* the "C" notation * the "C" notation
......
...@@ -325,7 +325,7 @@ static void BuildDimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC, ...@@ -325,7 +325,7 @@ static void BuildDimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
{ {
wxPoint delta; wxPoint delta;
int dx, dy; int dx, dy;
float angle, depl; double angle, depl;
delta = Dimension->m_featureLineDO - Dimension->m_featureLineGO; delta = Dimension->m_featureLineDO - Dimension->m_featureLineGO;
/* Calculating the direction of travel perpendicular to the selected axis. */ /* Calculating the direction of travel perpendicular to the selected axis. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment