Commit b76053efeaea120d051b6e2fe4e8f9003f15d501

Luke Dashjr 2012-06-13T16:50:14

Bugfix: modminer: Fix unsigned/signed comparison and similar warnings

diff --git a/driver-modminer.c b/driver-modminer.c
index 3077653..d139091 100644
--- a/driver-modminer.c
+++ b/driver-modminer.c
@@ -164,7 +164,7 @@ fd_set fds;
 	p = strrchr(buf, '=') ?: p;
 	if (p[0] == '=')
 		++p;
-	long fwusercode = strtol(p, &p, 16);
+	unsigned long fwusercode = (unsigned long)strtoll(p, &p, 16);
 	if (p[0] != '\0')
 		bailout(LOG_ERR, "Bad usercode in ModMiner firmware file");
 	if (fwusercode == 0xffffffff)
@@ -197,7 +197,7 @@ fd_set fds;
 	if (6 != write(fd, buf, 6))
 		bailout2(LOG_ERR, "%s %u: Error programming %s (cmd)", modminer->api->name, modminer->device_id, modminer->device_path);
 	status_read("cmd reply");
-	size_t buflen;
+	ssize_t buflen;
 	while (len) {
 		buflen = len < 32 ? len : 32;
 		if (fread(buf, buflen, 1, f) != 1)