kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #24410
[PATCH 0/4] Use of "virtual" and "override" keywords
Hi,
C++ has a misfeature where methods in derived classes can be virtual
without that being immediately obvious, which makes class definitions a bit
harder to read than strictly necessary because it isn't immediately obvious
what is happening.
In C++11, this is still the case, but at least we can use "override"
specifiers in method declarations to mark overriding functions, and get a
check from the compiler that this is indeed an override -- so if you are
intending to write an override but forget a const-qualifier somewhere, you
get a proper compilation error.
This patchset
- enables a warning on compilers that support this
- removes the compiler flags override in the 3d_cache subdirectory
(this causes all kinds of other interesting issues)
- adds the "virtual" keyword on all implicitly virtual methods
- adds the "override" specifier on all overriding methods
Simon
Simon Richter (4):
Warn about missing override specifiers, if supported (gcc 5.1, clang
3.5)
Don't clear compiler flags in 3d_cache directory
Add "virtual" keyword on implicitly virtual methods
Add C++11 "override" specifier to overrides
3d-viewer/3d_cache/CMakeLists.txt | 2 -
3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.h | 10 +-
3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h | 2 +-
3d-viewer/3d_cache/dialogs/panel_prev_model.h | 2 +-
3d-viewer/3d_cache/sg/scenegraph.h | 20 +-
3d-viewer/3d_cache/sg/sg_appearance.h | 20 +-
3d-viewer/3d_cache/sg/sg_colors.h | 20 +-
3d-viewer/3d_cache/sg/sg_coords.h | 20 +-
3d-viewer/3d_cache/sg/sg_faceset.h | 20 +-
3d-viewer/3d_cache/sg/sg_index.h | 20 +-
3d-viewer/3d_cache/sg/sg_normals.h | 20 +-
3d-viewer/3d_cache/sg/sg_shape.h | 20 +-
3d-viewer/3d_draw.cpp | 2 +-
3d-viewer/3d_material.h | 4 +-
.../3d_render_ogl_legacy/c3d_render_ogl_legacy.h | 4 +-
.../3d_render_raytracing/accelerators/ccontainer.h | 4 +-
.../accelerators/ccontainer2d.h | 4 +-
.../3d_rendering/3d_render_raytracing/cmaterial.h | 2 +-
.../shapes2D/cfilledcircle2d.h | 10 +-
.../3d_render_raytracing/shapes2D/cpolygon2d.h | 20 +-
.../3d_render_raytracing/shapes2D/cpolygon4pts2d.h | 10 +-
.../3d_render_raytracing/shapes2D/cring2d.h | 10 +-
.../shapes2D/croundsegment2d.h | 10 +-
.../3d_render_raytracing/shapes2D/ctriangle2d.h | 10 +-
3d-viewer/3d_rendering/ctrack_ball.h | 10 +-
3d-viewer/3d_struct.h | 6 +-
3d-viewer/3d_viewer.h | 4 +-
3d-viewer/dialogs/dialog_3D_view_option.cpp | 8 +-
3d-viewer/modelparsers.h | 4 +-
CMakeLists.txt | 12 ++
bitmap2component/bitmap2cmp_gui.cpp | 22 +-
common/confirm.cpp | 6 +-
common/dialogs/dialog_image_editor.h | 18 +-
common/dialogs/dialog_page_settings.h | 30 +--
common/dialogs/wx_html_report_panel.h | 14 +-
common/single_top.cpp | 12 +-
cvpcb/class_DisplayFootprintsFrame.h | 30 +--
cvpcb/cvpcb.cpp | 8 +-
cvpcb/cvpcb_mainframe.h | 10 +-
cvpcb/dialogs/dialog_config_equfiles.h | 14 +-
cvpcb/dialogs/dialog_display_options.h | 8 +-
cvpcb/dialogs/fp_conflict_assignment_selector.h | 10 +-
cvpcb/listview_classes.h | 6 +-
eeschema/class_libentry.h | 8 +-
eeschema/class_sch_screen.h | 6 +-
eeschema/dialogs/dialog_annotate.cpp | 6 +-
eeschema/dialogs/dialog_bom.cpp | 20 +-
eeschema/dialogs/dialog_choose_component.h | 18 +-
eeschema/dialogs/dialog_edit_component_in_lib.h | 22 +-
.../dialogs/dialog_edit_component_in_schematic.cpp | 24 +--
eeschema/dialogs/dialog_edit_label.cpp | 10 +-
.../dialogs/dialog_edit_libentry_fields_in_lib.cpp | 20 +-
eeschema/dialogs/dialog_edit_one_field.h | 12 +-
eeschema/dialogs/dialog_eeschema_config.cpp | 20 +-
eeschema/dialogs/dialog_eeschema_options.h | 10 +-
eeschema/dialogs/dialog_erc.h | 14 +-
eeschema/dialogs/dialog_lib_edit_pin.h | 12 +-
eeschema/dialogs/dialog_lib_edit_pin_table.cpp | 38 ++--
eeschema/dialogs/dialog_lib_edit_pin_table.h | 2 +-
eeschema/dialogs/dialog_lib_edit_text.h | 4 +-
eeschema/dialogs/dialog_lib_new_component.h | 4 +-
eeschema/dialogs/dialog_netlist.cpp | 16 +-
eeschema/dialogs/dialog_plot_schematic.h | 10 +-
eeschema/dialogs/dialog_print_using_printer.cpp | 20 +-
eeschema/dialogs/dialog_rescue_each.cpp | 16 +-
eeschema/dialogs/dialog_schematic_find.h | 20 +-
eeschema/eeschema.cpp | 8 +-
eeschema/lib_arc.h | 60 +++---
eeschema/lib_bezier.h | 48 ++---
eeschema/lib_circle.h | 60 +++---
eeschema/lib_collectors.h | 2 +-
eeschema/lib_draw_item.h | 8 +-
eeschema/lib_field.h | 66 +++---
eeschema/lib_pin.h | 58 ++---
eeschema/lib_polyline.h | 60 +++---
eeschema/lib_rectangle.h | 60 +++---
eeschema/lib_text.h | 64 +++---
eeschema/libeditframe.h | 36 ++--
.../netlist_exporters/netlist_exporter_cadstar.h | 2 +-
.../netlist_exporters/netlist_exporter_generic.h | 2 +-
.../netlist_exporters/netlist_exporter_kicad.h | 2 +-
.../netlist_exporters/netlist_exporter_orcadpcb2.h | 2 +-
.../netlist_exporters/netlist_exporter_pspice.h | 2 +-
eeschema/project_rescue.cpp | 22 +-
eeschema/sch_base_frame.h | 28 +--
eeschema/sch_bitmap.h | 42 ++--
eeschema/sch_bus_entry.h | 64 +++---
eeschema/sch_collectors.h | 6 +-
eeschema/sch_component.h | 72 +++----
eeschema/sch_field.h | 46 ++--
eeschema/sch_item_struct.h | 4 +-
eeschema/sch_junction.h | 54 ++---
eeschema/sch_line.h | 58 ++---
eeschema/sch_marker.h | 40 ++--
eeschema/sch_no_connect.h | 54 ++---
eeschema/sch_sheet.h | 120 +++++------
eeschema/sch_text.h | 162 +++++++-------
eeschema/sch_validators.h | 4 +-
eeschema/schframe.h | 52 ++---
eeschema/viewlib_frame.h | 28 +--
gerbview/class_excellon.h | 2 +-
gerbview/class_gbr_layer_box_selector.h | 11 +-
gerbview/class_gbr_screen.h | 4 +-
gerbview/class_gerber_draw_item.h | 10 +-
gerbview/class_gerbview_layer_widget.h | 12 +-
gerbview/dialogs/dialog_print_using_printer.cpp | 12 +-
gerbview/dialogs/dialog_show_page_borders.h | 4 +-
.../gerbview_dialog_display_options_frame.cpp | 6 +-
gerbview/gerbview.cpp | 8 +-
gerbview/gerbview_frame.h | 62 +++---
gerbview/select_layers_to_pcb.h | 12 +-
include/base_struct.h | 4 +-
include/basic_gal.h | 12 +-
include/class_base_screen.h | 4 +-
include/class_board_item.h | 4 +-
include/class_draw_panel_gal.h | 4 +-
include/class_drawpanel.h | 4 +-
include/class_pcb_screen.h | 4 +-
include/class_worksheet_dataitem.h | 12 +-
include/config_params.h | 32 +--
include/dialog_env_var_config.h | 10 +-
include/dialog_get_component.h | 6 +-
include/dialog_helpers.h | 12 +-
include/dialog_hotkeys_editor.h | 8 +-
include/dialog_shim.h | 4 +-
include/draw_frame.h | 8 +-
include/eda_pattern_match.h | 12 +-
include/filter_reader.h | 12 +-
include/gal/cairo/cairo_compositor.h | 14 +-
include/gal/cairo/cairo_gal.h | 86 ++++----
include/gal/opengl/cached_container.h | 10 +-
include/gal/opengl/gpu_manager.h | 20 +-
include/gal/opengl/noncached_container.h | 10 +-
include/gal/opengl/opengl_compositor.h | 14 +-
include/gal/opengl/opengl_gal.h | 74 +++----
include/geometry/shape_circle.h | 10 +-
include/geometry/shape_convex.h | 10 +-
include/geometry/shape_line_chain.h | 16 +-
include/geometry/shape_poly_set.h | 14 +-
include/geometry/shape_rect.h | 10 +-
include/geometry/shape_segment.h | 12 +-
include/html_messagebox.h | 2 +-
include/kiface_i.h | 8 +-
include/kiway.h | 2 +-
include/kiway_express.h | 2 +-
include/kiway_player.h | 2 +-
include/origin_viewitem.h | 10 +-
include/plot_common.h | 234 ++++++++++-----------
include/plugins/3dapi/ifsg_appearance.h | 6 +-
include/plugins/3dapi/ifsg_colors.h | 6 +-
include/plugins/3dapi/ifsg_coordindex.h | 6 +-
include/plugins/3dapi/ifsg_coords.h | 6 +-
include/plugins/3dapi/ifsg_faceset.h | 6 +-
include/plugins/3dapi/ifsg_index.h | 6 +-
include/plugins/3dapi/ifsg_normals.h | 6 +-
include/plugins/3dapi/ifsg_shape.h | 6 +-
include/plugins/3dapi/ifsg_transform.h | 6 +-
include/reporter.h | 8 +-
include/richio.h | 12 +-
include/tool/context_menu.h | 2 +-
include/ttl/halfedge/hetriang.h | 2 +-
include/view/view_group.h | 16 +-
include/view/wx_view_controls.h | 14 +-
include/worksheet_shape_builder.h | 34 +--
include/worksheet_viewitem.h | 10 +-
include/wxBasePcbFrame.h | 58 ++---
include/wxPcbStruct.h | 90 ++++----
include/wxstruct.h | 4 +-
kicad/class_treeprojectfiles.h | 3 +-
kicad/dialogs/dialog_template_selector.h | 8 +-
kicad/kicad.cpp | 6 +-
kicad/kicad.h | 14 +-
kicad/pgm_kicad.h | 6 +-
lib_dxf/drw_entities.h | 32 +--
lib_dxf/intern/drw_textcodec.h | 12 +-
lib_dxf/intern/dxfreader.h | 32 +--
lib_dxf/intern/dxfwriter.h | 24 +--
pagelayout_editor/class_pl_editor_screen.h | 4 +-
pagelayout_editor/design_tree_frame.h | 2 +-
pagelayout_editor/dialogs/dialog_new_dataitem.cpp | 4 +-
pagelayout_editor/dialogs/dialogs_for_printing.cpp | 8 +-
pagelayout_editor/pl_editor.cpp | 8 +-
pagelayout_editor/pl_editor_frame.h | 54 ++---
pagelayout_editor/pl_editor_undo_redo.cpp | 4 +-
pagelayout_editor/properties_frame.h | 6 +-
pcb_calculator/UnitSelector.h | 10 +-
pcb_calculator/attenuators/attenuator_classes.h | 8 +-
pcb_calculator/pcb_calculator.cpp | 8 +-
pcb_calculator/pcb_calculator.h | 56 ++---
pcb_calculator/regulators_funct.cpp | 4 +-
pcb_calculator/transline/c_microstrip.h | 4 +-
pcb_calculator/transline/coax.h | 4 +-
pcb_calculator/transline/coplanar.h | 4 +-
pcb_calculator/transline/microstrip.h | 4 +-
pcb_calculator/transline/rectwaveguide.h | 4 +-
pcb_calculator/transline/stripline.h | 4 +-
pcb_calculator/transline/twistedpair.h | 4 +-
pcbnew/block.cpp | 6 +-
pcbnew/class_board.cpp | 4 +-
pcbnew/class_board.h | 22 +-
pcbnew/class_board_connected_item.h | 2 +-
pcbnew/class_dimension.h | 36 ++--
pcbnew/class_drawsegment.h | 36 ++--
pcbnew/class_edge_mod.h | 22 +-
pcbnew/class_marker_pcb.h | 32 +--
pcbnew/class_mire.h | 30 +--
pcbnew/class_module.h | 49 +++--
pcbnew/class_netinfo.h | 14 +-
pcbnew/class_pad.h | 45 ++--
pcbnew/class_pcb_layer_box_selector.h | 8 +-
pcbnew/class_pcb_layer_widget.h | 10 +-
pcbnew/class_pcb_text.h | 32 +--
pcbnew/class_text_mod.h | 39 ++--
pcbnew/class_track.h | 89 ++++----
pcbnew/class_zone.h | 34 +--
pcbnew/collectors.h | 66 +++---
pcbnew/dialogs/dialog_SVG_print.cpp | 8 +-
pcbnew/dialogs/dialog_cleaning_options.h | 4 +-
pcbnew/dialogs/dialog_copper_zones.cpp | 16 +-
pcbnew/dialogs/dialog_create_array.h | 16 +-
pcbnew/dialogs/dialog_design_rules.h | 26 +--
.../dialogs/dialog_design_rules_aux_helper_class.h | 2 +-
pcbnew/dialogs/dialog_display_options.h | 4 +-
pcbnew/dialogs/dialog_drc.h | 32 +--
pcbnew/dialogs/dialog_drclistbox.h | 20 +-
.../dialogs/dialog_edit_module_for_BoardEditor.h | 24 +--
pcbnew/dialogs/dialog_edit_module_for_Modedit.h | 18 +-
pcbnew/dialogs/dialog_edit_module_text.h | 6 +-
pcbnew/dialogs/dialog_export_vrml.cpp | 2 +-
pcbnew/dialogs/dialog_find.h | 8 +-
pcbnew/dialogs/dialog_footprint_wizard_list.h | 2 +-
pcbnew/dialogs/dialog_fp_lib_table.cpp | 44 ++--
pcbnew/dialogs/dialog_fp_plugin_options.cpp | 20 +-
pcbnew/dialogs/dialog_freeroute_exchange.h | 8 +-
pcbnew/dialogs/dialog_gendrill.h | 14 +-
pcbnew/dialogs/dialog_general_options.h | 6 +-
pcbnew/dialogs/dialog_get_footprint_by_name.h | 2 +-
pcbnew/dialogs/dialog_global_deletion.h | 8 +-
.../dialogs/dialog_global_edit_tracks_and_vias.h | 6 +-
.../dialog_global_modules_fields_edition.cpp | 4 +-
pcbnew/dialogs/dialog_graphic_item_properties.cpp | 6 +-
.../dialog_graphic_item_properties_for_Modedit.cpp | 6 +-
pcbnew/dialogs/dialog_graphic_items_options.h | 4 +-
pcbnew/dialogs/dialog_keepout_area_properties.cpp | 4 +-
pcbnew/dialogs/dialog_layers_setup.cpp | 14 +-
pcbnew/dialogs/dialog_mask_clearance.h | 4 +-
pcbnew/dialogs/dialog_modedit_options.cpp | 4 +-
pcbnew/dialogs/dialog_move_exact.h | 8 +-
pcbnew/dialogs/dialog_netlist.h | 18 +-
.../dialogs/dialog_non_copper_zones_properties.cpp | 4 +-
pcbnew/dialogs/dialog_pad_properties.h | 20 +-
pcbnew/dialogs/dialog_pcb_text_properties.cpp | 4 +-
pcbnew/dialogs/dialog_plot.h | 18 +-
pcbnew/dialogs/dialog_pns_diff_pair_dimensions.h | 4 +-
pcbnew/dialogs/dialog_pns_length_tuning_settings.h | 2 +-
pcbnew/dialogs/dialog_pns_settings.h | 2 +-
pcbnew/dialogs/dialog_print_for_modedit.cpp | 10 +-
pcbnew/dialogs/dialog_print_using_printer.cpp | 12 +-
pcbnew/dialogs/dialog_select_net_from_list.cpp | 4 +-
pcbnew/dialogs/dialog_select_pretty_lib.h | 4 +-
pcbnew/dialogs/dialog_set_grid.cpp | 6 +-
pcbnew/dialogs/dialog_track_via_properties.h | 10 +-
pcbnew/dialogs/dialog_track_via_size.h | 6 +-
pcbnew/dialogs/dialog_update_pcb.h | 6 +-
pcbnew/dialogs/wizard_3DShape_Libs_downloader.h | 18 +-
pcbnew/dialogs/wizard_add_fplib.h | 14 +-
pcbnew/dimension.cpp | 4 +-
pcbnew/eagle_plugin.h | 14 +-
pcbnew/edit.cpp | 12 +-
pcbnew/exporters/gen_modules_placefile.cpp | 4 +-
pcbnew/footprint_wizard_frame.h | 32 +--
pcbnew/github/github_plugin.h | 28 +--
pcbnew/github/html_link_parser.h | 8 +-
pcbnew/globaleditpad.cpp | 6 +-
pcbnew/gpcb_plugin.h | 20 +-
pcbnew/import_dxf/dialog_dxf_import.h | 8 +-
pcbnew/import_dxf/dxf2brd_items.h | 110 +++++-----
pcbnew/kicad_plugin.h | 28 +--
pcbnew/legacy_plugin.h | 16 +-
pcbnew/module_editor_frame.h | 72 +++----
pcbnew/modview_frame.h | 38 ++--
pcbnew/netlist_reader.h | 4 +-
pcbnew/pcad2kicadpcb_plugin/pcad_plugin.h | 10 +-
pcbnew/pcad2kicadpcb_plugin/pcb.h | 18 +-
pcbnew/pcad2kicadpcb_plugin/pcb_arc.h | 8 +-
pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h | 2 +-
pcbnew/pcad2kicadpcb_plugin/pcb_line.h | 8 +-
pcbnew/pcad2kicadpcb_plugin/pcb_module.h | 4 +-
pcbnew/pcad2kicadpcb_plugin/pcb_pad.h | 4 +-
pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.h | 2 +-
pcbnew/pcad2kicadpcb_plugin/pcb_plane.h | 2 +-
pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h | 6 +-
pcbnew/pcad2kicadpcb_plugin/pcb_text.h | 4 +-
pcbnew/pcad2kicadpcb_plugin/pcb_via.h | 2 +-
pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.h | 2 +-
pcbnew/pcb_base_edit_frame.h | 4 +-
pcbnew/pcb_draw_panel_gal.h | 6 +-
pcbnew/pcb_painter.h | 12 +-
pcbnew/pcbnew.cpp | 8 +-
pcbnew/printout_controler.h | 6 +-
pcbnew/ratsnest.cpp | 2 +-
pcbnew/ratsnest_data.h | 8 +-
pcbnew/ratsnest_viewitem.h | 10 +-
pcbnew/router/length_tuner_tool.h | 2 +-
pcbnew/router/pns_diff_pair.h | 2 +-
pcbnew/router/pns_diff_pair_placer.h | 30 +--
pcbnew/router/pns_dp_meander_placer.h | 22 +-
pcbnew/router/pns_dragger.h | 2 +-
pcbnew/router/pns_joint.h | 2 +-
pcbnew/router/pns_line.h | 14 +-
pcbnew/router/pns_line_placer.h | 32 +--
pcbnew/router/pns_meander_placer.h | 22 +-
pcbnew/router/pns_meander_skew_placer.h | 8 +-
pcbnew/router/pns_node.h | 4 +-
pcbnew/router/pns_segment.h | 12 +-
pcbnew/router/pns_shove.h | 2 +-
pcbnew/router/pns_solid.h | 10 +-
pcbnew/router/pns_tool_base.h | 2 +-
pcbnew/router/pns_via.h | 10 +-
pcbnew/router/pns_walkaround.h | 2 +-
pcbnew/router/router_preview_item.h | 10 +-
pcbnew/router/router_tool.h | 4 +-
pcbnew/sel_layer.cpp | 16 +-
pcbnew/specctra.h | 122 +++++------
pcbnew/target_edit.cpp | 4 +-
pcbnew/tools/bright_box.h | 10 +-
pcbnew/tools/drawing_tool.h | 4 +-
pcbnew/tools/edit_constraints.h | 14 +-
pcbnew/tools/edit_points.h | 16 +-
pcbnew/tools/edit_tool.cpp | 16 +-
pcbnew/tools/edit_tool.h | 6 +-
pcbnew/tools/module_tools.h | 6 +-
pcbnew/tools/pcb_editor_control.h | 6 +-
pcbnew/tools/pcbnew_control.h | 4 +-
pcbnew/tools/picker_tool.h | 4 +-
pcbnew/tools/placement_tool.h | 6 +-
pcbnew/tools/point_editor.h | 6 +-
pcbnew/tools/selection_area.h | 10 +-
pcbnew/tools/selection_tool.h | 6 +-
pcbnew/xchgmod.cpp | 12 +-
plugins/3d/vrml/v1/vrml1_base.h | 10 +-
plugins/3d/vrml/v1/vrml1_coords.h | 8 +-
plugins/3d/vrml/v1/vrml1_faceset.h | 8 +-
plugins/3d/vrml/v1/vrml1_group.h | 4 +-
plugins/3d/vrml/v1/vrml1_matbinding.h | 8 +-
plugins/3d/vrml/v1/vrml1_material.h | 8 +-
plugins/3d/vrml/v1/vrml1_separator.h | 4 +-
plugins/3d/vrml/v1/vrml1_shapehints.h | 8 +-
plugins/3d/vrml/v1/vrml1_switch.h | 4 +-
plugins/3d/vrml/v1/vrml1_transform.h | 8 +-
plugins/3d/vrml/v2/vrml2_appearance.h | 14 +-
plugins/3d/vrml/v2/vrml2_base.h | 12 +-
plugins/3d/vrml/v2/vrml2_box.h | 10 +-
plugins/3d/vrml/v2/vrml2_color.h | 10 +-
plugins/3d/vrml/v2/vrml2_coords.h | 10 +-
plugins/3d/vrml/v2/vrml2_faceset.h | 14 +-
plugins/3d/vrml/v2/vrml2_inline.h | 10 +-
plugins/3d/vrml/v2/vrml2_lineset.h | 14 +-
plugins/3d/vrml/v2/vrml2_material.h | 10 +-
plugins/3d/vrml/v2/vrml2_norms.h | 10 +-
plugins/3d/vrml/v2/vrml2_pointset.h | 14 +-
plugins/3d/vrml/v2/vrml2_shape.h | 14 +-
plugins/3d/vrml/v2/vrml2_switch.h | 8 +-
plugins/3d/vrml/v2/vrml2_transform.h | 8 +-
plugins/3d/vrml/x3d/x3d_appearance.h | 10 +-
plugins/3d/vrml/x3d/x3d_coords.h | 10 +-
plugins/3d/vrml/x3d/x3d_ifaceset.h | 10 +-
plugins/3d/vrml/x3d/x3d_shape.h | 14 +-
plugins/3d/vrml/x3d/x3d_transform.h | 10 +-
plugins/ldr/3d/pluginldr3D.h | 8 +-
polygon/clipper.hpp | 2 +-
utils/idftools/dxf2idf.h | 100 ++++-----
utils/idftools/idf_common.h | 2 +-
utils/idftools/idf_outlines.h | 30 +--
374 files changed, 3116 insertions(+), 3114 deletions(-)
--
2.1.4
Follow ups