[Openal-devel] Setting of attributes and constness
rivorus at gmail.com
Mon Jun 23 10:35:45 PDT 2008
I've noticed that the use of const in OpenAL is seemingly nonexistant. For
instance, the "fv" and "iv" family of attribute setting functions take a
pointer-to-non-const, however, these pointed-to values are not to be changed
by the implementation, so why are they not const? This is particularly
frustrating for a program which is passing const data around since the user
of OpenAL now has to either change their program to not use const, which is
definitely not an option for many [most] applications, or they'd have to do
potentially unsafe casts (casting away constness of an object which was
initially declared as being const technically has undefined results
according to the standard if I recall correctly, though I'm not certain
without checking). Either way, this would be solved by simply making these
parameters pointers to const data rather than pointers to non-const data.
The change is backwards-compatible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Openal-devel