logo       

linus: tools scramble.c,1.14,1.15: msg#00199

systems.archos.rockbox.cvs

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

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

Modified Files:
scramble.c
Log Message:
Made the -add option use char instead of short, prevents endianness problems

Index: scramble.c
===================================================================
RCS file: /cvsroot/rockbox/tools/scramble.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- scramble.c 28 Jan 2005 10:28:34 -0000 1.14
+++ scramble.c 28 Jan 2005 12:20:20 -0000 1.15
@@ -199,10 +199,9 @@
switch (method)
{
case add:
- for (i = 0; i < length/2; i++) {
- unsigned short *inbuf16 = (unsigned short *)inbuf;
- /* add 16 unsigned bits but keep a 32 bit sum */
- chksum += inbuf16[i];
+ for (i = 0; i < length; i++) {
+ /* add 8 unsigned bits but keep a 32 bit sum */
+ chksum += inbuf[i];
}
break;
case scramble:

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



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

News | FAQ | advertise