Manual merged #43 Mac OS Compilation fixes

This commit is contained in:
BenDroid 2018-02-21 23:17:11 +01:00
parent 97df127e81
commit 9e37fa98fd
7 changed files with 10 additions and 7 deletions

View file

@ -28,7 +28,7 @@
#include "Cpu.h"
#include "CpuImpl.h"
void CpuImpl::init()
{

View file

@ -59,7 +59,7 @@ void CpuImpl::setAffinity(int id, uint64_t mask)
cpu_set_t set;
CPU_ZERO(&set);
for (int i = 0; i < threads(); i++) {
for (size_t i = 0; i < threads(); i++) {
if (mask & (1UL << i)) {
CPU_SET(i, &set);
}

View file

@ -47,7 +47,7 @@ bool Mem::allocate(const Options* options)
m_memorySize = 0;
size_t scratchPadSize = m_algo == Options::ALGO_CRYPTONIGHT ? MEMORY : MEMORY_LITE;
for (int i=0; i < m_threads; i++) {
for (size_t i=0; i < m_threads; i++) {
m_memorySize += sizeof(cryptonight_ctx);
m_memorySize += scratchPadSize * getThreadHashFactor(i);
}

View file

@ -104,7 +104,7 @@ static void print_threads()
threads.append(std::to_string(id));
};
for (int i=0; i < Options::i()->threads(); i++) {
for (size_t i=0; i < Options::i()->threads(); i++) {
if (Mem::getThreadHashFactor(i) > 1) {
addThread(multiThreads, i);
}

View file

@ -33,6 +33,7 @@
#include <thread>
#else
#include <sys/wait.h>
#include <errno.h>
#endif
int main(int argc, char **argv) {

View file

@ -68,7 +68,7 @@
# endif
#include <string>
#else
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__APPLE__)
#include <string>
#else
#include <string.h>