[pulseaudio-discuss] [PATCH 1/8] rtp; Make init return a boolean value for success/failure
Arun Raghavan
arun at accosted.net
Tue Apr 12 11:10:06 UTC 2016
On 12 April 2016 at 16:33, Tanu Kaskinen <tanuk at iki.fi> wrote:
> On Tue, 2016-04-12 at 10:00 +0530, Arun Raghavan wrote:
>> On Sun, 2016-04-10 at 17:17 +0300, Tanu Kaskinen wrote:
>> > On Sat, 2016-04-09 at 09:36 +0530, Arun Raghavan wrote:
>> > > On 7 April 2016 at 20:02, Tanu Kaskinen <tanuk at iki.fi> wrote:
>> > > > (Also, a reminder: we've agreed to report function failures using a
>> > > > negative int value rather than a bool.)
>> > >
>> > > Was that only for external functions, or internal ones as well?
>> >
>> > At least I understood the previous discussion to be about internal
>> > functions as well. Maybe it was ambiguous and we interpreted each other
>> > wrong (I don't have the previous discussion at hand to check).
>>
>> Does it matter, then, especially since this is internal?
>
> Well, does consistency matter in internal code? Do you want to remove
> the "errors are returned from functions as negative values, success is
> returned as 0 or positive value" point from
> https://wiki.freedesktop.org/www/Software/PulseAudio/Documentation/Developer/CodingStyle/ ?
I do think consistency is important. otoh, in this particular case, it
introduces an artificial constraint.
IMO a negative error value only makes sense if the caller can actually
figure out the error based on the return value.
We can continue this discussion to reevaluate what makes sense from
the project perspective. I'm fine with just returning -1 in the
interest of this patch series not stalling.
-- Arun
More information about the pulseaudio-discuss
mailing list