Browse Source

Bugfix: Correct various size mismatches

Luke Dashjr 13 years ago
parent
commit
966ce7bdd2
6 changed files with 11 additions and 7 deletions
  1. 2 0
      driver-ztex.c
  2. 2 0
      dynclock.c
  3. 1 1
      elist.h
  4. 1 1
      fpgautils.c
  5. 3 3
      ocl.c
  6. 2 2
      util.c

+ 2 - 0
driver-ztex.c

@@ -24,6 +24,8 @@
  *   along with this program; if not, see http://www.gnu.org/licenses/.
 **/
 
+#include "config.h"
+
 #include <unistd.h>
 #include <sha2.h>
 

+ 2 - 0
dynclock.c

@@ -8,6 +8,8 @@
  * any later version.  See COPYING for more details.
  */
 
+#include "config.h"
+
 #include "dynclock.h"
 #include "miner.h"
 

+ 1 - 1
elist.h

@@ -181,7 +181,7 @@ static inline void list_splice_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+	((type *)((char *)(ptr)-(intptr_t)(&((type *)0)->member)))
 
 /**
  * list_for_each	-	iterate over a list

+ 1 - 1
fpgautils.c

@@ -665,7 +665,7 @@ int serial_open(const char *devpath, unsigned long baud, uint8_t timeout, bool p
 		PurgeComm(hSerial, PURGE_TXCLEAR);
 	}
 
-	return _open_osfhandle((LONG)hSerial, 0);
+	return _open_osfhandle((intptr_t)hSerial, 0);
 #else
 	int fdDev = open(devpath, O_RDWR | O_CLOEXEC | O_NOCTTY);
 

+ 3 - 3
ocl.c

@@ -667,7 +667,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 					cgpu->thread_concurrency = cgpu->shaders * 5;
 			}
 				
-			applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %u",gpu,  cgpu->thread_concurrency);
+			applog(LOG_DEBUG, "GPU %u: selecting thread concurrency of %lu", gpu,  (unsigned long)cgpu->thread_concurrency);
 		} else
 			cgpu->thread_concurrency = cgpu->opt_tc;
 
@@ -985,10 +985,10 @@ built:
 		 * 2 greater >= required amount earlier */
 		if (bufsize > cgpu->max_alloc) {
 			applog(LOG_WARNING, "Maximum buffer memory device %d supports says %lu", gpu, (unsigned long)cgpu->max_alloc);
-			applog(LOG_WARNING, "Your scrypt settings come to %u", bufsize);
+			applog(LOG_WARNING, "Your scrypt settings come to %lu", (unsigned long)bufsize);
 		} else
 			bufsize = cgpu->max_alloc;
-		applog(LOG_DEBUG, "Creating scrypt buffer sized %d", bufsize);
+		applog(LOG_DEBUG, "Creating scrypt buffer sized %ld", (unsigned long)bufsize);
 		clState->padbufsize = bufsize;
 
 		/* This buffer is weird and might work to some degree even if

+ 2 - 2
util.c

@@ -445,7 +445,7 @@ void json_rpc_call_async(CURL *curl, const char *url,
 	if (likely(global_hashrate)) {
 		char ghashrate[255];
 
-		sprintf(ghashrate, "X-Mining-Hashrate: %llu", global_hashrate);
+		sprintf(ghashrate, "X-Mining-Hashrate: %"PRIu64, (uint64_t)global_hashrate);
 		headers = curl_slist_append(headers, ghashrate);
 	}
 
@@ -1095,7 +1095,7 @@ static void recalloc_sock(struct pool *pool, size_t len)
 	if (new < pool->sockbuf_size)
 		return;
 	new = new + (RBUFSIZE - (new % RBUFSIZE));
-	applog(LOG_DEBUG, "Recallocing pool sockbuf to %d", new);
+	applog(LOG_DEBUG, "Recallocing pool sockbuf to %lu", (unsigned long)new);
 	pool->sockbuf = realloc(pool->sockbuf, new);
 	if (!pool->sockbuf)
 		quit(1, "Failed to realloc pool sockbuf in recalloc_sock");