From 85946b0c4084943176945e931fcfd704607d3490 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 31 Aug 2018 23:55:50 +0300 Subject: [PATCH] Fixed numeric variant 2 in config file. --- src/common/crypto/Algorithm.cpp | 21 ++++++++++++++++----- src/common/crypto/Algorithm.h | 5 +++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/common/crypto/Algorithm.cpp b/src/common/crypto/Algorithm.cpp index 05c890dc..a3cf48b2 100644 --- a/src/common/crypto/Algorithm.cpp +++ b/src/common/crypto/Algorithm.cpp @@ -6,6 +6,7 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 Lee Clagett + * Copyright 2018 SChernykh * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify @@ -176,11 +177,21 @@ void xmrig::Algorithm::parseVariant(const char *variant) void xmrig::Algorithm::parseVariant(int variant) { - if (variant >= VARIANT_AUTO && variant < VARIANT_MAX) { - m_variant = static_cast(variant); - } - else { - assert(false); + assert(variant >= -1 && variant <= 2); + + switch (variant) { + case -1: + case 0: + case 1: + m_variant = static_cast(variant); + break; + + case 2: + m_variant = VARIANT_2; + break; + + default: + break; } } diff --git a/src/common/crypto/Algorithm.h b/src/common/crypto/Algorithm.h index bcf029d8..731fa793 100644 --- a/src/common/crypto/Algorithm.h +++ b/src/common/crypto/Algorithm.h @@ -6,6 +6,7 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 Lee Clagett + * Copyright 2018 SChernykh * Copyright 2016-2018 XMRig , * * This program is free software: you can redistribute it and/or modify @@ -22,8 +23,8 @@ * along with this program. If not, see . */ -#ifndef __ALGORITHM_H__ -#define __ALGORITHM_H__ +#ifndef XMRIG_ALGORITHM_H +#define XMRIG_ALGORITHM_H #include