diff --git a/include/fctsys.h b/include/fctsys.h index 8225dfd0f3..42e8742e08 100644 --- a/include/fctsys.h +++ b/include/fctsys.h @@ -12,23 +12,23 @@ #endif // for all others, include the necessary headers (this file is usually all you -// need because it includes almost all "standard" wxWindows headers +// need because it includes almost all "standard" wxWidgetss headers #ifndef WX_PRECOMP #include #endif -/* - * FIXME: This appears to already be included in the OSX build of wxWidgets. - * Will someone with OSX please remove this and see if it compiles. +/** + * @note This appears to already be included in the OSX build of wxWidgets. + * Will someone with OSX please remove this and see if it compiles? */ #ifdef __WXMAC__ #include #endif -#ifndef M_PI -#define M_PI 3.141592653 -#endif - +/** + * @note Shouldn't we be using wxFileName::GetPathSeparator() instead of the following code + * for improved portability? + */ #ifdef __WINDOWS__ #define DIR_SEP '\\' #define STRING_DIR_SEP wxT( "\\" ) @@ -37,6 +37,12 @@ #define STRING_DIR_SEP wxT( "/" ) #endif +/** + * @note Do we really need these defined again? + */ +#define UNIX_STRING_DIR_SEP wxT( "/" ) +#define WIN_STRING_DIR_SEP wxT( "\\" ) + #ifdef DEBUG #define D(x) x #else @@ -63,18 +69,14 @@ template inline const T& Clamp( const T& lower, const T& value, con return value; } -#define UNIX_STRING_DIR_SEP wxT( "/" ) -#define WIN_STRING_DIR_SEP wxT( "\\" ) - #define USE_RESIZE_BORDER #if defined(__UNIX__) || defined(USE_RESIZE_BORDER) -#define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // linux users like resizeable - // borders +#define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // Linux users like resizeable borders #else #define MAYBE_RESIZE_BORDER 0 // no resizeable border #endif -// wxNullPtr is not defined prior to wxWidget 2.9.0. +// wxNullPtr is not defined prior to wxWidgets 2.9.0. #if !wxCHECK_VERSION( 2, 9, 0 ) #define wxNullPtr ((void *)NULL) #endif diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index a25991594b..da2d7477fb 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -320,7 +320,7 @@ static void gen_arc( std::vector & aBuffer, if( seg_count == 0 ) seg_count = 1; - double increment_angle = (double) a_ArcAngle * 3.14159 / 1800 / seg_count; + double increment_angle = (double) a_ArcAngle * M_PI / 1800 / seg_count; // Creates nb_seg point to approximate arc by segments: for( int ii = 1; ii <= seg_count; ii++ ) diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index 2933d1cf56..fedbe05e28 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -137,7 +137,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) * For a circle the min radius is radius * cos( 2PI / s_CircleToSegmentsCount / 2) * s_Correction is 1 /cos( PI/s_CircleToSegmentsCount ) */ - s_Correction = 1.0 / cos( 3.14159265 / s_CircleToSegmentsCount ); + s_Correction = 1.0 / cos( M_PI / s_CircleToSegmentsCount ); // This KI_POLYGON_SET is the area(s) to fill, with m_ZoneMinThickness/2 KI_POLYGON_SET polyset_zone_solid_areas;