From 7ac101f365d3906a5d787fe82cad31322735374b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sanjin=20Tro=C5=A1elj?= Date: Mon, 27 Jan 2014 18:22:40 +0100 Subject: [PATCH] VS2010 build: Prepare miner.h Cherry-picked by veox. --- miner.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/miner.h b/miner.h index e4ef2f3e..64628d66 100644 --- a/miner.h +++ b/miner.h @@ -236,7 +236,9 @@ enum drv_driver { }; /* Use DRIVER_PARSE_COMMANDS to generate extern device_drv prototypes */ +#ifndef _MSC_VER DRIVER_PARSE_COMMANDS(DRIVER_PROTOTYPE) +#endif enum alive { LIFE_WELL, @@ -577,7 +579,7 @@ static inline void string_elist_add(const char *s, struct list_head *head) { struct string_elist *n; - n = calloc(1, sizeof(*n)); + n = (struct string_elist *)calloc(1, sizeof(*n)); n->string = strdup(s); n->free_me = true; list_add_tail(&n->list, head); @@ -598,8 +600,8 @@ static inline uint32_t swab32(uint32_t v) static inline void swap256(void *dest_p, const void *src_p) { - uint32_t *dest = dest_p; - const uint32_t *src = src_p; + uint32_t *dest = (uint32_t *)dest_p; + const uint32_t *src = (uint32_t *)src_p; dest[0] = src[7]; dest[1] = src[6]; @@ -613,8 +615,8 @@ static inline void swap256(void *dest_p, const void *src_p) static inline void swab256(void *dest_p, const void *src_p) { - uint32_t *dest = dest_p; - const uint32_t *src = src_p; + uint32_t *dest = (uint32_t *)dest_p; + const uint32_t *src = (uint32_t *)src_p; dest[0] = swab32(src[7]); dest[1] = swab32(src[6]); @@ -628,8 +630,8 @@ static inline void swab256(void *dest_p, const void *src_p) static inline void flip32(void *dest_p, const void *src_p) { - uint32_t *dest = dest_p; - const uint32_t *src = src_p; + uint32_t *dest = (uint32_t *)dest_p; + const uint32_t *src = (uint32_t *)src_p; int i; for (i = 0; i < 8; i++) @@ -638,8 +640,8 @@ static inline void flip32(void *dest_p, const void *src_p) static inline void flip64(void *dest_p, const void *src_p) { - uint32_t *dest = dest_p; - const uint32_t *src = src_p; + uint32_t *dest = (uint32_t *)dest_p; + const uint32_t *src = (uint32_t *)src_p; int i; for (i = 0; i < 16; i++) @@ -648,8 +650,8 @@ static inline void flip64(void *dest_p, const void *src_p) static inline void flip80(void *dest_p, const void *src_p) { - uint32_t *dest = dest_p; - const uint32_t *src = src_p; + uint32_t *dest = (uint32_t *)dest_p; + const uint32_t *src = (uint32_t *)src_p; int i; for (i = 0; i < 20; i++) @@ -658,8 +660,8 @@ static inline void flip80(void *dest_p, const void *src_p) static inline void flip128(void *dest_p, const void *src_p) { - uint32_t *dest = dest_p; - const uint32_t *src = src_p; + uint32_t *dest = (uint32_t *)dest_p; + const uint32_t *src = (uint32_t *)src_p; int i; for (i = 0; i < 32; i++)