Old snapshot `BigIntegerLibrary-2005.01.18'; see the ChangeLog file.
authorMatt McCutchen <hashproduct@gmail.com>
Sat, 27 Jan 2007 21:06:17 +0000 (16:06 -0500)
committerMatt McCutchen <hashproduct@gmail.com>
Sat, 27 Jan 2007 21:06:17 +0000 (16:06 -0500)
BigIntegerUtils.hh
CHANGELOG
README

index df91ef8..ba035d9 100644 (file)
@@ -57,7 +57,6 @@ BigInteger easyDataToBI(const T* data, BigInteger::Index length, BigInteger::Sig
        unsigned int pieceSizeInBits = 8 * sizeof(T);
        unsigned int piecesPerBlock = sizeof(BigInteger::Blk) / sizeof(T);
        unsigned int numBlocks = (length + piecesPerBlock - 1) / piecesPerBlock;
-       std::cout << pieceSizeInBits << ' ' << piecesPerBlock << ' ' << numBlocks << std::endl;
        
        // Allocate our block array
        BigInteger::Blk *blocks = new BigInteger::Blk[numBlocks];
@@ -65,13 +64,12 @@ BigInteger easyDataToBI(const T* data, BigInteger::Index length, BigInteger::Sig
        BigInteger::Index blockNum, pieceNum, pieceNumHere;
        
        // Convert
-       for (BigInteger::Index blockNum = 0, pieceNum = 0; blockNum < numBlocks; blockNum++) {
+       for (blockNum = 0, pieceNum = 0; blockNum < numBlocks; blockNum++) {
                BigInteger::Blk curBlock = 0;
-               for (unsigned int pieceNumHere = 0; pieceNumHere < piecesPerBlock && pieceNum < length;
+               for (pieceNumHere = 0; pieceNumHere < piecesPerBlock && pieceNum < length;
                        pieceNumHere++, pieceNum++)
                        curBlock |= (BigInteger::Blk(data[pieceNum]) << (pieceSizeInBits * pieceNumHere));
                blocks[blockNum] = curBlock;
-               std::cout << curBlock << std::endl;
        }
        
        // Create the BigInteger.
index af78108..e79ba1e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,10 @@ Change Log
 ==========
 These entries tell you what was added, fixed, or improved in each version as compared to the previous one.  In case you haven't noticed, a version number roughly corresponds to the release date of that version in `YYYY.MM.DD[.N]' format, where `.N' goes `.2', `.3', etc. if there are multiple versions on the same day.
 
+2005.01.18
+----------
+I fixed some problems with `easyDataToBI'.  Due to some multiply declared variables, this function would not compile.  However, it is a template function, so the compiler parses it and doesn't compile the parsed representation until something uses the function; this is how I missed the problems.  I also removed debugging output from this function.
+
 2005.01.17
 ----------
 A fix to some out-of-bounds accesses reported by Milan Tomic (see the comment under `BigUnsigned::divideWithRemainder').  `BigUnsigned::multiply' and `BigUnsigned::divideWithRemainder' implementations neatened up a bit with the help of a function `getShiftedBlock'.  I (finally!) introduced a constant `BigUnsigned::N', the number of bits in a `BigUnsigned::Blk', which varies depending on machine word size.  In both code and comments, it replaces the much clunkier `8*sizeof(Blk)'.  Numerous other small changes.  There's a new conversion routine `easyDataToBI' that will convert almost any format of binary data to a `BigInteger'.
diff --git a/README b/README
index 854d7a1..2f71144 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 +===================================================================+
 | Big Integer Library                                               |
 | A C++ library that does arithmetic on integers of unlimited size. |
-| Version 2005.01.17                                                |
+| Version 2005.01.18                                                |
 +-------------------------------------------------------------------+
 | By Matt McCutchen                                                 |
 | E-mail: hashproduct@verizon.net                                   |