We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ex.
miniply.cpp:430:58: runtime error: load of misaligned address 0xfffeb2a4881c for type 'const double', which requires 8 byte alignment 0xfffeb2a4881c: note: pointer points here af 99 7e 00 48 e1 7a 14 ae 07 43 c0 00 00 00 00 00 00 13 c0 a4 70 3d 0a d7 a3 f8 bf a7 92 77 00 ^
Most likely
template <class T> static void copy_and_convert_to(T* dest, const uint8_t* src, PLYPropertyType srcType) { switch (srcType) { case PLYPropertyType::Char: *dest = static_cast<T>(*reinterpret_cast<const int8_t*>(src)); break; case PLYPropertyType::UChar: *dest = static_cast<T>(*reinterpret_cast<const uint8_t*>(src)); break; case PLYPropertyType::Short: *dest = static_cast<T>(*reinterpret_cast<const int16_t*>(src)); break; case PLYPropertyType::UShort: *dest = static_cast<T>(*reinterpret_cast<const uint16_t*>(src)); break; case PLYPropertyType::Int: *dest = static_cast<T>(*reinterpret_cast<const int*>(src)); break; case PLYPropertyType::UInt: *dest = static_cast<T>(*reinterpret_cast<const uint32_t*>(src)); break; case PLYPropertyType::Float: *dest = static_cast<T>(*reinterpret_cast<const float*>(src)); break; case PLYPropertyType::Double: *dest = static_cast<T>(*reinterpret_cast<const double*>(src)); break; case PLYPropertyType::None: break; } }
should be using std::bit_cast if C++20 or memcpy before as as it stands, there are platforms on which
case PLYPropertyType::Double: *dest = static_cast<T>(*reinterpret_cast<const double*>(src)); break;
will fault.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ex.
Most likely
should be using std::bit_cast if C++20 or memcpy before as as it stands, there are platforms on which
will fault.
The text was updated successfully, but these errors were encountered: