Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
>> Yes, so that means OUTPUTFORMATTER::Print() is not thread safe >> currently, > > Rather, probably it is thread safe, but the locale change is not > thread specific to my knowledge. http://stackoverflow.com/questions/4057319/is-setlocale-thread-safe-function Here again, the interface we ha

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
On 03/15/2013 02:07 PM, Dick Hollenbeck wrote: > On 03/15/2013 01:46 PM, Miguel Angel Ajo Pelayo wrote: >> On 15/03/2013, at 19:32, Dick Hollenbeck wrote: >> >>> On 03/15/2013 11:39 AM, Miguel Angel Ajo Pelayo wrote: Ok, committed in 4008, cleanups included. Finally I used the LOCA

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
On 03/15/2013 01:46 PM, Miguel Angel Ajo Pelayo wrote: > On 15/03/2013, at 19:32, Dick Hollenbeck wrote: > >> On 03/15/2013 11:39 AM, Miguel Angel Ajo Pelayo wrote: >>> Ok, committed in 4008, cleanups included. >>> >>> Finally I used the LOCALE_IO implementation, because converting in >>> some si

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
On 15/03/2013, at 19:32, Dick Hollenbeck wrote: > On 03/15/2013 11:39 AM, Miguel Angel Ajo Pelayo wrote: >> Ok, committed in 4008, cleanups included. >> >> Finally I used the LOCALE_IO implementation, because converting in >> some situations didn't work, and my time was exhausting for today… >

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
On 03/15/2013 11:39 AM, Miguel Angel Ajo Pelayo wrote: > Ok, committed in 4008, cleanups included. > > Finally I used the LOCALE_IO implementation, because converting in > some situations didn't work, and my time was exhausting for today… > > I think there are some locale manipulators in std:: c++

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
Ok, committed in 4008, cleanups included. Finally I used the LOCALE_IO implementation, because converting in some situations didn't work, and my time was exhausting for today… I think there are some locale manipulators in std:: c++ that would let us do those conversions without switching system

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
On 03/15/2013 10:16 AM, Miguel Angel Ajo Pelayo wrote: > I'm doing it with pleasure, there's nothing better than reading > standardized code when > you get used to an style. > > One question: I'm uncrustifying, and diff-checking my .cpps/.hs, as > for sure I'd forget many things manually. > > It se

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
I'm doing it with pleasure, there's nothing better than reading standardized code when you get used to an style. One question: I'm uncrustifying, and diff-checking my .cpps/.hs, as for sure I'd forget many things manually. It seems that it's adding spaces to align variable declarations in block

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
Wow. There's a man with a positive attitude, that is why we want him on our team. On Mar 15, 2013 9:23 AM, "Miguel Angel Ajo Pelayo" wrote: > You're right dick, I promise you that I was at this task before reading > your email, > I re-read te kicad coding style policy last night, and now I can s

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
You're right dick, I promise you that I was at this task before reading your email, I re-read te kicad coding style policy last night, and now I can see many mistakes. I'm cleaning the code and fixing a couple of assert errors from wx in debug mode (never used it on debug mode until now, and wh

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Dick Hollenbeck
On 03/15/2013 07:58 AM, Miguel Angel Ajo Pelayo wrote: > I think I will fix it back to value.Replace(wxT( "," ),wxT( "." ));, which > seems to work > with wxwidgets 2.8 (was the wxT(..) missing what broke it) > > And It's the internal implementation of wxwidgets wxString CDouble things . Migue

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
I think I will fix it back to value.Replace(wxT( "," ),wxT( "." ));, which seems to work with wxwidgets 2.8 (was the wxT(..) missing what broke it) And It's the internal implementation of wxwidgets wxString CDouble things . Miguel Angel Ajo http://www.nbee.es +34911407752 skype: ajoajoajo O

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
JP, it's a problem to pull a dependency on wxwidgets 2.9.x? and use the CDouble methods from wxString? , It seems to work here, and LOCALE_IO seems dangerous regarding threading. This is the FromCDouble implementation, they used a Replace, as my original solution :-) wxString wxString::FromCD

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread jp charras
Le 15/03/2013 12:57, Miguel Angel Ajo Pelayo a écrit : Jean Pierre, It sounds like what I need, without adding dependencies on 2.9 or 3.0 (as Edwin was pointing me privately). Anyway, that cannot be a problem with threading? or it just sets locale "locally" and not App wide? Thanks a

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
Jean Pierre, It sounds like what I need, without adding dependencies on 2.9 or 3.0 (as Edwin was pointing me privately). Anyway, that cannot be a problem with threading? or it just sets locale "locally" and not App wide? Thanks a lot for the help, Miguel Angel Ajo http://www.nbee.es +34

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread jp charras
We have this kind of issue for all I/O file functions. In KiCad there is a class named LOCALE_IO to fix it thee ctor switches on the "C" fp notation, and the dtor restores the current locale. See for instance the line: LOCALE_IO toggle; // toggles on, then off, the C locale. in pcb_parser

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
Sorry, this is wxString to double… grr :) I meant, "wxString::FromCDouble" :) Miguel Angel Ajo http://www.nbee.es +34911407752 skype: ajoajoajo On 15/03/2013, at 12:26, Miguel Angel Ajo Pelayo wrote: > From wxString methods, this one looks like our friend. Edwin, is it available > in wx2.8 ?

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
From wxString methods, this one looks like our friend. Edwin, is it available in wx2.8 ? Conversion to numbers The string provides functions for conversion to signed and unsigned integer and floating point numbers. All functions take a pointer to the variable to put the numeric value in and

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
sprintf and others will render also using the LC_NUMERIC, or locale set in program, yet looking how to workaround this... http://www.stroustrup.com/3rd_loc.pdf Miguel Angel Ajo http://www.nbee.es +34911407752 skype: ajoajoajo On 15/03/2013, at 11:30, Miguel Angel Ajo Pelayo wrote: > Thanks ed

Re: [Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Miguel Angel Ajo Pelayo
Thanks edwin, I will try to fix it this night with a 2.8 compatible solution, Also thanks a lot for the suggestion, Anyway, I don't like changing the locale back and forth, I know the risk is minimal, but in a multithreading UI environment It could break anything running/displaying/printing elsew

[Kicad-developers] Locale fix in KiCAD is not working (breaks my build)

2013-03-15 Thread Edwin van den Oetelaar
Hello Miguel, My WX is 2.8 Your WX is 2.9 I guess http://wiki.wxwidgets.org/Converting_everything_to_and_from_wxString I think there should be a cleaner way to handle this kind of thing. (comma/dot in floating point) Would it be possible to set LC_NUMERIC someway? char prvlocale[255]; strcpy( p