Fix compile warning, mostly struct/class inconsistency.

This commit is contained in:
XMRig 2019-09-13 18:21:05 +07:00
parent 66fd532ee6
commit 6f5d175d12
7 changed files with 24 additions and 18 deletions

View file

@ -52,6 +52,10 @@ if (WITH_RANDOMX)
# cheat because cmake and ccache hate each other
set_property(SOURCE src/crypto/randomx/jit_compiler_x86_static.S PROPERTY LANGUAGE C)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
set_source_files_properties(src/crypto/randomx/jit_compiler_x86.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-const-variable)
endif()
else()
remove_definitions(/DXMRIG_ALGO_RANDOMX)
endif()

View file

@ -32,7 +32,7 @@
namespace xmrig {
constexpr const size_t oneMiB = 1024u * 1024u;
//constexpr const size_t oneMiB = 1024u * 1024u;

View file

@ -123,12 +123,6 @@ static OclDevice::Type getType(const String &name)
}
static inline bool isCNv2(const Algorithm &algorithm)
{
return algorithm.family() == Algorithm::CN && CnAlgo<>::base(algorithm) == Algorithm::CN_2;
}
} // namespace xmrig

View file

@ -47,7 +47,7 @@ namespace randomx {
rx_aligned_free(ptr);
}
template class AlignedAllocator<CacheLineSize>;
template struct AlignedAllocator<CacheLineSize>;
void* LargePageAllocator::allocMemory(size_t count) {
return allocLargePagesMemory(count);

View file

@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace randomx {
class Program;
class ProgramConfiguration;
struct ProgramConfiguration;
class SuperscalarProgram;
class JitCompilerX86;
class Instruction;

View file

@ -29,8 +29,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef RANDOMX_H
#define RANDOMX_H
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <type_traits>
#include "crypto/randomx/intrin_portable.h"
@ -41,17 +41,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define RANDOMX_EXPORT
#endif
typedef enum {
enum randomx_flags {
RANDOMX_FLAG_DEFAULT = 0,
RANDOMX_FLAG_LARGE_PAGES = 1,
RANDOMX_FLAG_HARD_AES = 2,
RANDOMX_FLAG_FULL_MEM = 4,
RANDOMX_FLAG_JIT = 8,
} randomx_flags;
};
struct randomx_dataset;
struct randomx_cache;
class randomx_vm;
typedef struct randomx_dataset randomx_dataset;
typedef struct randomx_cache randomx_cache;
typedef struct randomx_vm randomx_vm;
struct RandomX_ConfigurationBase
{

View file

@ -28,10 +28,13 @@
#define XMRIG_RX_VM_H
#include <stdint.h>
#include "base/tools/Object.h"
struct randomx_vm;
#include <cstdint>
class randomx_vm;
namespace xmrig
@ -44,6 +47,8 @@ class RxDataset;
class RxVm
{
public:
XMRIG_DISABLE_COPY_MOVE_DEFAULT(RxVm);
RxVm(RxDataset *dataset, uint8_t *scratchpad, bool softAes);
~RxVm();