forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dvbsnoop-1.4.50-crc32.patch
59 lines (45 loc) · 1.98 KB
/
dvbsnoop-1.4.50-crc32.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -rupN dvbsnoop-1.4.50-origdeb/src/misc/crc32.c dvbsnoop-1.4.50/src/misc/crc32.c
--- dvbsnoop-1.4.50-origdeb/src/misc/crc32.c 2006-01-02 21:24:04.000000000 +0200
+++ dvbsnoop-1.4.50/src/misc/crc32.c 2010-01-19 13:21:37.000000000 +0200
@@ -17,14 +17,14 @@ $Id$
-#include <sys/types.h>
+#include <stdint.h>
#include "crc32.h"
// CRC32 lookup table for polynomial 0x04c11db7
-static u_long crc_table[256] = {
+static uint32_t crc_table[256] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7,
@@ -69,10 +69,10 @@ static u_long crc_table[256] = {
0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4};
-u_long crc32 (char *data, int len)
+uint32_t crc32 (char *data, int len)
{
register int i;
- u_long crc = 0xffffffff;
+ uint32_t crc = 0xffffffff;
for (i=0; i<len; i++)
crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *data++) & 0xff];
diff -rupN dvbsnoop-1.4.50-origdeb/src/misc/crc32.h dvbsnoop-1.4.50/src/misc/crc32.h
--- dvbsnoop-1.4.50-origdeb/src/misc/crc32.h 2006-01-02 21:24:04.000000000 +0200
+++ dvbsnoop-1.4.50/src/misc/crc32.h 2010-01-19 13:21:37.000000000 +0200
@@ -19,8 +19,9 @@ $Id$
#ifndef __CRC32_H
#define __CRC32_H
+#include <stdint.h>
-u_long crc32 (char *data, int len);
+uint32_t crc32 (char *data, int len);
#endif
diff -rupN dvbsnoop-1.4.50-origdeb/src/sections/sectables.c dvbsnoop-1.4.50/src/sections/sectables.c
--- dvbsnoop-1.4.50-origdeb/src/sections/sectables.c 2005-12-29 05:43:40.000000000 +0200
+++ dvbsnoop-1.4.50/src/sections/sectables.c 2010-01-19 13:59:07.000000000 +0200
@@ -269,7 +269,7 @@ void decodeSI_packet (u_char *buf, int l
softcrc_fail = 0;
if (opt->soft_crc) {
- u_long crc = crc32 ((char *)buf,len);
+ uint32_t crc = crc32 ((char *)buf,len);
if (crc) {
softcrc_fail = 1;
}