On Sat, 2015-10-31 at 16:02 -0400, Ganesh Ajjanagadde wrote:
> On Sat, Oct 31, 2015 at 3:01 PM, Luca Barbato <[email protected]>
> wrote:
> > On 31/10/15 19:51, Ganesh Ajjanagadde wrote:
> > > why not just use U: it is a very simple solution.
> > 
> > 
> > The only, simple and correct solution is to use the provided
> > macros:
> > 
> > INT64_C and UINT64_C.
> > 
> > Anything else is just wrong.

I already said this on IRC, but posting here too: according to C99 and
later, "if (AV_RB64(pkt.data) == 0x89504e470d0a1a0a)" is just fine as
is, and requires no suffix or wrapper macro of any kind. As a
hexadecimal constant without suffix, "0x89504e470d0a1a0a" has the first type in 
[int, unsigned int, long, unsigned long, long long, unsigned long long] which 
can represent the value. At least unsigned long long is guaranteed to be large 
enough on any platform to contain the value, so it will never be truncated. 
Thus the equality comparison will always do the right thing.


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

Reply via email to