From 45d1684bbebdcce7e67ae88714086b82514fe4ae Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 1 Jun 2021 19:03:22 -0400 Subject: [PATCH] Move inline function declaration to allow removing include --- common/base_units.cpp | 13 +++++++++++++ include/base_units.h | 14 ++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/common/base_units.cpp b/common/base_units.cpp index 9ef529d06f..88c0ca8b96 100644 --- a/common/base_units.cpp +++ b/common/base_units.cpp @@ -53,6 +53,18 @@ #endif +int Mm2mils( double x ) +{ + return KiROUND( x * 1000. / 25.4 ); +} + + +int Mils2mm( double x ) +{ + return KiROUND( x * 25.4 / 1000. ); +} + + double To_User_Unit( EDA_UNITS aUnit, double aValue ) { switch( aUnit ) @@ -74,6 +86,7 @@ double To_User_Unit( EDA_UNITS aUnit, double aValue ) } } + /** * Convert a value to a string using double notation. * diff --git a/include/base_units.h b/include/base_units.h index 97672df4c6..02e2952edb 100644 --- a/include/base_units.h +++ b/include/base_units.h @@ -36,7 +36,6 @@ #include #include -#include // for KiROUND #include //TODO: Abstract Base Units to a single class @@ -57,12 +56,15 @@ #define ALLOW_BOLD_THICKNESS IsBold() #endif +/** + * Convert mm to mils. + */ +int Mm2mils( double x ); -/// Convert mm to mils. -inline int Mm2mils( double x ) { return KiROUND( x * 1000./25.4 ); } - -/// Convert mils to mm. -inline int Mils2mm( double x ) { return KiROUND( x * 25.4 / 1000. ); } +/** + * Convert mils to mm. + */ +int Mils2mm( double x ); /** * Function To_User_Unit