MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / reinterpret_data

Function reinterpret_data

src/mod_symbols.cpp:106–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105template <typename T>
106const T* reinterpret_data(std::span<const char> data, size_t& offset, size_t count = 1) {
107 if (offset + (sizeof(T) * count) > data.size()) {
108 return nullptr;
109 }
110
111 size_t original_offset = offset;
112 offset += sizeof(T) * count;
113 return reinterpret_cast<const T*>(data.data() + original_offset);
114}
115
116bool check_magic(const FileHeader* header) {
117 static const char good_magic[] = {'N','6','4','R','S','Y','M','S'};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected