Browse Source

Bugfix: Cleanup trivial warnings

Luke Dashjr 12 years ago
parent
commit
e8c1b97823
5 changed files with 12 additions and 12 deletions
  1. 6 5
      api-example.c
  2. 4 4
      api.c
  3. 1 1
      driver-cpu.c
  4. 0 1
      driver-icarus.c
  5. 1 1
      miner.h

+ 6 - 5
api-example.c

@@ -32,7 +32,7 @@
 	#define INVSOCK -1
 	#define CLOSESOCKET close
 
-	#define SOCKETINIT {}
+	#define SOCKETINIT do{}while(0)
 
 	#define SOCKERRMSG strerror(errno)
 #else
@@ -104,7 +104,6 @@
 
 	static char *WSAErrorMsg()
 	{
-		char *msg;
 		int i;
 		int id = WSAGetLastError();
 
@@ -122,11 +121,13 @@
 
 	static WSADATA WSA_Data;
 
-	#define SOCKETINIT	int wsa; \
-				if (wsa = WSAStartup(0x0202, &WSA_Data)) { \
+	#define SOCKETINIT	do {  \
+		int wsa; \
+				if ( (wsa = WSAStartup(0x0202, &WSA_Data)) ) { \
 					printf("Socket startup failed: %d\n", wsa); \
 					return 1; \
-				}
+		}  \
+	} while (0)
 
 	#ifndef SHUT_RDWR
 	#define SHUT_RDWR SD_BOTH

+ 4 - 4
api.c

@@ -3728,18 +3728,18 @@ void api(int api_thr_id)
 	}
 
 	if (opt_api_allow)
-		applog(LOG_WARNING, "API running in IP access mode on port %d (%d)", port, *apisock);
+		applog(LOG_WARNING, "API running in IP access mode on port %d", port);
 	else {
 		if (opt_api_network)
-			applog(LOG_WARNING, "API running in UNRESTRICTED read access mode on port %d (%d)", port, *apisock);
+			applog(LOG_WARNING, "API running in UNRESTRICTED read access mode on port %d", port);
 		else
-			applog(LOG_WARNING, "API running in local read access mode on port %d (%d)", port, *apisock);
+			applog(LOG_WARNING, "API running in local read access mode on port %d", port);
 	}
 
 	while (!bye) {
 		clisiz = sizeof(cli);
 		if (SOCKETFAIL(c = accept(*apisock, (struct sockaddr *)(&cli), &clisiz))) {
-			applog(LOG_ERR, "API failed (%s)%s (%d)", SOCKERRMSG, UNAVAILABLE, *apisock);
+			applog(LOG_ERR, "API failed (%s)%s", SOCKERRMSG, UNAVAILABLE);
 			goto die;
 		}
 

+ 1 - 1
driver-cpu.c

@@ -500,7 +500,7 @@ static double bench_algo_stage2(
 			&process_info		// Pointer to PROCESS_INFORMATION structure
 		);
 		if (!ok) {
-			applog(LOG_ERR, "CreateProcess failed with error %d\n", GetLastError() );
+			applog(LOG_ERR, "CreateProcess failed with error %ld\n", (long)GetLastError() );
 			exit(1);
 		}
 

+ 0 - 1
driver-icarus.c

@@ -555,7 +555,6 @@ bool icarus_detect_custom(const char *devpath, struct device_drv *api, struct IC
 	 */
 
 	const char golden_nonce[] = "000187a2";
-	const uint32_t golden_nonce_val = 0x000187a2;
 
 	unsigned char ob_bin[64], nonce_bin[ICARUS_READ_SIZE];
 	char *nonce_hex;

+ 1 - 1
miner.h

@@ -1196,7 +1196,7 @@ struct work {
 
 	// Allow devices to identify work if multiple sub-devices
 	// DEPRECATED: New code should be using multiple processors instead
-	char		subid;
+	unsigned char	subid;
 
 	blktemplate_t	*tmpl;
 	int		*tmpl_refcount;