Browse Source

Bugfix: Cleanup trivial warnings

Conflicts:
	api.c
	miner.h
Luke Dashjr 12 years ago
parent
commit
99b7208892
2 changed files with 7 additions and 6 deletions
  1. 6 5
      api-example.c
  2. 1 1
      driver-cpu.c

+ 6 - 5
api-example.c

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

+ 1 - 1
driver-cpu.c

@@ -499,7 +499,7 @@ static double bench_algo_stage2(
 			&process_info		// Pointer to PROCESS_INFORMATION structure
 			&process_info		// Pointer to PROCESS_INFORMATION structure
 		);
 		);
 		if (!ok) {
 		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);
 			exit(1);
 		}
 		}