[pulseaudio-discuss] [PATCH 2/4] Various fixes for build warnings

Maarten Bosmans mkbosmans at gmail.com
Wed Mar 2 06:00:04 PST 2011


2011/3/2 Colin Guthrie <gmane at colin.guthr.ie>:
> 'Twas brillig, and Maarten Bosmans at 02/03/11 11:41 did gyre and gimble:
>
>> diff --git a/src/tests/mainloop-test.c b/src/tests/mainloop-test.c
>> index 3ec6d11..75b77b5 100644
>> --- a/src/tests/mainloop-test.c
>> +++ b/src/tests/mainloop-test.c
>> @@ -48,7 +48,7 @@ static pa_defer_event *de;
>>
>>  static void iocb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {
>>      unsigned char c;
>> -    (void) read(fd, &c, sizeof(c));
>> +    assert(read(fd, &c, sizeof(c)) >= 0);
>>      fprintf(stderr, "IO EVENT: %c\n", c < 32 ? '.' : c);
>>      a->defer_enable(de, 1);
>>  }
>
> Shouldn't this be pa_assert_se()?

Ah, yes of course. I only tested it on a debug build, where there is
no difference. That is of course by far the common situation for
running the test programs.

Maarten



More information about the pulseaudio-discuss mailing list