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
This commit is contained in:
parent
2be09ba9e2
commit
69b7c2a1b6
|
@ -238,7 +238,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 49 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 25 )) * iusPerMil;
|
||||
pos.y = (refy - Mm2mils( 7.5 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -354,7 +354,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 119 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 60 )) * iusPerMil;
|
||||
pos.y = (refy - Mm2mils( 47.5 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -371,7 +371,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 22 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil;
|
||||
pos.y = (refy - Mm2mils( 27.5 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -388,7 +388,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 22 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil;
|
||||
pos.y = (refy - Mm2mils( 22.5 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -405,7 +405,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 22 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 167.5 )) * iusPerMil;
|
||||
pos.y = (refy - Mm2mils( 2.5 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -485,7 +485,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 109 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 65 )) * iusPerMil;
|
||||
pos.y = (refy - Mm2mils( 7.5 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -589,7 +589,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 69 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx + Mm2mils( 35 )) * iusPerMil;
|
||||
pos.y = (refy + Mm2mils( 7 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
@ -642,7 +642,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
lnMsg = ReturnGraphicTextWidth( msg, sz.x, false, false ) / iusPerMil;
|
||||
ln = Mm2mils( 69 );
|
||||
if( lnMsg > ln )
|
||||
sz.x *= float( ln ) / lnMsg;
|
||||
sz.x *= double( ln ) / lnMsg;
|
||||
pos.x = (refx - Mm2mils( 7 )) * iusPerMil;
|
||||
pos.y = (refy + Mm2mils( 35 )) * iusPerMil;
|
||||
plotter->Text( pos, plotClr,
|
||||
|
|
|
@ -71,8 +71,8 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
|||
wxRect DrawArea;
|
||||
BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
|
||||
|
||||
/* scale is the ratio resolution/internal units */
|
||||
float scale = 82.0 / 1000.0 / (double) screen->MilsToIuScalar();
|
||||
// scale is the ratio resolution/internal units
|
||||
double scale = 82.0 / 1000.0 / (double) screen->MilsToIuScalar();
|
||||
|
||||
if( screen->IsBlockActive() )
|
||||
{
|
||||
|
|
|
@ -223,8 +223,8 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
|
|||
multiplier = 1e12;
|
||||
break;
|
||||
case 'R':
|
||||
case '.': // floatting point separator
|
||||
case ',': // floatting point separator (some languages)
|
||||
case '.': // floating point separator
|
||||
case ',': // floating point separator (some languages)
|
||||
default:
|
||||
multiplier = 1;
|
||||
break;
|
||||
|
@ -262,7 +262,7 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
|
|||
break;
|
||||
}
|
||||
|
||||
LOCALE_IO dummy; // set to C floatting point standard
|
||||
LOCALE_IO dummy; // set to C floating point standard
|
||||
valueStr.ToDouble( aDouble );
|
||||
*aDouble *= multiplier;
|
||||
|
||||
|
|
|
@ -653,12 +653,12 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
|
|||
%.3f)</b> conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
|
||||
GetChars( stringCurrPinNum ),
|
||||
GetChars( curr_pin->GetName() ),
|
||||
(float) curr_pin->GetPosition().x / 1000.0,
|
||||
(float) -curr_pin->GetPosition().y / 1000.0,
|
||||
curr_pin->GetPosition().x / 1000.0,
|
||||
-curr_pin->GetPosition().y / 1000.0,
|
||||
GetChars( stringPinNum ),
|
||||
GetChars( Pin->GetName() ),
|
||||
(float) Pin->GetPosition().x / 1000.0,
|
||||
(float) -Pin->GetPosition().y / 1000.0 );
|
||||
Pin->GetPosition().x / 1000.0,
|
||||
-Pin->GetPosition().y / 1000.0 );
|
||||
|
||||
if( m_component->GetPartCount() > 1 )
|
||||
{
|
||||
|
@ -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>" ),
|
||||
GetChars( stringPinNum ),
|
||||
GetChars( Pin->GetName() ),
|
||||
(float) Pin->GetPosition().x / 1000.0,
|
||||
(float) -Pin->GetPosition().y / 1000.0 );
|
||||
Pin->GetPosition().x / 1000.0,
|
||||
-Pin->GetPosition().y / 1000.0 );
|
||||
|
||||
if( m_component->GetPartCount() > 1 )
|
||||
{
|
||||
|
|
|
@ -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" ),
|
||||
jj,
|
||||
pt_D_code->m_Num_Dcode,
|
||||
(float) pt_D_code->m_Size.y / scale,
|
||||
(float) pt_D_code->m_Size.x / scale,
|
||||
pt_D_code->m_Size.y / scale,
|
||||
pt_D_code->m_Size.x / scale,
|
||||
D_CODE::ShowApertureType( pt_D_code->m_Shape )
|
||||
);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* We cannot use wxConfigBase->Write for a double, because
|
||||
* this function uses a format with very few digits in mantissa,
|
||||
* 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
|
||||
* the "C" notation
|
||||
|
|
|
@ -325,7 +325,7 @@ static void BuildDimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
{
|
||||
wxPoint delta;
|
||||
int dx, dy;
|
||||
float angle, depl;
|
||||
double angle, depl;
|
||||
delta = Dimension->m_featureLineDO - Dimension->m_featureLineGO;
|
||||
|
||||
/* Calculating the direction of travel perpendicular to the selected axis. */
|
||||
|
|
Loading…
Reference in New Issue