Hi, regardingr12593 „C++ify calling a few SPLPEItem functions, much more work thanexpected... slowly slowly…”: I don’tknow what software you are using, with Eclipse my “optimized” workflow is asfollows: 1. Movefunction declaration in the header file into the class, remove the firstparameter 2. Go tothe function definition in the cpp-file, right click and select “Open CallHierarchy” 3. AddSPClass:: in front of the definition 4. Selectthe first parameter, press Shift+Alt+R and rename it to “this” 5. 6. Removethe first parameter, the function is c++ified 6. In theCall Hierarchy window go through the list and adjust the calls 7. Selectany occurrence of the function, again Shift+Alt+R and rename it But I agreethat it’s a lot of boring, monotonous, repetitive work :) . It took me tons ofcoffee and some really long nightly sessions. Scripting this process isn’t thateasy either. At least now I’ve got some deeper understanding of how the partsfit together… and how not to write code. There were some really nice code partsin these files, e. g. marker.cpp, parsing the viewbox attribute by movingaround a char-pointer. This code appears 1:1 in sp-root.cpp ;) .
Regards, Markus
Em Qui, 2013-09-26 às 05:17 -0400, Markus Engel escreveu:
I don’t know what software you are using, with Eclipse my “optimized” workflow is as follows: [...]
My optimized workflow is use Emacs with compiler-backed autocomplete support. I'm still waiting for llvm conquer the C++ land: http://www.phoronix.com/scan.php?page=news_item&px=MTEyMTE
Your workflow looks good. =)
Em Qui, 2013-09-26 às 05:17 -0400, Markus Engel escreveu:
But I agree that it’s a lot of boring, monotonous, repetitive work :) [...]
I came here to spam you guys a bit more, so I can share an awesome link of what the LLVM guys have been doing: http://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s...
(yes, I don't watch TV, because TV doesn't show C++ talks... or anything I like to watch)
On 4-10-2013 14:51, Vinícius dos Santos Oliveira wrote:
Em Qui, 2013-09-26 às 05:17 -0400, Markus Engel escreveu:
But I agree that it’s a lot of boring, monotonous, repetitive work :) [...]
I came here to spam you guys a bit more, so I can share an awesome link of what the LLVM guys have been doing: http://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s...
Thank you so much for sharing this!
Cheers, Johan
Em Sex, 2013-10-04 às 21:48 +0200, Johan Engelen escreveu:
On 4-10-2013 14:51, Vinícius dos Santos Oliveira wrote:
[...]
I came here to spam you guys a bit more, so I can share an awesome link of what the LLVM guys have been doing: http://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s...
Thank you so much for sharing this!
You are welcome. :)
On Fri, 2013-10-04 at 21:48 +0200, Johan Engelen wrote:
Thank you so much for sharing this!
I also wanted to add my thanks. I sometimes feel my C++ skills can be measured with a single bit; So seeing this was very interesting since he went through a lot of things that would trip up a programmer from a safer high level language like python.
Feel free to post anything like this in the future.
So I can go through our code base and remove all the loops that use end() in their evaluations? Because I've always hated those.
Martin,
2013/10/5 Martin Owens <doctormo@...400...>:
So I can go through our code base and remove all the loops that use end() in their evaluations? Because I've always hated those.
Do you want to replace them with C++11 range-based for, or with a declared iterator before the loop?
I'd opt for the 1st solution, but in that case it might be wise to wait until 0.49 before we start requiring a C++11 compiler.
Regards, Krzysztof
On 5-10-2013 0:34, Krzysztof Kosiński wrote:
2013/10/5 Martin Owens <doctormo@...400...>:
So I can go through our code base and remove all the loops that use end() in their evaluations? Because I've always hated those.
Do you want to replace them with C++11 range-based for, or with a declared iterator before the loop?
I'd opt for the 1st solution, but in that case it might be wise to wait until 0.49 before we start requiring a C++11 compiler.
I agree. (we are trying to get a release out the door, let's try and focus on that a little... ;)
Cheers, Johan
On Oct 4, 2013, at 3:34 PM, Krzysztof Kosiński wrote:
2013/10/5 Martin Owens <doctormo@...400...>:
So I can go through our code base and remove all the loops that use end() in their evaluations? Because I've always hated those.
Do you want to replace them with C++11 range-based for, or with a declared iterator before the loop?
I'd opt for the 1st solution, but in that case it might be wise to wait until 0.49 before we start requiring a C++11 compiler.
Actually we might need to wait a little longer on C++ requirements.
And more specifically, we need to do a breakdown of C++ features to use. Different versions of different compilers have different subsets implemented. Just in the last week or so I hit a difference in some implementation behavior with the gcc in certain Debian versions.
On 14-10-2013 0:00, Jon Cruz wrote:
On Oct 4, 2013, at 3:34 PM, Krzysztof Kosiński wrote:
2013/10/5 Martin Owens <doctormo@...400...>:
So I can go through our code base and remove all the loops that use end() in their evaluations? Because I've always hated those.
Do you want to replace them with C++11 range-based for, or with a declared iterator before the loop?
I'd opt for the 1st solution, but in that case it might be wise to wait until 0.49 before we start requiring a C++11 compiler.
Actually we might need to wait a little longer on C++ requirements.
And more specifically, we need to do a breakdown of C++ features to use. Different versions of different compilers have different subsets implemented. Just in the last week or so I hit a difference in some implementation behavior with the gcc in certain Debian versions.
I am very excited about C++11, and hope we can start using it ASAP. Even a small subset would already be awesome.
I started a page on our wiki http://wiki.inkscape.org/wiki/index.php/C%2B%2B11 to keep track of what new features are safe to use.
Thanks for helping out tinkering on that page!
Cheers, Johan
I am very excited about C++11, and hope we can start using it ASAP. Even a small subset would already be awesome.
I started a page on our wiki http://wiki.inkscape.org/wiki/index.php/C%2B%2B11 to keep track of what new features are safe to use.
Well, which Linux distributions (i. e. versions) should be supported? So we could simply find out the default compiler versions there and look into the according gcc documentation.
GCC 4.8.1 is feature complete. http://gcc.gnu.org/projects/cxx0x.html
libstdc++ is missing some rather important things such as regex support. http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html
clang 3.3 is feature complete as well. http://clang.llvm.org/cxx_status.html
libc++ is an alternative c++ library that targets c++11 and is feature complete. http://libcxx.llvm.org/
As far as Mac OS X 10.6.8 is concerned I can say that the default compiler is GCC 4.2, which does not seem to support any c++11 features. Anyway, I managed to compile Inkscape there with a brand new clang 3.3 and libc++, so this should be possible for any newer Mac versions as well. The default compiler/library combination on newer Mac versions is clang/libc++.
Btw, could I get a wiki account? I could then update the Mac OS X compile instructions.
Regards, Markus
On 15-Oct-2013 12:22, Johan Engelen wrote:
I am very excited about C++11, and hope we can start using it ASAP. Even a small subset would already be awesome.
This grey haired maintenance programmer thinks it is still 2-3 years too soon to be allowing in code that requires a C++11 compiler. New language release capabilities always look great on paper, and sometimes they actually even make for better programs, but getting them isn't worth trading off the advantages of being able to use the older compiler and library versions which may be present on some platforms. If history is any guide 4-5 years is roughly how long it takes for a new language version to become "pervasive". Moving to it before then tends to desupport too many old(ish) machines.
Regards,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech
Em Ter, 2013-10-15 às 21:22 +0200, Johan Engelen escreveu:
I started a page on our wiki http://wiki.inkscape.org/wiki/index.php/C%2B%2B11 to keep track of what new features are safe to use.
There is nothing about lambdas. This is the feature I care more about. Before add any feature to the list, what do I need to do first?
On Fri, 2013-10-04 at 09:51 -0300, Vinícius dos Santos Oliveira wrote:
Em Qui, 2013-09-26 às 05:17 -0400, Markus Engel escreveu:
But I agree that it’s a lot of boring, monotonous, repetitive work :) [...]
I came here to spam you guys a bit more, so I can share an awesome link of what the LLVM guys have been doing: http://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s...
This inspired me to try out Clang. It turns out it was pretty easy to download Clang and compile Inkscape with it using Fedora 19[1] but unfortunately Fedora is missing the libraries needed for the -fsanitize option.
Tav
[1] Install clang: $ yum install clang clang-analyzer Configure: ./configure --prefix=ZZZ CXX=/usr/bin/clang++
participants (8)
-
Johan Engelen
-
Jon Cruz
-
Krzysztof Kosiński
-
Markus Engel
-
Martin Owens
-
mathog
-
Tavmjong Bah
-
Vinícius dos Santos Oliveira