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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
Only in ./src: cksfv
diff -u -r ../cksfv-1.3-org/src/crc32.c ./src/crc32.c
--- ../cksfv-1.3-org/src/crc32.c 2001-07-06 09:33:08.000000000 +0300
+++ ./src/crc32.c 2004-04-18 02:34:19.297962360 +0300
@@ -16,14 +16,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <sys/types.h>
-#include <stdio.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <unistd.h>
#define BUFFERSIZE 16384 /* (16k) buffer size for reading from the file */
-static const unsigned long crctable[256] = {
+static const uint32_t crctable[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
@@ -91,11 +89,11 @@
};
-int crc32(register int fd, unsigned long *main_val, unsigned long *main_len)
+int crc32(register int fd, uint32_t *main_val, unsigned long *main_len)
{
char buf[BUFFERSIZE], *p;
- int len = 0, nr;
- unsigned long crc = ~0, crc32_total = ~0;
+ long len = 0, nr;
+ uint32_t crc = ~0, crc32_total = ~0;
while ((nr = read(fd, buf, sizeof(buf))) > 0)
for (len += nr, p = buf; nr--; ++p) {
Only in ./src: crc32.c~
diff -u -r ../cksfv-1.3-org/src/newsfv.c ./src/newsfv.c
--- ../cksfv-1.3-org/src/newsfv.c 2001-07-06 09:33:08.000000000 +0300
+++ ./src/newsfv.c 2004-04-18 02:38:11.903600928 +0300
@@ -16,6 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdint.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
@@ -24,14 +25,15 @@
extern void pnsfv_head();
extern void pfileinfo(char**);
-extern void pcrc(char*, unsigned long);
-extern int crc32(int, unsigned long*, unsigned long*);
+extern void pcrc(char*, unsigned long val);
+extern int crc32(int, uint32_t *, unsigned long *);
int newsfv(char **argv)
{
int fd, rval = 0;
char *fn;
- unsigned long len, val;
+ unsigned long len;
+ uint32_t val;
pnsfv_head();
pfileinfo(argv);
@@ -48,7 +50,7 @@
fprintf(stderr, "cksfv: %s: %s\n", fn, strerror(errno));
rval = 1;
} else
- pcrc(fn, val);
+ pcrc(fn, (unsigned long) val);
close(fd);
}
Only in ./src: newsfv.c~
Only in ./src: print.c~
diff -u -r ../cksfv-1.3-org/src/readsfv.c ./src/readsfv.c
--- ../cksfv-1.3-org/src/readsfv.c 2001-07-06 09:33:08.000000000 +0300
+++ ./src/readsfv.c 2004-04-18 02:39:48.612898880 +0300
@@ -17,6 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
@@ -28,7 +29,7 @@
#include <dirent.h>
#include <stdlib.h>
-extern int crc32(int, unsigned long*, unsigned long*);
+extern int crc32(int, uint32_t *, unsigned long*);
extern void prsfv_head(char*);
int find_file(char*, char*);
@@ -39,7 +40,9 @@
FILE *fd;
char buf[512], *end, filename[512], crc[9], path[256];
int file, rval = 0;
- unsigned long len, val, sfvcrc;
+ unsigned long len, sfvcrc;
+ uint32_t val;
+
if (quiet == 0) {
prsfv_head(fn);
@@ -104,7 +107,7 @@
fprintf(stderr, "cksfv: %s: %s\n", filename, strerror(errno));
rval = 1;
} else {
- if (val != sfvcrc) {
+ if (((unsigned long) val) != sfvcrc) {
if (quiet == 0)
fprintf(stderr, "different CRC\n");
else if (quiet == 1)
Only in ./src: readsfv.c~
|