Browse Source

Bugfix: Address Windows-specific formatting issues (including lack of support for %ll*)

Luke Dashjr 13 years ago
parent
commit
3895928811
3 changed files with 10 additions and 6 deletions
  1. 8 4
      driver-icarus.c
  2. 1 1
      fpgautils.c
  3. 1 1
      miner.c

+ 8 - 4
driver-icarus.c

@@ -888,9 +888,10 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 			estimate_hashes = 0xffffffff;
 
 		if (opt_debug) {
-			applog(LOG_DEBUG, "%s %u no nonce = 0x%08llx hashes (%ld.%06lds)",
+			applog(LOG_DEBUG, "%s %u no nonce = 0x%08" PRIx64 " hashes (%ld.%06lds)",
 					icarus->api->name,
-					icarus->device_id, estimate_hashes,
+					icarus->device_id,
+					(uint64_t)estimate_hashes,
 					elapsed.tv_sec, elapsed.tv_usec);
 		}
 
@@ -918,9 +919,12 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 	hash_count *= info->fpga_count;
 
 	if (opt_debug) {
-		applog(LOG_DEBUG, "%s %u nonce = 0x%08x = 0x%08llx hashes (%ld.%06lds)",
+		applog(LOG_DEBUG, "%s %u nonce = 0x%08x = 0x%08" PRIx64 " hashes (%ld.%06lds)",
 				icarus->api->name,
-				icarus->device_id, nonce, hash_count, elapsed.tv_sec, elapsed.tv_usec);
+				icarus->device_id,
+				nonce,
+				(uint64_t)hash_count,
+				elapsed.tv_sec, elapsed.tv_usec);
 	}
 
 	if (info->do_default_detection && elapsed.tv_sec >= DEFAULT_DETECT_THRESHOLD) {

+ 1 - 1
fpgautils.c

@@ -496,7 +496,7 @@ int serial_open(const char *devpath, unsigned long baud, uint8_t timeout, bool p
 			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:%u", devpath, (unsigned)e);
 			break;
 		}
 		return -1;

+ 1 - 1
miner.c

@@ -602,7 +602,7 @@ tryagain: ;
 	if (!QueryDosDevice(NULL, buf, bufLen)) {
 		if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
 			bufLen *= 2;
-			applog(LOG_DEBUG, "scan-serial: QueryDosDevice returned insufficent buffer error; enlarging to %llx", (unsigned long long)bufLen);
+			applog(LOG_DEBUG, "scan-serial: QueryDosDevice returned insufficent buffer error; enlarging to %lx", (unsigned long)bufLen);
 			goto tryagain;
 		}
 		return "scan-serial: Error occurred trying to enumerate COM ports with QueryDosDevice";