initialize valarrays with explicit contents (zero)
authorchristian.brunschen <christian.brunschen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 24 Oct 2008 09:53:01 +0000 (09:53 +0000)
committerchristian.brunschen <christian.brunschen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 24 Oct 2008 09:53:01 +0000 (09:53 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@636 59b500cc-1b3d-0410-9834-0bbf25fbcc57

cpp/core/src/common/BitArray.cpp
cpp/core/src/common/BitMatrix.cpp
cpp/core/src/common/GridSampler.cpp
cpp/core/src/common/reedsolomon/GF256.cpp
cpp/core/src/qrcode/detector/FinderPatternFinder.cpp

index 8937eb4..01f1a1b 100644 (file)
@@ -48,7 +48,8 @@ namespace common {
     cout << "hey! don't use this BitArrayConstructor!\n";
   }
   
-  BitArray::BitArray(size_t size) : size_(size), bits_(wordsForBits(size)) { 
+  BitArray::BitArray(size_t size) :
+  size_(size), bits_((const unsigned int)0, wordsForBits(size)) { 
   }
   BitArray::~BitArray() { }
   size_t BitArray::getSize() { 
index fe9ae5e..356e0b3 100644 (file)
@@ -50,7 +50,8 @@ namespace common {
   }
   
   BitMatrix::BitMatrix(size_t dimension) : 
-  dimension_(dimension), bits_(wordsForDimension(dimension)) { 
+  dimension_(dimension),
+  bits_((const unsigned int)0, wordsForDimension(dimension)) { 
   }
   
   BitMatrix::~BitMatrix() {
index 9e9daa1..4fa57fc 100644 (file)
@@ -45,7 +45,7 @@ namespace common {
       p1FromX, p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY));
     
     Ref<BitMatrix> bits(new BitMatrix(dimension));
-    valarray<float> points(dimension << 1);
+    valarray<float> points((const float)0.0f, dimension << 1);
     for (int i = 0; i < dimension; i++) {
       int max = points.size();
       float iValue = (float) i + 0.5f;
index c6006b3..7306246 100644 (file)
@@ -42,8 +42,8 @@ namespace reedsolomon {
   }
   
   GF256::GF256(int primitive) : 
-  exp_(256),
-  log_(256),
+  exp_((const int)0, 256),
+  log_((const int)0, 256),
   zero_(refPoly(*this, 0)),
   one_(refPoly(*this, 1)) {
     int x = 1;
index cd4a9e6..3c120db 100644 (file)
@@ -85,7 +85,7 @@ namespace qrcode {
                                                   int originalStateCountTotal) {
       
       int maxI = image_->getHeight();
-      valarray<int> stateCount(5);
+      valarray<int> stateCount((const int)0, 5);
       
       // Start counting up from center
       int i = startI;
@@ -152,7 +152,7 @@ namespace qrcode {
     {
       
       int maxJ = image_->getWidth();
-      valarray<int> stateCount(5);
+      valarray<int> stateCount((const int)0, 5);
       
       int j = startJ;
       while (j >= 0 && image_->isBlack(j, centerI)) {