[Openal-devel] Setting of attributes and constness
Matt Calabrese
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.
--
-Matt Calabrese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal-devel/attachments/20080623/827a807f/attachment.html
More information about the Openal-devel
mailing list