[FFmpeg-devel] [PATCH] Make the inet_aton replacement endian independent

Ronald S. Bultje rsbultje
Thu Jan 7 16:20:50 CET 2010


On Fri, Jan 1, 2010 at 11:04 AM, Martin Storsj? <martin at martin.st> wrote:
> Currently, the replacement which is used if inet_aton isn't available,
> only works correctly on little-endian. The attached patch makes it endian
> independent.

-    add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
+    add->s_addr = htonl((add1<<24) + (add2<<16) + (add3<<8) + add4);

I'd add spaces: add3_<<_8 (around all) while you're at it. Otherwise
patch OK, if tested.

Do you have a SVN account or do I need to apply for you?


More information about the ffmpeg-devel mailing list