On 2012-08-15 09:28:46 +0100, Måns Rullgård wrote:
> aviad rozenhek <avia...@gmail.com> writes:
> 
> > On Mon, Aug 13, 2012 at 12:33 PM, aviad rozenhek <avia...@gmail.com> wrote:
> >
> >> unary minus operator applied to unsigned type, result still unsigned
> >>
> >>
> >> I get this compiler warning when using any if the specialized AVERROR_XXX
> >> macros, like AVERROR_BSF_NOT_FOUND or AVERROR_DECODER_NOT_FOUND.
> >>
> >> the reason is because
> >>
> >>> #define AVERROR_BSF_NOT_FOUND      (-MKTAG(0xF8,'B','S','F')) ///<
> >>> Bitstream filter not found
> >>
> >>
> >> and the result from MKTAG is *unsigned* .
> >
> > how about we stop using the high byte [which contains the sign, thus making
> > the tag convertible to signed, like so, would this work?
> >
> > #define DEFINE_AVERROR_3CC_TAG(a, b, c)  (-(int32_t)MKTAG(a, b, c, 0))
> 
> Or how about we revert 6b34fbb and fix the one case where that matters
> differently?

Depends a little of that the user of MKTAG is expecting? Reverting
6b34fbb is only fine if we make clear that MKTAG is only supposed
to be used with 7 bit chars.

But I suspect most user of it will expect MKTAG(0xff, 0xff, 0xff,
0xff) to work.

I would add a AVERROR_MKTAG without the unsigned cast and keep
6b34fbb. It has the additional advantage of removing use of the
unprefixed MKTAG from a public header. avformat.h is the only other
public header which uses MKTAG.

Janne
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to