From e35d7b11058d9d166c6afeffcf075a032fa26ad3 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 scrypt.c Cherry-picked by veox. --- scrypt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scrypt.c b/scrypt.c index e0c75f446..d135a72d4 100644 --- a/scrypt.c +++ b/scrypt.c @@ -414,7 +414,7 @@ void scrypt_regenhash(struct work *work) be32enc_vect(data, (const uint32_t *)work->data, 19); data[19] = htobe32(*nonce); - scratchbuf = alloca(SCRATCHBUF_SIZE); + scratchbuf = (char *)alloca(SCRATCHBUF_SIZE); scrypt_1024_1_1_256_sp(data, scratchbuf, ohash); flip32(ohash, ohash); } @@ -430,7 +430,7 @@ int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t non be32enc_vect(data, (const uint32_t *)pdata, 19); data[19] = htobe32(nonce); - scratchbuf = alloca(SCRATCHBUF_SIZE); + scratchbuf = (char *)alloca(SCRATCHBUF_SIZE); scrypt_1024_1_1_256_sp(data, scratchbuf, ohash); tmp_hash7 = be32toh(ohash[7]); @@ -459,7 +459,7 @@ bool scanhash_scrypt(struct thr_info *thr, const unsigned char __maybe_unused *p be32enc_vect(data, (const uint32_t *)pdata, 19); - scratchbuf = malloc(SCRATCHBUF_SIZE); + scratchbuf = (char *)malloc(SCRATCHBUF_SIZE); if (unlikely(!scratchbuf)) { applog(LOG_ERR, "Failed to malloc scratchbuf in scanhash_scrypt"); return ret;