From: christian.brunschen Date: Fri, 24 Oct 2008 09:53:01 +0000 (+0000) Subject: initialize valarrays with explicit contents (zero) X-Git-Url: http://git.rot13.org/?p=zxing.git;a=commitdiff_plain;h=d000a3e555eb275088290ac551747f170201a478 initialize valarrays with explicit contents (zero) git-svn-id: http://zxing.googlecode.com/svn/trunk@636 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- diff --git a/cpp/core/src/common/BitArray.cpp b/cpp/core/src/common/BitArray.cpp index 8937eb40..01f1a1b7 100644 --- a/cpp/core/src/common/BitArray.cpp +++ b/cpp/core/src/common/BitArray.cpp @@ -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() { diff --git a/cpp/core/src/common/BitMatrix.cpp b/cpp/core/src/common/BitMatrix.cpp index fe9ae5e4..356e0b30 100644 --- a/cpp/core/src/common/BitMatrix.cpp +++ b/cpp/core/src/common/BitMatrix.cpp @@ -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() { diff --git a/cpp/core/src/common/GridSampler.cpp b/cpp/core/src/common/GridSampler.cpp index 9e9daa1a..4fa57fcc 100644 --- a/cpp/core/src/common/GridSampler.cpp +++ b/cpp/core/src/common/GridSampler.cpp @@ -45,7 +45,7 @@ namespace common { p1FromX, p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY)); Ref bits(new BitMatrix(dimension)); - valarray points(dimension << 1); + valarray points((const float)0.0f, dimension << 1); for (int i = 0; i < dimension; i++) { int max = points.size(); float iValue = (float) i + 0.5f; diff --git a/cpp/core/src/common/reedsolomon/GF256.cpp b/cpp/core/src/common/reedsolomon/GF256.cpp index c6006b37..73062466 100644 --- a/cpp/core/src/common/reedsolomon/GF256.cpp +++ b/cpp/core/src/common/reedsolomon/GF256.cpp @@ -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; diff --git a/cpp/core/src/qrcode/detector/FinderPatternFinder.cpp b/cpp/core/src/qrcode/detector/FinderPatternFinder.cpp index cd4a9e67..3c120dbd 100644 --- a/cpp/core/src/qrcode/detector/FinderPatternFinder.cpp +++ b/cpp/core/src/qrcode/detector/FinderPatternFinder.cpp @@ -85,7 +85,7 @@ namespace qrcode { int originalStateCountTotal) { int maxI = image_->getHeight(); - valarray stateCount(5); + valarray stateCount((const int)0, 5); // Start counting up from center int i = startI; @@ -152,7 +152,7 @@ namespace qrcode { { int maxJ = image_->getWidth(); - valarray stateCount(5); + valarray stateCount((const int)0, 5); int j = startJ; while (j >= 0 && image_->isBlack(j, centerI)) {