mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-10 02:41:47 +00:00
Replaced reinterpret cast with memcpy in GenericFeaturesPNextNode.
This commit is contained in:
parent
f5f9b54f38
commit
ad394dce69
@ -36,8 +36,9 @@ namespace vkb {
|
||||
|
||||
namespace detail {
|
||||
|
||||
GenericFeaturesPNextNode::GenericFeaturesPNextNode()
|
||||
: fields() {} // zero initializes the array of fields
|
||||
GenericFeaturesPNextNode::GenericFeaturesPNextNode() {
|
||||
memset(this, UINT8_MAX, sizeof(GenericFeaturesPNextNode));
|
||||
}
|
||||
|
||||
bool GenericFeaturesPNextNode::match(
|
||||
GenericFeaturesPNextNode const& requested, GenericFeaturesPNextNode const& supported) noexcept {
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include <vector>
|
||||
#include <system_error>
|
||||
@ -122,7 +123,8 @@ struct GenericFeaturesPNextNode {
|
||||
GenericFeaturesPNextNode();
|
||||
|
||||
template <typename T> GenericFeaturesPNextNode(T const& features) noexcept {
|
||||
*reinterpret_cast<T*>(this) = features;
|
||||
memset(this, UINT8_MAX, sizeof(GenericFeaturesPNextNode));
|
||||
memcpy(this, &features, sizeof(T));
|
||||
}
|
||||
|
||||
static bool match(GenericFeaturesPNextNode const& requested, GenericFeaturesPNextNode const& supported) noexcept;
|
||||
|
Loading…
Reference in New Issue
Block a user