Re: [Kicad-developers] file format change and STEP exporter

2017-12-08 Thread José Ignacio
Indeed, it is much easier to just re-parse pcb files than it is to extract
data using the internal APIs. The intention is for that to be temporary
until the internal api improves to the point where writing something
interfacing with it wont be a pile of workarounds for quirks and sharp
corners. If anything, it is a testament to the improvement the s-expr
format brought to kicad, being so easy to parse and work with external
tools.

On Sat, Dec 9, 2017 at 12:59 AM, Kevin Cozens  wrote:

> On 2017-12-08 04:34 PM, Cirilo Bernardo wrote:
>
>>   I haven't had time to follow changes for quite some time but there
>> was some talk about making changes to the PCB file format. If the
>> file format changes, some changes will also have to be made to
>> the STEP exporter (utils/kicad2step) to handle the new format.
>>
>
> This surprises me a little. Does that mean kicad2step is processing the
> saved file and not working from the data held internal to the program?
>
> --
> Cheers!
>
> Kevin.
>
> http://www.ve3syb.ca/   |"Nerds make the shiny things that
> distract
> Owner of Elecraft K2 #2172  | the mouth-breathers, and that's why we're
> | powerful!"
> #include  | --Chris Hardwick
>
>
> ___
> 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
>
___
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] macOS & New Zone Filling?

2017-12-08 Thread Tomasz Wlostowski
On 09/12/17 01:33, Bernhard Stegmaier wrote:
> Some sites say that.
> I tried to manually compile a test program from one of those, but my
> clang doesn’t even recognise -fopenmp.
> The other thing mentioned is clang-omp, but that seems not to be
> maintained any longer.
> Didn’t try further…

Hi Bernhard,

Could you try this:

in zone_filler.cpp, after lines 92-93:

void ZONE_FILLER::Fill( std::vector aZones )
{

put:
m_progressReporter = nullptr;

recompile and try filling zones to check if it still freezes.

Tom

> 
> 
> Regards,
> Bernhard
> 
>> On 8. Dec 2017, at 16:50, Simon Wells > > wrote:
>>
>> I thought it did if you can find the right lib as it was only the lib
>> that was missing?
>>
>>> On 9/12/2017, at 3:48 AM, Bernhard Stegmaier >> > wrote:
>>>
>>> … I looked around a bit and from that it seems to be pretty sure that
>>> stock Xcode Apple clang (which I use) doesn’t support OpenMP.
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
 On 8. Dec 2017, at 14:05, Bernhard Stegmaier
 > wrote:

 Hi Tom,

> On 8. Dec 2017, at 13:59, Tomasz Wlostowski
> > wrote:
>
> Wonderful.
>
> I thought a workaround for Windows OpenMP/wxWidgets support will be
> sufficient. Time to get a macbook...
>
> Bernard, could you try building kicad with OpenMP disabled?

 Hmm… how do I do this?

 I get from cmake
 <<<
 …
 -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
 -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Failed
 -- Performing Test COMPILER_SUPPORTS_WSHADOW
 -- Performing Test COMPILER_SUPPORTS_WSHADOW - Success
 -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS
 OpenMP_C_LIB_NAMES) (found version "1.0")
 -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS
 OpenMP_CXX_LIB_NAMES) (found version "1.0")
 -- Found wxWidgets:
 -L/Volumes/OSXData/bstegmaier/KiCad/wx-master/lib;;;-framework
 IOKit;-framework Carbon;-framework Co
 …
 >>>

 So I always thought it doesn’t use OpenMP?


 Regards,
 Bernhard

 ___
 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
>>>
>>> ___
>>> 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
>>
> 


___
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] macOS & New Zone Filling?

2017-12-08 Thread Bernhard Stegmaier
Some sites say that.
I tried to manually compile a test program from one of those, but my clang 
doesn’t even recognise -fopenmp.
The other thing mentioned is clang-omp, but that seems not to be maintained any 
longer.
Didn’t try further…


Regards,
Bernhard

> On 8. Dec 2017, at 16:50, Simon Wells  wrote:
> 
> I thought it did if you can find the right lib as it was only the lib that 
> was missing?
> 
>> On 9/12/2017, at 3:48 AM, Bernhard Stegmaier > > wrote:
>> 
>> … I looked around a bit and from that it seems to be pretty sure that stock 
>> Xcode Apple clang (which I use) doesn’t support OpenMP.
>> 
>> 
>> Regards,
>> Bernhard
>> 
>>> On 8. Dec 2017, at 14:05, Bernhard Stegmaier >> > wrote:
>>> 
>>> Hi Tom,
>>> 
 On 8. Dec 2017, at 13:59, Tomasz Wlostowski > wrote:
 
 Wonderful.
 
 I thought a workaround for Windows OpenMP/wxWidgets support will be
 sufficient. Time to get a macbook...
 
 Bernard, could you try building kicad with OpenMP disabled?
>>> 
>>> Hmm… how do I do this?
>>> 
>>> I get from cmake
>>> <<<
>>> …
>>> -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
>>> -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Failed
>>> -- Performing Test COMPILER_SUPPORTS_WSHADOW
>>> -- Performing Test COMPILER_SUPPORTS_WSHADOW - Success
>>> -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
>>> (found version "1.0")
>>> -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS 
>>> OpenMP_CXX_LIB_NAMES) (found version "1.0")
>>> -- Found wxWidgets: 
>>> -L/Volumes/OSXData/bstegmaier/KiCad/wx-master/lib;;;-framework 
>>> IOKit;-framework Carbon;-framework Co
>>> …
>>> >>>
>>> 
>>> So I always thought it doesn’t use OpenMP?
>>> 
>>> 
>>> Regards,
>>> Bernhard
>>> 
>>> ___
>>> 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 
>>> 
>> 
>> ___
>> 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 
>> 
> 

___
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] file format change and STEP exporter

2017-12-08 Thread Cirilo Bernardo
Hi folks,

 I haven't had time to follow changes for quite some time but there
was some talk about making changes to the PCB file format. If the
file format changes, some changes will also have to be made to
the STEP exporter (utils/kicad2step) to handle the new format.

 Unfortunately I can't find time to do this even though it's maybe
only 2 hours work. :(

- Cirilo

___
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] Filter empty libraries in CMP_TREE_MODEL_ADAPTER (fixes lp:1736930)

2017-12-08 Thread Seth Hillbrand
​Attached is a small patch to avoid showing library listings from the
component selector when they have no components.​  This resolves
https://bugs.launchpad.net/kicad/+bug/1736930

Empty libraries are still shown in the library editor (needed if you are
creating a new one)

-Seth
​​
From e5492bda0c2b876ad8aa9a925b1da1112e3a039a Mon Sep 17 00:00:00 2001
From: Seth Hillbrand 
Date: Fri, 8 Dec 2017 05:53:53 -0800
Subject: [PATCH] Eeschema: Filter out empty libraries

Fixes: lp:1736930
* https://bugs.launchpad.net/kicad/+bug/1736930
---
 eeschema/cmp_tree_model_adapter.cpp | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/eeschema/cmp_tree_model_adapter.cpp b/eeschema/cmp_tree_model_adapter.cpp
index 01c973564..6055674a8 100644
--- a/eeschema/cmp_tree_model_adapter.cpp
+++ b/eeschema/cmp_tree_model_adapter.cpp
@@ -60,9 +60,11 @@ void CMP_TREE_MODEL_ADAPTER::AddLibrary( wxString const& aLibNickname )
 return;
 }
 
-AddAliasList( aLibNickname, aliases );
-
-m_tree.AssignIntrinsicRanks();
+if( aliases.size() > 0 )
+{
+AddAliasList( aLibNickname, aliases );
+m_tree.AssignIntrinsicRanks();
+}
 }
 
 
@@ -91,5 +93,6 @@ void CMP_TREE_MODEL_ADAPTER::AddAliasList(
 alias_list.push_back( a );
 }
 
-AddAliasList( aNodeName, alias_list );
+if( alias_list.size() > 0 )
+AddAliasList( aNodeName, alias_list );
 }
-- 
2.11.0

___
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] Jenkins build is back to normal : linux-kicad-full-gcc-head #2607

2017-12-08 Thread Miguel Angel Ajo
See 



___
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] Jenkins build is back to normal : kicad-qa #3138

2017-12-08 Thread Miguel Angel Ajo
See 


___
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] macOS & New Zone Filling?

2017-12-08 Thread Simon Wells
I thought it did if you can find the right lib as it was only the lib that was 
missing?

> On 9/12/2017, at 3:48 AM, Bernhard Stegmaier  wrote:
> 
> … I looked around a bit and from that it seems to be pretty sure that stock 
> Xcode Apple clang (which I use) doesn’t support OpenMP.
> 
> 
> Regards,
> Bernhard
> 
>> On 8. Dec 2017, at 14:05, Bernhard Stegmaier > > wrote:
>> 
>> Hi Tom,
>> 
>>> On 8. Dec 2017, at 13:59, Tomasz Wlostowski >> > wrote:
>>> 
>>> Wonderful.
>>> 
>>> I thought a workaround for Windows OpenMP/wxWidgets support will be
>>> sufficient. Time to get a macbook...
>>> 
>>> Bernard, could you try building kicad with OpenMP disabled?
>> 
>> Hmm… how do I do this?
>> 
>> I get from cmake
>> <<<
>> …
>> -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
>> -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Failed
>> -- Performing Test COMPILER_SUPPORTS_WSHADOW
>> -- Performing Test COMPILER_SUPPORTS_WSHADOW - Success
>> -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
>> (found version "1.0")
>> -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS 
>> OpenMP_CXX_LIB_NAMES) (found version "1.0")
>> -- Found wxWidgets: 
>> -L/Volumes/OSXData/bstegmaier/KiCad/wx-master/lib;;;-framework 
>> IOKit;-framework Carbon;-framework Co
>> …
>> >>>
>> 
>> So I always thought it doesn’t use OpenMP?
>> 
>> 
>> Regards,
>> Bernhard
>> 
>> ___
>> 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 
>> 
> 
> ___
> 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

___
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] UTF8 class and wchar_t issues fix

2017-12-08 Thread Maciej Sumiński
This is one more thing to fix. I have successfully imported a schematic
sheet with non-ASCII texts, but this project uses symbols named using
non-ASCII characters and this is not yet handled.

On 12/08/2017 03:13 PM, Wayne Stambaugh wrote:
> I'm guessing we can also mark this bug report
> https://bugs.launchpad.net/kicad/+bug/1736083 as fix committed.
> 
> On 12/08/2017 08:50 AM, Maciej Sumiński wrote:
>> Hi Wayne,
>>
>> I have tested it and indeed it fixes the problem with Eagle import as well.
>>
>> Cheers,
>> Orson
>>
>> On 12/08/2017 02:42 PM, Wayne Stambaugh wrote:
>>> Orson,
>>>
>>> Did you test this with any eagle projects that contain non-ascii
>>> characters before pushing this patch?
>>>
>>> Cheers,
>>>
>>> Wayne
>>>
>>> On 12/08/2017 08:38 AM, Maciej Sumiński wrote:
 Hi Jean-Pierre,

 Thank you for the fix, I think you are right. I applied the patch to the
 master branch.

 Regards,
 Orson

 On 12/08/2017 01:53 PM, jp charras wrote:
> Hi Orson
>
> Could you have a look into this patch.
>
> I am thinking it is also a fix for bug 1737143.
>
> Currently our UTF8 class has only a append operator for ASCII7 chars.
> But if the code uses something like (it is accepted by the compiler):
> my_utf_8_string += mychar;
> and if mychar is a int (or a wchar_t) containing a non ASCII7 value, the 
> UTF8 string is broken.
> the patch adds a append operator for non ASCII7 value (wchar_t wide chars)
>
>
> I am pretty sure this kind of issues also exists in eagle import (when 
> eagle files uses non ASCII7
> chars in texts).
>
> Thanks.
>




 ___
 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

>>>
>>> ___
>>> 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
>>>
>>
>>
>>
>>
>> ___
>> 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
>>
> 
> ___
> 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
> 




signature.asc
Description: OpenPGP digital signature
___
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] Build failed in Jenkins: linux-kicad-full-gcc-head #2606

2017-12-08 Thread Miguel Angel Ajo
See 


Changes:

[Maciej Suminski] Fix operator+= for UTF8 class

[Maciej Suminski] fix double free and memory leak in SHAPE_POLY_SET

--
[...truncated 143.49 KB...]
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_edit_module_for_BoardEditor.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_edit_module_for_BoardEditor_base.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_edit_module_for_Modedit_base.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_edit_module_for_Modedit.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_edit_module_text.cpp.o
[ 86%] Built target eeschema_kiface
Scanning dependencies of target eeschema
[ 86%] Building CXX object 
eeschema/CMakeFiles/eeschema.dir/__/common/single_top.cpp.o
[ 86%] Building CXX object 
eeschema/CMakeFiles/eeschema.dir/__/common/pgm_base.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_edit_module_text_base.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_enum_pads.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_enum_pads_base.cpp.o
[ 86%] Linking CXX executable eeschema
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_exchange_modules_base.cpp.o
[ 86%] Built target eeschema
Scanning dependencies of target qa_eagle_plugin
[ 86%] Building CXX object 
eeschema/qa/CMakeFiles/qa_eagle_plugin.dir/test_module.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_exchange_modules.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_export_idf.cpp.o
[ 86%] Building CXX object 
eeschema/qa/CMakeFiles/qa_eagle_plugin.dir/test_basic.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_export_idf_base.cpp.o
[ 86%] Linking CXX executable qa_eagle_plugin
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_export_vrml_base.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_export_vrml.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_export_step_base.cpp.o
[ 86%] Built target qa_eagle_plugin
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_export_step.cpp.o
[ 86%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_find_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_find.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_fp_lib_table_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_fp_lib_table.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_fp_plugin_options_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_fp_plugin_options.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_freeroute_exchange.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_freeroute_exchange_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_gencad_export_options.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_gendrill.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_gendrill_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_gen_module_position_file_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_general_options.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_general_options_BoardEditor_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_get_footprint_by_name_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_global_edit_tracks_and_vias.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_global_edit_tracks_and_vias_base.cpp.o
[ 87%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_global_modules_fields_edition.cpp.o
[ 88%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_global_modules_fields_edition_base.cpp.o
[ 88%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_global_pads_edition_base.cpp.o
[ 88%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_global_pads_edition.cpp.o
[ 88%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/dialogs/dialog_graphic_items_options.cpp.o
[ 88%] Building CXX object 

Re: [Kicad-developers] macOS & New Zone Filling?

2017-12-08 Thread Bernhard Stegmaier
… I looked around a bit and from that it seems to be pretty sure that stock 
Xcode Apple clang (which I use) doesn’t support OpenMP.


Regards,
Bernhard

> On 8. Dec 2017, at 14:05, Bernhard Stegmaier  wrote:
> 
> Hi Tom,
> 
>> On 8. Dec 2017, at 13:59, Tomasz Wlostowski > > wrote:
>> 
>> Wonderful.
>> 
>> I thought a workaround for Windows OpenMP/wxWidgets support will be
>> sufficient. Time to get a macbook...
>> 
>> Bernard, could you try building kicad with OpenMP disabled?
> 
> Hmm… how do I do this?
> 
> I get from cmake
> <<<
> …
> -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
> -- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Failed
> -- Performing Test COMPILER_SUPPORTS_WSHADOW
> -- Performing Test COMPILER_SUPPORTS_WSHADOW - Success
> -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
> (found version "1.0")
> -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
> (found version "1.0")
> -- Found wxWidgets: 
> -L/Volumes/OSXData/bstegmaier/KiCad/wx-master/lib;;;-framework 
> IOKit;-framework Carbon;-framework Co
> …
> >>>
> 
> So I always thought it doesn’t use OpenMP?
> 
> 
> Regards,
> Bernhard
> 
> ___
> 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

___
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] Build failed in Jenkins: kicad-qa #3136

2017-12-08 Thread Miguel Angel Ajo
See 

Changes:

[Maciej Suminski] Fix operator+= for UTF8 class

--
[...truncated 65.73 KB...]
  ^
: In member 
function ‘int EDIT_TOOL::MoveExact(const TOOL_EVENT&)’:
:875:17: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 const auto& selection = m_selectionTool->RequestSelection();
 ^
: In member 
function ‘int EDIT_TOOL::Duplicate(const TOOL_EVENT&)’:
:930:17: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 const auto& selection = m_selectionTool->RequestSelection( 
SELECTION_DELETABLE | SELECTION_SANITIZE_PADS );
 ^
: In member 
function ‘int EDIT_TOOL::CreateArray(const TOOL_EVENT&)’:
:1074:17: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 const auto& selection = m_selectionTool->RequestSelection();
 ^
: In member 
function ‘int EDIT_TOOL::ExchangeFootprints(const TOOL_EVENT&)’:
:1090:17: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 const auto& selection = m_selectionTool->RequestSelection();
 ^
: In member 
function ‘int EDIT_TOOL::MeasureTool(const TOOL_EVENT&)’:
:1122:11: 
warning: declaration of ‘view’ shadows a member of 'this' [-Wshadow]
 auto& view = *getView();
   ^
:1123:11: 
warning: declaration of ‘controls’ shadows a member of 'this' [-Wshadow]
 auto& controls = *getViewControls();
   ^
: In member 
function ‘int EDIT_TOOL::editFootprintInFpEditor(const TOOL_EVENT&)’:
:1266:17: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 const auto& selection = m_selectionTool->RequestSelection();
 ^
: In member 
function ‘int EDIT_TOOL::copyToClipboard(const TOOL_EVENT&)’:
:1331:15: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 SELECTION selection = m_selectionTool->RequestSelection();
   ^
: In member 
function ‘T* EDIT_TOOL::uniqueSelected()’:
:1362:11: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 auto& selection = m_selectionTool->RequestSelection( SELECTION_DEFAULT );
   ^
: In 
instantiation of ‘T* EDIT_TOOL::uniqueSelected() [with T = TRACK]’:
:336:42:   
required from here
:1362:76: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
 auto& selection = m_selectionTool->RequestSelection( SELECTION_DEFAULT );
^
: In 
instantiation of ‘T* EDIT_TOOL::uniqueSelected() [with T = VIA]’:
:337:36:   
required from here
:1362:76: 
warning: declaration of ‘selection’ shadows a member of 'this' [-Wshadow]
[ 97%] Building CXX object 
pcbnew/CMakeFiles/pcbnew_kiface.dir/tools/pcb_editor_control.cpp.o
: In 
member function ‘int PCBNEW_CONTROL::PadDisplayMode(const TOOL_EVENT&)’:
:289:15:
 warning: declaration of ‘module’ shadows a member of 'this' [-Wshadow]
 for( auto module : board()->Modules() ) // fixme: move to PCB_VIEW
   ^
: In 
member function ‘int 

Re: [Kicad-developers] UTF8 class and wchar_t issues fix

2017-12-08 Thread Wayne Stambaugh
I'm guessing we can also mark this bug report
https://bugs.launchpad.net/kicad/+bug/1736083 as fix committed.

On 12/08/2017 08:50 AM, Maciej Sumiński wrote:
> Hi Wayne,
> 
> I have tested it and indeed it fixes the problem with Eagle import as well.
> 
> Cheers,
> Orson
> 
> On 12/08/2017 02:42 PM, Wayne Stambaugh wrote:
>> Orson,
>>
>> Did you test this with any eagle projects that contain non-ascii
>> characters before pushing this patch?
>>
>> Cheers,
>>
>> Wayne
>>
>> On 12/08/2017 08:38 AM, Maciej Sumiński wrote:
>>> Hi Jean-Pierre,
>>>
>>> Thank you for the fix, I think you are right. I applied the patch to the
>>> master branch.
>>>
>>> Regards,
>>> Orson
>>>
>>> On 12/08/2017 01:53 PM, jp charras wrote:
 Hi Orson

 Could you have a look into this patch.

 I am thinking it is also a fix for bug 1737143.

 Currently our UTF8 class has only a append operator for ASCII7 chars.
 But if the code uses something like (it is accepted by the compiler):
 my_utf_8_string += mychar;
 and if mychar is a int (or a wchar_t) containing a non ASCII7 value, the 
 UTF8 string is broken.
 the patch adds a append operator for non ASCII7 value (wchar_t wide chars)


 I am pretty sure this kind of issues also exists in eagle import (when 
 eagle files uses non ASCII7
 chars in texts).

 Thanks.

>>>
>>>
>>>
>>>
>>> ___
>>> 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
>>>
>>
>> ___
>> 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
>>
> 
> 
> 
> 
> ___
> 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
> 

___
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] fix double free and memory leak in SHAPE_POLY_SET

2017-12-08 Thread Maciej Sumiński
Hi Andreas,

Thank you for the patch. The proposed changes are reasonable, therefore
I merged your patch to the master branch.

Cheers,
Orson

On 12/08/2017 12:37 PM, Andreas Buhr wrote:
> Dear Kicad developers,
> 
> the attached patch fixes two bugs in SHAPE_POLY_SET.
> 
> There were two problems in the triangulation caching
> of SHAPE_POLY_SET:
> First there was a double free:
> While SHAPE_POLY_SET implements the copy constructor,
> it did not implement the operator=, which resulted
> in the default operator= being generated by the
> compiler. The default operator= copied the member
> m_triangulatedPolys, which is a std::vector of pointers.
> So after operator= execution, there are two SHAPE_POLY_SET
> having pointers to the same TRIANGULATED_POLYGONs, each
> of them deleting them in their destructors. This led
> to segfaults, because calling
> TransformShapeWithClearanceToPolygon on a Zone
> uses operator= to copy the contained SHAPE_POLY_SET.
> The new SHAPE_POLY_SET then went out of scope and
> deleted the cached triangulation within the Zone.
> 
> This first problem is fixed by implementing operator=
> for SHAPE_POLY_SET.
> 
> Second, there was a memory leak: Calling
> "CacheTriangulation" on a SHAPE_POLY_SET,
> then changing the polygon and then calling
> "CacheTriangulation" again led to
> leaking the
> triangulations generated in the first call.
> 
> This second problem is fixed by holding
> the cached triangulations in a unique_ptr.
> 
> I hope you find this patch useful.
> 
> Cheers,
> Andreas
> 
> 
> 
> ___
> 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
> 




signature.asc
Description: OpenPGP digital signature
___
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] Signal integrity simulation within Kicad

2017-12-08 Thread Andreas Buhr
On 11/29/2017 08:07 PM, Tomasz Wlostowski wrote:
> I've made a quick test program that prints most of the board's geometry
> as bare polygons. It's here:
> 
> https://github.com/twlostow/kicad-dev/tree/tom-polygon-gen/qa/polygon_generator

Hi Tom,

thanks a lot for your help extracting polygons from PCBs. I plotted the
polygons on top of the PCB, green lines are all polygons from all layers.

It works fine for tracks.
For some pads, it works correctly. Other pads are somehow enlarged.
For zones, the polygons I get are always smaller than what is visible.
Could you hint me at what I have to do to get the correct polygons for
zones?

See attached pictures for an example (Olimex A64 board).

Cheers,
Andreas
___
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] UTF8 class and wchar_t issues fix

2017-12-08 Thread Maciej Sumiński
Hi Wayne,

I have tested it and indeed it fixes the problem with Eagle import as well.

Cheers,
Orson

On 12/08/2017 02:42 PM, Wayne Stambaugh wrote:
> Orson,
> 
> Did you test this with any eagle projects that contain non-ascii
> characters before pushing this patch?
> 
> Cheers,
> 
> Wayne
> 
> On 12/08/2017 08:38 AM, Maciej Sumiński wrote:
>> Hi Jean-Pierre,
>>
>> Thank you for the fix, I think you are right. I applied the patch to the
>> master branch.
>>
>> Regards,
>> Orson
>>
>> On 12/08/2017 01:53 PM, jp charras wrote:
>>> Hi Orson
>>>
>>> Could you have a look into this patch.
>>>
>>> I am thinking it is also a fix for bug 1737143.
>>>
>>> Currently our UTF8 class has only a append operator for ASCII7 chars.
>>> But if the code uses something like (it is accepted by the compiler):
>>> my_utf_8_string += mychar;
>>> and if mychar is a int (or a wchar_t) containing a non ASCII7 value, the 
>>> UTF8 string is broken.
>>> the patch adds a append operator for non ASCII7 value (wchar_t wide chars)
>>>
>>>
>>> I am pretty sure this kind of issues also exists in eagle import (when 
>>> eagle files uses non ASCII7
>>> chars in texts).
>>>
>>> Thanks.
>>>
>>
>>
>>
>>
>> ___
>> 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
>>
> 
> ___
> 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
> 




signature.asc
Description: OpenPGP digital signature
___
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] UTF8 class and wchar_t issues fix

2017-12-08 Thread Wayne Stambaugh
Orson,

Did you test this with any eagle projects that contain non-ascii
characters before pushing this patch?

Cheers,

Wayne

On 12/08/2017 08:38 AM, Maciej Sumiński wrote:
> Hi Jean-Pierre,
> 
> Thank you for the fix, I think you are right. I applied the patch to the
> master branch.
> 
> Regards,
> Orson
> 
> On 12/08/2017 01:53 PM, jp charras wrote:
>> Hi Orson
>>
>> Could you have a look into this patch.
>>
>> I am thinking it is also a fix for bug 1737143.
>>
>> Currently our UTF8 class has only a append operator for ASCII7 chars.
>> But if the code uses something like (it is accepted by the compiler):
>> my_utf_8_string += mychar;
>> and if mychar is a int (or a wchar_t) containing a non ASCII7 value, the 
>> UTF8 string is broken.
>> the patch adds a append operator for non ASCII7 value (wchar_t wide chars)
>>
>>
>> I am pretty sure this kind of issues also exists in eagle import (when eagle 
>> files uses non ASCII7
>> chars in texts).
>>
>> Thanks.
>>
> 
> 
> 
> 
> ___
> 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
> 

___
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] UTF8 class and wchar_t issues fix

2017-12-08 Thread Maciej Sumiński
Hi Jean-Pierre,

Thank you for the fix, I think you are right. I applied the patch to the
master branch.

Regards,
Orson

On 12/08/2017 01:53 PM, jp charras wrote:
> Hi Orson
> 
> Could you have a look into this patch.
> 
> I am thinking it is also a fix for bug 1737143.
> 
> Currently our UTF8 class has only a append operator for ASCII7 chars.
> But if the code uses something like (it is accepted by the compiler):
> my_utf_8_string += mychar;
> and if mychar is a int (or a wchar_t) containing a non ASCII7 value, the UTF8 
> string is broken.
> the patch adds a append operator for non ASCII7 value (wchar_t wide chars)
> 
> 
> I am pretty sure this kind of issues also exists in eagle import (when eagle 
> files uses non ASCII7
> chars in texts).
> 
> Thanks.
> 




signature.asc
Description: OpenPGP digital signature
___
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] macOS & New Zone Filling?

2017-12-08 Thread Bernhard Stegmaier
Hi Tom,

> On 8. Dec 2017, at 13:59, Tomasz Wlostowski  wrote:
> 
> Wonderful.
> 
> I thought a workaround for Windows OpenMP/wxWidgets support will be
> sufficient. Time to get a macbook...
> 
> Bernard, could you try building kicad with OpenMP disabled?

Hmm… how do I do this?

I get from cmake
<<<
…
-- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
-- Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Failed
-- Performing Test COMPILER_SUPPORTS_WSHADOW
-- Performing Test COMPILER_SUPPORTS_WSHADOW - Success
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) (found 
version "1.0")
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
(found version "1.0")
-- Found wxWidgets: 
-L/Volumes/OSXData/bstegmaier/KiCad/wx-master/lib;;;-framework IOKit;-framework 
Carbon;-framework Co
…
>>>

So I always thought it doesn’t use OpenMP?


Regards,
Bernhard

___
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] macOS & New Zone Filling?

2017-12-08 Thread Tomasz Wlostowski
On 08/12/17 13:56, Bernhard Stegmaier wrote:
> Hi,
> 
> anybody tried a current version with the new zone filling on macOS?
> 
> The version I compiled just an hour ago only shows this dialog:
> 
> Then, it just hangs… Cancel doesn’t work (it is grey in the screenshot
> because I already pressed it), can’t close the dialog or do anything else.
> Looking close at the PCB seems that it didn’t do anything (or, just no
> update).
> 
> 
Wonderful.

I thought a workaround for Windows OpenMP/wxWidgets support will be
sufficient. Time to get a macbook...

Bernard, could you try building kicad with OpenMP disabled?

Tom


> Regards,
> Bernhard
> 
> 
> 
> 
> 
> 
> ___
> 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
> 


___
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] macOS & New Zone Filling?

2017-12-08 Thread Bernhard Stegmaier
Hi,

anybody tried a current version with the new zone filling on macOS?

The version I compiled just an hour ago only shows this dialog:


Then, it just hangs… Cancel doesn’t work (it is grey in the screenshot because 
I already pressed it), can’t close the dialog or do anything else.
Looking close at the PCB seems that it didn’t do anything (or, just no update).


Regards,
Bernhard




___
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] UTF8 class and wchar_t issues fix

2017-12-08 Thread jp charras
Hi Orson

Could you have a look into this patch.

I am thinking it is also a fix for bug 1737143.

Currently our UTF8 class has only a append operator for ASCII7 chars.
But if the code uses something like (it is accepted by the compiler):
my_utf_8_string += mychar;
and if mychar is a int (or a wchar_t) containing a non ASCII7 value, the UTF8 
string is broken.
the patch adds a append operator for non ASCII7 value (wchar_t wide chars)


I am pretty sure this kind of issues also exists in eagle import (when eagle 
files uses non ASCII7
chars in texts).

Thanks.

-- 
Jean-Pierre CHARRAS
 common/text_utils.cpp |  5 -
 common/utf8.cpp   | 19 +++
 include/utf8.h|  4 
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/common/text_utils.cpp b/common/text_utils.cpp
index 2d0d635..dc2a270 100644
--- a/common/text_utils.cpp
+++ b/common/text_utils.cpp
@@ -44,7 +44,10 @@ std::pair ProcessOverbars( const 
UTF8& aText )
 // If it is a double tilda, just process the second one
 }
 
-text += *chIt;
+// remember: *chIt is not necessary a ASCII7 char.
+// it is a unsigned ( wchar_t ) giving a multibyte char in UTF8 strings
+text += wchar_t( *chIt );
+
 flags.push_back( overbar );
 }
 
diff --git a/common/utf8.cpp b/common/utf8.cpp
index 1d4bf1d..7be3e0f 100644
--- a/common/utf8.cpp
+++ b/common/utf8.cpp
@@ -218,6 +218,25 @@ UTF8::UTF8( const wchar_t* txt ) :
 }
 
 
+/// Append a wide (unicode) char to the UTF8 string.
+/// if this char is not a ASCII7 char, it will be added as a UTF8 
multibyte seqence
+UTF8& UTF8::operator+=( wchar_t aUniChar )
+{
+if( aUniChar <= 0x7F )
+m_s.operator+=( char( aUniChar ) );
+else
+{
+wchar_t wide_chr[2];// buffer to store wide chars (unicode) read 
from aText
+wide_chr[1] = 0;
+wide_chr[0] = aUniChar;
+UTF8 substr( wide_chr );
+m_s += substr.m_s;
+}
+
+return (UTF8&) *this;
+}
+
+
 #if 0   // some unit tests:
 
 #include 
diff --git a/include/utf8.h b/include/utf8.h
index e78e8fd..48150f3 100644
--- a/include/utf8.h
+++ b/include/utf8.h
@@ -145,6 +145,10 @@ public:
 return (UTF8&) *this;
 }
 
+/// Append a wide (unicode) char to the UTF8 string.
+/// if this char is not a ASCII7 char, it will be added as a UTF8 
multibyte seqence
+UTF8& operator+=( wchar_t aUniChar );
+
 // std::string::npos is not constexpr, so we can't use it in an
 // initializer.
 static constexpr std::string::size_type npos = -1;
___
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] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings

2017-12-08 Thread Andreas Buhr
Dear Kicad developers,

The OPENGL_GAL::drawPolygon function and all functions using it
did not respect the isFillEnabled member set by
GAL::SetIsFill. This is fixed by the attached patch.

I hope you find it useful.
Cheers,
Andreas
>From d99a51c99e03bc6c28f2c0bc12c4a2327ecc378e Mon Sep 17 00:00:00 2001
From: Andreas Buhr 
Date: Fri, 8 Dec 2017 12:44:46 +0100
Subject: [PATCH] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings

The OPENGL_GAL::drawPolygon function and all functions using it
did not respect the isFillEnabled member set by
GAL::SetIsFill. This is fixed by this patch.
---
 common/gal/opengl/opengl_gal.cpp | 36 +++-
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp
index 63f08ee..763d08f 100644
--- a/common/gal/opengl/opengl_gal.cpp
+++ b/common/gal/opengl/opengl_gal.cpp
@@ -1511,28 +1511,30 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa
 
 void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
 {
-currentManager->Shader( SHADER_NONE );
-currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
+if(isFillEnabled){
+currentManager->Shader( SHADER_NONE );
+currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
 
-// Any non convex polygon needs to be tesselated
-// for this purpose the GLU standard functions are used
-TessParams params = { currentManager, tessIntersects };
-gluTessBeginPolygon( tesselator,  );
-gluTessBeginContour( tesselator );
+// Any non convex polygon needs to be tesselated
+// for this purpose the GLU standard functions are used
+TessParams params = { currentManager, tessIntersects };
+gluTessBeginPolygon( tesselator,  );
+gluTessBeginContour( tesselator );
 
-GLdouble* point = aPoints;
+GLdouble* point = aPoints;
 
-for( int i = 0; i < aPointCount; ++i )
-{
-gluTessVertex( tesselator, point, point );
-point += 3; // 3 coordinates
-}
+for( int i = 0; i < aPointCount; ++i )
+{
+gluTessVertex( tesselator, point, point );
+point += 3; // 3 coordinates
+}
 
-gluTessEndContour( tesselator );
-gluTessEndPolygon( tesselator );
+gluTessEndContour( tesselator );
+gluTessEndPolygon( tesselator );
 
-// Free allocated intersecting points
-tessIntersects.clear();
+// Free allocated intersecting points
+tessIntersects.clear();
+}
 
 if( isStrokeEnabled )
 drawPolyline( [&](int idx) { return VECTOR2D( aPoints[idx * 3], aPoints[idx * 3 + 1] ); },
-- 
2.7.4

___
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] fix double free and memory leak in SHAPE_POLY_SET

2017-12-08 Thread Andreas Buhr
Dear Kicad developers,

the attached patch fixes two bugs in SHAPE_POLY_SET.

There were two problems in the triangulation caching
of SHAPE_POLY_SET:
First there was a double free:
While SHAPE_POLY_SET implements the copy constructor,
it did not implement the operator=, which resulted
in the default operator= being generated by the
compiler. The default operator= copied the member
m_triangulatedPolys, which is a std::vector of pointers.
So after operator= execution, there are two SHAPE_POLY_SET
having pointers to the same TRIANGULATED_POLYGONs, each
of them deleting them in their destructors. This led
to segfaults, because calling
TransformShapeWithClearanceToPolygon on a Zone
uses operator= to copy the contained SHAPE_POLY_SET.
The new SHAPE_POLY_SET then went out of scope and
deleted the cached triangulation within the Zone.

This first problem is fixed by implementing operator=
for SHAPE_POLY_SET.

Second, there was a memory leak: Calling
"CacheTriangulation" on a SHAPE_POLY_SET,
then changing the polygon and then calling
"CacheTriangulation" again led to
leaking the
triangulations generated in the first call.

This second problem is fixed by holding
the cached triangulations in a unique_ptr.

I hope you find this patch useful.

Cheers,
Andreas
>From 947bf92c5a83cbd7202a6ad2220ac8c15aa3f9c8 Mon Sep 17 00:00:00 2001
From: Andreas Buhr 
Date: Fri, 8 Dec 2017 12:20:02 +0100
Subject: [PATCH] fix double free and memory leak in SHAPE_POLY_SET

There were two problems in the triangulation caching
of SHAPE_POLY_SET:
First there was a double free:
While SHAPE_POLY_SET implements the copy constructor,
it did not implement the operator=, which resulted
in the default operator= being generated by the
compiler. The default operator= copied the member
m_triangulatedPolys, which is a std::vector of pointers.
So after operator= execution, there are two SHAPE_POLY_SET
having pointers to the same TRIANGULATED_POLYGONs, each
of them deleting them in their destructors. This led
to segfaults, because calling
TransformShapeWithClearanceToPolygon on a Zone
uses operator= to copy the contained SHAPE_POLY_SET.
The new SHAPE_POLY_SET then went out of scope and
deleted the cached triangulation within the Zone.

This first problem is fixed by implementing operator=
for SHAPE_POLY_SET.

Second, there was a memory leak: Calling
"CacheTriangulation" on a SHAPE_POLY_SET,
then changing the polygon and then calling
"CacheTriangulation" again led to
leaking the
triangulations generated in the first call.

This second problem is fixed by holding
the cached triangulations in a unique_ptr.
---
 common/geometry/shape_poly_set.cpp | 27 +++
 include/geometry/shape_poly_set.h  |  9 +
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp
index ff2ad87..3b81809 100644
--- a/common/geometry/shape_poly_set.cpp
+++ b/common/geometry/shape_poly_set.cpp
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -58,14 +57,6 @@ SHAPE_POLY_SET::SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther ) :
 {
 }
 
-
-SHAPE_POLY_SET::~SHAPE_POLY_SET()
-{
-for( auto p : m_triangulatedPolys )
-delete p;
-}
-
-
 SHAPE* SHAPE_POLY_SET::Clone() const
 {
 return new SHAPE_POLY_SET( *this );
@@ -1871,6 +1862,19 @@ SHAPE_POLY_SET::POLYGON SHAPE_POLY_SET::chamferFilletPolygon( CORNER_MODE aMode,
 }
 
 
+SHAPE_POLY_SET _POLY_SET::operator=(const SHAPE_POLY_SET & aOther)
+{
+static_cast(*this) = aOther;
+m_polys = aOther.m_polys;
+
+// reset poly cache:
+m_hash = MD5_HASH{};
+m_triangulationValid = false;
+m_triangulatedPolys.clear();
+return *this;
+}
+
+
 typedef std::map  P2T_MAP;
 typedef std::vectorP2T_VEC;
 
@@ -2022,9 +2026,8 @@ void SHAPE_POLY_SET::CacheTriangulation()
 
 for( int i = 0; i < tmpSet.OutlineCount(); i++ )
 {
-auto p = new TRIANGULATED_POLYGON();
-m_triangulatedPolys.push_back( p );
-triangulateSingle( tmpSet.Polygon( i ), *p );
+m_triangulatedPolys.push_back( std::make_unique() );
+triangulateSingle( tmpSet.Polygon( i ), *m_triangulatedPolys.back() );
 }
 
 m_triangulationValid = true;
diff --git a/include/geometry/shape_poly_set.h b/include/geometry/shape_poly_set.h
index cec3491..78308bc 100644
--- a/include/geometry/shape_poly_set.h
+++ b/include/geometry/shape_poly_set.h
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -406,8 +407,6 @@ class SHAPE_POLY_SET : public SHAPE
  */
 SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther );
 
-~SHAPE_POLY_SET();
-
 /**
  * Function GetRelativeIndices
  *
@@ -585,7 +584,7 @@ class SHAPE_POLY_SET : public SHAPE
 
 const TRIANGULATED_POLYGON* TriangulatedPolygon( int aIndex ) const
 {
-return 

[Kicad-developers] Jenkins build is back to normal : linux-kicad-full-gcc-head #2603

2017-12-08 Thread Miguel Angel Ajo
See 



___
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