Commit 0d3a3a9cc008f24339aa44d1afb660cb8c09c12f

Jim Jagielski 2014-02-03T08:13:14

These may not be longs (eg: OSX)... fo a safe cast to ensure.

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