Go to the documentation of this file.Go to the SVN repository for this file.
1 #ifndef CORELIB___NCBI_BSWAP__HPP
2 #define CORELIB___NCBI_BSWAP__HPP
76 static float GetFloat(
const unsigned char* ptr);
78 static double GetDouble(
const unsigned char* ptr);
98 #ifdef WORDS_BIGENDIAN
110 #ifdef WORDS_BIGENDIAN
111 ptr[1] = (
unsigned char)(
value >> 8);
112 ptr[0] = (
unsigned char)(
value);
114 ptr[0] = (
unsigned char)(
value >> 8);
115 ptr[1] = (
unsigned char)(
value);
123 #ifdef WORDS_BIGENDIAN
125 (
Int4(ptr[2]) << 16) |
126 (
Int4(ptr[1]) << 8) |
130 (
Int4(ptr[1]) << 16) |
131 (
Int4(ptr[2]) << 8) |
140 #ifdef WORDS_BIGENDIAN
141 ptr[3] = (
unsigned char)(
value >> 24);
142 ptr[2] = (
unsigned char)(
value >> 16);
143 ptr[1] = (
unsigned char)(
value >> 8);
144 ptr[0] = (
unsigned char)(
value);
146 ptr[0] = (
unsigned char)(
value >> 24);
147 ptr[1] = (
unsigned char)(
value >> 16);
148 ptr[2] = (
unsigned char)(
value >> 8);
149 ptr[3] = (
unsigned char)(
value);
156 #ifdef WORDS_BIGENDIAN
158 (
Int8(ptr[6]) << 48) |
159 (
Int8(ptr[5]) << 40) |
160 (
Int8(ptr[4]) << 32) |
161 (
Int8(ptr[3]) << 24) |
162 (
Int8(ptr[2]) << 16) |
163 (
Int8(ptr[1]) << 8) |
167 (
Int8(ptr[1]) << 48) |
168 (
Int8(ptr[2]) << 40) |
169 (
Int8(ptr[3]) << 32) |
170 (
Int8(ptr[4]) << 24) |
171 (
Int8(ptr[5]) << 16) |
172 (
Int8(ptr[6]) << 8) |
182 #ifdef WORDS_BIGENDIAN
183 ptr[7] = (
unsigned char)(
value >> 56);
184 ptr[6] = (
unsigned char)(
value >> 48);
185 ptr[5] = (
unsigned char)(
value >> 40);
186 ptr[4] = (
unsigned char)(
value >> 32);
187 ptr[3] = (
unsigned char)(
value >> 24);
188 ptr[2] = (
unsigned char)(
value >> 16);
189 ptr[1] = (
unsigned char)(
value >> 8);
190 ptr[0] = (
unsigned char)(
value);
192 ptr[0] = (
unsigned char)(
value >> 56);
193 ptr[1] = (
unsigned char)(
value >> 48);
194 ptr[2] = (
unsigned char)(
value >> 40);
195 ptr[3] = (
unsigned char)(
value >> 32);
196 ptr[4] = (
unsigned char)(
value >> 24);
197 ptr[5] = (
unsigned char)(
value >> 16);
198 ptr[6] = (
unsigned char)(
value >> 8);
199 ptr[7] = (
unsigned char)(
value);
static Int8 GetInt8(const unsigned char *ptr)
static void PutFloat(unsigned char *ptr, float value)
static void PutInt2(unsigned char *ptr, Int2 value)
static double GetDouble(const unsigned char *ptr)
static Int2 GetInt2(const unsigned char *ptr)
static void PutDouble(unsigned char *ptr, double value)
static void PutInt8(unsigned char *ptr, Int8 value)
static Int4 GetInt4(const unsigned char *ptr)
static float GetFloat(const unsigned char *ptr)
static void PutInt4(unsigned char *ptr, Int4 value)
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const GenericPointer< typename T::ValueType > T2 value
The NCBI C++/STL use hints.
Defines Limits for the types used in NCBI C/C++ toolkit.