Re: [Crystal-cvs] SF.net SVN: crystal:[39815] CS/trunk/include/csgeom/spatialtree.h

res <[email protected]> Mon, 30 Sep 2013 19:37:45 +0200
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <[email protected]>
On 30.09.2013 19:25, [email protected] wrote:
> The static variable isn't allocated space anywhere so applications linking
> to the CS library fail to link.
> I didn't see a good place to define it so I did the easy thing and used a
> constant.

> @@ -415,7 +415,6 @@
>      int numObjects;      // current storage used
>      int maxObjects;      // current storage capacity
>      int estimateObjects; // estimated number of objects in whole tree
> -    static int const objectGrowth = 80; // storage growth minimum
>  
>      // Minimum amount of objects in this tree before we consider splitting.
>      int minSplitObjects;

I think it's a thing that works in C++11 (becomes a “true“ constant
there), but it results in the static var prob you see above with C++03.
There the workaround is to use an enum:
enum { objectGrowth = 80 };

-f.r.

------------------------------------------------------------------------------
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=60133471&iu=/4140/ostg.clktrk

_______________________________________________
Crystal-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-develop
signature.asc (application/pgp-signature, 263 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJJtu0ACgkQNCTzcE/07ezBygCeM4bslg79HsCdLRBBArVmED9s
cpcAnRlGmiZmRXCnyzd3jPH5B2YRPP4U
=3GiA
-----END PGP SIGNATURE-----