Logic Error: Argument in message expression is an uninitialized value

99 views Asked by At

I am getting the Logic error when I analyzed my code. It is saying that "Argument in message expression is an uninitialized value"

Here is what I have

// allocate symbol
 int baseMatrixSize = compact ? 11 + layers * 4 : 14 + layers * 4; // not including alignment lines
int alignmentMap[baseMatrixSize];
 int matrixSize;
if (compact) {
// no alignment marks in compact mode, alignmentMap is a no-op
matrixSize = baseMatrixSize;
for (int i = 0; i < baseMatrixSize; i++) {
  alignmentMap[i] = i;
}
} else {
matrixSize = baseMatrixSize + 1 + 2 * ((baseMatrixSize / 2 - 1) / 15);
int origCenter = baseMatrixSize / 2;
int center = matrixSize / 2;
for (int i = 0; i < origCenter; i++) {
  int newOffset = i + i / 15;
  alignmentMap[origCenter - i - 1] = center - newOffset - 1;
  alignmentMap[origCenter + i] = center + newOffset + 1;
}
}
ZXBitMatrix *matrix = [[ZXBitMatrix alloc] initWithDimension:matrixSize];

 // draw data bits
 for (int i = 0, rowOffset = 0; i < layers; i++) {
int rowSize = compact ? (layers - i) * 4 + 9 : (layers - i) * 4 + 12;
for (int j = 0; j < rowSize; j++) {
  int columnOffset = j * 2;
  for (int k = 0; k < 2; k++) {
    if ([messageBits get:rowOffset + columnOffset + k]) {
      [matrix setX:alignmentMap[i * 2 + k] y:alignmentMap[i * 2 + j]];
    }
    if ([messageBits get:rowOffset + rowSize * 2 + columnOffset + k]) {
      [matrix setX:alignmentMap[i * 2 + j] y:alignmentMap[baseMatrixSize - 1 - i * 2 - k]];
    }
    if ([messageBits get:rowOffset + rowSize * 4 + columnOffset + k]) {
      [matrix setX:alignmentMap[baseMatrixSize - 1 - i * 2 - k] y:alignmentMap[baseMatrixSize - 1 - i * 2 - j]];
    }
    if ([messageBits get:rowOffset + rowSize * 6 + columnOffset + k]) {
      [matrix setX:alignmentMap[baseMatrixSize - 1 - i * 2 - j] y:alignmentMap[i * 2 + k]];
    }
  }
}
rowOffset += rowSize * 8;
}

I tried by initializing the matrizSize with 0,but it still gives me the error .

Could you please tell me ,why I am getting this error?

0

There are 0 answers