aboutsummaryrefslogtreecommitdiffstats
path: root/src/crc.h
diff options
context:
space:
mode:
authorThomas Karlsson <thomas.karlsson@paneda.se>2016-11-14 16:35:37 +0100
committerThomas Karlsson <thomas.karlsson@paneda.se>2016-11-14 16:56:15 +0100
commit4d52b7e19d50ea3533ec7e07681115b9db08115e (patch)
treee5c96faac0445d75538da6f8fe4dc5923311513f /src/crc.h
parent261054bf3873b48d16f03a5f7de19428f12c26ec (diff)
downloadODR-PadEnc-4d52b7e19d50ea3533ec7e07681115b9db08115e.tar.gz
ODR-PadEnc-4d52b7e19d50ea3533ec7e07681115b9db08115e.tar.bz2
ODR-PadEnc-4d52b7e19d50ea3533ec7e07681115b9db08115e.zip
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".
Diffstat (limited to 'src/crc.h')
-rw-r--r--src/crc.h29
1 files changed, 14 insertions, 15 deletions
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 <stdint.h>
-
-// 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);
+
+}