fix windows log warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
diff --git a/driver-modminer.c b/driver-modminer.c
index 1502a5f..4baeeff 100644
--- a/driver-modminer.c
+++ b/driver-modminer.c
@@ -511,9 +511,9 @@ static bool modminer_fpga_upload_bitstream(struct cgpu_info *modminer)
ptr += amount;
if (opt_debug)
- applog(LOG_DEBUG, "%s%u: Program timeout (%d:%d) sent %zu tries %d",
+ applog(LOG_DEBUG, "%s%u: Program timeout (%d:%d) sent %d tries %d",
modminer->drv->name, modminer->device_id,
- amount, err, remaining, tries);
+ amount, err, (int)remaining, tries);
if (!get_status(modminer, "write status", C_PROGRAMSTATUS2))
goto dame;
@@ -521,8 +521,8 @@ static bool modminer_fpga_upload_bitstream(struct cgpu_info *modminer)
} else {
mutex_unlock(modminer->modminer_mutex);
- applog(LOG_ERR, "%s%u: Program failed (%d:%d) sent %zu",
- modminer->drv->name, modminer->device_id, amount, err, remaining);
+ applog(LOG_ERR, "%s%u: Program failed (%d:%d) sent %d",
+ modminer->drv->name, modminer->device_id, amount, err, (int)remaining);
goto dame;
}
diff --git a/fpgautils.c b/fpgautils.c
index ecde9a8..8c262e7 100644
--- a/fpgautils.c
+++ b/fpgautils.c
@@ -330,7 +330,7 @@ int serial_open(const char *devpath, unsigned long baud, signed short timeout, b
applog(LOG_ERR, "%s is already in use by another process", devpath);
break;
default:
- applog(LOG_DEBUG, "Open %s failed, GetLastError:%u", devpath, e);
+ applog(LOG_DEBUG, "Open %s failed, GetLastError:%d", devpath, (int)e);
break;
}
return -1;
diff --git a/libztex.c b/libztex.c
index 0cefcf6..dd56334 100644
--- a/libztex.c
+++ b/libztex.c
@@ -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: %zu/%zu", __func__, got_bytes, length);
+ applog(LOG_ERR, "%s: Incomplete firmware read: %d/%d", __func__, (int)got_bytes, (int)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 %zd", cnt);
+ applog(LOG_ERR, "Ztex scan devices: Failed to list usb devices with err %d", (int)cnt);
goto done;
}
diff --git a/usbutils.c b/usbutils.c
index 337518f..d2d4d9f 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -1537,7 +1537,7 @@ static int _usb_init(struct cgpu_info *cgpu, struct libusb_device *dev, struct u
case LIBUSB_ERROR_NOT_SUPPORTED:
applog(LOG_ERR,
"USB init, open device failed, err %d, "
- "you need to install a Windows USB driver for %s",
+ "you need to install a WinUSB driver for %s",
err, devstr);
break;
#endif
@@ -1890,7 +1890,7 @@ void usb_detect(struct device_drv *drv, bool (*device_detect)(struct libusb_devi
count = libusb_get_device_list(NULL, &list);
if (count < 0) {
- applog(LOG_DEBUG, "USB scan devices: failed, err %zd", count);
+ applog(LOG_DEBUG, "USB scan devices: failed, err %d", (int)count);
return;
}
@@ -2247,7 +2247,7 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro
USBDEBUG("USB debug: _usb_read(%s (nodev=%s),ep=%d,buf=%p,bufsiz=%zu,proc=%p,timeout=%u,end=%s,cmd=%s,ftdi=%s,readonce=%s)", cgpu->drv->name, bool_str(cgpu->usbinfo.nodev), ep, buf, bufsiz, processed, timeout, end ? (char *)str_text((char *)end) : "NULL", usb_cmdname(cmd), bool_str(ftdi), bool_str(readonce));
if (bufsiz > USB_MAX_READ)
- quit(1, "%s USB read request %zu too large (max=%d)", cgpu->drv->name, bufsiz, USB_MAX_READ);
+ quit(1, "%s USB read request %d too large (max=%d)", cgpu->drv->name, (int)bufsiz, USB_MAX_READ);
if (timeout == DEVTIMEOUT)
timeout = usbdev->found->timeout;
@@ -2988,7 +2988,7 @@ static LPSECURITY_ATTRIBUTES mksec(const char *dname, uint8_t bus_number, uint8_
applog(LOG_ERR,
"MTX: %s (%d:%d) USB failed to init secdes err (%d)",
dname, (int)bus_number, (int)device_address,
- GetLastError());
+ (int)GetLastError());
free(sec_des);
return NULL;
}
@@ -2997,7 +2997,7 @@ static LPSECURITY_ATTRIBUTES mksec(const char *dname, uint8_t bus_number, uint8_
applog(LOG_ERR,
"MTX: %s (%d:%d) USB failed to secdes dacl err (%d)",
dname, (int)bus_number, (int)device_address,
- GetLastError());
+ (int)GetLastError());
free(sec_des);
return NULL;
}
@@ -3006,7 +3006,7 @@ static LPSECURITY_ATTRIBUTES mksec(const char *dname, uint8_t bus_number, uint8_
applog(LOG_ERR,
"MTX: %s (%d:%d) USB failed to create gsid err (%d)",
dname, (int)bus_number, (int)device_address,
- GetLastError());
+ (int)GetLastError());
free(sec_des);
return NULL;
}
@@ -3015,7 +3015,7 @@ static LPSECURITY_ATTRIBUTES mksec(const char *dname, uint8_t bus_number, uint8_
applog(LOG_ERR,
"MTX: %s (%d:%d) USB failed to secdes grp err (%d)",
dname, (int)bus_number, (int)device_address,
- GetLastError());
+ (int)GetLastError());
FreeSid(gsid);
free(sec_des);
return NULL;
@@ -3060,7 +3060,7 @@ static bool resource_lock(const char *dname, uint8_t bus_number, uint8_t device_
if (usbMutex == NULL) {
applog(LOG_ERR,
"MTX: %s USB failed to get '%s' err (%d)",
- dname, name, GetLastError());
+ dname, name, (int)GetLastError());
sec = unsec(sec);
return false;
}
@@ -3084,7 +3084,7 @@ static bool resource_lock(const char *dname, uint8_t bus_number, uint8_t device_
}
applog(LOG_ERR,
"MTX: %s USB can't get '%s' - device in use - failure (%d)",
- dname, name, GetLastError());
+ dname, name, (int)GetLastError());
goto fail;
}
}
@@ -3098,12 +3098,12 @@ static bool resource_lock(const char *dname, uint8_t bus_number, uint8_t device_
case WAIT_FAILED:
applog(LOG_ERR,
"MTX: %s USB failed to get '%s' err (%d)",
- dname, name, GetLastError());
+ dname, name, (int)GetLastError());
goto fail;
default:
applog(LOG_ERR,
"MTX: %s USB failed to get '%s' unknown reply (%d)",
- dname, name, res);
+ dname, name, (int)res);
goto fail;
}
@@ -3219,7 +3219,7 @@ static void resource_unlock(const char *dname, uint8_t bus_number, uint8_t devic
if (!ReleaseMutex(usbMutex))
applog(LOG_ERR,
"MTX: %s USB failed to release '%s' err (%d)",
- dname, name, GetLastError());
+ dname, name, (int)GetLastError());
fila: