These may not be longs (eg: OSX)... fo a safe cast to ensure.
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
diff --git a/api.c b/api.c
index c71dad9..7fa4cd3 100644
--- a/api.c
+++ b/api.c
@@ -1204,8 +1204,8 @@ static struct api_data *print_data(struct io_data *io_data, struct api_data *roo
break;
case API_TIMEVAL:
snprintf(buf, sizeof(buf), "%ld.%06ld",
- ((struct timeval *)(root->data))->tv_sec,
- ((struct timeval *)(root->data))->tv_usec);
+ (long)((struct timeval *)(root->data))->tv_sec,
+ (long)((struct timeval *)(root->data))->tv_usec);
break;
case API_TEMP:
snprintf(buf, sizeof(buf), "%.2f", *((float *)(root->data)));
diff --git a/driver-icarus.c b/driver-icarus.c
index be2e1bf..4be196b 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -1182,7 +1182,7 @@ static int64_t icarus_scanwork(struct thr_info *thr)
applog(LOG_DEBUG, "%s%d: no nonce = 0x%08lX hashes (%ld.%06lds)",
icarus->drv->name, icarus->device_id,
(long unsigned int)estimate_hashes,
- elapsed.tv_sec, elapsed.tv_usec);
+ (long)elapsed.tv_sec, (long)elapsed.tv_usec);
hash_count = estimate_hashes;
goto out;
@@ -1218,7 +1218,7 @@ static int64_t icarus_scanwork(struct thr_info *thr)
applog(LOG_DEBUG, "%s%d: nonce = 0x%08x = 0x%08lX hashes (%ld.%06lds)",
icarus->drv->name, icarus->device_id,
nonce, (long unsigned int)hash_count,
- elapsed.tv_sec, elapsed.tv_usec);
+ (long)elapsed.tv_sec, (long)elapsed.tv_usec);
// Ignore possible end condition values ... and hw errors
// TODO: set limitations on calculated values depending on the device