Re: [Kicad-developers] [PATCH] Warnings cleanup

2015-07-04 Thread Simon Richter
Hi, On 04.07.2015 12:53, Camille 019 wrote: > -if( layer == NO_AVAILABLE_LAYERS ) > +if( layer == static_cast(NO_AVAILABLE_LAYERS) ) Nope, that relies on undefined overflow semantics, and compilers that do constant propagation through casts would miscompile this code. Th

Re: [Kicad-developers] [PATCH] Warnings cleanup

2015-07-04 Thread Edwin van den Oetelaar
Mmmm I am not an expert but does using the static_cast on the enum constant really solve the problem or just make it invisible? I think the enums should not be uint64_t but some smaller int type. include/layers_id_colors_and_visibility.h The layer ids are just a small enum (fits in a CHAR), maybe

[Kicad-developers] [PATCH] Warnings cleanup

2015-07-04 Thread Camille 019
Hi, A set of patch to clean some warnings I get with Clang. The list of warnings : ../pcbnew/router/pns_router.cpp:208:10: warning: unused variable 'nonOrtho' [-Wunused-variable]     bool nonOrtho = false; ../pcbnew/router/pns_topology.cpp:385:21: note: use function 'std::abs' instead