Commit Graph

213 Commits

Author SHA1 Message Date
Maciej Suminski ce610f33a2 Coverity fixes
resource leak: #172233
negative array index write: #102363
uninitialized scalar field: #174540 #174539
structurally dead code: #169334 #169331
2018-03-19 10:02:05 +01:00
jean-pierre charras d0754acf00 Fix code after renaming files 2018-01-29 11:37:29 +01:00
Seth Hillbrand e53fa2dda6 Partially revert 316ddad that added warnings but no functionality
Fixes: lp:1742978
* https://bugs.launchpad.net/kicad/+bug/1742978
2018-01-16 14:25:45 +01:00
Camille 9ff66a5274 Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
Tomasz Włostowski b47a06e42a poly2tri: include stdexcept in each file throwing an std::exception. 2017-12-14 02:29:33 +01:00
Tomasz Włostowski a83ece88fd poly2tri use std::runtime_error, fixes builds on many Linux distributions 2017-12-14 02:14:35 +01:00
Tomasz Włostowski 941ebe376c poly2tri: throw exceptions instead of crashing on non-supported polygons 2017-12-14 01:25:28 +01:00
jean-pierre charras cdad02336d fix minor compil warnings 2017-12-05 18:02:53 +01:00
Tomasz Włostowski c50da7e163 poly2tri: fixed some warnings 2017-12-05 14:54:57 +01:00
Tomasz Włostowski 316ddadec1 pcbnew: Optimized zone filling algorithm. 2017-12-05 14:54:57 +01:00
Nick ?stergaard c74437a44e Remove unused custom cmake target
This target seems to only create empty makefiles, tested on linux. And I
can not find any references to it in any of the current CMakeLists. Lets
remove it.
2017-12-03 18:21:40 -05:00
Marvin Schmidt 69974b73db Remove some extra semicolons 2017-11-09 19:52:18 +01:00
jean-pierre charras 2c21c70f46 Fix a few doxygen warnings 2017-06-22 09:09:52 +02:00
Maciej Suminski e79f97860c Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only
once, at other times they were just straight lines or crashed the
application.
2017-05-16 17:58:09 +02:00
Alejandro García Montoro f68ce306bd CPolyLine -> SHAPE_POLY_SET refactor.
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.

The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.

The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
2017-03-24 10:43:47 +01:00
jean-pierre charras 9f1e154753 Update Clipper to 6.4.2 2017-03-01 14:55:21 +01:00
Maciej Suminski 799c8b6922 Fixed a shadowed variable warning in clipper 2017-02-27 10:42:32 +01:00
jean-pierre charras 11dcb76fc9 Add -Wshadow compil option, if exists to warn about shadowed variables.
Swig auto generated .cxx file has a lot of shadowed variables, so this option cannot be used to compil all files.
2017-02-23 13:17:23 +01:00
Simon Richter 04e21d5c8f Remove check for undefined behaviour
Triangle::NeighborAcross returns a reference, which must refer to a valid
object whose address cannot be 0. Thus, this test is nonsensical.
2016-09-29 18:26:19 -04:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Tomasz Wlostowski 91a3b3d396 fixed polygon filleting glitch for colinear outline segments 2016-08-05 11:44:36 +02:00
jean-pierre charras 146a78a8fb Very minor fixes: Uncrustify a few files and rename a shadowed var. 2016-07-22 08:59:17 +02:00
Dick Hollenbeck e24990146d Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.

* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
  These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
  and C++ so that the resultant type name is common in both languages, and
  the types AGREE.

* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.

* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
  NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
  comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.

* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
  Having the name consistent between like types is helpful, and between
  languages.  std::map<> ends up as SOMETHING_MAP.

* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
  instead of hashtables, because swig does not yet support std::unordered_map.

* You can now get to any netclass or net info.   NETNAMES_MAP and NETCODES_MAP
  are traversable basically the same as a python dictionary using a python
  string (not wsString) as the key!  The wxString typemap converts python
  string to wxString before the lookup happens.  Iteration also works.
2016-07-18 13:23:09 -04:00
Jon Neal 1293d04a7a Fix a bunch of misspellings of length. 2016-07-10 23:09:18 -04:00
jean-pierre charras 58ddb0fd37 PolyLine.cpp: NormalizeAreaOutlines now removes null segments.
* CPolyLine::Chamfer (and CPolyLine::Fillet) :  removes null segments before calculating modified outlines.
  It fixes some incorrect outlines after chamfer or fillet due to null segments creating overflow during calculations.
* CPolyLine::Chamfer : code cleaning (avoid useless double to integer and integer to double conversions).
2016-06-26 16:39:15 +02:00
Maciej Suminski 71aade6b51 Fixed a few warnings (mostly gcc6 -Wmisleading-indent). 2016-06-07 14:42:42 +02:00
Simon Richter 96ec9db5d6 Add missing C++ stdlib headers
The GCC standard library headers often include other headers, which makes
some code compile that forgets to include several headers.
2016-05-28 12:46:29 -04:00
jean-pierre charras bbe42d0f47 Fix very minor issues: compil warnings (mainly deprecated and shadowed vars warnings). 2016-05-22 19:39:20 +02:00
jean-pierre charras 178cf0dc25 Polygon calculation (zones filling): use fast mode when possible (in fact most of time) and strictly simple polygon option only in critical cases (in fact in plot Gerber functions mainly).
In polygon calculations (combining polygons, fracture) the mode of calculation (fast or strictly simple polygon option) as no more a default value, because choosing the best mode is better to optimize the calculation time.
2015-12-15 21:21:25 +01:00
Cirilo Bernardo 2128594a85 Coding policy fixes: remove trailing white space. 2015-12-14 16:20:54 -05:00
jean-pierre charras ab7350bf2d Better fix for issue fixed in rev 6350 2015-12-07 14:51:46 +01:00
jean-pierre charras fefa8d16f0 math_for_graphics.cpp: use abs() instead of std::abs() for integer values, to avoid errors with some compilers. 2015-12-07 11:01:33 +01:00
jean-pierre charras c80d92e927 Kicad manager: fix a potential bug which could crash Kicad manager. math_for_graphics.cpp: remove useless includes. 2015-12-07 10:24:31 +01:00
jean-pierre charras 34f1c0ea2d Fix a few Coverity warnings. 2015-11-11 19:47:51 +01:00
jean-pierre charras 602e38dab5 Clipper.cpp: fix a few minor Coverity warnings (about not initialized private members) 2015-11-03 17:55:31 +01:00
jean-pierre charras 01be350851 Update clipper library version (from 6.21) to the latest (currently 6.4.0 , 2 July 2015) which fixes some bugs. 2015-11-02 13:45:33 +01:00
jean-pierre charras f67c7fe052 Very minor changes. ( changes in clipper are made to avoid coverity minor warnings). 2015-08-25 16:47:09 +02:00
Jean-Pierre Charras fb8afc61ab Fix selfintersecting or outline intersecting holes issue. 2015-07-27 21:48:38 +02:00
Tomasz Wlostowski 63b35f40a7 Removed all dependencies on boost::polygon except for bitmap2component. Replaced almost all instances of CPOLYGONS_LIST with SHAPE_POLY_SET. 2015-07-27 21:45:57 +02:00
Maciej Suminski d2ebf688f9 Reverted commits that remove boost::polygon dependency (need more testing). 2015-07-14 22:23:13 +02:00
Tomasz Wlostowski 41c753b05d Removed all dependencies on boost::polygon except for bitmap2component. Replaced almost all instances of CPOLYGONS_LIST with SHAPE_POLY_SET. 2015-07-14 13:36:24 +02:00
Chris Pavlina 3af895e285 Replace abs() with std::abs(). 2015-06-26 19:21:09 -04:00
jean-pierre charras fc4352f082 PolyLine.h, Polyline.cpp: a bit of cleaning code: add comments in header, remove duplicate (and not used) method. 2015-06-03 12:35:21 +02:00
jean-pierre charras ba37f33bbb Pcbnew: Use a better (i.e. more suitable to calculate clearance areas) algorithm to inflate/deflate zones outlines. It fixes bug#1459734.
Previously, acute angles (especially small angles)  in zone outlines create incorrect shapes and sometimes strange shapes for clearance areas, when using generic algorithms.
This happens when zones outlines have "spikes", but not usually for smooth outlines.
2015-05-30 14:02:55 +02:00
jean-pierre charras 3c4f76abe4 Fix a not shown dialog under XFCE and Unity. Make display hotkeys window not modal. 2015-03-15 12:41:06 +01:00
jean-pierre charras d6c6b4debb Fix some coverity warnings (mainly not initialized vars). 2015-02-27 15:33:13 +01:00
jean-pierre charras 64925bfc4f Very minor fixes: add missing const return type to some GetBoundingBox() declarations. Change few functions names to better names in some places (like GetName() to GetPinName() ) 2015-01-18 18:28:14 +01:00
jean-pierre charras bb7a74f58f Pcbnew: fix Bug #1404191 (Zone filling fails when a zone inside having the same net and a highter priority exists, which is allowed to manage different fill parameters ) 2014-12-19 20:09:53 +01:00
jean-pierre charras 25a801ed8a Modify usage of Inflate/deflate polygon in zone calculations, in order to be compatible with boost::polygon >= 1.56
Some code cleanup.
2014-11-30 18:07:02 +01:00
jean-pierre charras 8da93abcb8 Polygon tools: update Clipper lib to 6.2.1
Minor doc update.
2014-11-12 18:58:39 +01:00