28 #ifndef CASA_LITTLEENDIANCONVERSION_H
29 #define CASA_LITTLEENDIANCONVERSION_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/OS/CanonicalConversion.h>
73 static void toLocal (
char& to,
const void* from);
74 static void toLocal (
unsigned char& to,
const void* from);
75 static void toLocal (
short& to,
const void* from);
76 static void toLocal (
unsigned short& to,
const void* from);
77 static void toLocal (
int& to,
const void* from);
78 static void toLocal (
unsigned int& to,
const void* from);
81 static void toLocal (
float& to,
const void* from);
82 static void toLocal (
double& to,
const void* from);
88 static void toLocal (
char* to,
const void* from,
90 static void toLocal (
unsigned char* to,
const void* from,
92 static void toLocal (
short* to,
const void* from,
94 static void toLocal (
unsigned short* to,
const void* from,
96 static void toLocal (
int* to,
const void* from,
98 static void toLocal (
unsigned int* to,
const void* from,
104 static void toLocal (
float* to,
const void* from,
106 static void toLocal (
double* to,
const void* from,
113 static void fromLocal (
void* to,
char from);
114 static void fromLocal (
void* to,
unsigned char from);
115 static void fromLocal (
void* to,
short from);
116 static void fromLocal (
void* to,
unsigned short from);
117 static void fromLocal (
void* to,
int from);
118 static void fromLocal (
void* to,
unsigned int from);
121 static void fromLocal (
void* to,
float from);
122 static void fromLocal (
void* to,
double from);
130 static void fromLocal (
void* to,
const unsigned char* from,
134 static void fromLocal (
void* to,
const unsigned short* from,
138 static void fromLocal (
void* to,
const unsigned int* from,
166 to = *(
unsigned char*)from;
171 if (
sizeof(
short) != 2) {
172 if (((
signed char*)from)[2] < 0) {
178 #if !defined(AIPS_LITTLE_ENDIAN)
188 if (
sizeof(
unsigned short) != 2) {
191 #if !defined(AIPS_LITTLE_ENDIAN)
200 if (
sizeof(
int) != 4) {
201 if (((
signed char*)from)[3] < 0) {
207 #if !defined(AIPS_LITTLE_ENDIAN)
217 if (
sizeof(
unsigned int) != 4) {
220 #if !defined(AIPS_LITTLE_ENDIAN)
244 #if !defined(AIPS_LITTLE_ENDIAN)
253 #if !defined(AIPS_LITTLE_ENDIAN)
267 *(
unsigned char*)to = from;
272 #if !defined(AIPS_LITTLE_ENDIAN)
281 #if !defined(AIPS_LITTLE_ENDIAN)
290 #if !defined(AIPS_LITTLE_ENDIAN)
299 #if !defined(AIPS_LITTLE_ENDIAN)
308 #if !defined(AIPS_LITTLE_ENDIAN)
317 #if !defined(AIPS_LITTLE_ENDIAN)
326 #if !defined(AIPS_LITTLE_ENDIAN)
335 #if !defined(AIPS_LITTLE_ENDIAN)
static void reverse8(void *to, const void *from)
Reverse 8 bytes.
static void move8(void *to, const void *from)
Move 8 bytes.
static void reverse4(void *to, const void *from)
Reverse 4 bytes.
static void reverse2(void *to, const void *from)
Reverse 2 bytes.
static void move2(void *to, const void *from)
Move 2 bytes.
static void move4(void *to, const void *from)
Move 4 bytes.
static void fromLocal(void *to, const short *from, size_t nr)
static void toLocal(unsigned int *to, const void *from, size_t nr)
static void fromLocal(void *to, const char *from, size_t nr)
Convert nr values from local format to littleEndian format.
static void fromLocal(void *to, const float *from, size_t nr)
static void toLocal(Int64 *to, const void *from, size_t nr)
static void fromLocal(void *to, const Int64 *from, size_t nr)
static void toLocal(unsigned char *to, const void *from, size_t nr)
static void toLocal(int *to, const void *from, size_t nr)
static void toLocal(unsigned short *to, const void *from, size_t nr)
static void toLocal(char *to, const void *from, size_t nr)
Convert nr values from littleEndian format to local format.
static void fromLocal(void *to, const double *from, size_t nr)
static void toLocal(uInt64 *to, const void *from, size_t nr)
static void fromLocal(void *to, const unsigned short *from, size_t nr)
static void fromLocal(void *to, const unsigned char *from, size_t nr)
static void toLocal(char &to, const void *from)
Convert one value from littleEndian format to local format.
static void toLocal(float *to, const void *from, size_t nr)
static void toLocal(double *to, const void *from, size_t nr)
static void fromLocal(void *to, const unsigned int *from, size_t nr)
LittleEndianConversion()
This class should not be constructed (so declare the constructor private).
static void fromLocal(void *to, const uInt64 *from, size_t nr)
static void toLocal(short *to, const void *from, size_t nr)
static void fromLocal(void *to, const int *from, size_t nr)
static void fromLocal(void *to, char from)
Convert one value from local format to littleEndian format.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
unsigned long long uInt64