Monday, August 29, 2005
Sunday, August 14, 2005
cksfv 1.3 patch for x86_64
I've made cksfv version 1.3, a SFV checksum checker for Linux, a patch to make it works under Linux x86_64 platform. Here's the patch
diff -Naru cksfv-1.3/src/crc32.c cksfv-1.3-mod/src/crc32.c
--- cksfv-1.3/src/crc32.c 2001-07-06 13:33:08.000000000 +0700
+++ cksfv-1.3-mod/src/crc32.c 2005-08-14 00:08:13.000000000 +0700
@@ -18,6 +18,7 @@
#include
#include
+#include
#include
#include
@@ -91,11 +92,11 @@
};
-int crc32(register int fd, unsigned long *main_val, unsigned long *main_len)
+int crc32(register int fd, uint32_t *main_val, uint32_t *main_len)
{
char buf[BUFFERSIZE], *p;
int len = 0, nr;
- unsigned long crc = ~0, crc32_total = ~0;
+ uint32_t crc = ~0, crc32_total = ~0;
while ((nr = read(fd, buf, sizeof(buf))) > 0)
for (len += nr, p = buf; nr--; ++p) {
diff -Naru cksfv-1.3/src/newsfv.c cksfv-1.3-mod/src/newsfv.c
--- cksfv-1.3/src/newsfv.c 2001-07-06 13:33:08.000000000 +0700
+++ cksfv-1.3-mod/src/newsfv.c 2005-08-14 00:12:17.000000000 +0700
@@ -18,20 +18,21 @@
#include
#include
+#include
#include
#include
#include
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*, uint32_t);
+extern int crc32(int, uint32_t *, uint32_t *);
int newsfv(char **argv)
{
int fd, rval = 0;
char *fn;
- unsigned long len, val;
+ uint32_t len, val;
pnsfv_head();
pfileinfo(argv);
diff -Naru cksfv-1.3/src/readsfv.c cksfv-1.3-mod/src/readsfv.c
--- cksfv-1.3/src/readsfv.c 2001-07-06 13:33:08.000000000 +0700
+++ cksfv-1.3-mod/src/readsfv.c 2005-08-14 00:08:56.000000000 +0700
@@ -19,6 +19,7 @@
#include
#include
+#include
#include
#include
#include
@@ -28,7 +29,7 @@
#include
#include
-extern int crc32(int, unsigned long*, unsigned long*);
+extern int crc32(int, uint32_t *, uint32_t *);
extern void prsfv_head(char*);
int find_file(char*, char*);
@@ -39,7 +40,7 @@
FILE *fd;
char buf[512], *end, filename[512], crc[9], path[256];
int file, rval = 0;
- unsigned long len, val, sfvcrc;
+ uint32_t len, val, sfvcrc;
if (quiet == 0) {
prsfv_head(fn);
Tuesday, August 09, 2005
Subscribe to:
Posts (Atom)