Hi all, I just found this in sp-root.h:
class SPRoot : public SPGroup { ... bool viewBox_set : true;
I do not know what it means. Does it mean: bool viewBox_set : 1;
If so, let's change it to a more recognizable format?
Cheers, Johan
On 2013-10-15 22:48, Johan Engelen wrote:
Hi all, I just found this in sp-root.h:
class SPRoot : public SPGroup { ... bool viewBox_set : true;
I do not know what it means. Does it mean: bool viewBox_set : 1;
Sounds likely. It was just recently changed from an unsigned int to a bool (revision 12475.1.2), changing the 1 into true at the same time. Possibly the committer thought that it initialized the value. To be honest, the bitfield syntax in c++ is a little obscure, and I am wondering whether we actually /need/ a bitfield here. After all, how many sp-root's do we have lying around?
If so, let's change it to a more recognizable format?
Cheers, Johan
I think it should be : bool viewBox_set = true;
Adib. --
On Tue, Oct 15, 2013 at 10:48 PM, Johan Engelen <jbc.engelen@...2592...>wrote:
Hi all, I just found this in sp-root.h:
class SPRoot : public SPGroup { ... bool viewBox_set : true;
I do not know what it means. Does it mean: bool viewBox_set : 1;
If so, let's change it to a more recognizable format?
Cheers, Johan
October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clk... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Em Qua, 2013-10-16 às 20:28 +0200, the Adib escreveu:
I think it should be : bool viewBox_set = true;
Are you talking about C++11's non-static data member initialization[1]? The SPRoot's constructor disagrees. It is explicitly setting the viewBox_set value to FALSE (yes, in capital, probably a macro). And I think currently Inkscape is compiled using C++98/03.
Indeed, the SPRoot's code is a bit weird.
About the change to more idiomatic code, I don't know what is the Inkscape rules regarding bitfields. I hope some older developer will answer this one.
[1] http://en.wikipedia.org/wiki/C++11#Object_construction_improvement
2013/10/15 Johan Engelen <jbc.engelen@...2592...>:
Hi all, I just found this in sp-root.h:
class SPRoot : public SPGroup { ... bool viewBox_set : true;
I do not know what it means. Does it mean: bool viewBox_set : 1;
If so, let's change it to a more recognizable format?
I guess this was made by the same person who made a mess in the display tree with the same sort of changes. Preferably it should be reverted - there should be no performance difference between bools and bitfields on modern processors, since accesses to memory locations smaller than int are implemented in the microcode as aligned access + bit operations.
In the longer term, this particular bitfield should be replaced with Geom::ViewBox, which I recently added to 2Geom.
Regards, Krzysztof
participants (5)
-
Jasper van de Gronde
-
Johan Engelen
-
Krzysztof Kosiński
-
the Adib
-
Vinícius dos Santos Oliveira