PostGIS  2.1.10dev-r@@SVN_REVISION@@
static double read_float64 ( const uint8_t **  from,
uint8_t  littleEndian 
)
static

Definition at line 7342 of file rt_api.c.

Referenced by rt_band_from_wkb(), rt_raster_deserialize(), and rt_raster_from_wkb().

7342  {
7343 
7344  union {
7345  double d;
7346  uint64_t i;
7347  } ret;
7348 
7349  assert(NULL != from);
7350 
7351  if (littleEndian) {
7352  ret.i = (uint64_t) ((*from)[0] & 0xff) |
7353  (uint64_t) ((*from)[1] & 0xff) << 8 |
7354  (uint64_t) ((*from)[2] & 0xff) << 16 |
7355  (uint64_t) ((*from)[3] & 0xff) << 24 |
7356  (uint64_t) ((*from)[4] & 0xff) << 32 |
7357  (uint64_t) ((*from)[5] & 0xff) << 40 |
7358  (uint64_t) ((*from)[6] & 0xff) << 48 |
7359  (uint64_t) ((*from)[7] & 0xff) << 56;
7360  } else {
7361  /* big endian */
7362  ret.i = (uint64_t) ((*from)[7] & 0xff) |
7363  (uint64_t) ((*from)[6] & 0xff) << 8 |
7364  (uint64_t) ((*from)[5] & 0xff) << 16 |
7365  (uint64_t) ((*from)[4] & 0xff) << 24 |
7366  (uint64_t) ((*from)[3] & 0xff) << 32 |
7367  (uint64_t) ((*from)[2] & 0xff) << 40 |
7368  (uint64_t) ((*from)[1] & 0xff) << 48 |
7369  (uint64_t) ((*from)[0] & 0xff) << 56;
7370  }
7371 
7372  *from += 8;
7373  return ret.d;
7374 }

Here is the caller graph for this function: