0
0

some harmless functions, like setUserData returns FMOD_RESULT.
Why?

If I should to check result, basing on common sense, this can lead to subtle errors, becouse developers of FMOD and me can have different "common sense".

If I should check ALL results…. But this is pain. And I can’t use some CHECK_ERROR macro, becouse application should not terminate if some error with sound appear. So, if, if, if, if + assert for misprint errors.

:(

  • You must to post comments
0
0

setUserData could return errors, such as FMOD_ERR_INVALID_HANDLE.

Besides this it is a lot more consistent for all functions to have an error code than some do and some dont. No return value would just be the same as a function always returning FMOD_OK anyway.

Its up to you to determine what you want to do with the return values. You don’t have to check them if you don’t want to, i would recommend only doing them on functions you think matter, like init, createsound, playsound etc, but if you don’t check all you may miss an error which would catch a bug you may have caused with an invalid parameter etc.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.