metaparser: initialize variable
[enigma2.git] / lib / dvb / crc32.h
1 #ifndef CRC32_H
2 #define CRC32_H
3
4 /* $Id: crc32.h,v 1.1 2003-10-17 15:35:49 tmbinc Exp $ */
5
6 typedef unsigned int uint32_t;
7
8 extern const uint32_t crc32_table[256];
9
10 /* Return a 32-bit CRC of the contents of the buffer. */
11
12 static inline uint32_t 
13 crc32(uint32_t val, const void *ss, int len)
14 {
15         const unsigned char *s =(const unsigned char *) ss;
16         while (--len >= 0)
17 //                val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
18                 val = (val << 8) ^ crc32_table[(val >> 24) ^ *s++];
19         return val;
20 }
21
22 #endif