mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
initialize valarrays with explicit contents (zero)
git-svn-id: https://zxing.googlecode.com/svn/trunk@636 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
fd9ecdac96
commit
7b8b7e67d1
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue