diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index 0b236ae932..5f833142e7 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -51,8 +51,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::Load( ::BOARD* aBoard ) long long designSizeXkicad = (long long) designLimit.x * KiCadUnitMultiplier; long long designSizeYkicad = (long long) designLimit.y * KiCadUnitMultiplier; - // Max size limited by the positive dimention of wxPoint - double maxDesignSizekicad = Iu2Millimeter( std::numeric_limits::max() ); + // Max size limited by the positive dimension of wxPoint (which is an int) + long long maxDesignSizekicad = std::numeric_limits::max(); if( designSizeXkicad > maxDesignSizekicad || designSizeYkicad > maxDesignSizekicad ) THROW_IO_ERROR( wxString::Format( @@ -63,7 +63,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::Load( ::BOARD* aBoard ) "Maximum permitted design size: %.2f, %.2f millimeters.\n" ), (double) designSizeXkicad / PCB_IU_PER_MM, (double) designSizeYkicad / PCB_IU_PER_MM, - maxDesignSizekicad, maxDesignSizekicad ) ); + (double) maxDesignSizekicad / PCB_IU_PER_MM, + (double) maxDesignSizekicad / PCB_IU_PER_MM ) ); mDesignCenter = ( Assignments.Technology.DesignArea.first + Assignments.Technology.DesignArea.second ) diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp index 25322cfd0d..93097bdbc1 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp @@ -25,6 +25,7 @@ #include #include // pow() +#include // PCB_IU_PER_MM void CADSTAR_PCB_ARCHIVE_PARSER::Parse() @@ -45,7 +46,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::Parse() switch( Header.Resolution ) { case RESOLUTION::HUNDREDTH_MICRON: - KiCadUnitMultiplier = 10; + KiCadUnitMultiplier = PCB_IU_PER_MM / 1e5; break; default: