Re: [Kicad-developers] [PATCH 0/2] Remove useless casts

2019-09-09 Thread Wayne Stambaugh
On 9/9/19 1:42 PM, Seth Hillbrand wrote:
> On 2019-09-06 18:36, Simon Richter wrote:
>> Hi,
>>
>> I have two patches that remove useless casts. The first covers cases
>> where
>> it is quite obvious that the cast can be removed with no adverse effects,
>> the second contains the cases where that is less clear.
>>
>> In theory, both can be applied and should not cause code changes, but the
>> second needs review to see if something else was originally intended by
>> that code.
>>
>>    Simon
> 
> Hi Simon-
> 
> I'm in favor of cleaning the casts as we code or if there's a specific
> instance where the cast creates a problem (perhaps causing an unneeded
> class instantiation).  The large size of these patches without a clear
> problem they are solving makes me leery that we will introduce a new
> issue and I'd prefer to avoid this if possible.
> 
> Best-
> Seth
> 

I concur unless a cast is redundant in the sense that a function return
or a variable is already the same type as the cast.  In this case I
don't see where there would be any issues.

Wayne

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH 0/2] Remove useless casts

2019-09-09 Thread Seth Hillbrand

On 2019-09-06 18:36, Simon Richter wrote:

Hi,

I have two patches that remove useless casts. The first covers cases 
where
it is quite obvious that the cast can be removed with no adverse 
effects,

the second contains the cases where that is less clear.

In theory, both can be applied and should not cause code changes, but 
the

second needs review to see if something else was originally intended by
that code.

   Simon


Hi Simon-

I'm in favor of cleaning the casts as we code or if there's a specific 
instance where the cast creates a problem (perhaps causing an unneeded 
class instantiation).  The large size of these patches without a clear 
problem they are solving makes me leery that we will introduce a new 
issue and I'd prefer to avoid this if possible.


Best-
Seth

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 0/2] Remove useless casts

2019-09-06 Thread Simon Richter
Hi,

I have two patches that remove useless casts. The first covers cases where
it is quite obvious that the cast can be removed with no adverse effects,
the second contains the cases where that is less clear.

In theory, both can be applied and should not cause code changes, but the
second needs review to see if something else was originally intended by
that code.

   Simon

Simon Richter (2):
  Remove useless casts
  Remove questionable useless casts

 3d-viewer/3d_cache/sg/sg_helpers.h|  4 ++--
 3d-viewer/3d_canvas/create_layer_items.cpp| 10 -
 .../3d_model_viewer/c3d_model_viewer.cpp  |  2 +-
 .../c3d_render_ogl_legacy.cpp |  2 +-
 .../3d_render_ogl_legacy/clayer_triangles.h   |  4 ++--
 .../accelerators/cbvh_pbrt.cpp|  2 +-
 .../c3d_render_createscene.cpp|  8 +++
 .../c3d_render_raytracing.cpp |  4 ++--
 .../shapes2D/citemlayercsg2d.cpp  |  6 ++---
 .../shapes2D/cpolygon2d.cpp   |  2 +-
 .../shapes3D/clayeritem.cpp   |  4 ++--
 3d-viewer/3d_rendering/cimage.cpp |  4 ++--
 3d-viewer/3d_rendering/cpostshader.h  |  2 +-
 3d-viewer/3d_rendering/trackball.cpp  | 12 +-
 bitmap2component/bitmap2cmp_main.cpp  |  2 +-
 common/base_struct.cpp|  2 +-
 common/bezier_curves.cpp  |  4 ++--
 common/board_printout.cpp |  2 +-
 common/draw_panel_gal.cpp |  4 ++--
 common/gal/opengl/opengl_compositor.cpp   |  6 ++---
 common/gal/opengl/opengl_gal.cpp  |  2 +-
 common/gal/opengl/shader.cpp  |  4 ++--
 common/lib_table_base.cpp |  2 +-
 common/tool/picker_tool.cpp   |  2 +-
 common/utf8.cpp   |  2 +-
 common/view/view.cpp  |  4 ++--
 common/widgets/footprint_preview_widget.cpp   |  4 ++--
 common/widgets/net_selector.cpp   |  2 +-
 common/xnode.cpp  |  4 ++--
 cvpcb/cvpcb.cpp   |  2 +-
 cvpcb/display_footprints_frame.cpp|  2 +-
 dxflib_qcad/dl_dxf.cpp|  2 +-
 eeschema/dialogs/dialog_erc.cpp   |  2 +-
 eeschema/generate_alias_info.cpp  |  2 +-
 eeschema/hierarch.cpp |  2 +-
 eeschema/libedit/toolbars_libedit.cpp |  2 +-
 .../netlist_exporter_pspice.cpp   |  2 +-
 eeschema/sch_eagle_plugin.cpp |  4 ++--
 eeschema/sch_marker.cpp   |  2 +-
 eeschema/sch_sheet_path.h |  2 +-
 eeschema/toolbars_viewlib.cpp |  2 +-
 eeschema/tools/ee_inspection_tool.cpp |  2 +-
 eeschema/tools/ee_point_editor.cpp| 10 -
 eeschema/tools/ee_selection.cpp   |  2 +-
 eeschema/tools/ee_selection_tool.cpp  |  2 +-
 eeschema/tools/lib_edit_tool.cpp  |  2 +-
 eeschema/tools/sch_drawing_tools.cpp  |  6 ++---
 eeschema/tools/sch_edit_tool.cpp  |  4 ++--
 eeschema/tools/sch_editor_control.cpp |  2 +-
 gerbview/gerbview_frame.cpp   |  2 +-
 gerbview/tools/gerbview_control.cpp   |  2 +-
 gerbview/tools/gerbview_selection_tool.cpp|  2 +-
 include/gal/graphics_abstraction_layer.h  |  4 ++--
 include/gal/opengl/shader.h   |  2 +-
 include/utf8.h|  6 ++---
 pagelayout_editor/pl_editor.cpp   |  2 +-
 pagelayout_editor/pl_editor_frame.cpp |  2 +-
 pagelayout_editor/tools/pl_edit_tool.cpp  |  2 +-
 pagelayout_editor/tools/pl_editor_control.cpp |  2 +-
 pagelayout_editor/tools/pl_point_editor.cpp   |  2 +-
 pagelayout_editor/tools/pl_selection_tool.cpp |  2 +-
 pcb_calculator/pcb_calculator.cpp |  2 +-
 .../class_board_stackup.cpp   |  4 ++--
 pcbnew/class_board.cpp|  4 +---
 pcbnew/class_dimension.cpp|  2 +-
 pcbnew/class_drawsegment.cpp  |  4 ++--
 pcbnew/class_marker_pcb.cpp   |  8 +++
 pcbnew/class_module.cpp   |  4 ++--
 pcbnew/class_module.h |  4 ++--
 pcbnew/class_pcb_target.cpp   |  2 +-
 pcbnew/class_pcb_text.cpp |  2 +-
 pcbnew/class_track.cpp|  4 ++--
 pcbnew/class_zone.cpp |  2 +-
 pcbnew/connectivity/connectivity_algo.cpp |  8 +++
 .../convert_drawsegment_list_to_polygon.cpp   |  4 ++--
 pcbnew/dialogs/dialog_create_array.cpp|  4 ++--
 pcbnew/exporters/export_gencad.cpp|  4 +---
 pcbnew/files.cpp  |  2 +-
 pcbnew/footprint_info_impl.cpp|  2 +-
 pcbnew/legacy_plugin.cpp  |  2 +-
 pcbnew/pad_print_functions.cpp