diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index dcd902d029..23eba48f8a 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index d1c188aa79..99b2e8d50d 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/3d-viewer/common_ogl/cogl_att_list.cpp b/3d-viewer/common_ogl/cogl_att_list.cpp index 52ee9994d0..db48a41621 100644 --- a/3d-viewer/common_ogl/cogl_att_list.cpp +++ b/3d-viewer/common_ogl/cogl_att_list.cpp @@ -28,9 +28,9 @@ */ #include "cogl_att_list.h" -#include #include #include +#include /** * Attributes list to be passed to a wxGLCanvas creation. diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 6cef34f999..0cc6977c0f 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index f644d7a139..c7f9d69008 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/common/gestfich.cpp b/common/gestfich.cpp index ddcc6f9155..d349d7f3c4 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include void AddDelimiterString( wxString& string ) diff --git a/common/kiway.cpp b/common/kiway.cpp index c4696a8355..2a9b7cf19f 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/common/lset.cpp b/common/lset.cpp index 70f5e66bfb..52b964ce1c 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -28,6 +28,7 @@ #include // for string, endl, basic_ost... #include // for size_t +#include #include // for Clamp #include // for LSET, PCB_LAYER_ID, LSEQ #include // for arrayDim diff --git a/common/marker_base.cpp b/common/marker_base.cpp index cbc56fa82a..3f41c8f3bc 100644 --- a/common/marker_base.cpp +++ b/common/marker_base.cpp @@ -32,6 +32,7 @@ #include "base_screen.h" #include "marker_base.h" +#include #include #include #include "dialog_display_info_HTML_base.h" diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 5fab1e0304..c698e17406 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/common/project.cpp b/common/project.cpp index 976d8e3a28..bb19a9f3ec 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/common/project/project_archiver.cpp b/common/project/project_archiver.cpp index c2c736ef56..1d7440e5fe 100644 --- a/common/project/project_archiver.cpp +++ b/common/project/project_archiver.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 6e1a5e849b..90a2c31499 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include diff --git a/eeschema/autoplace_fields.cpp b/eeschema/autoplace_fields.cpp index a6c59699a0..5f2191f491 100644 --- a/eeschema/autoplace_fields.cpp +++ b/eeschema/autoplace_fields.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #define FIELD_PADDING Mils2iu( 10 ) // arbitrarily chosen for aesthetics #define FIELD_PADDING_ALIGNED Mils2iu( 18 ) // aligns 50 mil text to a 100 mil grid diff --git a/eeschema/pin_type.cpp b/eeschema/pin_type.cpp index 8781884a10..8319e15241 100644 --- a/eeschema/pin_type.cpp +++ b/eeschema/pin_type.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include // These are true singletons so it's OK for them to be globals. diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index e3847401ce..68da3be63f 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 01091d2d62..e41535ed29 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 2a0041e388..ab96596b71 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 360bdcd312..00b7b64aa9 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp index 99a2ce0285..5c9661580d 100644 --- a/eeschema/sch_junction.cpp +++ b/eeschema/sch_junction.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 105921fb04..c7c063a11c 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -22,6 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/eeschema/sch_no_connect.cpp b/eeschema/sch_no_connect.cpp index 6631f47b04..c64b399ac5 100644 --- a/eeschema/sch_no_connect.cpp +++ b/eeschema/sch_no_connect.cpp @@ -34,7 +34,7 @@ #include #include #include // For some default values -#include +#include #include diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index e35d42b414..901b29f812 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -25,6 +25,7 @@ #include +#include #include #include #include diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 497c0d1a86..72ad6104e8 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -22,6 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 8b1e88554c..635e857d98 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/gerbview/dialogs/panel_gerbview_settings.cpp b/gerbview/dialogs/panel_gerbview_settings.cpp index 8449f576d2..32dbd25c76 100644 --- a/gerbview/dialogs/panel_gerbview_settings.cpp +++ b/gerbview/dialogs/panel_gerbview_settings.cpp @@ -18,10 +18,9 @@ * with this program. If not, see . */ - #include #include -#include +#include #include "panel_gerbview_settings.h" diff --git a/gerbview/gerber_file_image.cpp b/gerbview/gerber_file_image.cpp index ad54518885..6168ef9157 100644 --- a/gerbview/gerber_file_image.cpp +++ b/gerbview/gerber_file_image.cpp @@ -35,6 +35,7 @@ #include #include #include +#include /** diff --git a/gerbview/widgets/gerbview_layer_widget.cpp b/gerbview/widgets/gerbview_layer_widget.cpp index 14de535547..038274e2dc 100644 --- a/gerbview/widgets/gerbview_layer_widget.cpp +++ b/gerbview/widgets/gerbview_layer_widget.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/include/core/arraydim.h b/include/core/arraydim.h new file mode 100644 index 0000000000..5d7f4c7e70 --- /dev/null +++ b/include/core/arraydim.h @@ -0,0 +1,34 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 KiCad Developers, see CHANGELOG.TXT for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-3.0.html + * or you may search the http://www.gnu.org website for the version 3 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef ARRAYDIM_H +#define ARRAYDIM_H + +/// # of elements in an array. This implements type-safe compile time checking +template +constexpr std::size_t arrayDim( T const ( & )[N] ) noexcept +{ + return N; +} + +#endif /* ARRAYDIM_H */ diff --git a/include/core/mirror.h b/include/core/mirror.h new file mode 100644 index 0000000000..b463bf15f6 --- /dev/null +++ b/include/core/mirror.h @@ -0,0 +1,47 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 KiCad Developers, see CHANGELOG.TXT for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-3.0.html + * or you may search the http://www.gnu.org website for the version 3 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef MIRROR_H +#define MIRROR_H + +/** + * Function MIRRORVAL + * Mirror @a aPoint in @a aMirrorRef. + */ +template +T MIRRORVAL( T aPoint, T aMirrorRef ) +{ + return -( aPoint - aMirrorRef ) + aMirrorRef; +} + +/** + * Function MIRROR + * Mirror @a aPoint in @a aMirrorRef. + */ +template +void MIRROR( T& aPoint, const T& aMirrorRef ) +{ + aPoint = MIRRORVAL( aPoint, aMirrorRef ); +} + +#endif /* MIRROR_H */ diff --git a/include/macros.h b/include/macros.h index 86b8425a78..b2823d1deb 100644 --- a/include/macros.h +++ b/include/macros.h @@ -116,26 +116,4 @@ static inline wxString FROM_UTF8( const char* cstring ) return line; } -/// # of elements in an array. This implements type-safe compile time checking -template -constexpr std::size_t arrayDim(T const (&)[N]) noexcept -{ - return N; -} - -/** - * Function MIRROR - * Mirror @a aPoint in @a aMirrorRef. - */ -template -T MIRRORVAL( T aPoint, T aMirrorRef ) -{ - return -( aPoint - aMirrorRef ) + aMirrorRef; -} -template -void MIRROR( T& aPoint, const T& aMirrorRef ) -{ - aPoint = MIRRORVAL( aPoint, aMirrorRef ); -} - #endif // MACROS_H diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 2c1a0aa2db..b0d36033e3 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index f60632de98..08bfd5ae4c 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/board_stackup_manager/dielectric_material.cpp b/pcbnew/board_stackup_manager/dielectric_material.cpp index b3392ac0b9..3d11a80269 100644 --- a/pcbnew/board_stackup_manager/dielectric_material.cpp +++ b/pcbnew/board_stackup_manager/dielectric_material.cpp @@ -27,9 +27,9 @@ * @file dielectric_material.cpp */ -#include #include "stackup_predefined_prms.h" #include "dielectric_material.h" +#include // A list of available substrate material diff --git a/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp b/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp index dc9f4b7bfd..fe34d862c3 100644 --- a/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp +++ b/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp @@ -29,6 +29,7 @@ #include "class_board_stackup.h" #include +#include #include #include #include // _HKI definition diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index ea47276b9f..072c746601 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index cd6207b99a..0effb9ec9b 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 208f32b96b..fbb5d9be81 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include // for enum RECT_CHAMFER_POSITIONS definition #include #include diff --git a/pcbnew/dialogs/dialog_print_pcbnew.cpp b/pcbnew/dialogs/dialog_print_pcbnew.cpp index 8f6b814d11..0ec0bea2e1 100644 --- a/pcbnew/dialogs/dialog_print_pcbnew.cpp +++ b/pcbnew/dialogs/dialog_print_pcbnew.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_setup_layers.cpp b/pcbnew/dialogs/panel_setup_layers.cpp index 97f5631e2b..96fdd59a5e 100644 --- a/pcbnew/dialogs/panel_setup_layers.cpp +++ b/pcbnew/dialogs/panel_setup_layers.cpp @@ -25,6 +25,7 @@ #include +#include #include #include #include diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 320844da51..e1e1b095c8 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 2255c0ffb5..02d97eba64 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -39,6 +39,7 @@ #include "track.h" #include "zone.h" #include "convert_to_biu.h" +#include #include #include "plugins/3dapi/ifsg_all.h" #include "streamwrapper.h" diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index abb48d446f..6c76061eb4 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -24,6 +24,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 3a26f8b607..dd46ed1238 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -24,6 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/pcbnew/fp_shape.cpp b/pcbnew/fp_shape.cpp index a5f3e574c0..0d14c3784d 100644 --- a/pcbnew/fp_shape.cpp +++ b/pcbnew/fp_shape.cpp @@ -25,6 +25,7 @@ */ #include +#include #include // for KiROUND #include #include diff --git a/pcbnew/fp_text.cpp b/pcbnew/fp_text.cpp index 65d819a547..7719317add 100644 --- a/pcbnew/fp_text.cpp +++ b/pcbnew/fp_text.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 1e7d869c83..f49dba5978 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -25,6 +25,7 @@ #include #include +#include #include // for KiROUND #include #include diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index a7c5f73a5d..7a4b5cdecb 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -1668,7 +1669,7 @@ void PCB_PAINTER::draw( const PCB_MARKER* aMarker, int aLayer ) m_gal->SetFillColor( color ); m_gal->SetIsFill( true ); } - + m_gal->DrawPolygon( polygon ); m_gal->Restore(); } diff --git a/pcbnew/pcb_text.cpp b/pcbnew/pcb_text.cpp index 8f8c47f439..83ded2ebd5 100644 --- a/pcbnew/pcb_text.cpp +++ b/pcbnew/pcb_text.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index df75c0fbad..d841e207e1 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -36,6 +36,7 @@ #include // for KiROUND #include +#include #include #include #include diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index 4a3ba92969..46a4d506d0 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -57,6 +57,7 @@ Load() TODO's #include #include +#include #include #include #include diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 0bfd18c08f..5ddc2c9cb4 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 1d2ac62093..7605d2ad19 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include