mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 10:45:06 +00:00
Added short aliases for algorithm names: cn, cn-lite and cn-heavy.
This commit is contained in:
parent
89c095f79e
commit
bb2faaddc0
2 changed files with 20 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
# v2.6.0-beta2
|
# v2.6.0-beta2
|
||||||
- [#499](https://github.com/xmrig/xmrig/issues/499) IPv6 disabled for internal HTTP API by default, was cause issues on some systems.
|
- [#499](https://github.com/xmrig/xmrig/issues/499) IPv6 disabled for internal HTTP API by default, was cause issues on some systems.
|
||||||
|
- Added short aliases for algorithm names: `cn`, `cn-lite` and `cn-heavy`.
|
||||||
- Fixed regressions (v2.6.0-beta1 affected)
|
- Fixed regressions (v2.6.0-beta1 affected)
|
||||||
- [#494](https://github.com/xmrig/xmrig/issues/494) Command line option `--donate-level` was broken.
|
- [#494](https://github.com/xmrig/xmrig/issues/494) Command line option `--donate-level` was broken.
|
||||||
- [#502](https://github.com/xmrig/xmrig/issues/502) Build without libmicrohttpd was broken.
|
- [#502](https://github.com/xmrig/xmrig/issues/502) Build without libmicrohttpd was broken.
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -45,6 +46,13 @@ static const char *algoNames[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const char *algoNamesShort[] = {
|
||||||
|
"cn",
|
||||||
|
"cn-lite",
|
||||||
|
"cn-heavy"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(strcasecmp)
|
#if defined(_WIN32) && !defined(strcasecmp)
|
||||||
# define strcasecmp _stricmp
|
# define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
@ -375,12 +383,21 @@ void xmrig::CommonConfig::setAlgo(const char *algo)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t size = sizeof(algoNames) / sizeof((algoNames)[0]);
|
const size_t size = sizeof(algoNames) / sizeof(algoNames[0]);
|
||||||
|
|
||||||
|
assert(size == (sizeof(algoNamesShort) / sizeof(algoNamesShort[0])));
|
||||||
|
|
||||||
for (size_t i = 0; i < size; i++) {
|
for (size_t i = 0; i < size; i++) {
|
||||||
if (algoNames[i] && strcasecmp(algo, algoNames[i]) == 0) {
|
if (algoNames[i] && strcasecmp(algo, algoNames[i]) == 0) {
|
||||||
m_algorithm = static_cast<Algo>(i);
|
m_algorithm = static_cast<Algo>(i);
|
||||||
break;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < size; i++) {
|
||||||
|
if (algoNamesShort[i] && strcasecmp(algo, algoNamesShort[i]) == 0) {
|
||||||
|
m_algorithm = static_cast<xmrig::Algo>(i);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue