From 3f8c9d49f88c3ac310bb0bae88808ca395d93817 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 30 Sep 2020 20:47:20 +0200 Subject: [PATCH] Revert "Code cleanup: remove useless wx/wx.h include inside a few files." due to compil issue on Linux This reverts commit cffccc3970d49ee9d6596f4e70ac78616e58f5a1. --- .../3d_render_raytracing/shapes3D/cbbox.cpp | 1 - .../3d_render_raytracing/shapes3D/cbbox.h | 1 + common/common.cpp | 3 ++ .../plugins/cadstar/cadstar_archive_parser.h | 46 +++++++++---------- common/richio.cpp | 2 - common/search_stack.cpp | 1 - common/searchhelpfilefullpath.cpp | 1 - common/widgets/mathplot.cpp | 2 +- eeschema/dialogs/dialog_plot_schematic.h | 1 + eeschema/sch_plugin.cpp | 1 - include/common.h | 5 +- include/eda_base_frame.h | 3 +- include/fctsys.h | 8 ++++ include/macros.h | 3 +- include/property.h | 2 +- include/richio.h | 3 +- include/status_popup.h | 5 +- include/tool/tools_holder.h | 2 + .../panel_board_stackup.h | 1 + .../stackup_predefined_prms.h | 2 - pcbnew/dialogs/dialog_board_reannotate.h | 3 +- pcbnew/dialogs/dialog_drc.h | 1 + .../drc/drc_test_provider_matched_length.cpp | 7 ++- pcbnew/netlist_reader/netlist_reader.h | 1 + pcbnew/pcbnew.h | 1 + pcbnew/plugin.cpp | 7 ++- pcbnew/specctra_import_export/specctra.h | 7 +-- pcbnew/zones_functions_for_undo_redo.cpp | 6 +-- qa/pcbnew/test_libeval_compiler.cpp | 8 ++-- 29 files changed, 68 insertions(+), 66 deletions(-) diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp index 72b15229ca..a00b1918a0 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp @@ -30,7 +30,6 @@ #include "cbbox.h" #include -#include #include // For the wxASSERT diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.h b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.h index 8cce10f1b6..1f5fedab80 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.h +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.h @@ -31,6 +31,7 @@ #define _CBBOX_H_ #include "../ray.h" +#include // For the DBG( /** * CBBOX diff --git a/common/common.cpp b/common/common.cpp index a806b042dd..8a5023a4b2 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include @@ -38,6 +39,8 @@ #include #include +using KIGFX::COLOR4D; + // Create only once, as seeding is *very* expensive static boost::uuids::random_generator randomGenerator; diff --git a/common/plugins/cadstar/cadstar_archive_parser.h b/common/plugins/cadstar/cadstar_archive_parser.h index 5ccb1c2e6e..76db8f563e 100644 --- a/common/plugins/cadstar/cadstar_archive_parser.h +++ b/common/plugins/cadstar/cadstar_archive_parser.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -443,7 +443,7 @@ public: * boundary and defines how the text is displayed. * * For example, with an alignment of bottom-right the origin will be positioned at the bottom - * right of the text boundary. This makes it easier to right-align several text items + * right of the text boundary. This makes it easier to right-align several text items * regardless of the length of text displayed. * * Text Alignment applies to all CADSTAR text. [...] @@ -451,7 +451,7 @@ public: * Note: Unaligned text operates in the way CADSTAR text always has. In most cases this behaves * as Bottom Left alignment, but there are a few exceptions, e.g. pin names. Also unaligned * multiline text has an origin Bottom Left of the first line." - * + * * See also JUSTIFICATION */ enum class ALIGNMENT @@ -472,8 +472,8 @@ public: static ALIGNMENT ParseAlignment( XNODE* aNode ); /** - * @brief From CADSTAR Help: "Multi Line Text can also be justified as Left, Centre or Right. - * This does not affect the text alignment. Note: Justification of single line text has no + * @brief From CADSTAR Help: "Multi Line Text can also be justified as Left, Centre or Right. + * This does not affect the text alignment. Note: Justification of single line text has no * effect." * * This only affects multiline text @@ -684,7 +684,7 @@ public: * a component outline/area (or an area of component copper, or * a string of component text) dependent on the current mirror * status of the component. - * + * * For example, you may require a string of component text to * be displayed only when the component is mirrored." */ @@ -1113,27 +1113,27 @@ public: /** * @brief Reads a CADSTAR Archive file (S-parameter format) - * @param aFileName + * @param aFileName * @param aFileTypeIdentifier Identifier of the first node in the file to check against. E.g. "CADSTARPCB" - * @return XNODE pointing to the top of the tree for further parsing. Each node has the first - * element as the node's name and subsequent elements as node attributes ("attr0", + * @return XNODE pointing to the top of the tree for further parsing. Each node has the first + * element as the node's name and subsequent elements as node attributes ("attr0", * "attr1", "attr2", etc.). Caller is responsible for deleting to avoid memory leaks. * @throws IO_ERROR */ static XNODE* LoadArchiveFile( const wxString& aFileName, const wxString& aFileTypeIdentifier ); /** - * @brief - * @param aAttribute - * @return + * @brief + * @param aAttribute + * @return */ static bool IsValidAttribute( wxXmlAttribute* aAttribute ); /** - * @brief - * @param aNode - * @param aID + * @brief + * @param aNode + * @param aID * @param aIsRequired Prevents exception throwing if false. * @return returns the value (wxString) of attribute "attrX" in aNode where 'X' is aID * @throws IO_ERROR if attribute does not exist @@ -1142,9 +1142,9 @@ public: XNODE* aNode, unsigned int aID, bool aIsRequired = true ); /** - * @brief - * @param aNode - * @param aID + * @brief + * @param aNode + * @param aID * @param aIsRequired Prevents exception throwing if false. * @return returns the value (long) of attribute "attrX" in aNode where 'X' is aID * @throws IO_ERROR if attribute does not exist @@ -1152,15 +1152,15 @@ public: static long GetXmlAttributeIDLong( XNODE* aNode, unsigned int aID, bool aIsRequired = true ); /** - * @brief - * @param aNode + * @brief + * @param aNode * @throw IO_ERROR if a child node was found */ static void CheckNoChildNodes( XNODE* aNode ); /** - * @brief - * @param aNode + * @brief + * @param aNode * @throw IO_ERROR if a node adjacent to aNode was found */ static void CheckNoNextNodes( XNODE* aNode ); @@ -1168,7 +1168,7 @@ public: /** * @brief * @param aNode with a child node containing an EVALUE - * @param aValueToParse + * @param aValueToParse * @throw IO_ERROR if unable to parse or node is not an EVALUE */ static void ParseChildEValue( XNODE* aNode, EVALUE& aValueToParse ); diff --git a/common/richio.cpp b/common/richio.cpp index b51414d3e8..9cbaaf1b36 100644 --- a/common/richio.cpp +++ b/common/richio.cpp @@ -28,8 +28,6 @@ #include -#include -#include // Fall back to getc() when getc_unlocked() is not available on the target platform. #if !defined( HAVE_FGETC_NOLOCK ) diff --git a/common/search_stack.cpp b/common/search_stack.cpp index 45e66fb1fe..3cfa3c4eda 100644 --- a/common/search_stack.cpp +++ b/common/search_stack.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #if defined(__MINGW32__) #define PATH_SEPS wxT( ";\r\n" ) diff --git a/common/searchhelpfilefullpath.cpp b/common/searchhelpfilefullpath.cpp index e59b382962..64636dbeff 100644 --- a/common/searchhelpfilefullpath.cpp +++ b/common/searchhelpfilefullpath.cpp @@ -27,7 +27,6 @@ #include #include // to define DEFAULT_INSTALL_PATH #include -#include #include diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 0ecfdf1564..82003223a6 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -631,7 +631,7 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w ) if( !m_continuous ) { bool first = true; - wxCoord ix = 0; + wxCoord ix; std::set ys; while( GetNextXY( x, y ) ) diff --git a/eeschema/dialogs/dialog_plot_schematic.h b/eeschema/dialogs/dialog_plot_schematic.h index 857f569ecf..dea1fb1f05 100644 --- a/eeschema/dialogs/dialog_plot_schematic.h +++ b/eeschema/dialogs/dialog_plot_schematic.h @@ -27,6 +27,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/eeschema/sch_plugin.cpp b/eeschema/sch_plugin.cpp index 83a90f26fa..29d763be2e 100644 --- a/eeschema/sch_plugin.cpp +++ b/eeschema/sch_plugin.cpp @@ -23,7 +23,6 @@ #include #include -#include #define FMT_UNIMPLEMENTED _( "Plugin \"%s\" does not implement the \"%s\" function." ) diff --git a/include/common.h b/include/common.h index d7aec28e06..7e951c7119 100644 --- a/include/common.h +++ b/include/common.h @@ -35,14 +35,13 @@ #include #include +#include #include #include #include -#include -#include -#include #include +#include #include #include diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index 47bcbab6bf..e4ddb219a3 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -41,7 +41,8 @@ #include #include #include - +#include +#include #include #include #include diff --git a/include/fctsys.h b/include/fctsys.h index e83da61664..5e209f2a59 100644 --- a/include/fctsys.h +++ b/include/fctsys.h @@ -26,6 +26,14 @@ #define FCTSYS_H_ #include + +#ifdef DEBUG +#define DBG(x) x +#else +#define DBG(x) // nothing +#endif + + #include #endif // FCTSYS_H__ diff --git a/include/macros.h b/include/macros.h index 4f8e20bb7e..ddb5611b2b 100644 --- a/include/macros.h +++ b/include/macros.h @@ -31,14 +31,13 @@ #ifndef MACROS_H #define MACROS_H +#include #include #include #include #include #include // std::shared_ptr -#include - #if defined( __has_attribute ) #define KI_HAS_ATTRIBUTE( x ) __has_attribute( x ) #else diff --git a/include/property.h b/include/property.h index df24e5e01f..c51f1bb1da 100644 --- a/include/property.h +++ b/include/property.h @@ -22,9 +22,9 @@ #ifndef PROPERTY_H #define PROPERTY_H +#include #include #include -#include #include #include diff --git a/include/richio.h b/include/richio.h index 96196e4c7c..b48d8d0f4d 100644 --- a/include/richio.h +++ b/include/richio.h @@ -35,8 +35,7 @@ // I really did not want to be dependent on wxWidgets in richio // but the errorText needs to be wide char so wxString rules. #include -#include -#include +#include #include diff --git a/include/status_popup.h b/include/status_popup.h index 835683a14b..6a4e9cb2fa 100644 --- a/include/status_popup.h +++ b/include/status_popup.h @@ -26,12 +26,9 @@ #define __STATUS_POPUP_H_ +#include #include #include -#include -#include -#include -#include class EDA_DRAW_FRAME; diff --git a/include/tool/tools_holder.h b/include/tool/tools_holder.h index 9b739c82ea..3431f54a83 100644 --- a/include/tool/tools_holder.h +++ b/include/tool/tools_holder.h @@ -25,6 +25,8 @@ #define TOOL_HOLDER_H #include +#include +#include #include #include #include diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.h b/pcbnew/board_stackup_manager/panel_board_stackup.h index 1a5b5fb3f2..0f6684b507 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup.h @@ -26,6 +26,7 @@ #define PANEL_SETUP_BOARD_STACKUP_H +#include #include #include #include diff --git a/pcbnew/board_stackup_manager/stackup_predefined_prms.h b/pcbnew/board_stackup_manager/stackup_predefined_prms.h index b4dc702d79..3a98690860 100644 --- a/pcbnew/board_stackup_manager/stackup_predefined_prms.h +++ b/pcbnew/board_stackup_manager/stackup_predefined_prms.h @@ -31,8 +31,6 @@ #include -#include -#include #include #include // For _HKI definition diff --git a/pcbnew/dialogs/dialog_board_reannotate.h b/pcbnew/dialogs/dialog_board_reannotate.h index a919e17650..7b4dbcec21 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.h +++ b/pcbnew/dialogs/dialog_board_reannotate.h @@ -36,9 +36,10 @@ #include #include #include -//#include +#include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index 3ec838155d..f6df90373c 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -28,6 +28,7 @@ #define _DIALOG_DRC_H_ #include +#include #include #include #include diff --git a/pcbnew/drc/drc_test_provider_matched_length.cpp b/pcbnew/drc/drc_test_provider_matched_length.cpp index 76619ea044..fb5fcb8245 100644 --- a/pcbnew/drc/drc_test_provider_matched_length.cpp +++ b/pcbnew/drc/drc_test_provider_matched_length.cpp @@ -52,13 +52,13 @@ public: { } - virtual ~DRC_TEST_PROVIDER_MATCHED_LENGTH() + virtual ~DRC_TEST_PROVIDER_MATCHED_LENGTH() { } virtual bool Run() override; - virtual const wxString GetName() const override + virtual const wxString GetName() const override { return "length"; }; @@ -109,8 +109,7 @@ void test::DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengthViolations( { bool minViolation = false; bool maxViolation = false; - int minLen = 0; - int maxLen = 0; + int minLen, maxLen; if( aConstraint.GetValue().HasMin() && ent.total < aConstraint.GetValue().Min() ) { diff --git a/pcbnew/netlist_reader/netlist_reader.h b/pcbnew/netlist_reader/netlist_reader.h index 8669875895..b2d5a051a5 100644 --- a/pcbnew/netlist_reader/netlist_reader.h +++ b/pcbnew/netlist_reader/netlist_reader.h @@ -32,6 +32,7 @@ #include +#include #include #include diff --git a/pcbnew/pcbnew.h b/pcbnew/pcbnew.h index c0eefa7adf..d336257460 100644 --- a/pcbnew/pcbnew.h +++ b/pcbnew/pcbnew.h @@ -25,6 +25,7 @@ #ifndef PCBNEW_H #define PCBNEW_H +#include // wxWidgets include. #include // to define Mils2iu() conversion function // These are only here for algorithmic safety, not to tell the user what to do diff --git a/pcbnew/plugin.cpp b/pcbnew/plugin.cpp index 67be973e6f..6b85411c09 100644 --- a/pcbnew/plugin.cpp +++ b/pcbnew/plugin.cpp @@ -24,10 +24,9 @@ #include #include -#include -#define FMT_UNIMPLEMENTED "Plugin \"%s\" does not implement the \"%s\" function." +#define FMT_UNIMPLEMENTED _( "Plugin \"%s\" does not implement the \"%s\" function." ) /** * Function not_implemented @@ -39,8 +38,8 @@ static void not_implemented( PLUGIN* aPlugin, const char* aCaller ) { THROW_IO_ERROR( wxString::Format( FMT_UNIMPLEMENTED, - aPlugin->PluginName(), - wxString::FromUTF8( aCaller ) ) ); + aPlugin->PluginName().GetData(), + wxString::FromUTF8( aCaller ).GetData() ) ); } diff --git a/pcbnew/specctra_import_export/specctra.h b/pcbnew/specctra_import_export/specctra.h index d3bbefc447..28f11ecc42 100644 --- a/pcbnew/specctra_import_export/specctra.h +++ b/pcbnew/specctra_import_export/specctra.h @@ -32,6 +32,7 @@ // see http://www.boost.org/libs/ptr_container/doc/ptr_set.html #include +#include #include #include @@ -3934,7 +3935,7 @@ public: /** * Function FromBOARD - * adds the entire BOARD to the PCB but does not write it out. Note that the BOARD given + * adds the entire BOARD to the PCB but does not write it out. Note that the BOARD given * to this function must have all the MODULEs on the component side of the BOARD. * * See PCB_EDIT_FRAME::ExportToSpecctra() for an example before calling this function. @@ -3945,8 +3946,8 @@ public: /** * Function FromSESSION - * adds the entire SESSION info to a BOARD but does not write it out. The BOARD given to - * this function will have all its tracks and via's replaced, and all its components are + * adds the entire SESSION info to a BOARD but does not write it out. The BOARD given to + * this function will have all its tracks and via's replaced, and all its components are * subject to being moved. * * @param aBoard The BOARD to merge the SESSION information into. diff --git a/pcbnew/zones_functions_for_undo_redo.cpp b/pcbnew/zones_functions_for_undo_redo.cpp index da1289d226..7adcdda77f 100644 --- a/pcbnew/zones_functions_for_undo_redo.cpp +++ b/pcbnew/zones_functions_for_undo_redo.cpp @@ -268,11 +268,9 @@ void UpdateCopyOfZonesList( PICKED_ITEMS_LIST& aPickList, if( notfound ) // happens when the new zone overlaps an existing zone // and these zones are combined { - #if defined(DEBUG) - printf( + DBG( printf( "UpdateCopyOfZonesList(): item not found in aAuxiliaryList," - "combined with another zone\n" ); - #endif + "combined with another zone\n" ) ); } break; } diff --git a/qa/pcbnew/test_libeval_compiler.cpp b/qa/pcbnew/test_libeval_compiler.cpp index 9f62d912ee..86fe1ce094 100644 --- a/qa/pcbnew/test_libeval_compiler.cpp +++ b/qa/pcbnew/test_libeval_compiler.cpp @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #include #include @@ -42,11 +40,11 @@ struct EXPR_TO_TEST using VAL = LIBEVAL::VALUE; -const static std::vector simpleExpressions = { +const static std::vector simpleExpressions = { { "10mm + 20 mm", false, VAL( 30e6 ) }, - { "3*(7+8)", false, VAL( 3 * ( 7 + 8 ) ) }, + { "3*(7+8)", false, VAL( 3 * ( 7 + 8 ) ) }, { "3*7+8", false, VAL( 3 * 7 + 8 ) }, - { "(3*7)+8", false, VAL( 3 * 7 + 8 ) }, + { "(3*7)+8", false, VAL( 3 * 7 + 8 ) }, { "10mm + 20)", true, VAL( 0 ) }, { "1", false, VAL(1) },