X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/a531720ae6e8c9882c96ba4968e5c7ce98e7fb4c..c9778481ffad23dd5749ae9f65d15154bc04c6e1:/common/parity.h

diff --git a/common/parity.h b/common/parity.h
index 89491646..8e2f097c 100644
--- a/common/parity.h
+++ b/common/parity.h
@@ -9,26 +9,24 @@
 #ifndef __PARITY_H
 #define __PARITY_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 extern const uint8_t OddByteParity[256];
-
-#define oddparity8(x) (OddByteParity[(x)])
-
-
 extern const uint8_t EvenByteParity[256];
 
-static inline bool /*__attribute__((always_inline))*/ evenparity8(const uint8_t x) {
-#if !defined __i386__ || !defined __GNUC__
-	return EvenByteParity[x];
-#else
-	uint8_t y;
-        __asm(	"testb $255, %1\n"
-                "setpo %0\n" : "=r"(y) : "r"(x): );
-	return y;
-#endif
+static inline uint8_t oddparity8(uint8_t bt)
+{
+	return OddByteParity[bt];
 }
 
+static inline uint8_t evenparity8(const uint8_t bt)
+{
+	return EvenByteParity[bt];
+}
 
 static inline uint8_t evenparity32(uint32_t x) 
 {
@@ -37,5 +35,8 @@ static inline uint8_t evenparity32(uint32_t x)
 	return EvenByteParity[x & 0xff];
 }
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* __PARITY_H */