32#ifndef _QORE_BITOPTS_H
34#define _QORE_BITOPTS_H
39static inline int i4LSB(
int i);
40static inline short i2LSB(
short i);
43static inline int LSBi4(
int i);
44static inline short LSBi2(
short i);
55 DLLLOCAL
void swap(
char *ibuf) {
69 char *ibuf = (
char *)&i;
76static inline double swapf8(
double f) {
77 char *ibuf = (
char *)&f;
89 DLLLOCAL
void swap(
char *ibuf) {
98static inline int swapi4(
int i) {
99 char *ibuf = (
char *)&i;
106static inline float swapf4(
float f) {
107 char *ibuf = (
char *)&f;
118 DLLLOCAL
void swap(
char *ibuf) {
125static inline short swapi2(
short i) {
126 char *ibuf = (
char *)&i;
132#ifdef WORDS_BIGENDIAN
137static inline int i4LSB(
int i) {
141static inline short i2LSB(
short i) {
149static inline int LSBi4(
int i) {
153static inline short LSBi2(
short i) {
157static inline int64 i8MSB(
int64 i) {
return i; }
158static inline int64 MSBi8(
int64 i) {
return i; }
160static inline double f8LSB(
double f) {
164static inline float f4LSB(
float f) {
168static inline double LSBf8(
double f) {
172static inline float LSBf4(
float f) {
176static inline double f8MSB(
double f) {
return f; }
177static inline double MSBf8(
double f) {
return f; }
178static inline float f4MSB(
float f) {
return f; }
179static inline float MSBf4(
float f) {
return f; }
183static inline int64 i8LSB(
int64 i) {
return i; }
184static inline int i4LSB(
int i) {
return i; }
185static inline short i2LSB(
short i) {
return i; }
187static inline int64 LSBi8(
int64 i) {
return i; }
188static inline int LSBi4(
int i) {
return i; }
189static inline short LSBi2(
short i) {
return i; }
199static inline double f8LSB(
double f) {
return f; }
200static inline float f4LSB(
float f) {
return f; }
202static inline double LSBf8(
double f) {
return f; }
203static inline float LSBf4(
float f) {
return f; }
205static inline double f8MSB(
double f) {
209static inline double MSBf8(
double f) {
213static inline float f4MSB(
float f) {
217static inline float MSBf4(
float f) {
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:260
used to swap 2-byte integers
Definition: qore_bitopts.h:114
used to swap byte order of 4-byte values
Definition: qore_bitopts.h:84
used to swap byte order of 8-byte values
Definition: qore_bitopts.h:50