From 4d52b7e19d50ea3533ec7e07681115b9db08115e Mon Sep 17 00:00:00 2001 From: Thomas Karlsson Date: Mon, 14 Nov 2016 16:35:37 +0100 Subject: converted the crc into c++ with namespace. Since it conflicts with other crc implementation in imagemagic lib. This resulted in png images that would not open due to "crc error". --- src/crc.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/crc.h') diff --git a/src/crc.h b/src/crc.h index 59a496a..0fde2d1 100644 --- a/src/crc.h +++ b/src/crc.h @@ -24,18 +24,17 @@ #include - -// The init functions can be used to create a new table with a different polynome -void init_crc8tab(uint8_t l_code, uint8_t l_init); -extern uint8_t crc8tab[]; - -uint8_t crc8(uint8_t l_crc, const void *lp_data, unsigned l_nb); - -void init_crc16tab(uint16_t l_code, uint16_t l_init); -uint16_t crc16(uint16_t l_crc, const void *lp_data, unsigned l_nb); -extern uint16_t crc16tab[]; - -void init_crc32tab(uint32_t l_code, uint32_t l_init); -uint32_t crc32(uint32_t l_crc, const void *lp_data, unsigned l_nb); -extern uint32_t crc32tab[]; - +namespace odr{ + + // The init functions can be used to create a new table with a different polynome + void init_crc8tab(uint8_t l_code, uint8_t l_init); + + uint8_t crc8(uint8_t l_crc, const void *lp_data, unsigned l_nb); + + void init_crc16tab(uint16_t l_code, uint16_t l_init); + uint16_t crc16(uint16_t l_crc, const void *lp_data, unsigned l_nb); + + void init_crc32tab(uint32_t l_code, uint32_t l_init); + uint32_t crc32(uint32_t l_crc, const void *lp_data, unsigned l_nb); + +} -- cgit v1.2.3