45 #include <QtCore/qglobal.h> 65 for (
int i = 0; i < size ; ++i) dest[i] = src[size - 1 - i];
74 template <
typename T>
inline void qbswap(
const T src,
uchar *dest)
76 qbswap_helper(reinterpret_cast<const uchar *>(&src), dest,
sizeof(T));
111 | src[3] *
quint32(0x01000000);
122 {
return static_cast<qint64>(qFromLittleEndian_helper(src, reinterpret_cast<quint64*>(0))); }
124 {
return static_cast<qint32>(qFromLittleEndian_helper(src, reinterpret_cast<quint32*>(0))); }
126 {
return static_cast<qint16>(qFromLittleEndian_helper(src, reinterpret_cast<quint16*>(0))); }
130 return qFromLittleEndian_helper(src, reinterpret_cast<T*>(0));
154 | src[3] *
quint32(0x01000000);
199 | src[0] *
quint32(0x01000000);
211 {
return static_cast<qint64>(qFromBigEndian_helper(src, reinterpret_cast<quint64*>(0))); }
213 {
return static_cast<qint32>(qFromBigEndian_helper(src, reinterpret_cast<quint32*>(0))); }
215 {
return static_cast<qint16>(qFromBigEndian_helper(src, reinterpret_cast<quint16*>(0))); }
219 return qFromBigEndian_helper(src, reinterpret_cast<T*>(0));
245 | src[0] *
quint32(0x01000000);
273 template <
typename T> T
qbswap(T source);
278 return bswap_64(source);
282 return bswap_32(source);
286 return bswap_16(source);
292 | ((source &
Q_UINT64_C(0x00000000000000ff)) << 56)
293 | ((source &
Q_UINT64_C(0x000000000000ff00)) << 40)
294 | ((source &
Q_UINT64_C(0x0000000000ff0000)) << 24)
295 | ((source &
Q_UINT64_C(0x00000000ff000000)) << 8)
296 | ((source &
Q_UINT64_C(0x000000ff00000000)) >> 8)
297 | ((source &
Q_UINT64_C(0x0000ff0000000000)) >> 24)
298 | ((source &
Q_UINT64_C(0x00ff000000000000)) >> 40)
299 | ((source &
Q_UINT64_C(0xff00000000000000)) >> 56);
305 | ((source & 0x000000ff) << 24)
306 | ((source & 0x0000ff00) << 8)
307 | ((source & 0x00ff0000) >> 8)
308 | ((source & 0xff000000) >> 24);
314 | ((source & 0x00ff) << 8)
315 | ((source & 0xff00) >> 8) );
335 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 342 {
return qbswap<T>(source); }
344 {
return qbswap<T>(source); }
346 { qToUnaligned<T>(src, dest); }
348 { qbswap<T>(src, dest); }
349 #else // Q_LITTLE_ENDIAN 352 {
return qbswap<T>(source); }
354 {
return qbswap<T>(source); }
360 { qbswap<T>(src, dest); }
362 { qToUnaligned<T>(src, dest); }
364 #endif // Q_BYTE_ORDER == Q_BIG_ENDIAN quint64 qFromLittleEndian< quint64 >(const uchar *src)
#define QT_END_NAMESPACE
This macro expands to.
quint64 qbswap< quint64 >(quint64 source)
void qbswap(const T src, uchar *dest)
quint16 qFromLittleEndian< quint16 >(const uchar *src)
T qFromBigEndian(const uchar *src)
qint16 qbswap< qint16 >(qint16 source)
quint32 qFromBigEndian< quint32 >(const uchar *src)
qint64 qFromLittleEndian< qint64 >(const uchar *src)
qint64 qbswap< qint64 >(qint64 source)
#define QT_BEGIN_NAMESPACE
This macro expands to.
void qToUnaligned(const T src, uchar *dest)
quint32 qFromLittleEndian< quint32 >(const uchar *src)
qint16 qFromBigEndian< qint16 >(const uchar *src)
qint32 qFromLittleEndian< qint32 >(const uchar *src)
quint8 qbswap< quint8 >(quint8 source)
qint32 qFromBigEndian< qint32 >(const uchar *src)
quint16 qFromBigEndian< quint16 >(const uchar *src)
void * qMemCopy(void *dest, const void *src, size_t n)
quint64 qFromBigEndian< quint64 >(const uchar *src)
qint64 qFromBigEndian< qint64 >(const uchar *src)
qint32 qbswap< qint32 >(qint32 source)
void qbswap_helper(const uchar *src, uchar *dest, int size)
qint16 qFromLittleEndian< qint16 >(const uchar *src)
quint32 qbswap< quint32 >(quint32 source)
quint16 qbswap< quint16 >(quint16 source)
T qToLittleEndian(T source)
T qFromLittleEndian(const uchar *src)