Show More
@@ -196,4 +196,17 b' static inline void putbe32(uint32_t x, c' | |||
|
196 | 196 | c[3] = (x) & 0xff; |
|
197 | 197 | } |
|
198 | 198 | |
|
199 | static inline double getbefloat64(const char *c) | |
|
200 | { | |
|
201 | const unsigned char *d = (const unsigned char *)c; | |
|
202 | double ret; | |
|
203 | int i; | |
|
204 | uint64_t t = 0; | |
|
205 | for (i = 0; i < 8; i++) { | |
|
206 | t = (t<<8) + d[i]; | |
|
207 | } | |
|
208 | memcpy(&ret, &t, sizeof(t)); | |
|
209 | return ret; | |
|
210 | } | |
|
211 | ||
|
199 | 212 | #endif /* _HG_UTIL_H_ */ |
General Comments 0
You need to be logged in to leave comments.
Login now