mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-22 15:24:34 +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 {
|
namespace detail {
|
||||||
|
|
||||||
GenericFeaturesPNextNode::GenericFeaturesPNextNode()
|
GenericFeaturesPNextNode::GenericFeaturesPNextNode() {
|
||||||
: fields() {} // zero initializes the array of fields
|
memset(this, UINT8_MAX, sizeof(GenericFeaturesPNextNode));
|
||||||
|
}
|
||||||
|
|
||||||
bool GenericFeaturesPNextNode::match(
|
bool GenericFeaturesPNextNode::match(
|
||||||
GenericFeaturesPNextNode const& requested, GenericFeaturesPNextNode const& supported) noexcept {
|
GenericFeaturesPNextNode const& requested, GenericFeaturesPNextNode const& supported) noexcept {
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
@ -122,7 +123,8 @@ struct GenericFeaturesPNextNode {
|
|||||||
GenericFeaturesPNextNode();
|
GenericFeaturesPNextNode();
|
||||||
|
|
||||||
template <typename T> GenericFeaturesPNextNode(T const& features) noexcept {
|
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;
|
static bool match(GenericFeaturesPNextNode const& requested, GenericFeaturesPNextNode const& supported) noexcept;
|
||||||
|
Loading…
Reference in New Issue
Block a user