X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/2b1f4228c2987459445d30443f92038f9ea080c6..16cfceb68966bb3022dee37f4c3f4f1bace3f9c5:/common/parity.h?ds=sidebyside diff --git a/common/parity.h b/common/parity.h index 6adfdb30..8e2f097c 100644 --- a/common/parity.h +++ b/common/parity.h @@ -9,30 +9,34 @@ #ifndef __PARITY_H #define __PARITY_H +#ifdef __cplusplus +extern "C" { +#endif + #include extern const uint8_t OddByteParity[256]; +extern const uint8_t EvenByteParity[256]; static inline uint8_t oddparity8(uint8_t bt) { return OddByteParity[bt]; } - -extern const uint8_t EvenByteParity[256]; - static inline uint8_t evenparity8(const uint8_t bt) { return EvenByteParity[bt]; } - -static inline uint32_t evenparity32(uint32_t x) +static inline uint8_t evenparity32(uint32_t x) { x ^= x >> 16; x ^= x >> 8; return EvenByteParity[x & 0xff]; } +#ifdef __cplusplus +} +#endif #endif /* __PARITY_H */