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

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
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -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,
            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,
            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,
            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,
            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,
            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,
            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,
            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,
+2 −2
Original line number Original line Diff line number Diff line
@@ -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() )
    {
    {
+3 −3
Original line number Original line Diff line number Diff line
@@ -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 )
        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;


+6 −6
Original line number Original line Diff line number Diff line
@@ -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 )
        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 )
        {
        {
+2 −2
Original line number Original line Diff line number Diff line
@@ -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 )
                         );
                         );


Loading