[pulseaudio-discuss] commit: resampler: Move some peak resampler asserts around
Tanu Kaskinen
tanuk at iki.fi
Wed Dec 21 22:31:42 PST 2011
On Thu, 2011-12-22 at 09:49 +0530, Arun Raghavan wrote:
> Again, I disagree. If code needs documentation, it should be documented.
> Relegating that to an assert is incorrect.
You could add a comment in the else branch saying that "format is here
always PA_SAMPLE_FLOAT32NE", but that's just an assertion translated
into English. The nice thing about using pa_assert instead of a comment
is that if the assertion ever crashes, the reason will be obvious. A bug
caused by violating a rule that is stated only in a comment may not be
as easy to track down.
I'm here with Maarten: assertions are documentation.
--
Tanu
More information about the pulseaudio-discuss
mailing list