src/lib/serial.c
float64_t unserial_float64(uint8_t * * const ptr)
{
    float64_t v;

    if (bigendian()) {
        memcpy(&v, *ptr, sizeof(float64_t));
    } else {
        int i;
        uint8_t rv[sizeof(float64_t)];
        uint8_t *pv = (uint8_t *) &v;

        memcpy(&v, *ptr, sizeof(float64_t));
        for (i = 0; i < 8; i++) {
            rv[i] = pv[7 - i];
        }
        memcpy(&v, &rv, sizeof(float64_t));
    }
    *ptr += sizeof(float64_t);
    return v;
}
/*  unserial_float64  --  Unserialise a 64 bit IEEE floating point number.
                         This code assumes that the host floating point
                         format is IEEE and that floating point quantities
                         are stored in IEEE format either LSB first or MSB
                         first.  More creative host formats will require
                         additional transformations here.  */
unserial_float64  --  Unserialise a 64 bit IEEE floating point number.
This code assumes that the host floating point
format is IEEE and that floating point quantities
are stored in IEEE format either LSB first or MSB
first.  More creative host formats will require
additional transformations here.
unserial_float64 -- Unserialise a 64 bit IEEE floating point number . This code assumes that the host floating point format is IEEE and that floating point quantities are stored in IEEE format either LSB first or MSB first . More creative host formats will require additional transformations here .
float64_t unserial_float64(uint8_t * * const ptr)
{
    float64_t v;
    if (bigendian()) {
        memcpy(&v, *ptr, sizeof(float64_t));
    } else {
        int i;
        uint8_t rv[sizeof(float64_t)];
        uint8_t *pv = (uint8_t *) &v;
        memcpy(&v, *ptr, sizeof(float64_t));
        for (i = 0; i < 8; i++) {
            rv[i] = pv[7 - i];
        }
        memcpy(&v, &rv, sizeof(float64_t));
    }
    *ptr += sizeof(float64_t);
    return v;
}
float64_t unserial_float64 ( uint8_t * * const ptr ) { float64_t v ; if ( bigendian ( ) ) { memcpy ( & v , * ptr , sizeof ( float64_t ) ) ; } else { int i ; uint8_t rv [ sizeof ( float64_t ) ] ; uint8_t * pv = ( uint8_t * ) & v ; memcpy ( & v , * ptr , sizeof ( float64_t ) ) ; for ( i = 0 ; i < 8 ; i ++ ) { rv [ i ] = pv [ 7 - i ] ; } memcpy ( & v , & rv , sizeof ( float64_t ) ) ; } * ptr += sizeof ( float64_t ) ; return v ; }
unserial_float64  --  Unserialise a 64 bit IEEE floating point number.
unserial_float64 -- Unserialise a 64 bit IEEE floating point number .