Verified Commit e295ae2c authored by Guilherme Amadio's avatar Guilherme Amadio
Browse files

Fix warning about null pointer being passed to memcpy

I'd use std::copy_n(), but that's a host-only function
and the function being fixed is host/device, so I replace
memcpy() with a simple for loop.
parent 8d0c478c
Pipeline #1797736 passed with stage
in 8 minutes and 2 seconds
......@@ -237,10 +237,10 @@ public:
void Set(const Precision *trans, const Precision *rot, bool has_trans, bool has_rot)
constexpr size_t kN3 = 3 * sizeof(Precision);
constexpr size_t kN9 = 9 * sizeof(Precision);
memcpy(fTranslation, trans, kN3);
memcpy(fRotation, rot, kN9);
for (auto &x : fTranslation)
x = *trans++;
for (auto &r : fRotation)
r = *rot++;
fHasTranslation = has_trans;
fHasRotation = has_rot;
fIdentity = !fHasTranslation && !fHasRotation;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment