Re: [linux-audio-dev] help with bigendian unsigned long long

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] help with bigendian unsigned long long
From: Paul Davis (pbd_AT_op.net)
Date: Thu May 09 2002 - 14:10:03 EEST


>> i am reading a little endian unsigned long long (64 bit integer) as
>> two LE 32 bit units. i know how to do this on a LE host. can someone
>> tell me how to byte swap and OR them together to form the correct
>> value if the host is bigendian?
>
>Working and tested (x86 Linux and Sparc Solaris) code:

thanks. however, i found it simpler to do:

#include <byteswap.h>
        ...
        bswap_64(val)

i knew about byteswap.h, and was using bswap_32 - i just hadn't
bothered to look to see if it included bswap_64, and it does.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu May 09 2002 - 14:02:12 EEST