Skip to content

Commit

Permalink
Fixing type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xcthulhu committed Mar 9, 2015
1 parent 8a23474 commit 9bb97f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
author = "Matthew Wampler-Doty",
author_email = "[email protected]",
license = 'GPL',
version = '20.8',
version = '20.9',
url = 'https://github.com/ethereum/ethash',
download_url = 'https://github.com/ethereum/ethash/tarball/v20.8',
download_url = 'https://github.com/ethereum/ethash/tarball/v20.9',
description = 'Python wrappers for ethash, the ethereum proof of work hashing function',
ext_modules = [pyethash],
)
16 changes: 8 additions & 8 deletions src/python/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#include <libethash/ethash.h>
#include "../libethash/ethash.h"
#define MIX_WORDS (MIX_BYTES/4)

static PyObject*
Expand Down Expand Up @@ -66,15 +66,15 @@ calc_dataset_bytes(PyObject* self, PyObject* args)
if (full_size % MIX_WORDS != 0)
{
char error_message[1024];
sprintf(error_message, "The size of data set must be a multiple of %lu bytes (was %i)", MIX_WORDS, full_size);
sprintf(error_message, "The size of data set must be a multiple of %i bytes (was %lu)", MIX_WORDS, full_size);
PyErr_SetString(PyExc_ValueError, error_message);
return 0;
}

if (cache_size % HASH_BYTES != 0)
{
char error_message[1024];
sprintf(error_message, "The size of the cache must be a multiple of %lu bytes (was %i)", HASH_BYTES, cache_size);
sprintf(error_message, "The size of the cache must be a multiple of %i bytes (was %i)", HASH_BYTES, cache_size);
PyErr_SetString(PyExc_ValueError, error_message);
return 0;
}
Expand Down Expand Up @@ -104,15 +104,15 @@ hashimoto_light(PyObject* self, PyObject* args)
if (full_size % MIX_WORDS != 0)
{
char error_message[1024];
sprintf(error_message, "The size of data set must be a multiple of %lu bytes (was %i)", MIX_WORDS, full_size);
sprintf(error_message, "The size of data set must be a multiple of %i bytes (was %lu)", MIX_WORDS, full_size);
PyErr_SetString(PyExc_ValueError, error_message);
return 0;
}

if (cache_size % HASH_BYTES != 0)
{
char error_message[1024];
sprintf(error_message, "The size of the cache must be a multiple of %lu bytes (was %i)", HASH_BYTES);
sprintf(error_message, "The size of the cache must be a multiple of %i bytes (was %i)", HASH_BYTES, cache_size);
PyErr_SetString(PyExc_ValueError, error_message);
return 0;
}
Expand Down Expand Up @@ -152,7 +152,7 @@ hashimoto_full(PyObject* self, PyObject* args)
if (full_size % MIX_WORDS != 0)
{
char error_message[1024];
sprintf(error_message, "The size of data set must be a multiple of %lu bytes (was %i)", MIX_WORDS, full_size);
sprintf(error_message, "The size of data set must be a multiple of %i bytes (was %i)", MIX_WORDS, full_size);
PyErr_SetString(PyExc_ValueError, error_message);
return 0;
}
Expand Down Expand Up @@ -190,7 +190,7 @@ mine(PyObject* self, PyObject* args)
if (full_size % MIX_WORDS != 0)
{
char error_message[1024];
sprintf(error_message, "The size of data set must be a multiple of %lu bytes (was %i)", MIX_WORDS, full_size);
sprintf(error_message, "The size of data set must be a multiple of %i bytes (was %i)", MIX_WORDS, full_size);
PyErr_SetString(PyExc_ValueError, error_message);
return 0;
}
Expand All @@ -217,7 +217,7 @@ mine(PyObject* self, PyObject* args)

do {
ethash_full(&out, (void *) full_bytes, &params, (uint8_t *) header, nonce);
} while (!ethash_check_difficulty(out.result, difficulty));
} while (!ethash_check_difficulty(out.result, (const uint8_t *) difficulty));

return Py_BuildValue("K", nonce);
}
Expand Down

0 comments on commit 9bb97f3

Please sign in to comment.