[Bf-committers] Casting arrays (matrices)

Douglas Toltzman bf-committers@blender.org
Wed, 2 Jul 2003 17:06:38 -0400 (EDT)


On Wed, 2 Jul 2003, Jacques Guignot wrote:

> Maarten Gribnau wrote:
> 
> > How does the const cause trouble?
> > The const is actually useful. It tells you the function is not going 
> > to modify the variable (usually pointers and references in C++) passed 
> > to it. It makes the variable an "in only" variable. 
> 
> 
> 
> The const ---was--- pretty useful ages ago. Now, these functions have 
> been called zillions times, we can be absolutely sure that they don't 
> try to modify their arguments...
> 

Unless someone makes a modification or optimization to the code.

Ton may be right in that the const doesn't apply well to the matrix code.
I haven't actually studied it.  However, if it is applied correctly, it
shouldn't generate warnings.  If the warnings can't be fixed some other
way, then I'd remove the const because "real" warnings are often
obfuscated by scrolling lines of useless warnings.  In that case, you may
as well just turn off warnings and fly by the seat of your pants; so to
speak.