[Bf-committers] Casting arrays (matrices)

Maarten Gribnau bf-committers@blender.org
Wed, 2 Jul 2003 22:07:14 +0200


Hi Ton

> Reading the arithb.c code, I found that someone (NaN) has included a 
> lot of 'const' variables in the function declarations. I have 
> absolutely no clue what it's good for. Originally, the code worked 
> fine without, as still is in the MTC_matrixops.c version in 
> source/blender/blenlib/
>
> I've removed the 'const' everywhere from arithb.c. The code compiles 
> quite a lot faster, with only a few and more useful warnings left.
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.

Maarten