1#ifndef MY_BYTEORDER_INCLUDED
2#define MY_BYTEORDER_INCLUDED
41#ifdef HAVE_ARPA_INET_H
49#if defined(_WIN32) && defined(WIN32_LEAN_AND_MEAN)
66 return ((
int32)(((A[2]) & 128)
106 *(T + 1) = (
uchar)(A >> 8);
107 *(T + 2) = (
uchar)(A >> 16);
112 *(T + 1) = (
uchar)(A >> 8);
113 *(T + 2) = (
uchar)(A >> 16);
114 *(T + 3) = (
uchar)(A >> 24);
115 *(T + 4) = (
uchar)(A >> 32);
120 *(T + 1) = (
uchar)(A >> 8);
121 *(T + 2) = (
uchar)(A >> 16);
122 *(T + 3) = (
uchar)(A >> 24);
123 *(T + 4) = (
uchar)(A >> 32);
124 *(T + 5) = (
uchar)(A >> 40);
130 return sint2korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
134 return uint2korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
138 return uint3korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
142 return sint3korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
146 return uint4korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
150 return sint4korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
154 return uint6korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
158 return uint8korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
162 return sint8korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
200 return float8get(
static_cast<const uchar *
>(
static_cast<const void *
>(
M)));
213 memcpy(&val, ptr,
sizeof(val));
218 memcpy(ptr, &val,
sizeof(val));
223 memcpy(&val, ptr,
sizeof(val));
228 memcpy(ptr, &val,
sizeof(val));
233 memcpy(&val, ptr,
sizeof(val));
239 memcpy(&val, ptr,
sizeof(val));
244 memcpy(ptr, &val,
sizeof(val));
249 memcpy(&val, ptr,
sizeof(val));
257 memcpy(&val, ptr,
sizeof(val));
263 memcpy(&val, ptr,
sizeof(val));
268 memcpy(ptr, &val,
sizeof(val));
280 memcpy(&val, ptr,
sizeof(val));
286 memcpy(&val, ptr,
sizeof(val));
293 val = _byteswap_ushort(val);
297 memcpy(ptr, &val,
sizeof(val));
298 return ptr +
sizeof(val);
303 memcpy(ptr, &val,
sizeof(val));
304 return ptr +
sizeof(val);
310 return load16be(pointer_cast<const char *>(ptr));
314 return load32be(pointer_cast<const char *>(ptr));
318 return pointer_cast<uchar *>(
store16be(pointer_cast<char *>(ptr), val));
322 return pointer_cast<uchar *>(
store32be(pointer_cast<char *>(ptr), val));
Endianness-independent definitions (little_endian.h contains optimized versions if you know you are o...
#define M
Definition: ctype-tis620.cc:74
Data in little-endian format.
static int32 sint3korr(const uchar *A)
Definition: my_byteorder.h:65
ALWAYS_INLINE char * store16be(char *ptr, uint16 val)
Definition: my_byteorder.h:290
void float8store(char *V, double M)
Definition: my_byteorder.h:203
double float8get(const char *M)
Definition: my_byteorder.h:199
double doubleget(const uchar *ptr)
Definition: my_byteorder.h:221
void longlongstore(uchar *ptr, longlong val)
Definition: my_byteorder.h:267
void float4store(char *V, float M)
Definition: my_byteorder.h:195
float floatget(const uchar *ptr)
Definition: my_byteorder.h:211
int32 longget(const uchar *ptr)
Definition: my_byteorder.h:247
longlong longlongget(const uchar *ptr)
Definition: my_byteorder.h:261
void shortstore(uchar *ptr, int16 val)
Definition: my_byteorder.h:243
static void int6store(uchar *T, ulonglong A)
Definition: my_byteorder.h:118
void int4store(char *pT, uint32 A)
Definition: my_byteorder.h:173
int16 sint2korr(const char *pT)
Definition: my_byteorder.h:129
uint16 load16be(const char *ptr)
Definition: my_byteorder.h:278
int16 shortget(const uchar *ptr)
Definition: my_byteorder.h:237
ulonglong uint8korr(const char *pT)
Definition: my_byteorder.h:157
static ulonglong uint6korr(const uchar *A)
Definition: my_byteorder.h:84
static void int5store(uchar *T, ulonglong A)
Definition: my_byteorder.h:110
static void int3store(uchar *T, uint A)
int3store
Definition: my_byteorder.h:104
void int8store(char *pT, ulonglong A)
Definition: my_byteorder.h:185
char * store32be(char *ptr, uint32 val)
Definition: my_byteorder.h:301
static uint32 uint3korr(const uchar *A)
Definition: my_byteorder.h:73
uint32 uint4korr(const char *pT)
Definition: my_byteorder.h:145
int32 sint4korr(const char *pT)
Definition: my_byteorder.h:149
uint16 uint2korr(const char *pT)
Definition: my_byteorder.h:133
void longstore(uchar *ptr, int32 val)
Definition: my_byteorder.h:253
longlong sint8korr(const char *pT)
Definition: my_byteorder.h:161
uint16 ushortget(const uchar *ptr)
Definition: my_byteorder.h:231
static ulonglong uint5korr(const uchar *A)
Definition: my_byteorder.h:78
void floatstore(uchar *ptr, float val)
Definition: my_byteorder.h:217
uint32 ulongget(const uchar *ptr)
Definition: my_byteorder.h:255
uint32 load32be(const char *ptr)
Definition: my_byteorder.h:284
void int2store(char *pT, uint16 A)
Definition: my_byteorder.h:165
void doublestore(uchar *ptr, double val)
Definition: my_byteorder.h:227
Header for compiler-dependent features.
#define ALWAYS_INLINE
Definition: my_compiler.h:110
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
int16_t int16
Definition: my_inttypes.h:64
int32_t int32
Definition: my_inttypes.h:66
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
unsigned int uint
Definition: uca9-dump.cc:75