aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2011-01-29 00:41:27 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-01-29 00:41:27 -0500
commita2967993586cdfe32bc6c61513a449c900820613 (patch)
tree49e2698e49e6be83acfed156417dc92f06f84c19
parent8504cf48031a98a4f76f0602098e000f369be704 (diff)
Replace ___constant_swab32() with gcc's __builtin_bswap32
http://www.bitcoin.org/smf/index.php?topic=1925.msg34827#msg34827 Credit: lfm
-rw-r--r--miner.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/miner.h b/miner.h
index 7979dc0..eda9498 100644
--- a/miner.h
+++ b/miner.h
@@ -22,15 +22,9 @@
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif
-#define ___constant_swab32(x) ((uint32_t)( \
- (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
- (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
- (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
- (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
-
static inline uint32_t swab32(uint32_t v)
{
- return ___constant_swab32(v);
+ return __builtin_bswap32(v);
}
extern bool opt_debug;