Index: trunk/Serial_Server/library/Checksum.cpp
===================================================================
--- trunk/Serial_Server/library/Checksum.cpp	(revision 376)
+++ trunk/Serial_Server/library/Checksum.cpp	(revision 526)
@@ -6,6 +6,6 @@
 
 //
-// XTIDE Universal BIOS and Associated Tools 
-// Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+// XTIDE Universal BIOS and Associated Tools
+// Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
 //
 // This program is free software; you can redistribute it and/or modify
@@ -13,21 +13,21 @@
 // the Free Software Foundation; either version 2 of the License, or
 // (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.		
+// GNU General Public License for more details.
 // Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 //
 
 //
-// This file implements Fletcher's Checksum.  The serial code uses this checksum, as it is very quick 
+// This file implements Fletcher's Checksum.  The serial code uses this checksum, as it is very quick
 // to calculate in assembly and offers reasonable error detection.
 // For more information, see http://en.wikipedia.org/wiki/Fletcher%27s_checksum.
 //
-// Since it is faster in 8088 assembly code to deal with 16-bit quantities than 8-bit quantities, 
+// Since it is faster in 8088 assembly code to deal with 16-bit quantities than 8-bit quantities,
 // Fletcher's Checksum has been modified to calculate the 32-bit checksum, and then "fold" the result into a
-// 16-bit quantity.  Fletcher's 32-bit Checksum consists of two parts: concatenated 16-bit accumulators.  
-// To "fold" to 16-bits, The upper and lower 8-bits of each of these accumulators is XOR'd independently, and then 
+// 16-bit quantity.  Fletcher's 32-bit Checksum consists of two parts: concatenated 16-bit accumulators.
+// To "fold" to 16-bits, The upper and lower 8-bits of each of these accumulators is XOR'd independently, and then
 // the two results concatenated together, resulting in 16-bits.  Although simpler, an early attempt to XOR the
 // 16-bit accumulators results in poorer error detection behavior.  Folding as described here results in error
@@ -35,5 +35,5 @@
 //
 // With #define CHECKSUM_TEST, this file becomes a self-contained command line program that runs
-// some statistical tests comparing various checksum algorithms with random 512-byte sectors and various 
+// some statistical tests comparing various checksum algorithms with random 512-byte sectors and various
 // levels of errors introduced.
 //
@@ -58,5 +58,5 @@
 	b = (b & 0xffff) + (b >> 16);
 
-// Although tempting to use, for its simplicity and size/speed in assembly, the following folding 
+// Although tempting to use, for its simplicity and size/speed in assembly, the following folding
 // algorithm results in many undetected single bit errors and therefore should not be used.
 //	return( (unsigned short) (a ^ b) );
@@ -68,5 +68,5 @@
 
 //====================================================================================================
-// 
+//
 // Test Code
 //
@@ -82,5 +82,5 @@
 unsigned char bit[] = { 1, 2, 4, 8, 16, 32, 64, 128 };
 
-class algorithm 
+class algorithm
 {
 public:
@@ -113,5 +113,5 @@
 
 //----------------------------------------------------------------------------------------------------
-// 
+//
 // Standard CRC-16
 //
@@ -131,5 +131,5 @@
 		unsigned short j;
 
-		for(i = 0; i < 256; ++i) 
+		for(i = 0; i < 256; ++i)
 		{
 			value = 0;
@@ -147,5 +147,5 @@
 	}
 
-	unsigned short checksum( unsigned char *data, int len );  
+	unsigned short checksum( unsigned char *data, int len );
 
 private:
@@ -158,5 +158,5 @@
 	int i;
 
-	for(i = 0; i < len; ++i) 
+	for(i = 0; i < len; ++i)
 	{
 		unsigned char index = (unsigned char)(crc ^ data[i]);
@@ -168,5 +168,5 @@
 
 //----------------------------------------------------------------------------------------------------
-// 
+//
 // Basic checksum (just add up the bytes)
 //
@@ -175,5 +175,5 @@
 {
 public:
-	unsigned short checksum( unsigned char *data, int len );  
+	unsigned short checksum( unsigned char *data, int len );
 	basic_algorithm( algorithm *last ) : algorithm( last, (char *) "basic" ) { };
 };
@@ -193,5 +193,5 @@
 {
 public:
-	unsigned short checksum( unsigned char *data, int len );  
+	unsigned short checksum( unsigned char *data, int len );
 	fletcher16_algorithm( algorithm *last ) : algorithm( last, (char *) "f-16" ) { }
 };
@@ -213,5 +213,5 @@
 
 //----------------------------------------------------------------------------------------------------
-// 
+//
 // Folded Fletcher's Checksum (what we use in the serial code, from the top of this file)
 //
@@ -220,5 +220,5 @@
 {
 public:
-	unsigned short checksum( unsigned char *data, int len );  
+	unsigned short checksum( unsigned char *data, int len );
 	folded_fletcher32_algorithm( algorithm *last ) : algorithm( last, (char *) "fold-f-32" ) { }
 };
@@ -230,5 +230,5 @@
 
 //----------------------------------------------------------------------------------------------------
-// 
+//
 // Test Driver and Support routines
 //
@@ -283,10 +283,10 @@
 	{
 		a->found = (unsigned long *) calloc( BUCKETS, sizeof(long) );
-		
+
 		a->zero = (unsigned long) a->checksum( bbuff, BBUFF_LENGTH );
 
 		a->min = iterations+1;
 	}
-	
+
 	printf( "\n" );
 	PRINTROW( "zero   ", "%10d  ", a->zero );
@@ -344,5 +344,5 @@
 
 			bbuff[ rand() % 512 ] ^= bit[ rand() % 8 ];
-			
+
 			if( b > 0 )
 			{
@@ -354,5 +354,5 @@
 			}
 		}
-	}  
+	}
 
 	printf( "\nbit change test:\n" );
