From e6900195f520f3d0c8ae6f7ef7edbfbf0b525281 Mon Sep 17 00:00:00 2001 From: BenDroid Date: Thu, 15 Mar 2018 21:44:21 +0100 Subject: [PATCH] Removed align.h macro --- src/3rdparty/align.h | 33 --------------------------------- src/Mem.h | 3 +-- src/crypto/CryptoNight.h | 5 ++--- src/net/Job.h | 3 +-- src/workers/MultiWorker.h | 1 - 5 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 src/3rdparty/align.h diff --git a/src/3rdparty/align.h b/src/3rdparty/align.h deleted file mode 100644 index b61179b9..00000000 --- a/src/3rdparty/align.h +++ /dev/null @@ -1,33 +0,0 @@ -/* XMRig - * Copyright 2010 Jeff Garzik - * Copyright 2012-2014 pooler - * Copyright 2014 Lucas Jones - * Copyright 2014-2016 Wolf9466 - * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef __ALIGN_H__ -#define __ALIGN_H__ - -#ifdef _MSC_VER -# define VAR_ALIGN(x, decl) __declspec(align(x)) decl -#else -# define VAR_ALIGN(x, decl) decl __attribute__ ((aligned(x))) -#endif - -#endif /* __ALIGN_H__ */ diff --git a/src/Mem.h b/src/Mem.h index ee19ebb7..5334f72a 100644 --- a/src/Mem.h +++ b/src/Mem.h @@ -31,7 +31,6 @@ #include #include -#include "align.h" #include "Options.h" struct cryptonight_ctx; @@ -69,7 +68,7 @@ private: static int m_flags; static ThreadBitSet m_multiHashThreadMask; static size_t m_memorySize; - VAR_ALIGN(16, static uint8_t *m_memory); + alignas(16) static uint8_t *m_memory; }; diff --git a/src/crypto/CryptoNight.h b/src/crypto/CryptoNight.h index faef076c..dc6b397b 100644 --- a/src/crypto/CryptoNight.h +++ b/src/crypto/CryptoNight.h @@ -28,15 +28,14 @@ #include #include -#include "align.h" #include "Options.h" #define MEMORY 2097152 /* 2 MiB */ #define MEMORY_LITE 1048576 /* 1 MiB */ struct cryptonight_ctx { - VAR_ALIGN(16, uint8_t state[MAX_NUM_HASH_BLOCKS][208]); // 208 instead of 200 to maintain aligned to 16 byte boundaries - VAR_ALIGN(16, uint8_t* memory); + alignas(16) uint8_t state[MAX_NUM_HASH_BLOCKS][208]; // 208 instead of 200 to maintain aligned to 16 byte boundaries + alignas(16) uint8_t* memory; }; diff --git a/src/net/Job.h b/src/net/Job.h index bf8f8835..4763a7c2 100644 --- a/src/net/Job.h +++ b/src/net/Job.h @@ -29,7 +29,6 @@ #include -#include "align.h" #include "net/JobId.h" @@ -70,7 +69,7 @@ public: bool operator==(const Job &other) const; private: - VAR_ALIGN(16, uint8_t m_blob[84]); // Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk. + alignas(16) uint8_t m_blob[84]; // Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk. bool m_nicehash; int m_poolId; diff --git a/src/workers/MultiWorker.h b/src/workers/MultiWorker.h index 46e1ea73..33f5a062 100644 --- a/src/workers/MultiWorker.h +++ b/src/workers/MultiWorker.h @@ -26,7 +26,6 @@ #define __MULTIWORKER_H__ -#include "align.h" #include "net/Job.h" #include "net/JobResult.h" #include "workers/Worker.h"