upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/root_signature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/root_signature.cpp')
-rw-r--r--runtime/src/root_signature.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/src/root_signature.cpp b/runtime/src/root_signature.cpp
index eda380198..4892ecb8c 100644
--- a/runtime/src/root_signature.cpp
+++ b/runtime/src/root_signature.cpp
@@ -1,6 +1,8 @@
1// Portable root-signature packer, see root_signature.h. 1// Portable root-signature packer, see root_signature.h.
2#include "root_signature.h" 2#include "root_signature.h"
3 3
4#include <cstring>
5
4namespace rt::rootsig { 6namespace rt::rootsig {
5 7
6PackResult pack(const RootSignature& sig) { 8PackResult pack(const RootSignature& sig) {
@@ -54,7 +56,7 @@ void put_u32(std::vector<uint8_t>& out, uint32_t v) {
54void put_f32(std::vector<uint8_t>& out, float v) { 56void put_f32(std::vector<uint8_t>& out, float v) {
55 uint32_t bits = 0; 57 uint32_t bits = 0;
56 static_assert(sizeof(bits) == sizeof(v)); 58 static_assert(sizeof(bits) == sizeof(v));
57 __builtin_memcpy(&bits, &v, sizeof(bits)); 59 std::memcpy(&bits, &v, sizeof(bits));
58 put_u32(out, bits); 60 put_u32(out, bits);
59} 61}
60 62
@@ -75,7 +77,7 @@ public:
75 [[nodiscard]] bool f32(float& v) { 77 [[nodiscard]] bool f32(float& v) {
76 uint32_t bits = 0; 78 uint32_t bits = 0;
77 if (!u32(bits)) return false; 79 if (!u32(bits)) return false;
78 __builtin_memcpy(&v, &bits, sizeof(v)); 80 std::memcpy(&v, &bits, sizeof(v));
79 return true; 81 return true;
80 } 82 }
81 83