logo       

linus: tools scramble.c,1.13,1.14: msg#00198

systems.archos.rockbox.cvs

Subject: linus: tools scramble.c,1.13,1.14

Update of /cvsroot/rockbox/tools
In directory labb:/tmp/cvs-serv25631

Modified Files:
scramble.c
Log Message:
The checksum is not a CRC

Index: scramble.c
===================================================================
RCS file: /cvsroot/rockbox/tools/scramble.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- scramble.c 24 Jan 2005 23:14:47 -0000 1.13
+++ scramble.c 28 Jan 2005 10:28:34 -0000 1.14
@@ -61,7 +61,7 @@
unsigned long length,i,slen;
unsigned char *inbuf,*outbuf;
unsigned short crc=0;
- unsigned long crc32=0; /* 32 bit checksum */
+ unsigned long chksum=0; /* 32 bit checksum */
unsigned char header[24];
unsigned char *iname = argv[1];
unsigned char *oname = argv[2];
@@ -143,7 +143,7 @@
}
/* we store a 4-letter model name too, for humans */
strcpy(irivermodel, &argv[1][5]);
- crc32 = irivernum; /* start checksum calcs with this */
+ chksum = irivernum; /* start checksum calcs with this */
}

else if(!strcmp(argv[1], "-iriver")) {
@@ -202,7 +202,7 @@
for (i = 0; i < length/2; i++) {
unsigned short *inbuf16 = (unsigned short *)inbuf;
/* add 16 unsigned bits but keep a 32 bit sum */
- crc32 += inbuf16[i];
+ chksum += inbuf16[i];
}
break;
case scramble:
@@ -237,7 +237,7 @@
{
case add:
{
- int2be(crc32, header); /* checksum, big-endian */
+ int2be(chksum, header); /* checksum, big-endian */
memcpy(&header[4], irivermodel, 4); /* 4 bytes model name */
memcpy(outbuf, inbuf, length); /* the input buffer to output*/
headerlen = 8;

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox-cvs



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise