Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
282 B

  1. #include "scan.h"
  2. #include "compiletimeassert.h"
  3. size_t scan_pb_type1_double(const char* in,size_t len,double* d) {
  4. union {
  5. double d;
  6. uint64_t u;
  7. } u;
  8. compiletimeassert(sizeof(double)==8);
  9. size_t n=scan_pb_type1_fixed64(in,len,&u.u);
  10. if (n) *d=u.d;
  11. return n;
  12. }