Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NBTTag& TagFloat::read(std::istream& stream) {
- static_assert(
- sizeof(int32_t)==sizeof(float),
- "Sizes of types are not appropriate!"
- );
- union {
- int32_t tmp;
- float flt;
- };
- stream.read(
- reinterpret_cast<char *>(&tmp),
- sizeof(int32_t)
- );
- tmp=be32toh(tmp);
- payload=flt;
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement