Guest User

Untitled

a guest
Dec 5th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. QDataStream &QDataStream::operator>>(float &f)
  2. {
  3. if (version() >= QDataStream::Qt_4_6
  4. && floatingPointPrecision() == QDataStream::DoublePrecision) {
  5. double d;
  6. *this >> d;
  7. f = d;
  8. return *this;
  9. }
  10. f = 0.0f;
  11. CHECK_STREAM_PRECOND(*this)
  12. if (dev->read((char *)&f, 4) != 4) {
  13. f = 0.0f;
  14. setStatus(ReadPastEnd);
  15. } else {
  16. if (!noswap) {
  17. union {
  18. float val1;
  19. quint32 val2;
  20. } x;
  21. x.val2 = qbswap(*reinterpret_cast<quint32 *>(&f));
  22. f = x.val1;
  23. }
  24. }
  25. return *this;
  26. }
Add Comment
Please, Sign In to add comment