On Tue, May 17, 2016 at 09:19:35PM +0300, Martin Storsjö wrote:
> On Tue, 17 May 2016, Diego Biurrun wrote:
> > On Tue, May 17, 2016 at 01:15:40PM -0400, Vittorio Giovara wrote:
> >> On Tue, May 17, 2016 at 12:49 PM, Diego Biurrun <[email protected]> wrote:
> >>> --- a/libavutil/tests/xtea.c
> >>> +++ b/libavutil/tests/xtea.c
> >>> @@ -80,41 +81,44 @@ static void test_xtea(AVXTEA *ctx, uint8_t *dst, 
> >>> const uint8_t *src,
> >>>
> >>>  int main(void)
> >>>  {
> >>> -    AVXTEA ctx;
> >>>      uint8_t buf[16], iv[8];
> >>>      int i, j;
> >>>      static const uint8_t src[32] = "HelloWorldHelloWorldHelloWorld";
> >>>      uint8_t ct[32];
> >>>      uint8_t pl[32];
> >>> +    AVXTEA *ctx = av_xtea_alloc();
> >>> +    if (!ctx)
> >>> +        return -1;
> >>
> >> I think you have to return positive values for errors.
> >
> > I don't think so.  What gives you the idea?
> 
> Because the return value of a process is in the range 0-255. Normally, the 
> range 0-127 is used for return values directly returned by the main 
> function, while the range 128-255 is used for cases when the process is 
> killed by a signal, where the value somehow hints about what signal killed 
> it. Now if you return a negative value from main, this ends up mapped into 
> the high half of the range, making it alias the return code or signals.

Indeed, thanks for reminding me.  For reference:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to