Commit 463e366c8ded0ccdf4d323da7dbfb0c2cd522882

Con Kolivas 2013-11-05T16:53:06

Correct set_blockdiff for big endian machines.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/cgminer.c b/cgminer.c
index 09fd008..c12d65e 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;