Commit d3955b8951b99ec69feb72176fd525bae4524ae6

Kano 2013-05-02T23:44:47

ztx correct applog typing

diff --git a/driver-ztex.c b/driver-ztex.c
index 3898589..2ab4a4d 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -274,13 +274,13 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 			if (nonce > noncecnt)
 				noncecnt = nonce;
 			if (((0xffffffff - nonce) < (nonce - lastnonce[i])) || nonce < lastnonce[i]) {
-				applog(LOG_DEBUG, "%s: overflow nonce=%0.8x lastnonce=%0.8x", ztex->repr, nonce, lastnonce[i]);
+				applog(LOG_DEBUG, "%s: overflow nonce=%08x lastnonce=%08x", ztex->repr, nonce, lastnonce[i]);
 				overflow = true;
 			} else
 				lastnonce[i] = nonce;
 
 			if (ztex_checkNonce(work, nonce) != (hdata->hash7 + 0x5be0cd19)) {
-				applog(LOG_DEBUG, "%s: checkNonce failed for %0.8X", ztex->repr, nonce);
+				applog(LOG_DEBUG, "%s: checkNonce failed for %08X", ztex->repr, nonce);
 
 				// do not count errors in the first 500ms after sendHashData (2x250 wait time)
 				if (count > 2) {
@@ -320,7 +320,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 
 					work->blk.nonce = 0xffffffff;
 					submit_nonce(thr, work, nonce);
-					applog(LOG_DEBUG, "%s: submitted %0.8x", ztex->repr, nonce);
+					applog(LOG_DEBUG, "%s: submitted %08x", ztex->repr, nonce);
 				}
 			}
 		}
diff --git a/libztex.c b/libztex.c
index b3dfbeb..0cefcf6 100644
--- a/libztex.c
+++ b/libztex.c
@@ -130,7 +130,7 @@ static enum check_result libztex_checkDevice(struct libusb_device *dev)
 	}
 
 	if (desc.idVendor != LIBZTEX_IDVENDOR || desc.idProduct != LIBZTEX_IDPRODUCT) {
-		applog(LOG_DEBUG, "Not a ZTEX device %0.4x:%0.4x", desc.idVendor, desc.idProduct);
+		applog(LOG_DEBUG, "Not a ZTEX device %04x:%04x", desc.idVendor, desc.idProduct);
 		return CHECK_IS_NOT_ZTEX;
 	}
 
@@ -238,7 +238,7 @@ static enum check_result libztex_checkDevice(struct libusb_device *dev)
 	fp = NULL;
 
 	if (got_bytes < length) {
-		applog(LOG_ERR, "%s: Incomplete firmware read: %d/%d", __func__, got_bytes, length);
+		applog(LOG_ERR, "%s: Incomplete firmware read: %zu/%zu", __func__, got_bytes, length);
 		goto done;
 	}
 
@@ -735,7 +735,7 @@ int libztex_scanDevices(struct libztex_dev_list*** devs_p)
 	do {
 		cnt = libusb_get_device_list(NULL, &list);
 		if (unlikely(cnt < 0)) {
-			applog(LOG_ERR, "Ztex scan devices: Failed to list usb devices with err %d", cnt);
+			applog(LOG_ERR, "Ztex scan devices: Failed to list usb devices with err %zd", cnt);
 			goto done;
 		}