From 9bb97f30e07152a1b303e70cc55109b6f1c3b3eb Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Mon, 9 Mar 2015 03:52:07 -0400 Subject: [PATCH] Fixing type errors --- setup.py | 4 ++-- src/python/core.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index bc563b31..9a4d05d3 100755 --- a/setup.py +++ b/setup.py @@ -25,9 +25,9 @@ author = "Matthew Wampler-Doty", author_email = "matthew.wampler.doty@gmail.com", 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], ) diff --git a/src/python/core.c b/src/python/core.c index bb566577..4c54f157 100644 --- a/src/python/core.c +++ b/src/python/core.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include "../libethash/ethash.h" #define MIX_WORDS (MIX_BYTES/4) static PyObject* @@ -66,7 +66,7 @@ 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; } @@ -74,7 +74,7 @@ calc_dataset_bytes(PyObject* self, PyObject* args) 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; } @@ -104,7 +104,7 @@ 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; } @@ -112,7 +112,7 @@ hashimoto_light(PyObject* self, PyObject* args) 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; } @@ -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; } @@ -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; } @@ -217,7 +217,7 @@ mine(PyObject* self, PyObject* args) do { ethash_full(&out, (void *) full_bytes, ¶ms, (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); }