Browse Source

Correct set_blockdiff for big endian machines.

Con Kolivas 12 years ago
parent
commit
463e366c8d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cgminer.c

+ 1 - 1
cgminer.c

@@ -4095,7 +4095,7 @@ static void set_blockdiff(const struct work *work)
 {
 {
 	uint8_t pow = work->data[72];
 	uint8_t pow = work->data[72];
 	int powdiff = (8 * (0x1d - 3)) - (8 * (pow - 3));
 	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 numerator = 0xFFFFULL << powdiff;
 	double ddiff = numerator / (double)diff32;
 	double ddiff = numerator / (double)diff32;