- Set a default PCM volume so that something can be heard when driver is
[AROS.git] / test / uae-tmpl / be_conv
blobcee64cf22723d88d41956c02bd88c4c8bbcd355f
2 /* native endian 2 big endian */
4 template<class C>
5 inline C ne2be (C value) // native endian to big endian (htonl ())
7   return static_cast<C> (htonl (static_cast<long> (value)));
10 template<>
11 inline short ne2be (short value) // specialization for short (htons ())
13   return static_cast<short> (htons (static_cast<short> (value)));
16 template<>
17 inline unsigned short ne2be (unsigned short value) // specialization for unsigned short (htons ())
19   return static_cast<unsigned short> (htons (static_cast<unsigned short> (value)));
22 /* big endian 2 native endian */
24 template<class C>
25 inline C be2ne (C value) // big endian to native endian (ntohl ())
27   return static_cast<C> (ntohl (static_cast<long> (value)));
30 template<>
31 inline short be2ne (short value) // specialization for short (ntohs ())
33   return static_cast<short> (ntohs (static_cast<short> (value)));
36 template<>
37 inline unsigned short be2ne (unsigned short value) // specialization for unsigned short (ntohs ())
39   return static_cast<unsigned short> (ntohs (static_cast<unsigned short> (value)));