From 36318291bf999e3a0542c1183d01b7d42875029d Mon Sep 17 00:00:00 2001 From: Xiangfu Date: Tue, 21 Feb 2012 20:10:30 +0800 Subject: [PATCH] fix icarus.c compile warning --- icarus.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/icarus.c b/icarus.c index 5562e5ea..d4b53066 100644 --- a/icarus.c +++ b/icarus.c @@ -108,7 +108,7 @@ static int icarus_open(const char *devpath) #endif } -static void icarus_gets(char *buf, size_t bufLen, int fd) +static void icarus_gets(unsigned char *buf, size_t bufLen, int fd) { ssize_t ret = 0; @@ -134,7 +134,7 @@ static void icarus_gets(char *buf, size_t bufLen, int fd) static void icarus_write(int fd, const void *buf, size_t bufLen) { - ssize_t ret; + size_t ret; ret = write(fd, buf, bufLen); if (unlikely(ret != bufLen)) @@ -147,14 +147,14 @@ static bool icarus_detect_one(const char *devpath) { int fd; - const unsigned char golden_ob[] = + const char golden_ob[] = "2db907f9cb4eb938ded904f4832c4331" "0380e3aeb54364057e7fec5157bfc533" "00000000000000000000000080000000" "00000000a58e091ac342724e7c3dc346"; - const unsigned char golden_nonce[] = "063c5e01"; + const char golden_nonce[] = "063c5e01"; - char ob_bin[64], nonce_bin[4]; + unsigned char ob_bin[64], nonce_bin[4]; char *nonce_hex; if (total_devices == MAX_DEVICES) @@ -235,13 +235,13 @@ static bool icarus_prepare(struct thr_info *thr) } static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work, - uint64_t max_nonce) + __maybe_unused uint64_t max_nonce) { struct cgpu_info *icarus; int fd; unsigned char ob_bin[64], nonce_bin[4]; - unsigned char *ob_hex, *nonce_hex; + char *ob_hex, *nonce_hex; uint32_t nonce; uint32_t hash_count; time_t t; @@ -307,7 +307,6 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work, static void icarus_shutdown(struct thr_info *thr) { struct cgpu_info *icarus; - int fd; if (thr->cgpu) { icarus = thr->cgpu;