mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
[cpp] Minor Changes. Changed static members initialization into enum to make the code build with clang, and probably visual c++, removed some dead code detected by clang static analyzer
git-svn-id: https://zxing.googlecode.com/svn/trunk@1689 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
1f46a8e5d8
commit
3e00ecd283
|
@ -91,7 +91,7 @@ void BitMatrix::clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitMatrix::setRegion(size_t left, size_t top, size_t width, size_t height) {
|
void BitMatrix::setRegion(size_t left, size_t top, size_t width, size_t height) {
|
||||||
if (top < 0 || left < 0) {
|
if ((long)top < 0 || (long)left < 0) {
|
||||||
throw IllegalArgumentException("topI and leftJ must be nonnegative");
|
throw IllegalArgumentException("topI and leftJ must be nonnegative");
|
||||||
}
|
}
|
||||||
if (height < 1 || width < 1) {
|
if (height < 1 || width < 1) {
|
||||||
|
|
|
@ -28,9 +28,10 @@ namespace zxing {
|
||||||
class Code128Reader : public OneDReader {
|
class Code128Reader : public OneDReader {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.25f);
|
//static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.25f);
|
||||||
static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f);
|
enum {MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.25f)};
|
||||||
|
//static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f);
|
||||||
|
enum {MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f)};
|
||||||
static const int CODE_SHIFT = 98;
|
static const int CODE_SHIFT = 98;
|
||||||
|
|
||||||
static const int CODE_CODE_C = 99;
|
static const int CODE_CODE_C = 99;
|
||||||
|
|
|
@ -29,9 +29,10 @@ namespace zxing {
|
||||||
class ITFReader : public OneDReader {
|
class ITFReader : public OneDReader {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f);
|
//static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f);
|
||||||
static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f);
|
enum {MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f)};
|
||||||
|
//static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f);
|
||||||
|
enum {MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f)};
|
||||||
// Stores the actual narrow line width of the image being decoded.
|
// Stores the actual narrow line width of the image being decoded.
|
||||||
int narrowLineWidth;
|
int narrowLineWidth;
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,10 @@ namespace zxing {
|
||||||
class UPCEANReader : public OneDReader {
|
class UPCEANReader : public OneDReader {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f);
|
//static const unsigned int MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f);
|
||||||
static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f);
|
enum {MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f)};
|
||||||
|
//static const int MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f);
|
||||||
|
enum {MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.7f)};
|
||||||
|
|
||||||
static bool findStartGuardPattern(Ref<BitArray> row, int* rangeStart, int* rangeEnd);
|
static bool findStartGuardPattern(Ref<BitArray> row, int* rangeStart, int* rangeEnd);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue