Giel van Schijndel schreef: > [EMAIL PROTECTED] schreef: > >> This is nothing new is it? Lots of functions also can't tell if >> something is invalid, and that is why 99.9% of all the ones I have >> see require you to check the result. >> > Yes, true, the problem, however, is that here we are talking about > function parameters rather than function results. > >> Using -1 is also standard AFAIK. It is easier to type that than >> 0xffffffffff. >> > Yes typing -1 is indeed easier than typing 0xffffffffff. It is also > incorrect when you try to assign -1 to an unsigned variable, assigning > ~0 to an unsigned variable on the other hand _is_ correct. So simply > put: don't assign -1 to unsigned variables, use ~0 for that purpose. > I'm thinking of simply rewriting the soundlib in C++ so I can use a class to handle all the calls to OpenAL. Then try to recreate the C interface to that class so that the rest of the code can use it.
Seems like the best way to go, especially since the current sound code itself (i.e. in lib/sound) is quite small. Maybe we would do best to have a separate branch for this purpose, but that's another discussion. Then as for all other parts of the code that assign negative values to unsigned variables, there's no excuse such as an external lib for that one. -- Giel
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Warzone-dev mailing list [email protected] https://mail.gna.org/listinfo/warzone-dev
