diff --git a/src/base/tools/Alignment.h b/src/base/tools/Alignment.h index 00316af9..7afe8726 100644 --- a/src/base/tools/Alignment.h +++ b/src/base/tools/Alignment.h @@ -30,7 +30,7 @@ namespace xmrig { template inline T readUnaligned(const T* ptr) { - static_assert(std::is_integral::value, "Integer type required"); + static_assert(std::is_trivially_copyable::value, "T must be trivially copyable"); T result; memcpy(&result, ptr, sizeof(T)); @@ -41,7 +41,7 @@ inline T readUnaligned(const T* ptr) template inline void writeUnaligned(T* ptr, T data) { - static_assert(std::is_integral::value, "Integer type required"); + static_assert(std::is_trivially_copyable::value, "T must be trivially copyable"); memcpy(ptr, &data, sizeof(T)); } diff --git a/src/crypto/randomx/jit_compiler_fallback.cpp b/src/crypto/randomx/jit_compiler_fallback.cpp index 369458a4..f29d644e 100644 --- a/src/crypto/randomx/jit_compiler_fallback.cpp +++ b/src/crypto/randomx/jit_compiler_fallback.cpp @@ -28,13 +28,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#pragma once - void randomx_set_huge_pages_jit(bool) { } + void randomx_set_optimized_dataset_init(int) { } diff --git a/src/hw/dmi/DmiTools.h b/src/hw/dmi/DmiTools.h index 65a1dfd7..cfaf23a0 100644 --- a/src/hw/dmi/DmiTools.h +++ b/src/hw/dmi/DmiTools.h @@ -24,6 +24,7 @@ #include #include +#include "base/tools/Alignment.h" namespace xmrig { @@ -45,10 +46,10 @@ struct u64 { template -inline T dmi_get(const uint8_t *data) { return *reinterpret_cast(data); } +inline T dmi_get(const uint8_t *data) { return readUnaligned(reinterpret_cast(data)); } template -inline T dmi_get(const dmi_header *h, size_t offset) { return *reinterpret_cast(h->data + offset); } +inline T dmi_get(const dmi_header *h, size_t offset) { return readUnaligned(reinterpret_cast(h->data + offset)); } const char *dmi_string(dmi_header *dm, size_t offset);