CesiumGS / cesium-native

Apache License 2.0
421 stars 212 forks source link

Fixed build warning - I3dmToGltfConverter.cpp:634:14: error: ‘positio… #910

Closed Ulvesson closed 3 months ago

Ulvesson commented 3 months ago

Found a compiler warning that might be problematic. See I3dmToGltfConverter.cpp:634:14: error: ‘position.glm::vec<3, double, glm::packed_highp>::x’ may be used uninitialized [-Werror=maybe-uninitialized]

copyInstanceToBuffer might return data based on uninitialized variables.

Fixed by adding a check and an error message. The error message might not be good enough but the compiler is happy.

kring commented 3 months ago

Thanks for the PR @Ulvesson! Before we can review and merge this, can I please bug you to sign our Contributor License Agreement? https://github.com/CesiumGS/cesium/blob/main/CONTRIBUTING.md#contributor-license-agreement-cla

Ulvesson commented 3 months ago

I have signed the CLA now.

timoore commented 3 months ago

This looks good to me. decompose() can return without setting the result variables... which shouldn't happen, but you never know.

Ulvesson commented 3 months ago

I am not 100% sure about the default values but I think I have fixed the code as requested.

kring commented 3 months ago

Thanks again for the PR @Ulvesson!