From 463e366c8ded0ccdf4d323da7dbfb0c2cd522882 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 5 Nov 2013 16:53:06 +1100 Subject: [PATCH] Correct set_blockdiff for big endian machines. --- cgminer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgminer.c b/cgminer.c index 09fd0085..c12d65e4 100644 --- a/cgminer.c +++ b/cgminer.c @@ -4095,7 +4095,7 @@ static void set_blockdiff(const struct work *work) { uint8_t pow = work->data[72]; int powdiff = (8 * (0x1d - 3)) - (8 * (pow - 3)); - uint32_t diff32 = swab32(*((uint32_t *)(work->data + 72))) & 0x00FFFFFF; + uint32_t diff32 = be32toh(*((uint32_t *)(work->data + 72))) & 0x00FFFFFF; double numerator = 0xFFFFULL << powdiff; double ddiff = numerator / (double)diff32;