[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809

ftylitak ftylitak at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:31 UTC 2010


The following commit has been merged in the upstream branch:
commit bd39a89da708d12a13a48bdafeaba07a30a7eb32
Author: ftylitak <ftylitak at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date:   Wed Jul 14 09:32:32 2010 +0000

    Updated with the latest version of the library. Uses MultiFormatReader instead of QRCodeReader. DataMatrixReader is still not supported.
    
    git-svn-id: http://zxing.googlecode.com/svn/trunk@1481 59b500cc-1b3d-0410-9834-0bbf25fbcc57

diff --git a/symbian/QQrDecoder/QQrDecoder.cpp b/symbian/QQrDecoder/QQrDecoder.cpp
index a20ad1f..7732394 100644
--- a/symbian/QQrDecoder/QQrDecoder.cpp
+++ b/symbian/QQrDecoder/QQrDecoder.cpp
@@ -29,7 +29,8 @@
  ****************************************************************************/
 
 #include "QQrDecoder.h"
-#include <zxing/qrcode/QRCodeReader.h>
+//#include <zxing/qrcode/QRCodeReader.h>
+#include <zxing/MultiFormatReader.h>
 
 #include <zxing/common/GlobalHistogramBinarizer.h>
 #include <zxing/Binarizer.h>
@@ -41,7 +42,7 @@
 #include <QPixmap>
 
 using namespace zxing;
-using namespace zxing::qrcode;
+//using namespace zxing::qrcode;
 
 QQrDecoder::QQrDecoder(QWidget *parent): QMainWindow(parent)
 {
@@ -67,7 +68,7 @@ void QQrDecoder::findAndDecode()
 
 void QQrDecoder::decodeImage(QImage originalImage)
 {
-    QRCodeReader decoder;
+    MultiFormatReader decoder;
 
     image.setImage(originalImage);
 
diff --git a/symbian/QQrDecoder/QQrDecoder.pro b/symbian/QQrDecoder/QQrDecoder.pro
index 6ebb452..3da4ea7 100644
--- a/symbian/QQrDecoder/QQrDecoder.pro
+++ b/symbian/QQrDecoder/QQrDecoder.pro
@@ -61,7 +61,6 @@ HEADERS += CameraImageWrapper.h \
     zxing/qrcode/detector/FinderPatternFinder.h \
     zxing/qrcode/detector/FinderPatternInfo.h \
     zxing/qrcode/detector/QREdgeDetector.h \
-    QQrDecoder.loc \
     QQrDecoder.h
 SOURCES += CameraImageWrapper.cpp \
     zxing/BarcodeFormat.cpp \
@@ -121,8 +120,6 @@ SOURCES += CameraImageWrapper.cpp \
     zxing/qrcode/detector/FinderPatternFinder.cpp \
     zxing/qrcode/detector/FinderPatternInfo.cpp \
     zxing/qrcode/detector/QREdgeDetector.cpp \
-    QQrDecoder.rss \
-    QQrDecoder_reg.rss \
     main.cpp \
     QQrDecoder.cpp
 FORMS += QQrDecoder.ui
diff --git a/symbian/QQrDecoder/QQrDecoder_template.sisx b/symbian/QQrDecoder/QQrDecoder_template.sisx
index 5504691..b60f46f 100644
Binary files a/symbian/QQrDecoder/QQrDecoder_template.sisx and b/symbian/QQrDecoder/QQrDecoder_template.sisx differ
diff --git a/symbian/QQrDecoder/zxing/Binarizer.cpp b/symbian/QQrDecoder/zxing/Binarizer.cpp
index adaab05..1901382 100644
--- a/symbian/QQrDecoder/zxing/Binarizer.cpp
+++ b/symbian/QQrDecoder/zxing/Binarizer.cpp
@@ -23,15 +23,17 @@
 
 namespace zxing {
 	
-	Binarizer::Binarizer(Ref<LuminanceSource> source) : source_(source), array_(NULL), matrix_(NULL) {
+	Binarizer::Binarizer(Ref<LuminanceSource> source) : source_(source), array_(NULL), matrix_(NULL), cached_y_(-1) {
 	}
 	
 	Binarizer::~Binarizer() {
 	}
 	
 	Ref<BitArray> Binarizer::getBlackRow(int y, Ref<BitArray> row){
-		if (array_ == NULL)
+		if (array_ == NULL && cached_y_ != y) {
 			array_ = estimateBlackRow(y, row);
+			cached_y_ = y;
+		}
 		return array_;
 	}
 	
diff --git a/symbian/QQrDecoder/zxing/Binarizer.h b/symbian/QQrDecoder/zxing/Binarizer.h
index ea1240c..694018d 100644
--- a/symbian/QQrDecoder/zxing/Binarizer.h
+++ b/symbian/QQrDecoder/zxing/Binarizer.h
@@ -28,24 +28,25 @@
 #include <zxing/common/Counted.h>
 
 namespace zxing {
-	
-	class Binarizer : public Counted {
-	private:
-		Ref<LuminanceSource> source_;
-		Ref<BitMatrix> matrix_;
-		Ref<BitArray> array_;
-		
-	public:
-		Binarizer(Ref<LuminanceSource> source);
-		virtual ~Binarizer();
-		
-		virtual Ref<BitArray> estimateBlackRow(int y, Ref<BitArray> row)=0;
-		Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
-		
-		virtual Ref<BitMatrix> estimateBlackMatrix() = 0;
-		Ref<BitMatrix> getBlackMatrix();
-		Ref<LuminanceSource> getSource();
-	};
-	
+
+class Binarizer : public Counted {
+ private:
+  Ref<LuminanceSource> source_;
+  Ref<BitArray> array_;
+  Ref<BitMatrix> matrix_;
+  int cached_y_;
+
+ public:
+  Binarizer(Ref<LuminanceSource> source);
+  virtual ~Binarizer();
+
+  virtual Ref<BitArray> estimateBlackRow(int y, Ref<BitArray> row)=0;
+  Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
+
+  virtual Ref<BitMatrix> estimateBlackMatrix() = 0;
+  Ref<BitMatrix> getBlackMatrix();
+  Ref<LuminanceSource> getSource();
+};
+
 }
 #endif /* BINARIZER_H_ */
diff --git a/symbian/QQrDecoder/zxing/BinaryBitmap.cpp b/symbian/QQrDecoder/zxing/BinaryBitmap.cpp
index c8fea36..ff79b55 100644
--- a/symbian/QQrDecoder/zxing/BinaryBitmap.cpp
+++ b/symbian/QQrDecoder/zxing/BinaryBitmap.cpp
@@ -23,7 +23,7 @@
 
 namespace zxing {
 	
-	BinaryBitmap::BinaryBitmap(Ref<Binarizer> binarizer) : bits_(NULL), array_bits_(NULL), binarizer_(binarizer) {
+	BinaryBitmap::BinaryBitmap(Ref<Binarizer> binarizer) : bits_(NULL), array_bits_(NULL), binarizer_(binarizer), cached_y_(-1) {
 		
 	}
 	
@@ -31,8 +31,9 @@ namespace zxing {
 	}
 	
 	Ref<BitArray> BinaryBitmap::getBlackRow(int y, Ref<BitArray> row) {
-		if (array_bits_ == NULL) {
+		if (array_bits_ == NULL && cached_y_ != y) {
 			array_bits_ = binarizer_->getBlackRow(y, row);
+			cached_y_ = y;
 		}
 		return array_bits_;
 	}
diff --git a/symbian/QQrDecoder/zxing/BinaryBitmap.h b/symbian/QQrDecoder/zxing/BinaryBitmap.h
index ecd9a85..ddea910 100644
--- a/symbian/QQrDecoder/zxing/BinaryBitmap.h
+++ b/symbian/QQrDecoder/zxing/BinaryBitmap.h
@@ -33,6 +33,7 @@ namespace zxing {
 		Ref<BitMatrix> bits_;
 		Ref<BitArray> array_bits_;
 		Ref<Binarizer> binarizer_;
+		int cached_y_;
 		
 	public:
 		BinaryBitmap(Ref<Binarizer> binarizer);
diff --git a/symbian/QQrDecoder/zxing/LuminanceSource.cpp b/symbian/QQrDecoder/zxing/LuminanceSource.cpp
index d7af375..6c8ef1e 100644
--- a/symbian/QQrDecoder/zxing/LuminanceSource.cpp
+++ b/symbian/QQrDecoder/zxing/LuminanceSource.cpp
@@ -28,7 +28,7 @@ LuminanceSource::LuminanceSource() {
 LuminanceSource::~LuminanceSource() {
 }
 
-unsigned char* LuminanceSource::copyMatrix() const {
+unsigned char* LuminanceSource::copyMatrix() {
   int width = getWidth();
   int height =  getHeight();
   unsigned char* matrix = new unsigned char[width*height];
diff --git a/symbian/QQrDecoder/zxing/LuminanceSource.h b/symbian/QQrDecoder/zxing/LuminanceSource.h
index fcc6588..d39f06f 100644
--- a/symbian/QQrDecoder/zxing/LuminanceSource.h
+++ b/symbian/QQrDecoder/zxing/LuminanceSource.h
@@ -34,7 +34,7 @@ public:
   virtual int getHeight() const = 0;
 
   virtual unsigned char getPixel(int x, int y) const = 0;
-  virtual unsigned char* copyMatrix() const;
+  virtual unsigned char* copyMatrix();
 };
 
 }
diff --git a/symbian/QQrDecoder/zxing/MultiFormatReader.cpp b/symbian/QQrDecoder/zxing/MultiFormatReader.cpp
index 169283f..bacb3cd 100644
--- a/symbian/QQrDecoder/zxing/MultiFormatReader.cpp
+++ b/symbian/QQrDecoder/zxing/MultiFormatReader.cpp
@@ -19,7 +19,7 @@
  * limitations under the License.
  */
 
-#include "MultiFormatReader.h"
+#include <zxing/MultiFormatReader.h>
 #include <zxing/qrcode/QRCodeReader.h>
 //#include <zxing/datamatrix/DataMatrixReader.h>
 #include <zxing/oned/MultiFormatUPCEANReader.h>
@@ -27,23 +27,27 @@
 #include <zxing/ReaderException.h>
 
 namespace zxing {
-	MultiFormatReader::MultiFormatReader() : readers() {
-    readers.push_back(Ref<Reader>(new zxing::qrcode::QRCodeReader()));
-		//readers.push_back(Ref<Reader>(new zxing::datamatrix::DataMatrixReader()));
-		readers.push_back(Ref<Reader>(new zxing::oned::MultiFormatUPCEANReader()));
-		readers.push_back(Ref<Reader>(new zxing::oned::MultiFormatOneDReader()));
+	MultiFormatReader::MultiFormatReader() {
+		readers.push_back(new zxing::qrcode::QRCodeReader());
+		//readers.push_back(new zxing::datamatrix::DataMatrixReader());
+		readers.push_back(new zxing::oned::MultiFormatUPCEANReader());
+		readers.push_back(new zxing::oned::MultiFormatOneDReader());
 	}
 	
 	Ref<Result> MultiFormatReader::decode(Ref<BinaryBitmap> image){
-		int size = readers.size();
-		for (int i = 0; i < size; i++) {
-			Ref<Reader> reader = readers[i];
+		for (unsigned int i = 0; i < readers.size(); i++) {
 			try {
-				return reader->decode(image);
+				return readers[i]->decode(image);
 			} catch (ReaderException re) {
 				// continue
 			}
 		}
 		throw ReaderException("No code detected");
 	}
+	
+	MultiFormatReader::~MultiFormatReader(){
+		for (unsigned int i = 0; i < readers.size(); i++) {
+			delete readers[i];
+		}
+	}
 }
diff --git a/symbian/QQrDecoder/zxing/MultiFormatReader.h b/symbian/QQrDecoder/zxing/MultiFormatReader.h
index 4cbe61b..f88ebc9 100644
--- a/symbian/QQrDecoder/zxing/MultiFormatReader.h
+++ b/symbian/QQrDecoder/zxing/MultiFormatReader.h
@@ -3,6 +3,7 @@
  *  ZXing
  *
  *  Created by Lukasz Warchol on 10-01-26.
+ *  Modified by Luiz Silva on 09/02/2010.
  *  Copyright 2010 ZXing authors All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,11 +28,12 @@ namespace zxing {
 	class MultiFormatReader : public Reader {
 		
 	private:
-		std::vector<Ref<Reader> >readers;
+		std::vector<Reader*>readers;
 	public:
 		MultiFormatReader();
 		
 		Ref<Result> decode(Ref<BinaryBitmap> image);
   
+		~MultiFormatReader();
 	};
 }
diff --git a/symbian/QQrDecoder/zxing/common/BitArray.cpp b/symbian/QQrDecoder/zxing/common/BitArray.cpp
index 9355d01..6ba7fd2 100644
--- a/symbian/QQrDecoder/zxing/common/BitArray.cpp
+++ b/symbian/QQrDecoder/zxing/common/BitArray.cpp
@@ -107,10 +107,12 @@ vector<unsigned int>& BitArray::getBitArray() {
   return bits_;
 }
 void BitArray::reverse() {
-  unsigned int allBits = numeric_limits<unsigned int>::max();
-  size_t max = bits_.size();
-  for (size_t i = 0; i < max; i++) {
-    bits_[i] = bits_[i] ^ allBits;
+  std::vector<unsigned int> newBits(bits_.size(),(const unsigned int) 0);
+  for (size_t i = 0; i < size_; i++) {
+    if (get(size_ - i - 1)) {
+      newBits[i >> logBits_] |= 1<< (i & bitsMask_);
+    }
   }
+  bits_ = newBits;
 }
 }
diff --git a/symbian/QQrDecoder/zxing/common/GlobalHistogramBinarizer.cpp b/symbian/QQrDecoder/zxing/common/GlobalHistogramBinarizer.cpp
index 61615d3..8b99611 100644
--- a/symbian/QQrDecoder/zxing/common/GlobalHistogramBinarizer.cpp
+++ b/symbian/QQrDecoder/zxing/common/GlobalHistogramBinarizer.cpp
@@ -24,154 +24,160 @@
 #include <zxing/common/IllegalArgumentException.h>
 
 namespace zxing {
-	using namespace std;
-	
-	const int LUMINANCE_BITS = 5;
-	const int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
-	const int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
-	
-	GlobalHistogramBinarizer::GlobalHistogramBinarizer(Ref<LuminanceSource> source) :
-    Binarizer(source) {
-		
-	}
-	
-	GlobalHistogramBinarizer::~GlobalHistogramBinarizer() {
-	}
-	
-	
-	Ref<BitArray> GlobalHistogramBinarizer::estimateBlackRow(int y, Ref<BitArray> row){
-		vector<int> histogram(LUMINANCE_BUCKETS, 0);
-		LuminanceSource& source = *getSource();
-		int width = source.getWidth();
-		if (row == NULL || row->getSize() < width) {
-			row = new BitArray(width);
-		} else {
-			row->clear();
-		}
-		
-		for (int x = 0; x < width; x++) {
-			unsigned char pixel = source.getPixel(x, y);
-			histogram[pixel >> LUMINANCE_SHIFT]++;
-		}
-		int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
-		
-		
-		Ref<BitArray> array_ref(new BitArray(width));
-		BitArray& array = *array_ref;
-		
-		int left = source.getPixel(0, y);
-		int center = source.getPixel(1, y);
-		for (int x = 1; x < width - 1; x++) {
-			int right = source.getPixel(x+1, y);
-			// A simple -1 4 -1 box filter with a weight of 2.
-			int luminance = ((center << 2) - left - right) >> 1;
-			if (luminance < blackPoint) {
-				array.set(x);
-			}
-			left = center;
-			center = right;
-		}
-		
-		return array_ref;
-	}
-	
-	Ref<BitMatrix> GlobalHistogramBinarizer::estimateBlackMatrix() {
-		// Faster than working with the reference
-		LuminanceSource& source = *getSource();
-		int width = source.getWidth();
-		int height = source.getHeight();
-		vector<int> histogram(LUMINANCE_BUCKETS, 0);
-		
-		
-		// Quickly calculates the histogram by sampling four rows from the image. This proved to be
-		// more robust on the blackbox tests than sampling a diagonal as we used to do.
-		for (int y = 1; y < 5; y++) {
-			int row = height * y / 5;
-			int right = (width << 2) / 5;
-			int sdf;
-			for (int x = width / 5; x < right; x++) {
-				unsigned char pixel = source.getPixel(x, row);
-				histogram[pixel >> LUMINANCE_SHIFT]++;
-				sdf = histogram[pixel >> LUMINANCE_SHIFT];
-			}
-		}
-		
-		int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
-		
-		Ref<BitMatrix> matrix_ref(new BitMatrix(width, height));
-		BitMatrix& matrix = *matrix_ref;
-		for (int y = 0; y < height; y++) {
-			for (int x = 0; x < width; x++) {
-				if (source.getPixel(x, y) <= blackPoint)
-					matrix.set(x, y);
-			}
-		}
-		return matrix_ref;
-	}
-	
-	int GlobalHistogramBinarizer::estimate(vector<int> &histogram) {
-		int numBuckets = histogram.size();
-		int maxBucketCount = 0;
-		
-		
-		// Find tallest peak in histogram
-		int firstPeak = 0;
-		int firstPeakSize = 0;
-		for (int i = 0; i < numBuckets; i++) {
-			if (histogram[i] > firstPeakSize) {
-				firstPeak = i;
-				firstPeakSize = histogram[i];
-			}
-			if (histogram[i] > maxBucketCount) {
-				maxBucketCount = histogram[i];
-			}
-		}
-		
-		// Find second-tallest peak -- well, another peak that is tall and not
-		// so close to the first one
-		int secondPeak = 0;
-		int secondPeakScore = 0;
-		for (int i = 0; i < numBuckets; i++) {
-			int distanceToBiggest = i - firstPeak;
-			// Encourage more distant second peaks by multiplying by square of distance
-			int score = histogram[i] * distanceToBiggest * distanceToBiggest;
-			if (score > secondPeakScore) {
-				secondPeak = i;
-				secondPeakScore = score;
-			}
-		}
-		
-		// Put firstPeak first
-		if (firstPeak > secondPeak) {
-			int temp = firstPeak;
-			firstPeak = secondPeak;
-			secondPeak = temp;
-		}
-		
-		// Kind of arbitrary; if the two peaks are very close, then we figure there is so little
-		// dynamic range in the image, that discriminating black and white is too error-prone.
-		// Decoding the image/line is either pointless, or may in some cases lead to a false positive
-		// for 1D formats, which are relatively lenient.
-		// We arbitrarily say "close" is "<= 1/16 of the total histogram buckets apart"
-		if (secondPeak - firstPeak <= numBuckets >> 4) {
-			throw IllegalArgumentException("Too little dynamic range in luminance");
-		}
-		
-		// Find a valley between them that is low and closer to the white peak
-		int bestValley = secondPeak - 1;
-		int bestValleyScore = -1;
-		for (int i = secondPeak - 1; i > firstPeak; i--) {
-			int fromFirst = i - firstPeak;
-			// Favor a "valley" that is not too close to either peak -- especially not the black peak --
-			// and that has a low value of course
-			int score = fromFirst * fromFirst * (secondPeak - i) * (maxBucketCount - histogram[i]);
-			if (score > bestValleyScore) {
-				bestValley = i;
-				bestValleyScore = score;
-			}
-		}
-		
-		return bestValley;
-	}
-	
+using namespace std;
+
+const int LUMINANCE_BITS = 5;
+const int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
+const int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
+
+GlobalHistogramBinarizer::GlobalHistogramBinarizer(Ref<LuminanceSource> source) :
+  Binarizer(source) {
+
+}
+
+GlobalHistogramBinarizer::~GlobalHistogramBinarizer() {
+}
+
+
+Ref<BitArray> GlobalHistogramBinarizer::estimateBlackRow(int y,
+  Ref<BitArray> row){
+  vector<int> histogram(LUMINANCE_BUCKETS, 0);
+  LuminanceSource& source = *getSource();
+  int width = source.getWidth();
+  if (row == NULL || static_cast<int>(row->getSize()) < width) {
+    row = new BitArray(width);
+  } else {
+    row->clear();
+  }
+
+  for (int x = 0; x < width; x++) {
+    unsigned char pixel = source.getPixel(x, y);
+    histogram[pixel >> LUMINANCE_SHIFT]++;
+  }
+  int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
+
+
+  Ref<BitArray> array_ref(new BitArray(width));
+  BitArray& array = *array_ref;
+
+  int left = source.getPixel(0, y);
+  int center = source.getPixel(1, y);
+  for (int x = 1; x < width - 1; x++) {
+    int right = source.getPixel(x+1, y);
+    // A simple -1 4 -1 box filter with a weight of 2.
+    int luminance = ((center << 2) - left - right) >> 1;
+    if (luminance < blackPoint) {
+      array.set(x);
+    }
+    left = center;
+    center = right;
+  }
+
+  return array_ref;
+}
+
+Ref<BitMatrix> GlobalHistogramBinarizer::estimateBlackMatrix() {
+  // Faster than working with the reference
+  LuminanceSource& source = *getSource();
+  int width = source.getWidth();
+  int height = source.getHeight();
+  vector<int> histogram(LUMINANCE_BUCKETS, 0);
+
+
+  // Quickly calculates the histogram by sampling four rows from the image.
+  // This proved to be more robust on the blackbox tests than sampling a
+  // diagonal as we used to do.
+  for (int y = 1; y < 5; y++) {
+    int row = height * y / 5;
+    int right = (width << 2) / 5;
+    int sdf;
+    for (int x = width / 5; x < right; x++) {
+      unsigned char pixel = source.getPixel(x, row);
+      histogram[pixel >> LUMINANCE_SHIFT]++;
+      sdf = histogram[pixel >> LUMINANCE_SHIFT];
+    }
+  }
+
+  int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
+
+  Ref<BitMatrix> matrix_ref(new BitMatrix(width, height));
+  BitMatrix& matrix = *matrix_ref;
+  for (int y = 0; y < height; y++) {
+    for (int x = 0; x < width; x++) {
+      if (source.getPixel(x, y) <= blackPoint)
+        matrix.set(x, y);
+    }
+  }
+  return matrix_ref;
 }
+
+int GlobalHistogramBinarizer::estimate(vector<int> &histogram) {
+  int numBuckets = histogram.size();
+  int maxBucketCount = 0;
+
+
+  // Find tallest peak in histogram
+  int firstPeak = 0;
+  int firstPeakSize = 0;
+  for (int i = 0; i < numBuckets; i++) {
+    if (histogram[i] > firstPeakSize) {
+      firstPeak = i;
+      firstPeakSize = histogram[i];
+    }
+    if (histogram[i] > maxBucketCount) {
+      maxBucketCount = histogram[i];
+    }
+  }
+
+  // Find second-tallest peak -- well, another peak that is tall and not
+  // so close to the first one
+  int secondPeak = 0;
+  int secondPeakScore = 0;
+  for (int i = 0; i < numBuckets; i++) {
+    int distanceToBiggest = i - firstPeak;
+    // Encourage more distant second peaks by multiplying by square of distance
+    int score = histogram[i] * distanceToBiggest * distanceToBiggest;
+    if (score > secondPeakScore) {
+      secondPeak = i;
+      secondPeakScore = score;
+    }
+  }
+
+  // Put firstPeak first
+  if (firstPeak > secondPeak) {
+    int temp = firstPeak;
+    firstPeak = secondPeak;
+    secondPeak = temp;
+  }
+
+  // Kind of arbitrary; if the two peaks are very close, then we figure there is
+  // so little dynamic range in the image, that discriminating black and white
+  // is too error-prone.
+  // Decoding the image/line is either pointless, or may in some cases lead to
+  // a false positive for 1D formats, which are relatively lenient.
+  // We arbitrarily say "close" is
+  // "<= 1/16 of the total histogram buckets apart"
+  if (secondPeak - firstPeak <= numBuckets >> 4) {
+    throw IllegalArgumentException("Too little dynamic range in luminance");
+  }
+
+  // Find a valley between them that is low and closer to the white peak
+  int bestValley = secondPeak - 1;
+  int bestValleyScore = -1;
+  for (int i = secondPeak - 1; i > firstPeak; i--) {
+    int fromFirst = i - firstPeak;
+    // Favor a "valley" that is not too close to either peak -- especially not
+    // the black peak -- and that has a low value of course
+    int score = fromFirst * fromFirst * (secondPeak - i) *
+      (maxBucketCount - histogram[i]);
+    if (score > bestValleyScore) {
+      bestValley = i;
+      bestValleyScore = score;
+    }
+  }
+
+  return bestValley;
+}
+
+} // namespace zxing
+
diff --git a/symbian/QQrDecoder/zxing/common/PerspectiveTransform.cpp b/symbian/QQrDecoder/zxing/common/PerspectiveTransform.cpp
index 16d1327..5b4ae2e 100644
--- a/symbian/QQrDecoder/zxing/common/PerspectiveTransform.cpp
+++ b/symbian/QQrDecoder/zxing/common/PerspectiveTransform.cpp
@@ -28,8 +28,8 @@ PerspectiveTransform::PerspectiveTransform(float inA11, float inA21,
                                            float inA22, float inA32, 
                                            float inA13, float inA23, 
                                            float inA33) : 
-  a11(inA11), a21(inA21), a31(inA31), a12(inA12), a22(inA22), a32(inA32),
-  a13(inA13), a23(inA23), a33(inA33) {}
+  a11(inA11), a12(inA12), a13(inA13), a21(inA21), a22(inA22), a23(inA23),
+  a31(inA31), a32(inA32), a33(inA33) {}
 
 Ref<PerspectiveTransform> PerspectiveTransform::quadrilateralToQuadrilateral(float x0, float y0, float x1, float y1,
     float x2, float y2, float x3, float y3, float x0p, float y0p, float x1p, float y1p, float x2p, float y2p,
diff --git a/symbian/QQrDecoder/zxing/common/reedsolomon/GF256.cpp b/symbian/QQrDecoder/zxing/common/reedsolomon/GF256.cpp
index 35fc692..51b621e 100644
--- a/symbian/QQrDecoder/zxing/common/reedsolomon/GF256.cpp
+++ b/symbian/QQrDecoder/zxing/common/reedsolomon/GF256.cpp
@@ -109,13 +109,10 @@ int GF256::multiply(int a, int b) {
   if (a == 0 || b == 0) {
     return 0;
   }
-  if (a == 1) {
-    return b;
-  }
-  if (b == 1) {
-    return a;
-  }
-  return exp_[(log_[a] + log_[b]) % 255];
+  int logSum = log_[a] + log_[b];
+  // index is a sped-up alternative to logSum % 255 since sum
+  // is in [0,510]. Thanks to jmsachs for the idea
+  return exp_[(logSum & 0xFF) + (logSum >> 8)];
 }
 
 GF256 GF256::QR_CODE_FIELD(0x011D); // x^8 + x^4 + x^3 + x^2 + 1
diff --git a/cpp/core/src/zxing/datamatrix/DataMatrixReader.cpp b/symbian/QQrDecoder/zxing/datamatrix/DataMatrixReader.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/DataMatrixReader.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/DataMatrixReader.cpp
diff --git a/cpp/core/src/zxing/datamatrix/DataMatrixReader.h b/symbian/QQrDecoder/zxing/datamatrix/DataMatrixReader.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/DataMatrixReader.h
copy to symbian/QQrDecoder/zxing/datamatrix/DataMatrixReader.h
diff --git a/cpp/core/src/zxing/datamatrix/Version.cpp b/symbian/QQrDecoder/zxing/datamatrix/Version.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/Version.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/Version.cpp
diff --git a/cpp/core/src/zxing/datamatrix/Version.h b/symbian/QQrDecoder/zxing/datamatrix/Version.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/Version.h
copy to symbian/QQrDecoder/zxing/datamatrix/Version.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.cpp b/symbian/QQrDecoder/zxing/datamatrix/decoder/BitMatrixParser.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/BitMatrixParser.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.h b/symbian/QQrDecoder/zxing/datamatrix/decoder/BitMatrixParser.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.h
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/BitMatrixParser.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DataBlock.cpp b/symbian/QQrDecoder/zxing/datamatrix/decoder/DataBlock.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DataBlock.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/DataBlock.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DataBlock.h b/symbian/QQrDecoder/zxing/datamatrix/decoder/DataBlock.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DataBlock.h
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/DataBlock.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp b/symbian/QQrDecoder/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h b/symbian/QQrDecoder/zxing/datamatrix/decoder/DecodedBitStreamParser.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/DecodedBitStreamParser.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/Decoder.cpp b/symbian/QQrDecoder/zxing/datamatrix/decoder/Decoder.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/Decoder.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/Decoder.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/Decoder.h b/symbian/QQrDecoder/zxing/datamatrix/decoder/Decoder.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/Decoder.h
copy to symbian/QQrDecoder/zxing/datamatrix/decoder/Decoder.h
diff --git a/cpp/core/src/zxing/datamatrix/detector/CornerPoint.cpp b/symbian/QQrDecoder/zxing/datamatrix/detector/CornerPoint.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/CornerPoint.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/detector/CornerPoint.cpp
diff --git a/cpp/core/src/zxing/datamatrix/detector/CornerPoint.h b/symbian/QQrDecoder/zxing/datamatrix/detector/CornerPoint.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/CornerPoint.h
copy to symbian/QQrDecoder/zxing/datamatrix/detector/CornerPoint.h
diff --git a/cpp/core/src/zxing/datamatrix/detector/Detector.cpp b/symbian/QQrDecoder/zxing/datamatrix/detector/Detector.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/Detector.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/detector/Detector.cpp
diff --git a/cpp/core/src/zxing/datamatrix/detector/Detector.h b/symbian/QQrDecoder/zxing/datamatrix/detector/Detector.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/Detector.h
copy to symbian/QQrDecoder/zxing/datamatrix/detector/Detector.h
diff --git a/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp b/symbian/QQrDecoder/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp
copy to symbian/QQrDecoder/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp
diff --git a/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.h b/symbian/QQrDecoder/zxing/datamatrix/detector/MonochromeRectangleDetector.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.h
copy to symbian/QQrDecoder/zxing/datamatrix/detector/MonochromeRectangleDetector.h
diff --git a/symbian/QQrDecoder/zxing/oned/Code128Reader.cpp b/symbian/QQrDecoder/zxing/oned/Code128Reader.cpp
index 6f638d5..36ab5dc 100644
--- a/symbian/QQrDecoder/zxing/oned/Code128Reader.cpp
+++ b/symbian/QQrDecoder/zxing/oned/Code128Reader.cpp
@@ -24,6 +24,7 @@
 #include <zxing/ReaderException.h>
 #include <math.h>
 #include <string.h>
+#include <sstream>
 
 namespace zxing {
 	namespace oned {
@@ -166,10 +167,10 @@ namespace zxing {
 					counters[counterPosition]++;
 				} else {
 					if (counterPosition == patternLength - 1) {
-						int bestVariance = MAX_AVG_VARIANCE;
+						unsigned int bestVariance = MAX_AVG_VARIANCE;
 						int bestMatch = -1;
 						for (int startCode = CODE_START_A; startCode <= CODE_START_C; startCode++) {
-							int variance = patternMatchVariance(counters, sizeof(counters)/sizeof(int), CODE_PATTERNS[startCode], MAX_INDIVIDUAL_VARIANCE);
+							unsigned int variance = patternMatchVariance(counters, sizeof(counters)/sizeof(int), CODE_PATTERNS[startCode], MAX_INDIVIDUAL_VARIANCE);
 							if (variance < bestVariance) {
 								bestVariance = variance;
 								bestMatch = startCode;
@@ -204,7 +205,7 @@ namespace zxing {
 		
 		int Code128Reader::decodeCode(Ref<BitArray> row, int counters[], int countersCount, int rowOffset){
 			recordPattern(row, rowOffset, counters, countersCount);
-			int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
+			unsigned int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
 			int bestMatch = -1;
 			for (int d = 0; d < CODE_PATTERNS_LENGTH; d++) {
 				int pattern[countersLength];
@@ -213,7 +214,7 @@ namespace zxing {
 					pattern[ind] = CODE_PATTERNS[d][ind];
 				}
 //				memcpy(pattern, CODE_PATTERNS[d], countersLength);
-				int variance = patternMatchVariance(counters, countersCount, pattern, MAX_INDIVIDUAL_VARIANCE);
+				unsigned int variance = patternMatchVariance(counters, countersCount, pattern, MAX_INDIVIDUAL_VARIANCE);
 				if (variance < bestVariance) {
 					bestVariance = variance;
 					bestMatch = d;
@@ -251,7 +252,7 @@ namespace zxing {
 			bool isNextShifted = false;
 			
 			std::string tmpResultString;
-
+			std::stringstream tmpResultSStr; // used if its Code 128C
 			
 			int lastStart = startPatternInfo[0];
 			int nextStart = startPatternInfo[1];
@@ -373,11 +374,11 @@ namespace zxing {
 						}
 						break;
 					case CODE_CODE_C:
+					// the code read in this case is the number encoded directly
 						if (code < 100) {
-							if (code < 10) {
-								tmpResultString.append(1, '0');
-							}
-							tmpResultString.append(1, code);
+							if (code < 10) 
+							tmpResultSStr << '0';
+						tmpResultSStr << code;
 						} else {
 							if (code != CODE_STOP) {
 								lastCharacterWasPrintable = false;
@@ -437,6 +438,9 @@ namespace zxing {
 				throw ReaderException("");
 			}
 			
+			if (codeSet == CODE_CODE_C)
+				tmpResultString.append(tmpResultSStr.str());
+			
 			// Need to pull out the check digits from string
 			int resultLength = tmpResultString.length();
 			// Only bother if the result had at least one character, and if the checksum digit happened to
diff --git a/symbian/QQrDecoder/zxing/oned/Code128Reader.h b/symbian/QQrDecoder/zxing/oned/Code128Reader.h
index ad191aa..2b6752e 100644
--- a/symbian/QQrDecoder/zxing/oned/Code128Reader.h
+++ b/symbian/QQrDecoder/zxing/oned/Code128Reader.h
@@ -27,7 +27,7 @@ namespace zxing {
 		class Code128Reader : public OneDReader {
 			
 		private:
-			static const int MAX_AVG_VARIANCE = (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);
 			
 			static const int CODE_SHIFT = 98;
diff --git a/symbian/QQrDecoder/zxing/oned/Code39Reader.cpp b/symbian/QQrDecoder/zxing/oned/Code39Reader.cpp
index 92e63b5..337f237 100644
--- a/symbian/QQrDecoder/zxing/oned/Code39Reader.cpp
+++ b/symbian/QQrDecoder/zxing/oned/Code39Reader.cpp
@@ -26,321 +26,333 @@
 #include <limits.h>
 
 namespace zxing {
-	namespace oned {
-		
-		static const char* ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
-		
-		
-		/**
-		 * These represent the encodings of characters, as patterns of wide and narrow bars.
-		 * The 9 least-significant bits of each int correspond to the pattern of wide and narrow,
-		 * with 1s representing "wide" and 0s representing narrow.
-		 */
-		const int CHARACTER_ENCODINGS_LEN = 44;
-		static int CHARACTER_ENCODINGS[CHARACTER_ENCODINGS_LEN] = {
-			0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, // 0-9
-			0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, // A-J
-			0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, // K-T
-			0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, // U-*
-			0x0A8, 0x0A2, 0x08A, 0x02A // $-%
-		};
-		
-		static int ASTERISK_ENCODING = 0x094;
-		static const char* ALPHABET_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
-	
-		
-		/**
-		 * Creates a reader that assumes all encoded data is data, and does not treat the final
-		 * character as a check digit. It will not decoded "extended Code 39" sequences.
-		 */
-		Code39Reader::Code39Reader() : alphabet_string(ALPHABET_STRING), 
-                                   usingCheckDigit(false), 
-                                   extendedMode(false) {
-		}
-		
-		/**
-		 * Creates a reader that can be configured to check the last character as a check digit.
-		 * It will not decoded "extended Code 39" sequences.
-		 *
-		 * @param usingCheckDigit if true, treat the last data character as a check digit, not
-		 * data, and verify that the checksum passes.
-		 */
-		Code39Reader::Code39Reader(bool usingCheckDigit_) : alphabet_string(ALPHABET_STRING), 
-                                                        usingCheckDigit(usingCheckDigit_), 
-                                                        extendedMode(false) {
-		}
- 
-
-		
-		Ref<Result> Code39Reader::decodeRow(int rowNumber, Ref<BitArray> row){
-			int* start = findAsteriskPattern(row);
-			int nextStart = start[1];
-			int end = row->getSize();
-			
-			// Read off white space
-			while (nextStart < end && !row->get(nextStart)) {
-				nextStart++;
-			}
-			
-			std::string tmpResultString;
-			
-			int countersLen = 9;
-			int* counters = new int[countersLen];
-			for (int i=0; i<countersLen; i++) {
-				counters[i] = 0;
-			}
-			char decodedChar;
-			int lastStart;
-			do {
-				try {
-				recordPattern(row, nextStart, counters, countersLen);
-				} catch (ReaderException re) {
-					delete [] start;
-					throw re;
-				}
-				int pattern = toNarrowWidePattern(counters, countersLen);
-				if (pattern < 0) {
-					delete [] start;
-					throw ReaderException("pattern < 0");
-				}
-				decodedChar = patternToChar(pattern);
-				tmpResultString.append(1, decodedChar);
-				lastStart = nextStart;
-				for (int i = 0; i < countersLen; i++) {
-					nextStart += counters[i];
-				}
-				// Read off white space
-				while (nextStart < end && !row->get(nextStart)) {
-					nextStart++;
-				}
-			} while (decodedChar != '*');
-			tmpResultString.erase(tmpResultString.length()-1, 1);// remove asterisk
-			
-			// Look for whitespace after pattern:
-			int lastPatternSize = 0;
-			for (int i = 0; i < countersLen; i++) {
-				lastPatternSize += counters[i];
-			}
-			// IS begin
-			delete [] counters;
-			// IS end
-			int whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
-			// If 50% of last pattern size, following last pattern, is not whitespace, fail
-			// (but if it's whitespace to the very end of the image, that's OK)
-			if (nextStart != end && whiteSpaceAfterEnd / 2 < lastPatternSize) {
-				delete [] start;
-				throw ReaderException("too short end white space");
-			}
-			
-			if (usingCheckDigit) {
-				int max = tmpResultString.length() - 1;
-				int total = 0;
-				for (int i = 0; i < max; i++) {
-					total += alphabet_string.find_first_of(tmpResultString[i], 0);
-				}
-				if (total % 43 != alphabet_string.find_first_of(tmpResultString[max], 0)) {
-					throw ReaderException("");
-				}
-				tmpResultString.erase(max, 1);
-			}
-			
-			
-			
-			
-			Ref<String> resultString(new String(tmpResultString));
-			if (extendedMode) {
-				delete resultString;
-				resultString = decodeExtended(tmpResultString);
-			}
-			
-			if (tmpResultString.length() == 0) {
-				delete [] start;
-				// Almost surely a false positive
-				throw ReaderException("");
-			}
-			
-			float left = (float) (start[1] + start[0]) / 2.0f;
-			float right = (float) (nextStart + lastStart) / 2.0f;
-			
-			std::vector< Ref<ResultPoint> > resultPoints(2);
-			Ref<OneDResultPoint> resultPoint1(new OneDResultPoint(left, (float) rowNumber));
-			Ref<OneDResultPoint> resultPoint2(new OneDResultPoint(right, (float) rowNumber));
-			resultPoints[0] = resultPoint1;
-			resultPoints[1] = resultPoint2;
-			
-			ArrayRef<unsigned char> resultBytes(1);
-			
-			delete [] start;
-			
-			Ref<Result> res(new Result(resultString, resultBytes, resultPoints, BarcodeFormat_CODE_39));
-			return res;
-		}
-		
-		int* Code39Reader::findAsteriskPattern(Ref<BitArray> row){
-			int width = row->getSize();
-			int rowOffset = 0;
-			while (rowOffset < width) {
-				if (row->get(rowOffset)) {
-					break;
-				}
-				rowOffset++;
-			}
-			
-			int counterPosition = 0;
-			int countersLen = 9;
-			int* counters = new int[countersLen];
-			for (int i=0; i<countersLen; i++) {
-				counters[i] = 0;
-			}
-			int patternStart = rowOffset;
-			bool isWhite = false;
-			int patternLength = countersLen;
-			
-			for (int i = rowOffset; i < width; i++) {
-				bool pixel = row->get(i);
-				if (pixel ^ isWhite) {
-					counters[counterPosition]++;
-				} else {
-					if (counterPosition == patternLength - 1) {
-						if (toNarrowWidePattern(counters, countersLen) == ASTERISK_ENCODING) {
-							// Look for whitespace before start pattern, >= 50% of width of start pattern
-							if (row->isRange(fmaxl(0, patternStart - (i - patternStart) / 2), patternStart, false)) {
-								int* resultValue = new int[2];
-								resultValue[0] = patternStart;
-								resultValue[1] = i;
-								return resultValue;
-							}
-						}
-						patternStart += counters[0] + counters[1];
-						for (int y = 2; y < patternLength; y++) {
-							counters[y - 2] = counters[y];
-						}
-						counters[patternLength - 2] = 0;
-						counters[patternLength - 1] = 0;
-						counterPosition--;
-					} else {
-						counterPosition++;
-					}
-					counters[counterPosition] = 1;
-					isWhite = !isWhite;
-				}
-			}
-			// IS begin
-			delete [] counters;
-			// IS end
-			throw ReaderException("");
-		}
-		
-		// For efficiency, returns -1 on failure. Not throwing here saved as many as 700 exceptions
-		// per image when using some of our blackbox images.
-		int Code39Reader::toNarrowWidePattern(int counters[], int countersLen){
-			int numCounters = countersLen;
-			int maxNarrowCounter = 0;
-			int wideCounters;
-			do {
-				int minCounter = INT_MAX;
-				for (int i = 0; i < numCounters; i++) {
-					int counter = counters[i];
-					if (counter < minCounter && counter > maxNarrowCounter) {
-						minCounter = counter;
-					}
-				}
-				maxNarrowCounter = minCounter;
-				wideCounters = 0;
-				int totalWideCountersWidth = 0;
-				int pattern = 0;
-				for (int i = 0; i < numCounters; i++) {
-					int counter = counters[i];
-					if (counters[i] > maxNarrowCounter) {
-						pattern |= 1 << (numCounters - 1 - i);
-						wideCounters++;
-						totalWideCountersWidth += counter;
-					}
-				}
-				if (wideCounters == 3) {
-					// Found 3 wide counters, but are they close enough in width?
-					// We can perform a cheap, conservative check to see if any individual
-					// counter is more than 1.5 times the average:
-					for (int i = 0; i < numCounters && wideCounters > 0; i++) {
-						int counter = counters[i];
-						if (counters[i] > maxNarrowCounter) {
-							wideCounters--;
-							// totalWideCountersWidth = 3 * average, so this checks if counter >= 3/2 * average
-							if ((counter << 1) >= totalWideCountersWidth) {
-								return -1;
-							}
-						}
-					}
-					return pattern;
-				}
-			} while (wideCounters > 3);
-			return -1;
-		}
-		
-		char Code39Reader::patternToChar(int pattern){
-			for (int i = 0; i < CHARACTER_ENCODINGS_LEN; i++) {
-				if (CHARACTER_ENCODINGS[i] == pattern) {
-					return ALPHABET[i];
-				}
-			}
-			throw ReaderException("");
-		}
-		
-		Ref<String> Code39Reader::decodeExtended(std::string encoded){
-			int length = encoded.length();
-			std::string tmpDecoded;
-			for (int i = 0; i < length; i++) {
-				char c = encoded[i];
-				if (c == '+' || c == '$' || c == '%' || c == '/') {
-					char next = encoded[i + 1];
-					char decodedChar = '\0';
-					switch (c) {
-						case '+':
-							// +A to +Z map to a to z
-							if (next >= 'A' && next <= 'Z') {
-								decodedChar = (char) (next + 32);
-							} else {
-								throw ReaderException("");
-							}
-							break;
-						case '$':
-							// $A to $Z map to control codes SH to SB
-							if (next >= 'A' && next <= 'Z') {
-								decodedChar = (char) (next - 64);
-							} else {
-								throw ReaderException("");
-							}
-							break;
-						case '%':
-							// %A to %E map to control codes ESC to US
-							if (next >= 'A' && next <= 'E') {
-								decodedChar = (char) (next - 38);
-							} else if (next >= 'F' && next <= 'W') {
-								decodedChar = (char) (next - 11);
-							} else {
-								throw ReaderException("");
-							}
-							break;
-						case '/':
-							// /A to /O map to ! to , and /Z maps to :
-							if (next >= 'A' && next <= 'O') {
-								decodedChar = (char) (next - 32);
-							} else if (next == 'Z') {
-								decodedChar = ':';
-							} else {
-								throw ReaderException("");
-							}
-							break;
-					}
-					tmpDecoded.append(1, decodedChar);
-					// bump up i again since we read two characters
-					i++;
-				} else {
-					tmpDecoded.append(1, c);
-				}
-			}
-			Ref<String> decoded(new String(tmpDecoded));
-			return decoded;
-		}
-	}
-}
+namespace oned {
+
+  static const char* ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
+
+
+  /**
+   * These represent the encodings of characters, as patterns of wide and narrow
+   * bars.
+   * The 9 least-significant bits of each int correspond to the pattern of wide
+   * and narrow, with 1s representing "wide" and 0s representing narrow.
+   */
+  const int CHARACTER_ENCODINGS_LEN = 44;
+  static int CHARACTER_ENCODINGS[CHARACTER_ENCODINGS_LEN] = {
+    0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, // 0-9
+    0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, // A-J
+    0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, // K-T
+    0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, // U-*
+    0x0A8, 0x0A2, 0x08A, 0x02A // $-%
+  };
+
+  static int ASTERISK_ENCODING = 0x094;
+  static const char* ALPHABET_STRING =
+    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
+
+
+  /**
+   * Creates a reader that assumes all encoded data is data, and does not treat
+   * the final character as a check digit. It will not decoded "extended
+   * Code 39" sequences.
+   */
+  Code39Reader::Code39Reader() : alphabet_string(ALPHABET_STRING),
+                                 usingCheckDigit(false),
+                                 extendedMode(false) {
+  }
+
+  /**
+   * Creates a reader that can be configured to check the last character as a
+   * check digit. It will not decoded "extended Code 39" sequences.
+   *
+   * @param usingCheckDigit if true, treat the last data character as a check
+   * digit, not data, and verify that the checksum passes.
+   */
+  Code39Reader::Code39Reader(bool usingCheckDigit_) :
+    alphabet_string(ALPHABET_STRING), 
+    usingCheckDigit(usingCheckDigit_),
+    extendedMode(false) {
+  }
+
+
+
+  Ref<Result> Code39Reader::decodeRow(int rowNumber, Ref<BitArray> row){
+    int* start = findAsteriskPattern(row);
+    int nextStart = start[1];
+    int end = row->getSize();
+
+    // Read off white space
+    while (nextStart < end && !row->get(nextStart)) {
+      nextStart++;
+    }
+
+    std::string tmpResultString;
+
+    int countersLen = 9;
+    int* counters = new int[countersLen];
+    for (int i=0; i<countersLen; i++) {
+      counters[i] = 0;
+    }
+    char decodedChar;
+    int lastStart;
+    do {
+      try {
+      recordPattern(row, nextStart, counters, countersLen);
+      } catch (ReaderException re) {
+        delete [] start;
+        throw re;
+      }
+      int pattern = toNarrowWidePattern(counters, countersLen);
+      if (pattern < 0) {
+        delete [] start;
+        throw ReaderException("pattern < 0");
+      }
+      decodedChar = patternToChar(pattern);
+      tmpResultString.append(1, decodedChar);
+      lastStart = nextStart;
+      for (int i = 0; i < countersLen; i++) {
+        nextStart += counters[i];
+      }
+      // Read off white space
+      while (nextStart < end && !row->get(nextStart)) {
+        nextStart++;
+      }
+    } while (decodedChar != '*');
+    tmpResultString.erase(tmpResultString.length()-1, 1);// remove asterisk
+
+    // Look for whitespace after pattern:
+    int lastPatternSize = 0;
+    for (int i = 0; i < countersLen; i++) {
+      lastPatternSize += counters[i];
+    }
+    // IS begin
+    delete [] counters;
+    // IS end
+    int whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
+    // If 50% of last pattern size, following last pattern, is not whitespace,
+    // fail (but if it's whitespace to the very end of the image, that's OK)
+    if (nextStart != end && whiteSpaceAfterEnd / 2 < lastPatternSize) {
+      delete [] start;
+      throw ReaderException("too short end white space");
+    }
+
+    if (usingCheckDigit) {
+      int max = tmpResultString.length() - 1;
+      unsigned int total = 0;
+      for (int i = 0; i < max; i++) {
+        total += alphabet_string.find_first_of(tmpResultString[i], 0);
+      }
+      if (total % 43 != alphabet_string.find_first_of(tmpResultString[max], 0)) {
+        throw ReaderException("");
+      }
+      tmpResultString.erase(max, 1);
+    }
+
+
+
+
+    Ref<String> resultString(new String(tmpResultString));
+    if (extendedMode) {
+      delete resultString;
+      resultString = decodeExtended(tmpResultString);
+    }
+
+    if (tmpResultString.length() == 0) {
+      delete [] start;
+      // Almost surely a false positive
+      throw ReaderException("");
+    }
+
+    float left = (float) (start[1] + start[0]) / 2.0f;
+    float right = (float) (nextStart + lastStart) / 2.0f;
+
+    std::vector< Ref<ResultPoint> > resultPoints(2);
+    Ref<OneDResultPoint> resultPoint1(
+      new OneDResultPoint(left, (float) rowNumber));
+    Ref<OneDResultPoint> resultPoint2(
+      new OneDResultPoint(right, (float) rowNumber));
+    resultPoints[0] = resultPoint1;
+    resultPoints[1] = resultPoint2;
+
+    ArrayRef<unsigned char> resultBytes(1);
+
+    delete [] start;
+
+    Ref<Result> res(new Result(
+      resultString, resultBytes, resultPoints, BarcodeFormat_CODE_39));
+    return res;
+  }
+
+  int* Code39Reader::findAsteriskPattern(Ref<BitArray> row){
+    int width = row->getSize();
+    int rowOffset = 0;
+    while (rowOffset < width) {
+      if (row->get(rowOffset)) {
+        break;
+      }
+      rowOffset++;
+    }
+
+    int counterPosition = 0;
+    int countersLen = 9;
+    int* counters = new int[countersLen];
+    for (int i=0; i<countersLen; i++) {
+      counters[i] = 0;
+    }
+    int patternStart = rowOffset;
+    bool isWhite = false;
+    int patternLength = countersLen;
+
+    for (int i = rowOffset; i < width; i++) {
+      bool pixel = row->get(i);
+      if (pixel ^ isWhite) {
+        counters[counterPosition]++;
+      } else {
+        if (counterPosition == patternLength - 1) {
+          if (toNarrowWidePattern(counters, countersLen) == ASTERISK_ENCODING) {
+            // Look for whitespace before start pattern, >= 50% of width of
+            // start pattern.
+            long double longPatternOffset =
+              fmaxl(0, patternStart - (i - patternStart) / 2);
+            if (row->isRange(longPatternOffset, patternStart, false)) {
+              int* resultValue = new int[2];
+              resultValue[0] = patternStart;
+              resultValue[1] = i;
+              return resultValue;
+            }
+          }
+          patternStart += counters[0] + counters[1];
+          for (int y = 2; y < patternLength; y++) {
+            counters[y - 2] = counters[y];
+          }
+          counters[patternLength - 2] = 0;
+          counters[patternLength - 1] = 0;
+          counterPosition--;
+        } else {
+          counterPosition++;
+        }
+        counters[counterPosition] = 1;
+        isWhite = !isWhite;
+      }
+    }
+    // IS begin
+    delete [] counters;
+    // IS end
+    throw ReaderException("");
+  }
+
+  // For efficiency, returns -1 on failure. Not throwing here saved as many as
+  // 700 exceptions per image when using some of our blackbox images.
+  int Code39Reader::toNarrowWidePattern(int counters[], int countersLen){
+    int numCounters = countersLen;
+    int maxNarrowCounter = 0;
+    int wideCounters;
+    do {
+      int minCounter = INT_MAX;
+      for (int i = 0; i < numCounters; i++) {
+        int counter = counters[i];
+        if (counter < minCounter && counter > maxNarrowCounter) {
+          minCounter = counter;
+        }
+      }
+      maxNarrowCounter = minCounter;
+      wideCounters = 0;
+      int totalWideCountersWidth = 0;
+      int pattern = 0;
+      for (int i = 0; i < numCounters; i++) {
+        int counter = counters[i];
+        if (counters[i] > maxNarrowCounter) {
+          pattern |= 1 << (numCounters - 1 - i);
+          wideCounters++;
+          totalWideCountersWidth += counter;
+        }
+      }
+      if (wideCounters == 3) {
+        // Found 3 wide counters, but are they close enough in width?
+        // We can perform a cheap, conservative check to see if any individual
+        // counter is more than 1.5 times the average:
+        for (int i = 0; i < numCounters && wideCounters > 0; i++) {
+          int counter = counters[i];
+          if (counters[i] > maxNarrowCounter) {
+            wideCounters--;
+            // totalWideCountersWidth = 3 * average, so this checks if
+            // counter >= 3/2 * average.
+            if ((counter << 1) >= totalWideCountersWidth) {
+              return -1;
+            }
+          }
+        }
+        return pattern;
+      }
+    } while (wideCounters > 3);
+    return -1;
+  }
+
+  char Code39Reader::patternToChar(int pattern){
+    for (int i = 0; i < CHARACTER_ENCODINGS_LEN; i++) {
+      if (CHARACTER_ENCODINGS[i] == pattern) {
+        return ALPHABET[i];
+      }
+    }
+    throw ReaderException("");
+  }
+
+  Ref<String> Code39Reader::decodeExtended(std::string encoded){
+    int length = encoded.length();
+    std::string tmpDecoded;
+    for (int i = 0; i < length; i++) {
+      char c = encoded[i];
+      if (c == '+' || c == '$' || c == '%' || c == '/') {
+        char next = encoded[i + 1];
+        char decodedChar = '\0';
+        switch (c) {
+          case '+':
+            // +A to +Z map to a to z
+            if (next >= 'A' && next <= 'Z') {
+              decodedChar = (char) (next + 32);
+            } else {
+              throw ReaderException("");
+            }
+            break;
+          case '$':
+            // $A to $Z map to control codes SH to SB
+            if (next >= 'A' && next <= 'Z') {
+              decodedChar = (char) (next - 64);
+            } else {
+              throw ReaderException("");
+            }
+            break;
+          case '%':
+            // %A to %E map to control codes ESC to US
+            if (next >= 'A' && next <= 'E') {
+              decodedChar = (char) (next - 38);
+            } else if (next >= 'F' && next <= 'W') {
+              decodedChar = (char) (next - 11);
+            } else {
+              throw ReaderException("");
+            }
+            break;
+          case '/':
+            // /A to /O map to ! to , and /Z maps to :
+            if (next >= 'A' && next <= 'O') {
+              decodedChar = (char) (next - 32);
+            } else if (next == 'Z') {
+              decodedChar = ':';
+            } else {
+              throw ReaderException("");
+            }
+            break;
+        }
+        tmpDecoded.append(1, decodedChar);
+        // bump up i again since we read two characters
+        i++;
+      } else {
+        tmpDecoded.append(1, c);
+      }
+    }
+    Ref<String> decoded(new String(tmpDecoded));
+    return decoded;
+  }
+} // namespace oned
+} // namespace zxing
+
diff --git a/symbian/QQrDecoder/zxing/oned/ITFReader.cpp b/symbian/QQrDecoder/zxing/oned/ITFReader.cpp
index 51a712f..4464326 100644
--- a/symbian/QQrDecoder/zxing/oned/ITFReader.cpp
+++ b/symbian/QQrDecoder/zxing/oned/ITFReader.cpp
@@ -237,7 +237,7 @@ namespace zxing {
 		 * @throws ReaderException if the quiet zone cannot be found, a ReaderException is thrown.
 		 */
 		void ITFReader::validateQuietZone(Ref<BitArray> row, int startPattern){
-#pragma mark needs some corrections
+//#pragma mark needs some corrections
 //			int quietCount = narrowLineWidth * 10;  // expect to find this many pixels of quiet zone
 //			
 //			for (int i = startPattern - 1; quietCount > 0 && i >= 0; i--) {
@@ -335,7 +335,7 @@ namespace zxing {
 		 * @throws ReaderException if digit cannot be decoded
 		 */
 		int ITFReader::decodeDigit(int counters[], int countersLen){
-			int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
+			unsigned int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
 			int bestMatch = -1;
 			int max = PATTERNS_LEN;
 			for (int i = 0; i < max; i++) {
@@ -343,7 +343,7 @@ namespace zxing {
 				for(int ind = 0; ind<countersLen; ind++){
 					pattern[ind] = PATTERNS[i][ind];
 				}
-				int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
+				unsigned int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
 				if (variance < bestVariance) {
 					bestVariance = variance;
 					bestMatch = i;
diff --git a/symbian/QQrDecoder/zxing/oned/ITFReader.h b/symbian/QQrDecoder/zxing/oned/ITFReader.h
index 759d841..41c22cd 100644
--- a/symbian/QQrDecoder/zxing/oned/ITFReader.h
+++ b/symbian/QQrDecoder/zxing/oned/ITFReader.h
@@ -27,7 +27,7 @@ namespace zxing {
 		class ITFReader : public OneDReader {
 			
 		private:
-			static const int MAX_AVG_VARIANCE = (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);
 			
 			// Stores the actual narrow line width of the image being decoded.
diff --git a/symbian/QQrDecoder/zxing/oned/OneDReader.cpp b/symbian/QQrDecoder/zxing/oned/OneDReader.cpp
index 0b557d6..d3e4916 100644
--- a/symbian/QQrDecoder/zxing/oned/OneDReader.cpp
+++ b/symbian/QQrDecoder/zxing/oned/OneDReader.cpp
@@ -20,6 +20,7 @@
 
 #include "OneDReader.h"
 #include <zxing/ReaderException.h>
+#include <zxing/oned/OneDResultPoint.h>
 #include <math.h>
 #include <limits.h>
 
@@ -93,6 +94,8 @@ namespace zxing {
 					row = image->getBlackRow(rowNumber, row);
 				}catch (ReaderException re) {
 					continue;
+				}catch (IllegalArgumentException re) {
+					continue;
 				}
 				
 				// While we have the image data in a BitArray, it's fairly cheap to reverse it in place to
@@ -109,9 +112,17 @@ namespace zxing {
 							//						// But it was upside down, so note that
 							//						result.putMetadata(ResultMetadataType.ORIENTATION, new Integer(180));
 							//						// And remember to flip the result points horizontally.
-							//						ResultPoint[] points = result.getResultPoints();
-							//						points[0] = new ResultPoint(width - points[0].getX() - 1, points[0].getY());
-							//						points[1] = new ResultPoint(width - points[1].getX() - 1, points[1].getY());
+							std::vector<Ref<ResultPoint> > points(result->getResultPoints());
+							if (points.size() == 2) {
+								Ref<ResultPoint> pointZero(new OneDResultPoint(width - points[0]->getX() - 1, points[0]->getY()));
+								points[0] = pointZero;
+
+								Ref<ResultPoint> pointOne(new OneDResultPoint(width - points[1]->getX() - 1, points[1]->getY()));
+								points[1] = pointOne;
+
+                result.reset(new Result(result->getText(),result->getRawBytes(),points,result->getBarcodeFormat()));
+							}
+								
 						}
 						return result;
 					} catch (ReaderException re) {
@@ -119,13 +130,13 @@ namespace zxing {
 					}
 				}
 			}
-			throw ReaderException("");
+			throw ReaderException("doDecode() failed");
 		}
 		
-		int OneDReader::patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance) {
+		unsigned int OneDReader::patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance) {
 			int numCounters = countersSize;
-			int total = 0;
-			int patternLength = 0;
+			unsigned int total = 0;
+			unsigned int patternLength = 0;
 			for (int i = 0; i < numCounters; i++) {
 				total += counters[i];
 				patternLength += pattern[i];
@@ -138,10 +149,10 @@ namespace zxing {
 			// We're going to fake floating-point math in integers. We just need to use more bits.
 			// Scale up patternLength so that intermediate values below like scaledCounter will have
 			// more "significant digits"
-			int unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
+			unsigned int unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
 			maxIndividualVariance = (maxIndividualVariance * unitBarWidth) >> INTEGER_MATH_SHIFT;
 			
-			int totalVariance = 0;
+			unsigned int totalVariance = 0;
 			for (int x = 0; x < numCounters; x++) {
 				int counter = counters[x] << INTEGER_MATH_SHIFT;
 				int scaledPattern = pattern[x] * unitBarWidth;
diff --git a/symbian/QQrDecoder/zxing/oned/OneDReader.h b/symbian/QQrDecoder/zxing/oned/OneDReader.h
index 92a7e77..bb3b649 100644
--- a/symbian/QQrDecoder/zxing/oned/OneDReader.h
+++ b/symbian/QQrDecoder/zxing/oned/OneDReader.h
@@ -38,7 +38,7 @@ namespace zxing {
 			virtual Ref<Result> decode(Ref<BinaryBitmap> image);
 			virtual Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row) = 0;
 			
-			static int patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance);
+			static unsigned int patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance);
 			static void recordPattern(Ref<BitArray> row, int start, int counters[], int countersCount);
 			virtual ~OneDReader();
 		};
diff --git a/symbian/QQrDecoder/zxing/oned/UPCEANReader.cpp b/symbian/QQrDecoder/zxing/oned/UPCEANReader.cpp
index b5923bf..e0154c5 100644
--- a/symbian/QQrDecoder/zxing/oned/UPCEANReader.cpp
+++ b/symbian/QQrDecoder/zxing/oned/UPCEANReader.cpp
@@ -239,7 +239,7 @@ namespace zxing {
 //		int UPCEANReader::decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, int** patterns/*[][]*/, int paterns1Len, int paterns2Len)		
 		int UPCEANReader::decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, UPC_EAN_PATTERNS patternType){
 			recordPattern(row, rowOffset, counters, countersLen);
-			int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
+			unsigned int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
 			int bestMatch = -1;
 			
 			int max = 0;
@@ -252,7 +252,7 @@ namespace zxing {
 							pattern[j] = L_PATTERNS[i][j];
 						}
 						
-						int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
+						unsigned int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
 						if (variance < bestVariance) {
 							bestVariance = variance;
 							bestMatch = i;
@@ -267,7 +267,7 @@ namespace zxing {
 							pattern[j] = L_AND_G_PATTERNS[i][j];
 						}
 						
-						int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
+						unsigned int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
 						if (variance < bestVariance) {
 							bestVariance = variance;
 							bestMatch = i;
diff --git a/symbian/QQrDecoder/zxing/oned/UPCEANReader.h b/symbian/QQrDecoder/zxing/oned/UPCEANReader.h
index d673dc9..6ee2186 100644
--- a/symbian/QQrDecoder/zxing/oned/UPCEANReader.h
+++ b/symbian/QQrDecoder/zxing/oned/UPCEANReader.h
@@ -32,7 +32,7 @@ namespace zxing {
 		class UPCEANReader : public OneDReader {
 			
 		private:
-			static const int MAX_AVG_VARIANCE = (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);
 			
 			static int* findStartGuardPattern(Ref<BitArray> row);																	//throws ReaderException
diff --git a/symbian/ZXingBarcodeReader/.cproject b/symbian/ZXingBarcodeReader/.cproject
index 26abcfb..a64dacd 100644
--- a/symbian/ZXingBarcodeReader/.cproject
+++ b/symbian/ZXingBarcodeReader/.cproject
@@ -4,8 +4,8 @@
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 <storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="0" concurrentBuildJobs="4" defaultMMPChangedAction="2" extraSBSv2Args="" infBuildComponents="" infFileLocation="group\bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="false" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
 <storageModule moduleId="org.eclipse.cdt.core.settings">
-<cconfiguration id="Emulator Debug (WINSCW) [S60_3rd_FP2_SDK_v1.1]">
-<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [S60_3rd_FP2_SDK_v1.1]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [S60_3rd_FP2_SDK_v1.1]">
+<cconfiguration id="Emulator Debug (WINSCW) [S60_5th_Edition_SDK_v1.0]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [S60_5th_Edition_SDK_v1.0]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [S60_5th_Edition_SDK_v1.0]">
 <externalSettings/>
 <extensions>
 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -21,18 +21,18 @@
 <extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 </extensions>
 </storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 <storageModule moduleId="CarbideConfigurationDataProvider">
 <ENV_VAR_DATA_ID/>
 <ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
-<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\Symbian\9.2\S60_3rd_FP2_SDK_v1.1\epoc32\rom\"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\"/>
 </storageModule>
-<storageModule filesCache="C:\Carbide\Testworkspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\Testworkspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/sys;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/variant;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/ecom;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport/stl;C:/Carbide/Testworkspace/ZXingBarcodeReader/group;C:/Carbide/Testworkspace/ZXingBarcodeReader/inc;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EXE__;__S60_3X__;__SERIES60_3X__;__S60_32__;__CW32__;__WINS__;__WINSCW__;_DEBUG;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1274434344850" useMmpMacrosCache="true"/>
+<storageModule filesCache="C:\Carbide\workspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\workspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/sys;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/variant;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/ecom;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport/stl;C:/Carbide/workspace/ZXingBarcodeReader/group;C:/Carbide/workspace/ZXingBarcodeReader/inc;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EXE__;__S60_3X__;__SERIES60_3X__;__S60_5X__;__CW32__;__WINS__;__WINSCW__;__S60_50__;_DEBUG;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1279097973179" useMmpMacrosCache="true"/>
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 </cconfiguration>
-<cconfiguration id="Phone Debug (ARMV5) [S60_3rd_FP2_SDK_v1.1]">
-<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [S60_3rd_FP2_SDK_v1.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [S60_3rd_FP2_SDK_v1.1]">
+<cconfiguration id="Phone Debug (ARMV5) [S60_5th_Edition_SDK_v1.0]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [S60_5th_Edition_SDK_v1.0]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [S60_5th_Edition_SDK_v1.0]">
 <externalSettings/>
 <extensions>
 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -49,18 +49,18 @@
 <extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 </extensions>
 </storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 <storageModule moduleId="CarbideConfigurationDataProvider">
 <ENV_VAR_DATA_ID/>
 <ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
-<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\Symbian\9.2\S60_3rd_FP2_SDK_v1.1\epoc32\rom\"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\"/>
 </storageModule>
-<storageModule filesCache="C:\Carbide\Testworkspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\Testworkspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/sys;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/variant;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/ecom;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport/stl;C:/Carbide/Testworkspace/ZXingBarcodeReader/group;C:/Carbide/Testworkspace/ZXingBarcodeReader/inc;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__S60_32__;__MARM_ARMV5__;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__S60_3X__;__SERIES60_3X__;__EPOC32__;__GENERIC_MARM__;__EABI__;_DEBUG;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1274434344850" useMmpMacrosCache="true"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+<storageModule filesCache="C:\Carbide\workspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\workspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/sys;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/variant;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/ecom;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport/stl;C:/Carbide/workspace/ZXingBarcodeReader/group;C:/Carbide/workspace/ZXingBarcodeReader/inc;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__S60_3X__;__SERIES60_3X__;__ARMCC_2__;__S60_5X__;__EPOC32__;__GENERIC_MARM__;__EABI__;__S60_50__;_DEBUG;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1279097973195" useMmpMacrosCache="true"/>
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 </cconfiguration>
-<cconfiguration id="Phone Release (ARMV5) [S60_3rd_FP2_SDK_v1.1]">
-<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [S60_3rd_FP2_SDK_v1.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [S60_3rd_FP2_SDK_v1.1]">
+<cconfiguration id="Phone Release (ARMV5) [S60_5th_Edition_SDK_v1.0]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [S60_5th_Edition_SDK_v1.0]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [S60_5th_Edition_SDK_v1.0]">
 <externalSettings/>
 <extensions>
 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -77,18 +77,18 @@
 <extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 </extensions>
 </storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 <storageModule moduleId="CarbideConfigurationDataProvider">
 <ENV_VAR_DATA_ID/>
 <ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
-<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\Symbian\9.2\S60_3rd_FP2_SDK_v1.1\epoc32\rom\"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\"/>
 </storageModule>
-<storageModule filesCache="C:\Carbide\Testworkspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\Testworkspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/sys;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/variant;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/ecom;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport/stl;C:/Carbide/Testworkspace/ZXingBarcodeReader/group;C:/Carbide/Testworkspace/ZXingBarcodeReader/inc;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__S60_32__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__S60_3X__;__SERIES60_3X__;__EPOC32__;__GENERIC_MARM__;__EABI__;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1274434344865" useMmpMacrosCache="true"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+<storageModule filesCache="C:\Carbide\workspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\workspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/sys;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/variant;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/ecom;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport/stl;C:/Carbide/workspace/ZXingBarcodeReader/group;C:/Carbide/workspace/ZXingBarcodeReader/inc;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__S60_3X__;__SERIES60_3X__;__ARMCC_2__;__S60_5X__;__EPOC32__;__GENERIC_MARM__;__EABI__;__S60_50__;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1279097973226" useMmpMacrosCache="true"/>
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 </cconfiguration>
-<cconfiguration id="Phone Debug (GCCE) [S60_3rd_FP2_SDK_v1.1]">
-<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCE) [S60_3rd_FP2_SDK_v1.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCE) [S60_3rd_FP2_SDK_v1.1]">
+<cconfiguration id="Phone Debug (GCCE) [S60_5th_Edition_SDK_v1.0]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCE) [S60_5th_Edition_SDK_v1.0]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCE) [S60_5th_Edition_SDK_v1.0]">
 <externalSettings/>
 <extensions>
 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -105,19 +105,19 @@
 <extension id="com.nokia.carbide.cdt.builder.GCCELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 </extensions>
 </storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 <storageModule moduleId="CarbideConfigurationDataProvider">
-<SIS_BUILDER_DATA_ID CREATESTUBSTORAGE="false" ENABLEDSTORAGE="true" PARTIALUPGRADESTORAGE="false" PKGFILESTORAGE="C:\Carbide\Testworkspace\ZXingBarcodeReader\sis\ZXingBarcodeReader_S60.pkg" SIGNINGTYPESTORAGE="1"/>
+<SIS_BUILDER_DATA_ID CREATESTUBSTORAGE="false" ENABLEDSTORAGE="true" PARTIALUPGRADESTORAGE="false" PKGFILESTORAGE="C:\Carbide\workspace\ZXingBarcodeReader\sis\ZXingBarcodeReader_S60.pkg" SIGNINGTYPESTORAGE="1"/>
 <ENV_VAR_DATA_ID/>
 <ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
-<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\Symbian\9.2\S60_3rd_FP2_SDK_v1.1\epoc32\rom\"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\"/>
 </storageModule>
-<storageModule filesCache="C:\Carbide\Testworkspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\Testworkspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/sys;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/variant;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/ecom;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport/stl;C:/Carbide/Testworkspace/ZXingBarcodeReader/group;C:/Carbide/Testworkspace/ZXingBarcodeReader/inc;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__S60_32__;__MARM_ARMV5__;__SYMBIAN32__;__GCCE__;__MARM__;__EXE__;__SERIES60_3X__;__S60_3X__;__GENERIC_MARM__;__EPOC32__;__EABI__;_DEBUG;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1274434344881" useMmpMacrosCache="true"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+<storageModule filesCache="C:\Carbide\workspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\workspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/sys;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/variant;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/ecom;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport/stl;C:/Carbide/workspace/ZXingBarcodeReader/group;C:/Carbide/workspace/ZXingBarcodeReader/inc;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;__SYMBIAN32__;__GCCE__;__MARM__;__EXE__;__SERIES60_3X__;__S60_3X__;__S60_5X__;__EPOC32__;__GENERIC_MARM__;__EABI__;_DEBUG;__S60_50__;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1279097973257" useMmpMacrosCache="true"/>
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 </cconfiguration>
-<cconfiguration id="Phone Release (GCCE) [S60_3rd_FP2_SDK_v1.1]">
-<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCE) [S60_3rd_FP2_SDK_v1.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCE) [S60_3rd_FP2_SDK_v1.1]">
+<cconfiguration id="Phone Release (GCCE) [S60_5th_Edition_SDK_v1.0]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCE) [S60_5th_Edition_SDK_v1.0]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCE) [S60_5th_Edition_SDK_v1.0]">
 <externalSettings/>
 <extensions>
 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -134,14 +134,14 @@
 <extension id="com.nokia.carbide.cdt.builder.GCCELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 </extensions>
 </storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 <storageModule moduleId="CarbideConfigurationDataProvider">
 <ENV_VAR_DATA_ID/>
 <ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
-<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\Symbian\9.2\S60_3rd_FP2_SDK_v1.1\epoc32\rom\"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="C:\"/>
 </storageModule>
-<storageModule filesCache="C:\Carbide\Testworkspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\Testworkspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/sys;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/variant;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/ecom;C:/Symbian/9.2/S60_3rd_FP2_SDK_v1.1/epoc32/include/stdapis/stlport/stl;C:/Carbide/Testworkspace/ZXingBarcodeReader/group;C:/Carbide/Testworkspace/ZXingBarcodeReader/inc;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/Testworkspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__S60_32__;__MARM_ARMV5__;NDEBUG;__SYMBIAN32__;__GCCE__;__MARM__;__EXE__;__SERIES60_3X__;__S60_3X__;__GENERIC_MARM__;__EPOC32__;__EABI__;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1274434344912" useMmpMacrosCache="true"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+<storageModule filesCache="C:\Carbide\workspace\ZXingBarcodeReader\group\bld.inf;C:\Carbide\workspace\ZXingBarcodeReader\group\ZXingBarcodeReader.mmp;" includesCache="C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/sys;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/variant;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/ecom;C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/include/stdapis/stlport/stl;C:/Carbide/workspace/ZXingBarcodeReader/group;C:/Carbide/workspace/ZXingBarcodeReader/inc;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/common/reedsolomon;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/oned;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/decoder;C:/Carbide/workspace/ZXingBarcodeReader/group/zxing/qrcode/detector;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;NDEBUG;__SYMBIAN32__;__GCCE__;__MARM__;__EXE__;__SERIES60_3X__;__S60_3X__;__S60_5X__;__EPOC32__;__GENERIC_MARM__;__EABI__;__S60_50__;" moduleId="configDataCache" sourcesCache="/ZXingBarcodeReader/data;/ZXingBarcodeReader/group;/ZXingBarcodeReader/group/zxing;/ZXingBarcodeReader/group/zxing/common;/ZXingBarcodeReader/group/zxing/common/reedsolomon;/ZXingBarcodeReader/group/zxing/oned;/ZXingBarcodeReader/group/zxing/qrcode;/ZXingBarcodeReader/group/zxing/qrcode/decoder;/ZXingBarcodeReader/group/zxing/qrcode/detector;/ZXingBarcodeReader/inc;/ZXingBarcodeReader/src;" timestampCache="1279097973273" useMmpMacrosCache="true"/>
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 </cconfiguration>
 </storageModule>
diff --git a/symbian/ZXingBarcodeReader/group/ABLD.BAT b/symbian/ZXingBarcodeReader/group/ABLD.BAT
index f771061..ca1586a 100644
--- a/symbian/ZXingBarcodeReader/group/ABLD.BAT
+++ b/symbian/ZXingBarcodeReader/group/ABLD.BAT
@@ -3,7 +3,7 @@
 REM Bldmake-generated batch file - ABLD.BAT
 REM ** DO NOT EDIT **
 
-perl -S ABLD.PL "\Carbide\ZXingWorkspace\ZXingBarcodeReader\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
+perl -S ABLD.PL "\Carbide\workspace\ZXingBarcodeReader\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
 if errorlevel==1 goto CheckPerl
 goto End
 
diff --git a/symbian/ZXingBarcodeReader/group/ZXingBarcodeReader.mmp b/symbian/ZXingBarcodeReader/group/ZXingBarcodeReader.mmp
index 4d384e0..e395db5 100644
--- a/symbian/ZXingBarcodeReader/group/ZXingBarcodeReader.mmp
+++ b/symbian/ZXingBarcodeReader/group/ZXingBarcodeReader.mmp
@@ -31,12 +31,19 @@ SYSTEMINCLUDE		/epoc32/include/stdapis/stlport/stl
 
 SYSTEMINCLUDE		.
 SYSTEMINCLUDE     	../inc
+SYSTEMINCLUDE		zxing/common
 SYSTEMINCLUDE		zxing/common/reedsolomon
 SYSTEMINCLUDE		zxing/oned
 SYSTEMINCLUDE		zxing/qrcode
 SYSTEMINCLUDE		zxing/qrcode/decoder
 SYSTEMINCLUDE		zxing/qrcode/detector
 
+/*
+SYSTEMINCLUDE		zxing/datamatrix
+SYSTEMINCLUDE		zxing/datamatrix/decoder
+SYSTEMINCLUDE		zxing/datamatrix/detector
+*/
+
 SOURCEPATH      ../src
 SOURCE          ZXingBarcodeReader.cpp
 SOURCE          ZXingBarcodeReaderApplication.cpp ZXingBarcodeReaderAppView.cpp
@@ -81,6 +88,15 @@ SOURCE ErrorCorrectionLevel.cpp FormatInformation.cpp QRCodeReader.cpp Version.c
 SOURCEPATH zxing
 SOURCE BarcodeFormat.cpp Binarizer.cpp BinaryBitmap.cpp Exception.cpp LuminanceSource.cpp MultiFormatReader.cpp Reader.cpp ReaderException.cpp Result.cpp ResultPoint.cpp
 
+/*
+SOURCEPATH zxing/datamatrix/detector
+SOURCE CornerPoint.cpp Detector.cpp MonochromeRectangleDetector.cpp
+SOURCEPATH zxing/datamatrix/decoder
+SOURCE BitMatrixParser.cpp DataBlock.cpp DecodedBitStreamParser.cpp Decoder.cpp
+SOURCEPATH zxing/datamatrix
+SOURCE Version.cpp DataMatrixReader.cpp
+*/
+
 OPTION CW -wchar_t on
 OPTION ARMCC --visibility_inlines_hidden
 OPTION GCCE -fvisibility-inlines-hidden
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Binarizer.cpp b/symbian/ZXingBarcodeReader/group/zxing/Binarizer.cpp
index 5f6e746..1901382 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Binarizer.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/Binarizer.cpp
@@ -23,15 +23,17 @@
 
 namespace zxing {
 	
-	Binarizer::Binarizer(Ref<LuminanceSource> source) : source_(source) {
+	Binarizer::Binarizer(Ref<LuminanceSource> source) : source_(source), array_(NULL), matrix_(NULL), cached_y_(-1) {
 	}
 	
 	Binarizer::~Binarizer() {
 	}
 	
 	Ref<BitArray> Binarizer::getBlackRow(int y, Ref<BitArray> row){
-		if (array_ == NULL)
+		if (array_ == NULL && cached_y_ != y) {
 			array_ = estimateBlackRow(y, row);
+			cached_y_ = y;
+		}
 		return array_;
 	}
 	
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Binarizer.h b/symbian/ZXingBarcodeReader/group/zxing/Binarizer.h
index ea1240c..694018d 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Binarizer.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/Binarizer.h
@@ -28,24 +28,25 @@
 #include <zxing/common/Counted.h>
 
 namespace zxing {
-	
-	class Binarizer : public Counted {
-	private:
-		Ref<LuminanceSource> source_;
-		Ref<BitMatrix> matrix_;
-		Ref<BitArray> array_;
-		
-	public:
-		Binarizer(Ref<LuminanceSource> source);
-		virtual ~Binarizer();
-		
-		virtual Ref<BitArray> estimateBlackRow(int y, Ref<BitArray> row)=0;
-		Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
-		
-		virtual Ref<BitMatrix> estimateBlackMatrix() = 0;
-		Ref<BitMatrix> getBlackMatrix();
-		Ref<LuminanceSource> getSource();
-	};
-	
+
+class Binarizer : public Counted {
+ private:
+  Ref<LuminanceSource> source_;
+  Ref<BitArray> array_;
+  Ref<BitMatrix> matrix_;
+  int cached_y_;
+
+ public:
+  Binarizer(Ref<LuminanceSource> source);
+  virtual ~Binarizer();
+
+  virtual Ref<BitArray> estimateBlackRow(int y, Ref<BitArray> row)=0;
+  Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
+
+  virtual Ref<BitMatrix> estimateBlackMatrix() = 0;
+  Ref<BitMatrix> getBlackMatrix();
+  Ref<LuminanceSource> getSource();
+};
+
 }
 #endif /* BINARIZER_H_ */
diff --git a/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.cpp b/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.cpp
index 1e692a9..ff79b55 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.cpp
@@ -23,7 +23,7 @@
 
 namespace zxing {
 	
-	BinaryBitmap::BinaryBitmap(Ref<Binarizer> binarizer) : bits_(NULL), binarizer_(binarizer) {
+	BinaryBitmap::BinaryBitmap(Ref<Binarizer> binarizer) : bits_(NULL), array_bits_(NULL), binarizer_(binarizer), cached_y_(-1) {
 		
 	}
 	
@@ -31,8 +31,9 @@ namespace zxing {
 	}
 	
 	Ref<BitArray> BinaryBitmap::getBlackRow(int y, Ref<BitArray> row) {
-		if (array_bits_ == NULL) {
+		if (array_bits_ == NULL && cached_y_ != y) {
 			array_bits_ = binarizer_->getBlackRow(y, row);
+			cached_y_ = y;
 		}
 		return array_bits_;
 	}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.h b/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.h
index ecd9a85..ddea910 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/BinaryBitmap.h
@@ -33,6 +33,7 @@ namespace zxing {
 		Ref<BitMatrix> bits_;
 		Ref<BitArray> array_bits_;
 		Ref<Binarizer> binarizer_;
+		int cached_y_;
 		
 	public:
 		BinaryBitmap(Ref<Binarizer> binarizer);
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Exception.cpp b/symbian/ZXingBarcodeReader/group/zxing/Exception.cpp
index 47143c9..d20b6e3 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Exception.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/Exception.cpp
@@ -16,7 +16,7 @@ Exception::Exception(const char *msg) :
 }
 
 const char* Exception::what() const throw() {
-  return message;
+  return message.c_str();
 }
 
 Exception::~Exception() throw() {
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Exception.h b/symbian/ZXingBarcodeReader/group/zxing/Exception.h
index 7502c5c..ac4026e 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Exception.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/Exception.h
@@ -28,7 +28,7 @@ namespace zxing {
 
 class Exception : public std::exception {
 private:
-  const char * message;
+  std::string message;
 
 public:
   Exception(const char *msg);
diff --git a/symbian/ZXingBarcodeReader/group/zxing/LuminanceSource.h b/symbian/ZXingBarcodeReader/group/zxing/LuminanceSource.h
index e23621e..d39f06f 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/LuminanceSource.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/LuminanceSource.h
@@ -30,10 +30,10 @@ public:
   LuminanceSource();
   virtual ~LuminanceSource();
 
-  virtual int getWidth() = 0;
-  virtual int getHeight() = 0;
+  virtual int getWidth() const = 0;
+  virtual int getHeight() const = 0;
 
-  virtual unsigned char getPixel(int x, int y) = 0;
+  virtual unsigned char getPixel(int x, int y) const = 0;
   virtual unsigned char* copyMatrix();
 };
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.cpp
index fd3d8d2..bacb3cd 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.cpp
@@ -19,7 +19,7 @@
  * limitations under the License.
  */
 
-#include "MultiFormatReader.h"
+#include <zxing/MultiFormatReader.h>
 #include <zxing/qrcode/QRCodeReader.h>
 //#include <zxing/datamatrix/DataMatrixReader.h>
 #include <zxing/oned/MultiFormatUPCEANReader.h>
@@ -27,28 +27,27 @@
 #include <zxing/ReaderException.h>
 
 namespace zxing {
-	MultiFormatReader::MultiFormatReader(){
-		readers = new std::vector<Reader*>();
-		
-		readers->push_back(new zxing::qrcode::QRCodeReader());
-		//readers->push_back(new zxing::datamatrix::DataMatrixReader());
-		readers->push_back(new zxing::oned::MultiFormatUPCEANReader());
-		readers->push_back(new zxing::oned::MultiFormatOneDReader());
+	MultiFormatReader::MultiFormatReader() {
+		readers.push_back(new zxing::qrcode::QRCodeReader());
+		//readers.push_back(new zxing::datamatrix::DataMatrixReader());
+		readers.push_back(new zxing::oned::MultiFormatUPCEANReader());
+		readers.push_back(new zxing::oned::MultiFormatOneDReader());
 	}
 	
 	Ref<Result> MultiFormatReader::decode(Ref<BinaryBitmap> image){
-		int size = readers->size();
-		for (int i = 0; i < size; i++) {
-			Reader* reader = (*readers)[i];
+		for (unsigned int i = 0; i < readers.size(); i++) {
 			try {
-				return reader->decode(image);
+				return readers[i]->decode(image);
 			} catch (ReaderException re) {
 				// continue
 			}
 		}
 		throw ReaderException("No code detected");
 	}
+	
 	MultiFormatReader::~MultiFormatReader(){
-		delete readers;
+		for (unsigned int i = 0; i < readers.size(); i++) {
+			delete readers[i];
+		}
 	}
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.h b/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.h
index 9fca54f..f88ebc9 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/MultiFormatReader.h
@@ -3,6 +3,7 @@
  *  ZXing
  *
  *  Created by Lukasz Warchol on 10-01-26.
+ *  Modified by Luiz Silva on 09/02/2010.
  *  Copyright 2010 ZXing authors All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,12 +28,12 @@ namespace zxing {
 	class MultiFormatReader : public Reader {
 		
 	private:
-		std::vector<Reader*>* readers;
+		std::vector<Reader*>readers;
 	public:
 		MultiFormatReader();
 		
 		Ref<Result> decode(Ref<BinaryBitmap> image);
-		
+  
 		~MultiFormatReader();
 	};
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Reader.h b/symbian/ZXingBarcodeReader/group/zxing/Reader.h
index 3de270f..d7844a9 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Reader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/Reader.h
@@ -21,16 +21,17 @@
  * limitations under the License.
  */
 
-#include <map>
 #include <zxing/BinaryBitmap.h>
 #include <zxing/Result.h>
 
 namespace zxing {
 
-class Reader {
-public:
-  virtual Ref<Result> decode(Ref<BinaryBitmap> image) = 0;
-  virtual ~Reader();
+ class Reader : public Counted {
+  protected:
+   Reader() {}
+  public:
+   virtual Ref<Result> decode(Ref<BinaryBitmap> image) = 0;
+   virtual ~Reader();
 };
 
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Result.cpp b/symbian/ZXingBarcodeReader/group/zxing/Result.cpp
index f87ef88..6ea6582 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Result.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/Result.cpp
@@ -39,11 +39,11 @@ ArrayRef<unsigned char> Result::getRawBytes() {
   return rawBytes_;
 }
 
-std::vector<Ref<ResultPoint> > Result::getResultPoints() {
+const std::vector<Ref<ResultPoint> >& Result::getResultPoints() const {
   return resultPoints_;
 }
 
-BarcodeFormat Result::getBarcodeFormat() {
+BarcodeFormat Result::getBarcodeFormat() const {
   return format_;
 }
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/Result.h b/symbian/ZXingBarcodeReader/group/zxing/Result.h
index 710d8d5..c9fcf43 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/Result.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/Result.h
@@ -44,8 +44,8 @@ public:
   ~Result();
   Ref<String> getText();
   ArrayRef<unsigned char> getRawBytes();
-  std::vector<Ref<ResultPoint> > getResultPoints();
-  BarcodeFormat getBarcodeFormat();
+  const std::vector<Ref<ResultPoint> >& getResultPoints() const;
+  BarcodeFormat getBarcodeFormat() const;
 
   friend std::ostream& operator<<(std::ostream &out, Result& result);
 };
diff --git a/symbian/ZXingBarcodeReader/group/zxing/ResultPoint.h b/symbian/ZXingBarcodeReader/group/zxing/ResultPoint.h
index 6118cc0..33dff70 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/ResultPoint.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/ResultPoint.h
@@ -26,9 +26,11 @@
 namespace zxing {
 
 class ResultPoint : public Counted {
+protected:
+  ResultPoint() {}
 public:
-  virtual float getX() = 0;
-  virtual float getY() = 0;
+  virtual float getX() const = 0;
+  virtual float getY() const = 0;
 };
 
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/Array.h b/symbian/ZXingBarcodeReader/group/zxing/common/Array.h
index 39b1786..9b82269 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/Array.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/Array.h
@@ -21,8 +21,7 @@
  * limitations under the License.
  */
 
-#include <valarray>
-#include <cstdarg>
+#include <vector>
 
 #ifdef DEBUG_COUNTING
 #include <iostream>
@@ -37,17 +36,17 @@ namespace zxing {
 template<typename T> class Array : public Counted {
 protected:
 public:
-  std::valarray<T> values_;
+  std::vector<T> values_;
   Array(size_t n) :
-      Counted(), values_(T(), n) {
+      Counted(), values_(n, T()) {
   }
   Array(T *ts, size_t n) :
-      Counted(), values_(ts, n) {
+      Counted(), values_(ts, ts+n) {
   }
   Array(T v, size_t n) :
-      Counted(), values_(v, n) {
+      Counted(), values_(n, v) {
   }
-  Array(std::valarray<T> &v) :
+  Array(std::vector<T> &v) :
       Counted(), values_(v) {
   }
   Array(Array<T> &other) :
@@ -68,7 +67,7 @@ public:
 #endif
     return *this;
   }
-  Array<T>& operator=(const std::valarray<T> &array) {
+  Array<T>& operator=(const std::vector<T> &array) {
 #ifdef DEBUG_COUNTING
     cout << "assigning values from Array " << &array << " to this Array " << this << ", ";
 #endif
@@ -87,10 +86,10 @@ public:
   size_t size() const {
     return values_.size();
   }
-  std::valarray<T> values() const {
+  std::vector<T> values() const {
     return values_;
   }
-  std::valarray<T>& values() {
+  std::vector<T>& values() {
     return values_;
   }
 };
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.cpp
index 26e6869..6ba7fd2 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.cpp
@@ -20,6 +20,7 @@
 
 #include <zxing/common/BitArray.h>
 #include <iostream>
+#include <limits>
 
 using namespace std;
 
@@ -43,12 +44,9 @@ size_t BitArray::wordsForBits(size_t bits) {
   }
   return arraySize;
 }
-BitArray::BitArray() {
-  cout << "hey! don't use this BitArrayConstructor!\n";
-}
 
 BitArray::BitArray(size_t size) :
-    size_(size), bits_((const unsigned int)0, wordsForBits(size)) {
+    size_(size), bits_(wordsForBits(size), (const unsigned int)0) {
 }
 BitArray::~BitArray() {
 }
@@ -105,14 +103,16 @@ bool BitArray::isRange(size_t start, size_t end, bool value) {
   }
   return true;
 }
-valarray<unsigned int>& BitArray::getBitArray() {
+vector<unsigned int>& BitArray::getBitArray() {
   return bits_;
 }
 void BitArray::reverse() {
-  unsigned int allBits = numeric_limits<unsigned int>::max();
-  size_t max = bits_.size();
-  for (size_t i = 0; i < max; i++) {
-    bits_[i] = bits_[i] ^ allBits;
+  std::vector<unsigned int> newBits(bits_.size(),(const unsigned int) 0);
+  for (size_t i = 0; i < size_; i++) {
+    if (get(size_ - i - 1)) {
+      newBits[i >> logBits_] |= 1<< (i & bitsMask_);
+    }
   }
+  bits_ = newBits;
 }
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.h b/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.h
index 1e8828e..d3b6f66 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/BitArray.h
@@ -23,8 +23,7 @@
 
 #include <zxing/common/Counted.h>
 #include <zxing/common/IllegalArgumentException.h>
-#include <valarray>
-#include <limits>
+#include <vector>
 #include <iostream>
 
 namespace zxing {
@@ -32,7 +31,7 @@ namespace zxing {
 class BitArray : public Counted {
 private:
   size_t size_;
-  std::valarray<unsigned int> bits_;
+  std::vector<unsigned int> bits_;
   static const unsigned int bitsPerWord_;
   static const unsigned int logBits_;
   static const unsigned int bitsMask_;
@@ -48,7 +47,7 @@ public:
   void setBulk(size_t i, unsigned int newBits);
   void clear();
   bool isRange(size_t start, size_t end, bool value);
-  std::valarray<unsigned int>& getBitArray();
+  std::vector<unsigned int>& getBitArray();
   void reverse();
 };
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.cpp
index 9256c40..8c137f2 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.cpp
@@ -24,7 +24,6 @@
 #include <iostream>
 #include <sstream>
 #include <string>
-#include <cstring>
 
 namespace zxing {
 using namespace std;
@@ -40,7 +39,7 @@ unsigned int logDigits(unsigned digits) {
 }
 
 
-const unsigned int bitsPerWord = std::numeric_limits<unsigned int>::digits;
+const unsigned int bitsPerWord = numeric_limits<unsigned int>::digits;
 const unsigned int logBits = logDigits(bitsPerWord);
 const unsigned int bitsMask = (1 << logBits) - 1;
 
@@ -54,7 +53,7 @@ static size_t wordsForSize(size_t width, size_t height) {
 }
 
 BitMatrix::BitMatrix(size_t dimension) :
-    width_(dimension), height_(dimension), bits_(NULL) {
+    width_(dimension), height_(dimension), words_(0), bits_(NULL) {
 
   words_ = wordsForSize(width_, height_);
   bits_ = new unsigned int[words_];
@@ -62,7 +61,7 @@ BitMatrix::BitMatrix(size_t dimension) :
 }
 
 BitMatrix::BitMatrix(size_t width, size_t height) :
-    width_(width), height_(height), bits_(NULL) {
+    width_(width), height_(height), words_(0), bits_(NULL) {
 
   words_ = wordsForSize(width_, height_);
   bits_ = new unsigned int[words_];
@@ -90,7 +89,7 @@ void BitMatrix::flip(size_t x, size_t y) {
 }
 
 void BitMatrix::clear() {
-  std::memset(bits_, 0, sizeof(unsigned int) * words_);
+  std::fill(bits_, bits_+words_, 0);
 }
 
 void BitMatrix::setRegion(size_t left, size_t top, size_t width, size_t height) {
@@ -126,11 +125,11 @@ size_t BitMatrix::getDimension() const {
   return width_;
 }
 
-unsigned int* BitMatrix::getBits() {
+unsigned int* BitMatrix::getBits() const {
   return bits_;
 }
 
-ostream& operator<<(ostream &out, BitMatrix &bm) {
+ostream& operator<<(ostream &out, const BitMatrix &bm) {
   for (size_t y = 0; y < bm.height_; y++) {
     for (size_t x = 0; x < bm.width_; x++) {
       out << (bm.get(x, y) ? "X " : "  ");
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.h b/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.h
index e8f8f84..91d785e 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/BitMatrix.h
@@ -22,7 +22,6 @@
  */
 
 #include <zxing/common/Counted.h>
-#include <valarray>
 #include <limits>
 
 namespace zxing {
@@ -50,10 +49,14 @@ public:
   size_t getWidth() const;
   size_t getHeight() const;
 
-  unsigned int* getBits();
+  unsigned int* getBits() const;
 
-  friend std::ostream& operator<<(std::ostream &out, BitMatrix &bm);
+  friend std::ostream& operator<<(std::ostream &out, const BitMatrix &bm);
   const char *description();
+
+private:
+  BitMatrix(const BitMatrix&);
+  BitMatrix& operator =(const BitMatrix&);
 };
 
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/Counted.h b/symbian/ZXingBarcodeReader/group/zxing/common/Counted.h
index dd0f845..4f2b369 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/Counted.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/Counted.h
@@ -172,10 +172,10 @@ public:
   T& operator*() {
     return *object_;
   }
-  T* operator->() {
+  T* operator->() const {
     return object_;
   }
-  operator T*() {
+  operator T*() const {
     return object_;
   }
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/EdgeDetector.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/EdgeDetector.cpp
index 3f0b403..70ac8c5 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/EdgeDetector.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/EdgeDetector.cpp
@@ -20,6 +20,7 @@
 
 #include <zxing/common/EdgeDetector.h>
 #include <algorithm>
+#include <cmath>
 
 using namespace std;
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.cpp
index 8767dbd..8b99611 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.cpp
@@ -24,154 +24,160 @@
 #include <zxing/common/IllegalArgumentException.h>
 
 namespace zxing {
-	using namespace std;
-	
-	const int LUMINANCE_BITS = 5;
-	const int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
-	const int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
-	
-	GlobalHistogramBinarizer::GlobalHistogramBinarizer(Ref<LuminanceSource> source) :
-    Binarizer(source) {
-		
-	}
-	
-	GlobalHistogramBinarizer::~GlobalHistogramBinarizer() {
-	}
-	
-	
-	Ref<BitArray> GlobalHistogramBinarizer::estimateBlackRow(int y, Ref<BitArray> row){
-		valarray<int> histogram(0, LUMINANCE_BUCKETS);
-		LuminanceSource& source = *getSource();
-		int width = source.getWidth();
-		if (row == NULL || row->getSize() < width) {
-			row = new BitArray(width);
-		} else {
-			row->clear();
-		}
-		
-		for (int x = 0; x < width; x++) {
-			unsigned char pixel = source.getPixel(x, y);
-			histogram[pixel >> LUMINANCE_SHIFT]++;
-		}
-		int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
-		
-		
-		Ref<BitArray> array_ref(new BitArray(width));
-		BitArray& array = *array_ref;
-		
-		int left = source.getPixel(0, y);
-		int center = source.getPixel(1, y);
-		for (int x = 1; x < width - 1; x++) {
-			int right = source.getPixel(x+1, y);
-			// A simple -1 4 -1 box filter with a weight of 2.
-			int luminance = ((center << 2) - left - right) >> 1;
-			if (luminance < blackPoint) {
-				array.set(x);
-			}
-			left = center;
-			center = right;
-		}
-		
-		return array_ref;
-	}
-	
-	Ref<BitMatrix> GlobalHistogramBinarizer::estimateBlackMatrix() {
-		// Faster than working with the reference
-		LuminanceSource& source = *getSource();
-		int width = source.getWidth();
-		int height = source.getHeight();
-		valarray<int> histogram(0, LUMINANCE_BUCKETS);
-		
-		
-		// Quickly calculates the histogram by sampling four rows from the image. This proved to be
-		// more robust on the blackbox tests than sampling a diagonal as we used to do.
-		for (int y = 1; y < 5; y++) {
-			int row = height * y / 5;
-			int right = (width << 2) / 5;
-			int sdf;
-			for (int x = width / 5; x < right; x++) {
-				unsigned char pixel = source.getPixel(x, row);
-				histogram[pixel >> LUMINANCE_SHIFT]++;
-				sdf = histogram[pixel >> LUMINANCE_SHIFT];
-			}
-		}
-		
-		int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
-		
-		Ref<BitMatrix> matrix_ref(new BitMatrix(width, height));
-		BitMatrix& matrix = *matrix_ref;
-		for (int y = 0; y < height; y++) {
-			for (int x = 0; x < width; x++) {
-				if (source.getPixel(x, y) <= blackPoint)
-					matrix.set(x, y);
-			}
-		}
-		return matrix_ref;
-	}
-	
-	int GlobalHistogramBinarizer::estimate(valarray<int> &histogram) {
-		int numBuckets = histogram.size();
-		int maxBucketCount = 0;
-		
-		
-		// Find tallest peak in histogram
-		int firstPeak = 0;
-		int firstPeakSize = 0;
-		for (int i = 0; i < numBuckets; i++) {
-			if (histogram[i] > firstPeakSize) {
-				firstPeak = i;
-				firstPeakSize = histogram[i];
-			}
-			if (histogram[i] > maxBucketCount) {
-				maxBucketCount = histogram[i];
-			}
-		}
-		
-		// Find second-tallest peak -- well, another peak that is tall and not
-		// so close to the first one
-		int secondPeak = 0;
-		int secondPeakScore = 0;
-		for (int i = 0; i < numBuckets; i++) {
-			int distanceToBiggest = i - firstPeak;
-			// Encourage more distant second peaks by multiplying by square of distance
-			int score = histogram[i] * distanceToBiggest * distanceToBiggest;
-			if (score > secondPeakScore) {
-				secondPeak = i;
-				secondPeakScore = score;
-			}
-		}
-		
-		// Put firstPeak first
-		if (firstPeak > secondPeak) {
-			int temp = firstPeak;
-			firstPeak = secondPeak;
-			secondPeak = temp;
-		}
-		
-		// Kind of arbitrary; if the two peaks are very close, then we figure there is so little
-		// dynamic range in the image, that discriminating black and white is too error-prone.
-		// Decoding the image/line is either pointless, or may in some cases lead to a false positive
-		// for 1D formats, which are relatively lenient.
-		// We arbitrarily say "close" is "<= 1/16 of the total histogram buckets apart"
-		if (secondPeak - firstPeak <= numBuckets >> 4) {
-			throw IllegalArgumentException("Too little dynamic range in luminance");
-		}
-		
-		// Find a valley between them that is low and closer to the white peak
-		int bestValley = secondPeak - 1;
-		int bestValleyScore = -1;
-		for (int i = secondPeak - 1; i > firstPeak; i--) {
-			int fromFirst = i - firstPeak;
-			// Favor a "valley" that is not too close to either peak -- especially not the black peak --
-			// and that has a low value of course
-			int score = fromFirst * fromFirst * (secondPeak - i) * (maxBucketCount - histogram[i]);
-			if (score > bestValleyScore) {
-				bestValley = i;
-				bestValleyScore = score;
-			}
-		}
-		
-		return bestValley;
-	}
-	
+using namespace std;
+
+const int LUMINANCE_BITS = 5;
+const int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
+const int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
+
+GlobalHistogramBinarizer::GlobalHistogramBinarizer(Ref<LuminanceSource> source) :
+  Binarizer(source) {
+
+}
+
+GlobalHistogramBinarizer::~GlobalHistogramBinarizer() {
+}
+
+
+Ref<BitArray> GlobalHistogramBinarizer::estimateBlackRow(int y,
+  Ref<BitArray> row){
+  vector<int> histogram(LUMINANCE_BUCKETS, 0);
+  LuminanceSource& source = *getSource();
+  int width = source.getWidth();
+  if (row == NULL || static_cast<int>(row->getSize()) < width) {
+    row = new BitArray(width);
+  } else {
+    row->clear();
+  }
+
+  for (int x = 0; x < width; x++) {
+    unsigned char pixel = source.getPixel(x, y);
+    histogram[pixel >> LUMINANCE_SHIFT]++;
+  }
+  int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
+
+
+  Ref<BitArray> array_ref(new BitArray(width));
+  BitArray& array = *array_ref;
+
+  int left = source.getPixel(0, y);
+  int center = source.getPixel(1, y);
+  for (int x = 1; x < width - 1; x++) {
+    int right = source.getPixel(x+1, y);
+    // A simple -1 4 -1 box filter with a weight of 2.
+    int luminance = ((center << 2) - left - right) >> 1;
+    if (luminance < blackPoint) {
+      array.set(x);
+    }
+    left = center;
+    center = right;
+  }
+
+  return array_ref;
+}
+
+Ref<BitMatrix> GlobalHistogramBinarizer::estimateBlackMatrix() {
+  // Faster than working with the reference
+  LuminanceSource& source = *getSource();
+  int width = source.getWidth();
+  int height = source.getHeight();
+  vector<int> histogram(LUMINANCE_BUCKETS, 0);
+
+
+  // Quickly calculates the histogram by sampling four rows from the image.
+  // This proved to be more robust on the blackbox tests than sampling a
+  // diagonal as we used to do.
+  for (int y = 1; y < 5; y++) {
+    int row = height * y / 5;
+    int right = (width << 2) / 5;
+    int sdf;
+    for (int x = width / 5; x < right; x++) {
+      unsigned char pixel = source.getPixel(x, row);
+      histogram[pixel >> LUMINANCE_SHIFT]++;
+      sdf = histogram[pixel >> LUMINANCE_SHIFT];
+    }
+  }
+
+  int blackPoint = estimate(histogram) << LUMINANCE_SHIFT;
+
+  Ref<BitMatrix> matrix_ref(new BitMatrix(width, height));
+  BitMatrix& matrix = *matrix_ref;
+  for (int y = 0; y < height; y++) {
+    for (int x = 0; x < width; x++) {
+      if (source.getPixel(x, y) <= blackPoint)
+        matrix.set(x, y);
+    }
+  }
+  return matrix_ref;
 }
+
+int GlobalHistogramBinarizer::estimate(vector<int> &histogram) {
+  int numBuckets = histogram.size();
+  int maxBucketCount = 0;
+
+
+  // Find tallest peak in histogram
+  int firstPeak = 0;
+  int firstPeakSize = 0;
+  for (int i = 0; i < numBuckets; i++) {
+    if (histogram[i] > firstPeakSize) {
+      firstPeak = i;
+      firstPeakSize = histogram[i];
+    }
+    if (histogram[i] > maxBucketCount) {
+      maxBucketCount = histogram[i];
+    }
+  }
+
+  // Find second-tallest peak -- well, another peak that is tall and not
+  // so close to the first one
+  int secondPeak = 0;
+  int secondPeakScore = 0;
+  for (int i = 0; i < numBuckets; i++) {
+    int distanceToBiggest = i - firstPeak;
+    // Encourage more distant second peaks by multiplying by square of distance
+    int score = histogram[i] * distanceToBiggest * distanceToBiggest;
+    if (score > secondPeakScore) {
+      secondPeak = i;
+      secondPeakScore = score;
+    }
+  }
+
+  // Put firstPeak first
+  if (firstPeak > secondPeak) {
+    int temp = firstPeak;
+    firstPeak = secondPeak;
+    secondPeak = temp;
+  }
+
+  // Kind of arbitrary; if the two peaks are very close, then we figure there is
+  // so little dynamic range in the image, that discriminating black and white
+  // is too error-prone.
+  // Decoding the image/line is either pointless, or may in some cases lead to
+  // a false positive for 1D formats, which are relatively lenient.
+  // We arbitrarily say "close" is
+  // "<= 1/16 of the total histogram buckets apart"
+  if (secondPeak - firstPeak <= numBuckets >> 4) {
+    throw IllegalArgumentException("Too little dynamic range in luminance");
+  }
+
+  // Find a valley between them that is low and closer to the white peak
+  int bestValley = secondPeak - 1;
+  int bestValleyScore = -1;
+  for (int i = secondPeak - 1; i > firstPeak; i--) {
+    int fromFirst = i - firstPeak;
+    // Favor a "valley" that is not too close to either peak -- especially not
+    // the black peak -- and that has a low value of course
+    int score = fromFirst * fromFirst * (secondPeak - i) *
+      (maxBucketCount - histogram[i]);
+    if (score > bestValleyScore) {
+      bestValley = i;
+      bestValleyScore = score;
+    }
+  }
+
+  return bestValley;
+}
+
+} // namespace zxing
+
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.h b/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.h
index 6735c5b..42956e9 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/GlobalHistogramBinarizer.h
@@ -22,7 +22,7 @@
 #ifndef GLOBALHISTOGRAMBINARIZER_H_
 #define GLOBALHISTOGRAMBINARIZER_H_
 
-#include <valarray>
+#include <vector>
 #include <zxing/Binarizer.h>
 #include <zxing/common/BitArray.h>
 #include <zxing/common/BitMatrix.h>
@@ -36,7 +36,7 @@ namespace zxing {
 		
 		virtual Ref<BitArray> estimateBlackRow(int y, Ref<BitArray> row);
 		virtual Ref<BitMatrix> estimateBlackMatrix();
-		static int estimate(std::valarray<int> &histogram);
+		static int estimate(std::vector<int> &histogram);
 	};
 	
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.cpp
index 06bb602..03a240e 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.cpp
@@ -34,7 +34,7 @@ GridSampler::GridSampler() {
 
 Ref<BitMatrix> GridSampler::sampleGrid(Ref<BitMatrix> image, int dimension, Ref<PerspectiveTransform> transform) {
   Ref<BitMatrix> bits(new BitMatrix(dimension));
-  valarray<float> points((const float)0.0f, dimension << 1);
+  vector<float> points(dimension << 1, (const float)0.0f);
   for (int y = 0; y < dimension; y++) {
     int max = points.size();
     float yValue = (float)y + 0.5f;
@@ -63,7 +63,7 @@ Ref<BitMatrix> GridSampler::sampleGrid(Ref<BitMatrix> image, int dimension, floa
 
 }
 
-void GridSampler::checkAndNudgePoints(Ref<BitMatrix> image, valarray<float> &points) {
+void GridSampler::checkAndNudgePoints(Ref<BitMatrix> image, vector<float> &points) {
   int width = image->getWidth();
   int height = image->getHeight();
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.h b/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.h
index 3dd577d..a7ad8b9 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/GridSampler.h
@@ -36,7 +36,7 @@ public:
   Ref<BitMatrix> sampleGrid(Ref<BitMatrix> image, int dimension, float p1ToX, float p1ToY, float p2ToX, float p2ToY,
                             float p3ToX, float p3ToY, float p4ToX, float p4ToY, float p1FromX, float p1FromY, float p2FromX,
                             float p2FromY, float p3FromX, float p3FromY, float p4FromX, float p4FromY);
-  static void checkAndNudgePoints(Ref<BitMatrix> image, std::valarray<float> &points);
+  static void checkAndNudgePoints(Ref<BitMatrix> image, std::vector<float> &points);
   static GridSampler &getInstance();
 };
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.cpp
index 44d9ddc..5b4ae2e 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.cpp
@@ -23,18 +23,13 @@
 namespace zxing {
 using namespace std;
 
-PerspectiveTransform::PerspectiveTransform(float a11, float a21, float a31, float a12, float a22, float a32, float a13,
-    float a23, float a33) {
-  this->a11 = a11;
-  this->a12 = a12;
-  this->a13 = a13;
-  this->a21 = a21;
-  this->a22 = a22;
-  this->a23 = a23;
-  this->a31 = a31;
-  this->a32 = a32;
-  this->a33 = a33;
-}
+PerspectiveTransform::PerspectiveTransform(float inA11, float inA21, 
+                                           float inA31, float inA12, 
+                                           float inA22, float inA32, 
+                                           float inA13, float inA23, 
+                                           float inA33) : 
+  a11(inA11), a12(inA12), a13(inA13), a21(inA21), a22(inA22), a23(inA23),
+  a31(inA31), a32(inA32), a33(inA33) {}
 
 Ref<PerspectiveTransform> PerspectiveTransform::quadrilateralToQuadrilateral(float x0, float y0, float x1, float y1,
     float x2, float y2, float x3, float y3, float x0p, float y0p, float x1p, float y1p, float x2p, float y2p,
@@ -91,17 +86,8 @@ Ref<PerspectiveTransform> PerspectiveTransform::times(Ref<PerspectiveTransform>
   return result;
 }
 
-void PerspectiveTransform::transformPoints(valarray<float> &points) {
+void PerspectiveTransform::transformPoints(vector<float> &points) {
   int max = points.size();
-  float a11 = this->a11;
-  float a12 = this->a12;
-  float a13 = this->a13;
-  float a21 = this->a21;
-  float a22 = this->a22;
-  float a23 = this->a23;
-  float a31 = this->a31;
-  float a32 = this->a32;
-  float a33 = this->a33;
   for (int i = 0; i < max; i += 2) {
     float x = points[i];
     float y = points[i + 1];
@@ -111,7 +97,7 @@ void PerspectiveTransform::transformPoints(valarray<float> &points) {
   }
 }
 
-ostream& operator<<(ostream& out, PerspectiveTransform &pt) {
+ostream& operator<<(ostream& out, const PerspectiveTransform &pt) {
   out << pt.a11 << ", " << pt.a12 << ", " << pt.a13 << ", \n";
   out << pt.a21 << ", " << pt.a22 << ", " << pt.a23 << ", \n";
   out << pt.a31 << ", " << pt.a32 << ", " << pt.a33 << "\n";
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.h b/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.h
index 581f928..b322632 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/PerspectiveTransform.h
@@ -22,7 +22,7 @@
  */
 
 #include <zxing/common/Counted.h>
-#include <valarray>
+#include <vector>
 
 namespace zxing {
 class PerspectiveTransform : public Counted {
@@ -41,9 +41,9 @@ public:
       float x3, float y3);
   Ref<PerspectiveTransform> buildAdjoint();
   Ref<PerspectiveTransform> times(Ref<PerspectiveTransform> other);
-  void transformPoints(std::valarray<float> &points);
+  void transformPoints(std::vector<float> &points);
 
-  friend std::ostream& operator<<(std::ostream& out, PerspectiveTransform &pt);
+  friend std::ostream& operator<<(std::ostream& out, const PerspectiveTransform &pt);
 };
 }
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/Point.h b/symbian/ZXingBarcodeReader/group/zxing/common/Point.h
index a391042..ea27052 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/Point.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/Point.h
@@ -18,10 +18,10 @@
  * limitations under the License.
  */
 
-#ifndef ZXING_POINT_H_
-#define ZXING_POINT_H_
+#ifndef ZXING_POINT_H_
+#define ZXING_POINT_H_
 
-namespace zxing {
+namespace zxing {
 class PointI {
 public:
   int x;
@@ -30,6 +30,7 @@ public:
 
 class Point {
 public:
+  Point() : x(0.0f), y(0.0f) {};
   Point(float x_, float y_) : x(x_), y(y_) {};
 
   float x;
@@ -42,6 +43,6 @@ public:
 
   Point start;
   Point end;
-};
-}
-#endif // POINT_H_
+};
+}
+#endif // POINT_H_
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/Str.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/Str.cpp
index e2122dc..6259f94 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/Str.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/Str.cpp
@@ -26,7 +26,7 @@ using namespace std;
 String::String(const std::string &text) :
     text_(text) {
 }
-std::string& String::getText() {
+const std::string& String::getText() const {
   return text_;
 }
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/Str.h b/symbian/ZXingBarcodeReader/group/zxing/common/Str.h
index 255a055..09ff2bb 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/Str.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/Str.h
@@ -32,7 +32,7 @@ private:
   std::string text_;
 public:
   String(const std::string &text);
-  std::string &getText();
+  const std::string &getText() const;
   friend std::ostream &operator<<(std::ostream &out, const String &s);
 };
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.cpp b/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.cpp
index 8add889..51b621e 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.cpp
@@ -18,7 +18,6 @@
  * limitations under the License.
  */
 
-#include <valarray>
 #include <vector>
 #include <iostream>
 #include <zxing/common/reedsolomon/GF256.h>
@@ -42,7 +41,7 @@ static inline Ref<GF256Poly> refPoly(GF256 &field, int value) {
 }
 
 GF256::GF256(int primitive) :
-    exp_((const int)0, 256), log_((const int)0, 256), zero_(refPoly(*this, 0)), one_(refPoly(*this, 1)) {
+    exp_(256, (const int)0), log_(256, (const int)0), zero_(refPoly(*this, 0)), one_(refPoly(*this, 1)) {
   int x = 1;
   for (int i = 0; i < 256; i++) {
     exp_[i] = x;
@@ -110,13 +109,10 @@ int GF256::multiply(int a, int b) {
   if (a == 0 || b == 0) {
     return 0;
   }
-  if (a == 1) {
-    return b;
-  }
-  if (b == 1) {
-    return a;
-  }
-  return exp_[(log_[a] + log_[b]) % 255];
+  int logSum = log_[a] + log_[b];
+  // index is a sped-up alternative to logSum % 255 since sum
+  // is in [0,510]. Thanks to jmsachs for the idea
+  return exp_[(logSum & 0xFF) + (logSum >> 8)];
 }
 
 GF256 GF256::QR_CODE_FIELD(0x011D); // x^8 + x^4 + x^3 + x^2 + 1
diff --git a/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.h b/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.h
index 0930f63..070a0fd 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/common/reedsolomon/GF256.h
@@ -22,7 +22,7 @@
  */
 
 #include <memory>
-#include <valarray>
+#include <vector>
 #include <zxing/common/Counted.h>
 
 namespace zxing {
@@ -42,8 +42,8 @@ class GF256 {
    * @author christian.brunschen at gmail.com (Christian Brunschen)
    */
 private:
-  std::valarray<int> exp_;
-  std::valarray<int> log_;
+  std::vector<int> exp_;
+  std::vector<int> log_;
   Ref<GF256Poly> zero_;
   Ref<GF256Poly> one_;
 
diff --git a/cpp/core/src/zxing/datamatrix/DataMatrixReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/DataMatrixReader.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/DataMatrixReader.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/DataMatrixReader.cpp
diff --git a/cpp/core/src/zxing/datamatrix/DataMatrixReader.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/DataMatrixReader.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/DataMatrixReader.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/DataMatrixReader.h
diff --git a/cpp/core/src/zxing/datamatrix/Version.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/Version.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/Version.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/Version.cpp
diff --git a/cpp/core/src/zxing/datamatrix/Version.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/Version.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/Version.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/Version.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/BitMatrixParser.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/BitMatrixParser.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/BitMatrixParser.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/BitMatrixParser.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DataBlock.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DataBlock.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DataBlock.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DataBlock.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DataBlock.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DataBlock.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DataBlock.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DataBlock.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DecodedBitStreamParser.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/DecodedBitStreamParser.h
diff --git a/cpp/core/src/zxing/datamatrix/decoder/Decoder.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/Decoder.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/Decoder.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/Decoder.cpp
diff --git a/cpp/core/src/zxing/datamatrix/decoder/Decoder.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/Decoder.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/decoder/Decoder.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/decoder/Decoder.h
diff --git a/cpp/core/src/zxing/datamatrix/detector/CornerPoint.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/CornerPoint.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/CornerPoint.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/CornerPoint.cpp
diff --git a/cpp/core/src/zxing/datamatrix/detector/CornerPoint.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/CornerPoint.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/CornerPoint.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/CornerPoint.h
diff --git a/cpp/core/src/zxing/datamatrix/detector/Detector.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/Detector.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/Detector.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/Detector.cpp
diff --git a/cpp/core/src/zxing/datamatrix/detector/Detector.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/Detector.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/Detector.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/Detector.h
diff --git a/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp
diff --git a/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.h b/symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/MonochromeRectangleDetector.h
similarity index 100%
copy from cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.h
copy to symbian/ZXingBarcodeReader/group/zxing/datamatrix/detector/MonochromeRectangleDetector.h
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.cpp
index 943a574..36ab5dc 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.cpp
@@ -24,13 +24,14 @@
 #include <zxing/ReaderException.h>
 #include <math.h>
 #include <string.h>
+#include <sstream>
 
 namespace zxing {
 	namespace oned {
 		
-		const int CODE_PATTERNS_LENGHT = 107;
-		const int countersLenght = 6;
-		static const int CODE_PATTERNS[CODE_PATTERNS_LENGHT][countersLenght] = {
+		const int CODE_PATTERNS_LENGTH = 107;
+		const int countersLength = 6;
+		static const int CODE_PATTERNS[CODE_PATTERNS_LENGTH][countersLength] = {
 			{2, 1, 2, 2, 2, 2}, /* 0 */
 			{2, 2, 2, 1, 2, 2},
 			{2, 2, 2, 2, 2, 1},
@@ -155,7 +156,7 @@ namespace zxing {
 			}
 			
 			int counterPosition = 0;
-			int counters[countersLenght] = {0,0,0,0,0,0};
+			int counters[countersLength] = {0,0,0,0,0,0};
 			int patternStart = rowOffset;
 			bool isWhite = false;
 			int patternLength =  sizeof(counters) / sizeof(int);
@@ -166,10 +167,10 @@ namespace zxing {
 					counters[counterPosition]++;
 				} else {
 					if (counterPosition == patternLength - 1) {
-						int bestVariance = MAX_AVG_VARIANCE;
+						unsigned int bestVariance = MAX_AVG_VARIANCE;
 						int bestMatch = -1;
 						for (int startCode = CODE_START_A; startCode <= CODE_START_C; startCode++) {
-							int variance = patternMatchVariance(counters, sizeof(counters)/sizeof(int), CODE_PATTERNS[startCode], MAX_INDIVIDUAL_VARIANCE);
+							unsigned int variance = patternMatchVariance(counters, sizeof(counters)/sizeof(int), CODE_PATTERNS[startCode], MAX_INDIVIDUAL_VARIANCE);
 							if (variance < bestVariance) {
 								bestVariance = variance;
 								bestMatch = startCode;
@@ -204,16 +205,16 @@ namespace zxing {
 		
 		int Code128Reader::decodeCode(Ref<BitArray> row, int counters[], int countersCount, int rowOffset){
 			recordPattern(row, rowOffset, counters, countersCount);
-			int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
+			unsigned int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
 			int bestMatch = -1;
-			for (int d = 0; d < CODE_PATTERNS_LENGHT; d++) {
-				int pattern[countersLenght];
+			for (int d = 0; d < CODE_PATTERNS_LENGTH; d++) {
+				int pattern[countersLength];
 				
-				for(int ind = 0; ind< countersLenght; ind++){
+				for(int ind = 0; ind< countersLength; ind++){
 					pattern[ind] = CODE_PATTERNS[d][ind];
 				}
-//				memcpy(pattern, CODE_PATTERNS[d], countersLenght);
-				int variance = patternMatchVariance(counters, countersCount, pattern, MAX_INDIVIDUAL_VARIANCE);
+//				memcpy(pattern, CODE_PATTERNS[d], countersLength);
+				unsigned int variance = patternMatchVariance(counters, countersCount, pattern, MAX_INDIVIDUAL_VARIANCE);
 				if (variance < bestVariance) {
 					bestVariance = variance;
 					bestMatch = d;
@@ -243,6 +244,7 @@ namespace zxing {
 					codeSet = CODE_CODE_C;
 					break;
 				default:
+					delete [] startPatternInfo;
 					throw ReaderException("");
 			}
 			
@@ -250,11 +252,11 @@ namespace zxing {
 			bool isNextShifted = false;
 			
 			std::string tmpResultString;
-
+			std::stringstream tmpResultSStr; // used if its Code 128C
 			
 			int lastStart = startPatternInfo[0];
 			int nextStart = startPatternInfo[1];
-			int counters[countersLenght] = {0,0,0,0,0,0};
+			int counters[countersLength] = {0,0,0,0,0,0};
 			
 			int lastCode = 0;
 			int code = 0;
@@ -271,7 +273,12 @@ namespace zxing {
 				lastCode = code;
 				
 				// Decode another code from image
+				try {
 				code = decodeCode(row, counters, sizeof(counters)/sizeof(int), nextStart);
+				} catch (ReaderException re) {
+					delete [] startPatternInfo;
+					throw re;
+				}
 				
 				// Remember whether the last code was printable or not (excluding CODE_STOP)
 				if (code != CODE_STOP) {
@@ -286,8 +293,8 @@ namespace zxing {
 				
 				// Advance to where the next code will to start
 				lastStart = nextStart;
-				int _countersLenght = sizeof(counters) / sizeof(int);
-				for (int i = 0; i < _countersLenght; i++) {
+				int _countersLength = sizeof(counters) / sizeof(int);
+				for (int i = 0; i < _countersLength; i++) {
 					nextStart += counters[i];
 				}
 				
@@ -296,6 +303,7 @@ namespace zxing {
 					case CODE_START_A:
 					case CODE_START_B:
 					case CODE_START_C:
+						delete [] startPatternInfo;
 						throw ReaderException("");
 				}
 				
@@ -366,11 +374,11 @@ namespace zxing {
 						}
 						break;
 					case CODE_CODE_C:
+					// the code read in this case is the number encoded directly
 						if (code < 100) {
-							if (code < 10) {
-								tmpResultString.append(1, '0');
-							}
-							tmpResultString.append(1, code);
+							if (code < 10) 
+							tmpResultSStr << '0';
+						tmpResultSStr << code;
 						} else {
 							if (code != CODE_STOP) {
 								lastCharacterWasPrintable = false;
@@ -418,6 +426,7 @@ namespace zxing {
 				nextStart++;
 			}
 			if (!row->isRange(nextStart, fminl(width, nextStart + (nextStart - lastStart) / 2), false)) {
+				delete [] startPatternInfo;
 				throw ReaderException("");
 			}
 			
@@ -425,9 +434,13 @@ namespace zxing {
 			checksumTotal -= multiplier * lastCode;
 			// lastCode is the checksum then:
 			if (checksumTotal % 103 != lastCode) {
+				delete [] startPatternInfo;
 				throw ReaderException("");
 			}
 			
+			if (codeSet == CODE_CODE_C)
+				tmpResultString.append(tmpResultSStr.str());
+			
 			// Need to pull out the check digits from string
 			int resultLength = tmpResultString.length();
 			// Only bother if the result had at least one character, and if the checksum digit happened to
@@ -444,6 +457,7 @@ namespace zxing {
 //			String resultString(tmpResultString);
 			
 			if (tmpResultString.length() == 0) {
+				delete [] startPatternInfo;
 				// Almost surely a false positive
 				throw ReaderException("");
 			}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.h
index ad191aa..2b6752e 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/Code128Reader.h
@@ -27,7 +27,7 @@ namespace zxing {
 		class Code128Reader : public OneDReader {
 			
 		private:
-			static const int MAX_AVG_VARIANCE = (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);
 			
 			static const int CODE_SHIFT = 98;
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.cpp
index cb03dd9..337f237 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.cpp
@@ -26,315 +26,333 @@
 #include <limits.h>
 
 namespace zxing {
-	namespace oned {
-		
-		static const char* ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
-		
-		
-		/**
-		 * These represent the encodings of characters, as patterns of wide and narrow bars.
-		 * The 9 least-significant bits of each int correspond to the pattern of wide and narrow,
-		 * with 1s representing "wide" and 0s representing narrow.
-		 */
-		const int CHARACTER_ENCODINGS_LEN = 44;
-		static int CHARACTER_ENCODINGS[CHARACTER_ENCODINGS_LEN] = {
-			0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, // 0-9
-			0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, // A-J
-			0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, // K-T
-			0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, // U-*
-			0x0A8, 0x0A2, 0x08A, 0x02A // $-%
-		};
-		
-		static int ASTERISK_ENCODING = 0x094;
-		
-	
-		
-		/**
-		 * Creates a reader that assumes all encoded data is data, and does not treat the final
-		 * character as a check digit. It will not decoded "extended Code 39" sequences.
-		 */
-		Code39Reader::Code39Reader(){
-			ALPHABET_STRING = new std::string("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%");
-			usingCheckDigit = false;
-			extendedMode = false;
-		}
-		
-		/**
-		 * Creates a reader that can be configured to check the last character as a check digit.
-		 * It will not decoded "extended Code 39" sequences.
-		 *
-		 * @param usingCheckDigit if true, treat the last data character as a check digit, not
-		 * data, and verify that the checksum passes.
-		 */
-		Code39Reader::Code39Reader(bool usingCheckDigit_){
-			ALPHABET_STRING = new std::string("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%");
-			usingCheckDigit = usingCheckDigit_;
-			extendedMode = false;
-		}
- 
-
-		
-		Ref<Result> Code39Reader::decodeRow(int rowNumber, Ref<BitArray> row){
-			int* start = findAsteriskPattern(row);
-			int nextStart = start[1];
-			int end = row->getSize();
-			
-			// Read off white space
-			while (nextStart < end && !row->get(nextStart)) {
-				nextStart++;
-			}
-			
-			std::string tmpResultString;
-			
-			int countersLen = 9;
-			int* counters = new int[countersLen];
-			for (int i=0; i<countersLen; i++) {
-				counters[i] = 0;
-			}
-			char decodedChar;
-			int lastStart;
-			do {
-				recordPattern(row, nextStart, counters, countersLen);
-				int pattern = toNarrowWidePattern(counters, countersLen);
-				if (pattern < 0) {
-					throw ReaderException("pattern < 0");
-				}
-				decodedChar = patternToChar(pattern);
-				tmpResultString.append(1, decodedChar);
-				lastStart = nextStart;
-				for (int i = 0; i < countersLen; i++) {
-					nextStart += counters[i];
-				}
-				// Read off white space
-				while (nextStart < end && !row->get(nextStart)) {
-					nextStart++;
-				}
-			} while (decodedChar != '*');
-			tmpResultString.erase(tmpResultString.length()-1, 1);// remove asterisk
-			
-			// Look for whitespace after pattern:
-			int lastPatternSize = 0;
-			for (int i = 0; i < countersLen; i++) {
-				lastPatternSize += counters[i];
-			}
-			int whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
-			// If 50% of last pattern size, following last pattern, is not whitespace, fail
-			// (but if it's whitespace to the very end of the image, that's OK)
-			if (nextStart != end && whiteSpaceAfterEnd / 2 < lastPatternSize) {
-				throw ReaderException("too short end white space");
-			}
-			
-			if (usingCheckDigit) {
-				int max = tmpResultString.length() - 1;
-				int total = 0;
-				for (int i = 0; i < max; i++) {
-					total += ALPHABET_STRING->find_first_of(tmpResultString[i], 0);
-				}
-				if (total % 43 != ALPHABET_STRING->find_first_of(tmpResultString[max], 0)) {
-					throw ReaderException("");
-				}
-				tmpResultString.erase(max, 1);
-			}
-			
-			
-			
-			
-			Ref<String> resultString(new String(tmpResultString));
-			if (extendedMode) {
-				delete resultString;
-				resultString = decodeExtended(tmpResultString);
-			}
-			
-			if (tmpResultString.length() == 0) {
-				// Almost surely a false positive
-				throw ReaderException("");
-			}
-			
-			float left = (float) (start[1] + start[0]) / 2.0f;
-			float right = (float) (nextStart + lastStart) / 2.0f;
-			
-			std::vector< Ref<ResultPoint> > resultPoints(2);
-			Ref<OneDResultPoint> resultPoint1(new OneDResultPoint(left, (float) rowNumber));
-			Ref<OneDResultPoint> resultPoint2(new OneDResultPoint(right, (float) rowNumber));
-			resultPoints[0] = resultPoint1;
-			resultPoints[1] = resultPoint2;
-			
-			ArrayRef<unsigned char> resultBytes(1);
-			
-			delete [] start;
-			
-			Ref<Result> res(new Result(resultString, resultBytes, resultPoints, BarcodeFormat_CODE_39));
-			return res;
-		}
-		
-		int* Code39Reader::findAsteriskPattern(Ref<BitArray> row){
-			int width = row->getSize();
-			int rowOffset = 0;
-			while (rowOffset < width) {
-				if (row->get(rowOffset)) {
-					break;
-				}
-				rowOffset++;
-			}
-			
-			int counterPosition = 0;
-			int countersLen = 9;
-			int* counters = new int[countersLen];
-			for (int i=0; i<countersLen; i++) {
-				counters[i] = 0;
-			}
-			int patternStart = rowOffset;
-			bool isWhite = false;
-			int patternLength = countersLen;
-			
-			for (int i = rowOffset; i < width; i++) {
-				bool pixel = row->get(i);
-				if (pixel ^ isWhite) {
-					counters[counterPosition]++;
-				} else {
-					if (counterPosition == patternLength - 1) {
-						if (toNarrowWidePattern(counters, countersLen) == ASTERISK_ENCODING) {
-							// Look for whitespace before start pattern, >= 50% of width of start pattern
-							if (row->isRange(fmaxl(0, patternStart - (i - patternStart) / 2), patternStart, false)) {
-								int* resultValue = new int[2];
-								resultValue[0] = patternStart;
-								resultValue[1] = i;
-								return resultValue;
-							}
-						}
-						patternStart += counters[0] + counters[1];
-						for (int y = 2; y < patternLength; y++) {
-							counters[y - 2] = counters[y];
-						}
-						counters[patternLength - 2] = 0;
-						counters[patternLength - 1] = 0;
-						counterPosition--;
-					} else {
-						counterPosition++;
-					}
-					counters[counterPosition] = 1;
-					isWhite = !isWhite;
-				}
-			}
-			throw ReaderException("");
-		}
-		
-		// For efficiency, returns -1 on failure. Not throwing here saved as many as 700 exceptions
-		// per image when using some of our blackbox images.
-		int Code39Reader::toNarrowWidePattern(int counters[], int countersLen){
-			int numCounters = countersLen;
-			int maxNarrowCounter = 0;
-			int wideCounters;
-			do {
-				int minCounter = INT_MAX;
-				for (int i = 0; i < numCounters; i++) {
-					int counter = counters[i];
-					if (counter < minCounter && counter > maxNarrowCounter) {
-						minCounter = counter;
-					}
-				}
-				maxNarrowCounter = minCounter;
-				wideCounters = 0;
-				int totalWideCountersWidth = 0;
-				int pattern = 0;
-				for (int i = 0; i < numCounters; i++) {
-					int counter = counters[i];
-					if (counters[i] > maxNarrowCounter) {
-						pattern |= 1 << (numCounters - 1 - i);
-						wideCounters++;
-						totalWideCountersWidth += counter;
-					}
-				}
-				if (wideCounters == 3) {
-					// Found 3 wide counters, but are they close enough in width?
-					// We can perform a cheap, conservative check to see if any individual
-					// counter is more than 1.5 times the average:
-					for (int i = 0; i < numCounters && wideCounters > 0; i++) {
-						int counter = counters[i];
-						if (counters[i] > maxNarrowCounter) {
-							wideCounters--;
-							// totalWideCountersWidth = 3 * average, so this checks if counter >= 3/2 * average
-							if ((counter << 1) >= totalWideCountersWidth) {
-								return -1;
-							}
-						}
-					}
-					return pattern;
-				}
-			} while (wideCounters > 3);
-			return -1;
-		}
-		
-		char Code39Reader::patternToChar(int pattern){
-			for (int i = 0; i < CHARACTER_ENCODINGS_LEN; i++) {
-				if (CHARACTER_ENCODINGS[i] == pattern) {
-					return ALPHABET[i];
-				}
-			}
-			throw ReaderException("");
-		}
-		
-		Ref<String> Code39Reader::decodeExtended(std::string encoded){
-			int length = encoded.length();
-			std::string tmpDecoded;
-			for (int i = 0; i < length; i++) {
-				char c = encoded[i];
-				if (c == '+' || c == '$' || c == '%' || c == '/') {
-					char next = encoded[i + 1];
-					char decodedChar = '\0';
-					switch (c) {
-						case '+':
-							// +A to +Z map to a to z
-							if (next >= 'A' && next <= 'Z') {
-								decodedChar = (char) (next + 32);
-							} else {
-								throw ReaderException("");
-							}
-							break;
-						case '$':
-							// $A to $Z map to control codes SH to SB
-							if (next >= 'A' && next <= 'Z') {
-								decodedChar = (char) (next - 64);
-							} else {
-								throw ReaderException("");
-							}
-							break;
-						case '%':
-							// %A to %E map to control codes ESC to US
-							if (next >= 'A' && next <= 'E') {
-								decodedChar = (char) (next - 38);
-							} else if (next >= 'F' && next <= 'W') {
-								decodedChar = (char) (next - 11);
-							} else {
-								throw ReaderException("");
-							}
-							break;
-						case '/':
-							// /A to /O map to ! to , and /Z maps to :
-							if (next >= 'A' && next <= 'O') {
-								decodedChar = (char) (next - 32);
-							} else if (next == 'Z') {
-								decodedChar = ':';
-							} else {
-								throw ReaderException("");
-							}
-							break;
-					}
-					tmpDecoded.append(1, decodedChar);
-					// bump up i again since we read two characters
-					i++;
-				} else {
-					tmpDecoded.append(1, c);
-				}
-			}
-			Ref<String> decoded(new String(tmpDecoded));
-			return decoded;
-		}
-		
-
-		Code39Reader::~Code39Reader(){
-			delete ALPHABET_STRING;
-		}
-
-	}
-}
+namespace oned {
+
+  static const char* ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
+
+
+  /**
+   * These represent the encodings of characters, as patterns of wide and narrow
+   * bars.
+   * The 9 least-significant bits of each int correspond to the pattern of wide
+   * and narrow, with 1s representing "wide" and 0s representing narrow.
+   */
+  const int CHARACTER_ENCODINGS_LEN = 44;
+  static int CHARACTER_ENCODINGS[CHARACTER_ENCODINGS_LEN] = {
+    0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, // 0-9
+    0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, // A-J
+    0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, // K-T
+    0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, // U-*
+    0x0A8, 0x0A2, 0x08A, 0x02A // $-%
+  };
+
+  static int ASTERISK_ENCODING = 0x094;
+  static const char* ALPHABET_STRING =
+    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
+
+
+  /**
+   * Creates a reader that assumes all encoded data is data, and does not treat
+   * the final character as a check digit. It will not decoded "extended
+   * Code 39" sequences.
+   */
+  Code39Reader::Code39Reader() : alphabet_string(ALPHABET_STRING),
+                                 usingCheckDigit(false),
+                                 extendedMode(false) {
+  }
+
+  /**
+   * Creates a reader that can be configured to check the last character as a
+   * check digit. It will not decoded "extended Code 39" sequences.
+   *
+   * @param usingCheckDigit if true, treat the last data character as a check
+   * digit, not data, and verify that the checksum passes.
+   */
+  Code39Reader::Code39Reader(bool usingCheckDigit_) :
+    alphabet_string(ALPHABET_STRING), 
+    usingCheckDigit(usingCheckDigit_),
+    extendedMode(false) {
+  }
+
+
+
+  Ref<Result> Code39Reader::decodeRow(int rowNumber, Ref<BitArray> row){
+    int* start = findAsteriskPattern(row);
+    int nextStart = start[1];
+    int end = row->getSize();
+
+    // Read off white space
+    while (nextStart < end && !row->get(nextStart)) {
+      nextStart++;
+    }
+
+    std::string tmpResultString;
+
+    int countersLen = 9;
+    int* counters = new int[countersLen];
+    for (int i=0; i<countersLen; i++) {
+      counters[i] = 0;
+    }
+    char decodedChar;
+    int lastStart;
+    do {
+      try {
+      recordPattern(row, nextStart, counters, countersLen);
+      } catch (ReaderException re) {
+        delete [] start;
+        throw re;
+      }
+      int pattern = toNarrowWidePattern(counters, countersLen);
+      if (pattern < 0) {
+        delete [] start;
+        throw ReaderException("pattern < 0");
+      }
+      decodedChar = patternToChar(pattern);
+      tmpResultString.append(1, decodedChar);
+      lastStart = nextStart;
+      for (int i = 0; i < countersLen; i++) {
+        nextStart += counters[i];
+      }
+      // Read off white space
+      while (nextStart < end && !row->get(nextStart)) {
+        nextStart++;
+      }
+    } while (decodedChar != '*');
+    tmpResultString.erase(tmpResultString.length()-1, 1);// remove asterisk
+
+    // Look for whitespace after pattern:
+    int lastPatternSize = 0;
+    for (int i = 0; i < countersLen; i++) {
+      lastPatternSize += counters[i];
+    }
+    // IS begin
+    delete [] counters;
+    // IS end
+    int whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
+    // If 50% of last pattern size, following last pattern, is not whitespace,
+    // fail (but if it's whitespace to the very end of the image, that's OK)
+    if (nextStart != end && whiteSpaceAfterEnd / 2 < lastPatternSize) {
+      delete [] start;
+      throw ReaderException("too short end white space");
+    }
+
+    if (usingCheckDigit) {
+      int max = tmpResultString.length() - 1;
+      unsigned int total = 0;
+      for (int i = 0; i < max; i++) {
+        total += alphabet_string.find_first_of(tmpResultString[i], 0);
+      }
+      if (total % 43 != alphabet_string.find_first_of(tmpResultString[max], 0)) {
+        throw ReaderException("");
+      }
+      tmpResultString.erase(max, 1);
+    }
+
+
+
+
+    Ref<String> resultString(new String(tmpResultString));
+    if (extendedMode) {
+      delete resultString;
+      resultString = decodeExtended(tmpResultString);
+    }
+
+    if (tmpResultString.length() == 0) {
+      delete [] start;
+      // Almost surely a false positive
+      throw ReaderException("");
+    }
+
+    float left = (float) (start[1] + start[0]) / 2.0f;
+    float right = (float) (nextStart + lastStart) / 2.0f;
+
+    std::vector< Ref<ResultPoint> > resultPoints(2);
+    Ref<OneDResultPoint> resultPoint1(
+      new OneDResultPoint(left, (float) rowNumber));
+    Ref<OneDResultPoint> resultPoint2(
+      new OneDResultPoint(right, (float) rowNumber));
+    resultPoints[0] = resultPoint1;
+    resultPoints[1] = resultPoint2;
+
+    ArrayRef<unsigned char> resultBytes(1);
+
+    delete [] start;
+
+    Ref<Result> res(new Result(
+      resultString, resultBytes, resultPoints, BarcodeFormat_CODE_39));
+    return res;
+  }
+
+  int* Code39Reader::findAsteriskPattern(Ref<BitArray> row){
+    int width = row->getSize();
+    int rowOffset = 0;
+    while (rowOffset < width) {
+      if (row->get(rowOffset)) {
+        break;
+      }
+      rowOffset++;
+    }
+
+    int counterPosition = 0;
+    int countersLen = 9;
+    int* counters = new int[countersLen];
+    for (int i=0; i<countersLen; i++) {
+      counters[i] = 0;
+    }
+    int patternStart = rowOffset;
+    bool isWhite = false;
+    int patternLength = countersLen;
+
+    for (int i = rowOffset; i < width; i++) {
+      bool pixel = row->get(i);
+      if (pixel ^ isWhite) {
+        counters[counterPosition]++;
+      } else {
+        if (counterPosition == patternLength - 1) {
+          if (toNarrowWidePattern(counters, countersLen) == ASTERISK_ENCODING) {
+            // Look for whitespace before start pattern, >= 50% of width of
+            // start pattern.
+            long double longPatternOffset =
+              fmaxl(0, patternStart - (i - patternStart) / 2);
+            if (row->isRange(longPatternOffset, patternStart, false)) {
+              int* resultValue = new int[2];
+              resultValue[0] = patternStart;
+              resultValue[1] = i;
+              return resultValue;
+            }
+          }
+          patternStart += counters[0] + counters[1];
+          for (int y = 2; y < patternLength; y++) {
+            counters[y - 2] = counters[y];
+          }
+          counters[patternLength - 2] = 0;
+          counters[patternLength - 1] = 0;
+          counterPosition--;
+        } else {
+          counterPosition++;
+        }
+        counters[counterPosition] = 1;
+        isWhite = !isWhite;
+      }
+    }
+    // IS begin
+    delete [] counters;
+    // IS end
+    throw ReaderException("");
+  }
+
+  // For efficiency, returns -1 on failure. Not throwing here saved as many as
+  // 700 exceptions per image when using some of our blackbox images.
+  int Code39Reader::toNarrowWidePattern(int counters[], int countersLen){
+    int numCounters = countersLen;
+    int maxNarrowCounter = 0;
+    int wideCounters;
+    do {
+      int minCounter = INT_MAX;
+      for (int i = 0; i < numCounters; i++) {
+        int counter = counters[i];
+        if (counter < minCounter && counter > maxNarrowCounter) {
+          minCounter = counter;
+        }
+      }
+      maxNarrowCounter = minCounter;
+      wideCounters = 0;
+      int totalWideCountersWidth = 0;
+      int pattern = 0;
+      for (int i = 0; i < numCounters; i++) {
+        int counter = counters[i];
+        if (counters[i] > maxNarrowCounter) {
+          pattern |= 1 << (numCounters - 1 - i);
+          wideCounters++;
+          totalWideCountersWidth += counter;
+        }
+      }
+      if (wideCounters == 3) {
+        // Found 3 wide counters, but are they close enough in width?
+        // We can perform a cheap, conservative check to see if any individual
+        // counter is more than 1.5 times the average:
+        for (int i = 0; i < numCounters && wideCounters > 0; i++) {
+          int counter = counters[i];
+          if (counters[i] > maxNarrowCounter) {
+            wideCounters--;
+            // totalWideCountersWidth = 3 * average, so this checks if
+            // counter >= 3/2 * average.
+            if ((counter << 1) >= totalWideCountersWidth) {
+              return -1;
+            }
+          }
+        }
+        return pattern;
+      }
+    } while (wideCounters > 3);
+    return -1;
+  }
+
+  char Code39Reader::patternToChar(int pattern){
+    for (int i = 0; i < CHARACTER_ENCODINGS_LEN; i++) {
+      if (CHARACTER_ENCODINGS[i] == pattern) {
+        return ALPHABET[i];
+      }
+    }
+    throw ReaderException("");
+  }
+
+  Ref<String> Code39Reader::decodeExtended(std::string encoded){
+    int length = encoded.length();
+    std::string tmpDecoded;
+    for (int i = 0; i < length; i++) {
+      char c = encoded[i];
+      if (c == '+' || c == '$' || c == '%' || c == '/') {
+        char next = encoded[i + 1];
+        char decodedChar = '\0';
+        switch (c) {
+          case '+':
+            // +A to +Z map to a to z
+            if (next >= 'A' && next <= 'Z') {
+              decodedChar = (char) (next + 32);
+            } else {
+              throw ReaderException("");
+            }
+            break;
+          case '$':
+            // $A to $Z map to control codes SH to SB
+            if (next >= 'A' && next <= 'Z') {
+              decodedChar = (char) (next - 64);
+            } else {
+              throw ReaderException("");
+            }
+            break;
+          case '%':
+            // %A to %E map to control codes ESC to US
+            if (next >= 'A' && next <= 'E') {
+              decodedChar = (char) (next - 38);
+            } else if (next >= 'F' && next <= 'W') {
+              decodedChar = (char) (next - 11);
+            } else {
+              throw ReaderException("");
+            }
+            break;
+          case '/':
+            // /A to /O map to ! to , and /Z maps to :
+            if (next >= 'A' && next <= 'O') {
+              decodedChar = (char) (next - 32);
+            } else if (next == 'Z') {
+              decodedChar = ':';
+            } else {
+              throw ReaderException("");
+            }
+            break;
+        }
+        tmpDecoded.append(1, decodedChar);
+        // bump up i again since we read two characters
+        i++;
+      } else {
+        tmpDecoded.append(1, c);
+      }
+    }
+    Ref<String> decoded(new String(tmpDecoded));
+    return decoded;
+  }
+} // namespace oned
+} // namespace zxing
+
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.h
index 1846761..cc7148c 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/Code39Reader.h
@@ -33,7 +33,7 @@ namespace zxing {
 		class Code39Reader : public OneDReader {
 			
 		private:
-			std::string* ALPHABET_STRING;
+			std::string alphabet_string;
 
 			bool usingCheckDigit;
 			bool extendedMode;
@@ -49,9 +49,7 @@ namespace zxing {
 			Code39Reader(bool usingCheckDigit_);
 			
 			Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row);
-			
-			~Code39Reader();
-		};
+    };
 	}
 }
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.cpp
index 0e3de97..dab360b 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.cpp
@@ -27,20 +27,11 @@ namespace zxing {
 		static const int FIRST_DIGIT_ENCODINGS[10] = {0x00, 0x0B, 0x0D, 0xE, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1A};
 				
 		
-		EAN13Reader::EAN13Reader(){
-			decodeMiddleCounters = new int[4];
-			for (int i=0; i<4; i++) {
-				decodeMiddleCounters[i] = 0;
-			}
-		}
+		EAN13Reader::EAN13Reader() { }
 		
 		int EAN13Reader::decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString){
-			int countersLen = 4;
-			int* counters = decodeMiddleCounters;
-			counters[0] = 0;
-			counters[1] = 0;
-			counters[2] = 0;
-			counters[3] = 0;
+			const int countersLen = 4;
+			int counters[countersLen] = { 0, 0, 0, 0 };
 			
 			
 			int end = row->getSize();
@@ -88,8 +79,5 @@ namespace zxing {
 		BarcodeFormat EAN13Reader::getBarcodeFormat(){
 			return BarcodeFormat_EAN_13;
 		}
-		EAN13Reader::~EAN13Reader(){
-			delete [] decodeMiddleCounters;
-		}
 	}
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.h
index 8ef6fe3..540d326 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN13Reader.h
@@ -26,7 +26,6 @@ namespace zxing {
 		class EAN13Reader : public UPCEANReader {
 			
 		private:
-			int* decodeMiddleCounters;
 			static void determineFirstDigit(std::string& resultString, int lgPatternFound);								//throws ReaderException
 			
 		public:
@@ -35,7 +34,6 @@ namespace zxing {
 			int decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString);			//throws ReaderException
 			
 			BarcodeFormat getBarcodeFormat();
-			~EAN13Reader();
 		};
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.cpp
index 52d09fe..e3c0e2a 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.cpp
@@ -24,21 +24,11 @@
 namespace zxing {
 	namespace oned {
 		
-		EAN8Reader::EAN8Reader(){
-			decodeMiddleCounters = new int[4];
-			for (int i=0; i<4; i++) {
-				decodeMiddleCounters[i] = 0;
-			}
-		}
+		EAN8Reader::EAN8Reader(){ }
 		
 		int EAN8Reader::decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString){
-			int countersLen = 4;
-			int* counters = decodeMiddleCounters;
-			counters[0] = 0;
-			counters[1] = 0;
-			counters[2] = 0;
-			counters[3] = 0;
-			
+			const int countersLen = 4;
+			int counters[countersLen] = { 0, 0, 0, 0 };
 			
 			int end = row->getSize();
 			int rowOffset = startRange[1];
@@ -68,8 +58,5 @@ namespace zxing {
 		BarcodeFormat EAN8Reader::getBarcodeFormat(){
 			return BarcodeFormat_EAN_8;
 		}
-		EAN8Reader::~EAN8Reader(){
-			delete [] decodeMiddleCounters;
-		}
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.h
index 3e4f3d6..481944c 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/EAN8Reader.h
@@ -25,16 +25,12 @@ namespace zxing {
 	namespace oned {
 		class EAN8Reader : public UPCEANReader {
 			
-		private:
-			int* decodeMiddleCounters;
-			
 		public:
 			EAN8Reader();
 			
 			int decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString);			//throws ReaderException
 			
 			BarcodeFormat getBarcodeFormat();
-			~EAN8Reader();
 		};
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.cpp
index e38ab21..4464326 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.cpp
@@ -62,18 +62,29 @@ namespace zxing {
 		};
 		
 		
-		ITFReader::ITFReader(){
-			narrowLineWidth = -1;
+		ITFReader::ITFReader() : narrowLineWidth(-1) {
 		}
 		
 		
 		Ref<Result> ITFReader::decodeRow(int rowNumber, Ref<BitArray> row){
 			// Find out where the Middle section (payload) starts & ends
 			int* startRange = decodeStart(row);
-			int* endRange = decodeEnd(row);
+			int* endRange;
+			try {
+				endRange = decodeEnd(row);
+			} catch (Exception e) {
+				delete [] startRange;
+				throw e;
+			}
 			
 			std::string tmpResult;
+			try {
 			decodeMiddle(row, startRange[1], endRange[0], tmpResult);
+			} catch (zxing::ReaderException re) {
+				delete [] startRange;
+				delete [] endRange;
+				throw re;
+			}
 			
 			// To avoid false positives with 2D barcodes (and other patterns), make
 			// an assumption that the decoded string must be 6, 10 or 14 digits.
@@ -83,7 +94,9 @@ namespace zxing {
 					lengthOK = true;
 				}
 			if (!lengthOK) {
-				throw ReaderException("not enought characters count");
+				delete [] startRange;
+				delete [] endRange;
+				throw ReaderException("not enough characters count");
 			}
 			
 			Ref<String> resultString(new String(tmpResult));
@@ -116,13 +129,13 @@ namespace zxing {
 			// Therefore, need to scan 10 lines and then
 			// split these into two arrays
 			int counterDigitPairLen = 10;
-			int* counterDigitPair = new int[counterDigitPairLen];
+			int counterDigitPair[counterDigitPairLen];
 			for (int i=0; i<counterDigitPairLen; i++) {
 				counterDigitPair[i] = 0;
 			}
 			
-			int* counterBlack = new int[5];
-			int* counterWhite = new int[5];
+			int counterBlack[5];
+			int counterWhite[5];
 			for (int i=0; i<5; i++) {
 				counterBlack[i] = 0;
 				counterWhite[i] = 0;
@@ -147,9 +160,6 @@ namespace zxing {
 					payloadStart += counterDigitPair[i];
 				}
 			}
-			delete [] counterDigitPair;
-			delete [] counterBlack;
-			delete [] counterWhite;
 		}
 		
 		/**
@@ -227,7 +237,7 @@ namespace zxing {
 		 * @throws ReaderException if the quiet zone cannot be found, a ReaderException is thrown.
 		 */
 		void ITFReader::validateQuietZone(Ref<BitArray> row, int startPattern){
-#pragma mark needs some corrections
+//#pragma mark needs some corrections
 //			int quietCount = narrowLineWidth * 10;  // expect to find this many pixels of quiet zone
 //			
 //			for (int i = startPattern - 1; quietCount > 0 && i >= 0; i--) {
@@ -278,7 +288,7 @@ namespace zxing {
 			// TODO: This is very similar to implementation in UPCEANReader. Consider if they can be
 			// merged to a single method.
 			int patternLength = patternLen;
-			int* counters = new int[patternLength];
+			int counters[patternLength];
 			for (int i=0; i<patternLength; i++) {
 				counters[i] = 0;
 			}
@@ -325,7 +335,7 @@ namespace zxing {
 		 * @throws ReaderException if digit cannot be decoded
 		 */
 		int ITFReader::decodeDigit(int counters[], int countersLen){
-			int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
+			unsigned int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
 			int bestMatch = -1;
 			int max = PATTERNS_LEN;
 			for (int i = 0; i < max; i++) {
@@ -333,7 +343,7 @@ namespace zxing {
 				for(int ind = 0; ind<countersLen; ind++){
 					pattern[ind] = PATTERNS[i][ind];
 				}
-				int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
+				unsigned int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
 				if (variance < bestVariance) {
 					bestVariance = variance;
 					bestMatch = i;
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.h
index 759d841..41c22cd 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/ITFReader.h
@@ -27,7 +27,7 @@ namespace zxing {
 		class ITFReader : public OneDReader {
 			
 		private:
-			static const int MAX_AVG_VARIANCE = (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);
 			
 			// Stores the actual narrow line width of the image being decoded.
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.cpp
index 1338a56..ea44471 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.cpp
@@ -28,18 +28,17 @@
 
 namespace zxing {
 	namespace oned {
-		MultiFormatOneDReader::MultiFormatOneDReader(){
-			readers = new std::vector<OneDReader*>();
-			readers->push_back(new MultiFormatUPCEANReader());
-			readers->push_back(new Code39Reader());
-			readers->push_back(new Code128Reader());
-			readers->push_back(new ITFReader());
+		MultiFormatOneDReader::MultiFormatOneDReader() : readers() {
+			readers.push_back(Ref<OneDReader>(new MultiFormatUPCEANReader()));
+			readers.push_back(Ref<OneDReader>(new Code39Reader()));
+			readers.push_back(Ref<OneDReader>(new Code128Reader()));
+			readers.push_back(Ref<OneDReader>(new ITFReader()));
 		}
 		
 		Ref<Result> MultiFormatOneDReader::decodeRow(int rowNumber, Ref<BitArray> row){
-			int size = readers->size();
+			int size = readers.size();
 			for (int i = 0; i < size; i++) {
-				OneDReader* reader = (*readers)[i];
+				OneDReader* reader = readers[i];
 				try {
 					return reader->decodeRow(rowNumber, row);
 				} catch (ReaderException re) {
@@ -48,8 +47,5 @@ namespace zxing {
 			}
 			throw ReaderException("No code detected");
 		}
-		MultiFormatOneDReader::~MultiFormatOneDReader(){
-			delete readers;
-		}
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.h
index 9fcc6fb..0e5ab53 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatOneDReader.h
@@ -27,13 +27,11 @@ namespace zxing {
 		class MultiFormatOneDReader : public OneDReader {
 			
 		private:
-			std::vector<OneDReader*>* readers;
+			std::vector<Ref<OneDReader> > readers;
 		public:
 			MultiFormatOneDReader();
 			
-			Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row);
-			
-			~MultiFormatOneDReader();
+			Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row);			
 		};
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.cpp
index 61011f0..24aa5e6 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.cpp
@@ -30,19 +30,18 @@
 namespace zxing {
 	namespace oned {
 		
-		MultiFormatUPCEANReader::MultiFormatUPCEANReader(){
-			readers = new std::vector<OneDReader*>();
-			readers->push_back(new EAN13Reader());
+		MultiFormatUPCEANReader::MultiFormatUPCEANReader() : readers() {
+			readers.push_back(Ref<OneDReader>(new EAN13Reader()));
 			// UPC-A is covered by EAN-13
-			readers->push_back(new EAN8Reader());
-			readers->push_back(new UPCEReader());
+			readers.push_back(Ref<OneDReader>(new EAN8Reader()));
+			readers.push_back(Ref<OneDReader>(new UPCEReader()));
 		}
 		
 		Ref<Result> MultiFormatUPCEANReader::decodeRow(int rowNumber, Ref<BitArray> row){			
 			// Compute this location once and reuse it on multiple implementations
-			int size = readers->size();
+			int size = readers.size();
 			for (int i = 0; i < size; i++) {
-				OneDReader* reader = (*readers)[i];
+				Ref<OneDReader> reader = readers[i];
 				Ref<Result> result;
 				try {
 					result = reader->decodeRow(rowNumber, row);//decodeRow(rowNumber, row, startGuardPattern);
@@ -60,7 +59,7 @@ namespace zxing {
 				// UPC-A. So we special case it here, and convert an EAN-13 result to a UPC-A
 				// result if appropriate.
 				if (result->getBarcodeFormat() == BarcodeFormat_EAN_13) {
-					std::string& text = (result->getText())->getText();
+					const std::string& text = (result->getText())->getText();
 					if (text[0] == '0') {
 						Ref<String> resultString(new String(text.substr(1)));
 						Ref<Result> res(new Result(resultString, result->getRawBytes(), result->getResultPoints(), BarcodeFormat_UPC_A));
@@ -71,9 +70,5 @@ namespace zxing {
 			}
 			throw ReaderException("No EAN code detected");
 		}
-		
-		MultiFormatUPCEANReader::~MultiFormatUPCEANReader(){
-			delete readers;
-		}
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.h
index 706f9c4..2c5b196 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/MultiFormatUPCEANReader.h
@@ -29,13 +29,11 @@ namespace zxing {
 		class MultiFormatUPCEANReader : public OneDReader {
 			
 		private:
-			std::vector<OneDReader*>* readers;
+			std::vector<Ref<OneDReader> > readers;
 		public:
 			MultiFormatUPCEANReader();
 			
 			Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row);
-			
-			~MultiFormatUPCEANReader();
-		};
+    };
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.cpp
index 21526f5..d3e4916 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.cpp
@@ -20,6 +20,7 @@
 
 #include "OneDReader.h"
 #include <zxing/ReaderException.h>
+#include <zxing/oned/OneDResultPoint.h>
 #include <math.h>
 #include <limits.h>
 
@@ -93,6 +94,8 @@ namespace zxing {
 					row = image->getBlackRow(rowNumber, row);
 				}catch (ReaderException re) {
 					continue;
+				}catch (IllegalArgumentException re) {
+					continue;
 				}
 				
 				// While we have the image data in a BitArray, it's fairly cheap to reverse it in place to
@@ -109,9 +112,17 @@ namespace zxing {
 							//						// But it was upside down, so note that
 							//						result.putMetadata(ResultMetadataType.ORIENTATION, new Integer(180));
 							//						// And remember to flip the result points horizontally.
-							//						ResultPoint[] points = result.getResultPoints();
-							//						points[0] = new ResultPoint(width - points[0].getX() - 1, points[0].getY());
-							//						points[1] = new ResultPoint(width - points[1].getX() - 1, points[1].getY());
+							std::vector<Ref<ResultPoint> > points(result->getResultPoints());
+							if (points.size() == 2) {
+								Ref<ResultPoint> pointZero(new OneDResultPoint(width - points[0]->getX() - 1, points[0]->getY()));
+								points[0] = pointZero;
+
+								Ref<ResultPoint> pointOne(new OneDResultPoint(width - points[1]->getX() - 1, points[1]->getY()));
+								points[1] = pointOne;
+
+                result.reset(new Result(result->getText(),result->getRawBytes(),points,result->getBarcodeFormat()));
+							}
+								
 						}
 						return result;
 					} catch (ReaderException re) {
@@ -119,13 +130,13 @@ namespace zxing {
 					}
 				}
 			}
-			throw ReaderException("");
+			throw ReaderException("doDecode() failed");
 		}
 		
-		int OneDReader::patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance) {
+		unsigned int OneDReader::patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance) {
 			int numCounters = countersSize;
-			int total = 0;
-			int patternLength = 0;
+			unsigned int total = 0;
+			unsigned int patternLength = 0;
 			for (int i = 0; i < numCounters; i++) {
 				total += counters[i];
 				patternLength += pattern[i];
@@ -138,10 +149,10 @@ namespace zxing {
 			// We're going to fake floating-point math in integers. We just need to use more bits.
 			// Scale up patternLength so that intermediate values below like scaledCounter will have
 			// more "significant digits"
-			int unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
+			unsigned int unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
 			maxIndividualVariance = (maxIndividualVariance * unitBarWidth) >> INTEGER_MATH_SHIFT;
 			
-			int totalVariance = 0;
+			unsigned int totalVariance = 0;
 			for (int x = 0; x < numCounters; x++) {
 				int counter = counters[x] << INTEGER_MATH_SHIFT;
 				int scaledPattern = pattern[x] * unitBarWidth;
@@ -191,4 +202,4 @@ namespace zxing {
 		OneDReader::~OneDReader() {
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.h
index a029f9c..bb3b649 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDReader.h
@@ -38,9 +38,9 @@ namespace zxing {
 			virtual Ref<Result> decode(Ref<BinaryBitmap> image);
 			virtual Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row) = 0;
 			
-			static int patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance);
+			static unsigned int patternMatchVariance(int counters[], int countersSize, const int pattern[], int maxIndividualVariance);
 			static void recordPattern(Ref<BitArray> row, int start, int counters[], int countersCount);
 			virtual ~OneDReader();
 		};
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.cpp
index 272319d..0ac8dc3 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.cpp
@@ -23,17 +23,15 @@
 namespace zxing {
 	namespace oned {
 		
-		using namespace std;
-		
 		OneDResultPoint::OneDResultPoint(float posX, float posY) : posX_(posX), posY_(posY){
 		}
 		
-		float OneDResultPoint::getX() {
+		float OneDResultPoint::getX() const {
 			return posX_;
 		}
 		
-		float OneDResultPoint::getY() {
+		float OneDResultPoint::getY() const {
 			return posY_;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.h b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.h
index 1b07b77..18f1614 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/OneDResultPoint.h
@@ -30,8 +30,8 @@ namespace zxing {
 			
 		public:
 			OneDResultPoint(float posX, float posY);
-			float getX();
-			float getY();
+			float getX() const;
+			float getY() const;
 		};
 	}
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.cpp
index e46c2b7..cb2fcb5 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.cpp
@@ -19,31 +19,29 @@
  */
 
 #include "UPCAReader.h"
-#include <zxing/oned/EAN13Reader.h>
 #include <zxing/ReaderException.h>
 
 namespace zxing {
 	namespace oned {
-		UPCAReader::UPCAReader(){
-			ean13Reader = new EAN13Reader();
+		UPCAReader::UPCAReader() : ean13Reader() {
 		}
 		
 		Ref<Result> UPCAReader::decodeRow(int rowNumber, Ref<BitArray> row){
-			return maybeReturnResult(ean13Reader->decodeRow(rowNumber, row)); 
+			return maybeReturnResult(ean13Reader.decodeRow(rowNumber, row)); 
 		}
 		Ref<Result> UPCAReader::decodeRow(int rowNumber, Ref<BitArray> row, int startGuardRange[]){
-			return maybeReturnResult(ean13Reader->decodeRow(rowNumber, row, startGuardRange));
+			return maybeReturnResult(ean13Reader.decodeRow(rowNumber, row, startGuardRange));
 		}
 		Ref<Result> UPCAReader::decode(Ref<BinaryBitmap> image){
-			return maybeReturnResult(ean13Reader->decode(image));
+			return maybeReturnResult(ean13Reader.decode(image));
 		}
 		
 		int UPCAReader::decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString){
-			return ean13Reader->decodeMiddle(row, startRange, startRangeLen, resultString);
+			return ean13Reader.decodeMiddle(row, startRange, startRangeLen, resultString);
 		}
 		
 		Ref<Result> UPCAReader::maybeReturnResult(Ref<Result> result){
-			std::string& text = (result->getText())->getText();
+			const std::string& text = (result->getText())->getText();
 			if (text[0] == '0') {
 				Ref<String> resultString(new String(text.substr(1)));
 				Ref<Result> res(new Result(resultString, result->getRawBytes(), result->getResultPoints(), BarcodeFormat_UPC_A));
@@ -57,8 +55,5 @@ namespace zxing {
 		BarcodeFormat UPCAReader::getBarcodeFormat(){
 			return BarcodeFormat_UPC_A;
 		}
-		UPCAReader::~UPCAReader(){
-			delete ean13Reader;
-		}
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.h
index 217184b..8542207 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCAReader.h
@@ -18,15 +18,14 @@
  * limitations under the License.
  */
 
-#include <zxing/oned/UPCEANReader.h>
-#include <zxing/Result.h>
+#include <zxing/oned/EAN13Reader.h>
 
 namespace zxing {
 	namespace oned {
 		class UPCAReader : public UPCEANReader {
 			
 		private:
-			UPCEANReader* ean13Reader;
+			EAN13Reader ean13Reader;
 			static Ref<Result> maybeReturnResult(Ref<Result> result);														//throws ReaderException
 			
 		public:
@@ -39,7 +38,6 @@ namespace zxing {
 			Ref<Result> decode(Ref<BinaryBitmap> image);
 			
 			BarcodeFormat getBarcodeFormat();
-			~UPCAReader();
 		};
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.cpp
index 5345cad..e0154c5 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.cpp
@@ -100,7 +100,16 @@ namespace zxing {
 			
 			std::string tmpResultString;
 			std::string& tmpResultStringRef = tmpResultString;
-			int endStart = decodeMiddle(row, startGuardRange, 2 /*reference findGuardPattern*/ , tmpResultStringRef);
+			int endStart;
+			try {
+				endStart = decodeMiddle(row, startGuardRange, 2 /*reference findGuardPattern*/ , tmpResultStringRef);
+			} catch (ReaderException re) {
+				if (startGuardRange!=NULL) {
+					delete [] startGuardRange;
+					startGuardRange = NULL;
+				}
+				throw re;
+			}
 			
 			int* endRange = decodeEnd(row, endStart);
 						
@@ -114,6 +123,14 @@ namespace zxing {
 //			}
 			
 			if (!checkChecksum(tmpResultString)) {
+				if (startGuardRange!=NULL) {
+					delete [] startGuardRange;
+					startGuardRange = NULL;
+				}
+				if (endRange!=NULL) {
+					delete [] endRange;
+					endRange = NULL;
+				}
 				throw ReaderException("Checksum fail.");
 			}
 			
@@ -159,6 +176,9 @@ namespace zxing {
 				if (quietStart >= 0) {
 					foundStart = row->isRange(quietStart, start, false);
 				}
+				if (!foundStart) {
+					delete [] startRange;
+				}
 			}
 			return startRange;
 		}
@@ -217,13 +237,13 @@ namespace zxing {
 		}
 		
 //		int UPCEANReader::decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, int** patterns/*[][]*/, int paterns1Len, int paterns2Len)		
-		int UPCEANReader::decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, UPC_EAN_PATTERNS paternType){
+		int UPCEANReader::decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, UPC_EAN_PATTERNS patternType){
 			recordPattern(row, rowOffset, counters, countersLen);
-			int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
+			unsigned int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
 			int bestMatch = -1;
 			
 			int max = 0;
-			switch (paternType) {
+			switch (patternType) {
 				case UPC_EAN_PATTERNS_L_PATTERNS:
 					max = L_PATTERNS_LEN;
 					for (int i = 0; i < max; i++) {
@@ -232,7 +252,7 @@ namespace zxing {
 							pattern[j] = L_PATTERNS[i][j];
 						}
 						
-						int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
+						unsigned int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
 						if (variance < bestVariance) {
 							bestVariance = variance;
 							bestMatch = i;
@@ -247,7 +267,7 @@ namespace zxing {
 							pattern[j] = L_AND_G_PATTERNS[i][j];
 						}
 						
-						int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
+						unsigned int variance = patternMatchVariance(counters, countersLen, pattern, MAX_INDIVIDUAL_VARIANCE);
 						if (variance < bestVariance) {
 							bestVariance = variance;
 							bestMatch = i;
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.h
index 8f825c2..6ee2186 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEANReader.h
@@ -32,7 +32,7 @@ namespace zxing {
 		class UPCEANReader : public OneDReader {
 			
 		private:
-			static const int MAX_AVG_VARIANCE = (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);
 			
 			static int* findStartGuardPattern(Ref<BitArray> row);																	//throws ReaderException
@@ -54,7 +54,7 @@ namespace zxing {
 			Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row);
 			Ref<Result> decodeRow(int rowNumber, Ref<BitArray> row, int startGuardRange[]);
 			
-			static int decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, UPC_EAN_PATTERNS paternType);	//throws ReaderException 
+			static int decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, UPC_EAN_PATTERNS patternType);	//throws ReaderException 
 			
 			bool checkChecksum(std::string s);																						//throws ReaderException
 			
@@ -62,4 +62,5 @@ namespace zxing {
 			virtual ~UPCEANReader();
 		};
 	}
-}
\ No newline at end of file
+}
+
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.cpp b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.cpp
index 3738d4c..1bba2f7 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.cpp
@@ -40,21 +40,11 @@ namespace zxing {
 			{0x07, 0x0B, 0x0D, 0x0E, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1A}
 		};
 		
-		UPCEReader::UPCEReader(){
-			decodeMiddleCounters = new int[4];
-			for (int i=0; i<4; i++) {
-				decodeMiddleCounters[i] = 0;
-			}
-		}
+		UPCEReader::UPCEReader(){}
 		
 		int UPCEReader::decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString){
-			int countersLen = 4;
-			int* counters = decodeMiddleCounters;
-			counters[0] = 0;
-			counters[1] = 0;
-			counters[2] = 0;
-			counters[3] = 0;
-			
+			const int countersLen = 4;
+			int counters[countersLen] = { 0, 0, 0, 0 };
 			
 			int end = row->getSize();
 			int rowOffset = startRange[1];
@@ -143,8 +133,5 @@ namespace zxing {
 		BarcodeFormat UPCEReader::getBarcodeFormat(){
 			return BarcodeFormat_UPC_E;
 		}
-		UPCEReader::~UPCEReader(){
-			delete [] decodeMiddleCounters;
-		}
 	}
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.h b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.h
index a26e2ec..5de2ef5 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/oned/UPCEReader.h
@@ -26,7 +26,6 @@ namespace zxing {
 		class UPCEReader : public UPCEANReader {
 			
 		private:
-			int* decodeMiddleCounters;
 			static void determineFirstDigit(std::string& resultString, int lgPatternFound);								//throws ReaderException
 			static void determineNumSysAndCheckDigit(std::string& resultString, int lgPatternFound);						//throws ReaderException
 		protected:
@@ -39,7 +38,6 @@ namespace zxing {
 			static std::string& convertUPCEtoUPCA(std::string upce);
 			
 			BarcodeFormat getBarcodeFormat();
-			~UPCEReader();
 		};
 	}
-}
\ No newline at end of file
+}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.cpp
index 9c610b5..e8faf90 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.cpp
@@ -23,8 +23,8 @@
 namespace zxing {
 namespace qrcode {
 
-ErrorCorrectionLevel::ErrorCorrectionLevel(int ordinal) :
-    ordinal_(ordinal) {
+ErrorCorrectionLevel::ErrorCorrectionLevel(int inOrdinal) :
+    ordinal_(inOrdinal) {
 }
 
 int ErrorCorrectionLevel::ordinal() {
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.h
index 426d204..9d6a6c5 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/ErrorCorrectionLevel.h
@@ -29,7 +29,7 @@ namespace qrcode {
 class ErrorCorrectionLevel {
 private:
   int ordinal_;
-  ErrorCorrectionLevel(int ordinal);
+  ErrorCorrectionLevel(int inOrdinal);
   static ErrorCorrectionLevel *FOR_BITS[];
   static int N_LEVELS;
 public:
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.cpp
index 5e63c82..62c2acf 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.cpp
@@ -20,9 +20,9 @@
 
 #include <zxing/qrcode/Version.h>
 #include <zxing/qrcode/FormatInformation.h>
-#include <cstdarg>
 #include <limits>
 #include <iostream>
+#include <cstdarg>
 
 namespace zxing {
 namespace qrcode {
@@ -41,13 +41,11 @@ int ECB::getDataCodewords() {
 }
 
 ECBlocks::ECBlocks(int ecCodewords, ECB *ecBlocks) :
-    ecCodewords_(ecCodewords) {
-  ecBlocks_.push_back(ecBlocks);
+    ecCodewords_(ecCodewords), ecBlocks_(1, ecBlocks) {
 }
 
 ECBlocks::ECBlocks(int ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2) :
-    ecCodewords_(ecCodewords) {
-  ecBlocks_.push_back(ecBlocks1);
+    ecCodewords_(ecCodewords), ecBlocks_(1, ecBlocks1) {
   ecBlocks_.push_back(ecBlocks2);
 }
 
@@ -78,7 +76,7 @@ int Version::getVersionNumber() {
   return versionNumber_;
 }
 
-valarray<int> &Version::getAlignmentPatternCenters() {
+vector<int> &Version::getAlignmentPatternCenters() {
   return alignmentPatternCenters_;
 }
 
@@ -102,16 +100,16 @@ Version *Version::getProvisionalVersionForDimension(int dimension) {
 }
 
 Version *Version::getVersionForNumber(int versionNumber) {
-  if (versionNumber < 1 || versionNumber > 40) {
+  if (versionNumber < 1 || versionNumber > N_VERSIONS) {
     throw ReaderException("versionNumber must be between 1 and 40");
   }
 
   return VERSIONS[versionNumber - 1];
 }
 
-Version::Version(int versionNumber, valarray<int> *alignmentPatternCenters, ECBlocks *ecBlocks1, ECBlocks *ecBlocks2,
+Version::Version(int versionNumber, vector<int> *alignmentPatternCenters, ECBlocks *ecBlocks1, ECBlocks *ecBlocks2,
                  ECBlocks *ecBlocks3, ECBlocks *ecBlocks4) :
-    versionNumber_(versionNumber), alignmentPatternCenters_(*alignmentPatternCenters), ecBlocks_(4) {
+    versionNumber_(versionNumber), alignmentPatternCenters_(*alignmentPatternCenters), ecBlocks_(4), totalCodewords_(0) {
   ecBlocks_[0] = ecBlocks1;
   ecBlocks_[1] = ecBlocks2;
   ecBlocks_[2] = ecBlocks3;
@@ -207,10 +205,10 @@ Ref<BitMatrix> Version::buildFunctionPattern() {
   return functionPattern;
 }
 
-static valarray<int> *intArray(size_t n...) {
+static vector<int> *intArray(size_t n...) {
   va_list ap;
   va_start(ap, n);
-  valarray<int> *result = new valarray<int>(n);
+  vector<int> *result = new vector<int>(n);
   for (size_t i = 0; i < n; i++) {
     (*result)[i] = va_arg(ap, int);
   }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.h
index 181bd98..a89518d 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/Version.h
@@ -27,7 +27,6 @@
 #include <zxing/common/BitMatrix.h>
 #include <zxing/common/Counted.h>
 #include <vector>
-#include <valarray>
 
 namespace zxing {
 namespace qrcode {
@@ -58,10 +57,10 @@ class Version : public Counted {
 
 private:
   int versionNumber_;
-  std::valarray<int> &alignmentPatternCenters_;
+  std::vector<int> &alignmentPatternCenters_;
   std::vector<ECBlocks*> ecBlocks_;
   int totalCodewords_;
-  Version(int versionNumber, std::valarray<int> *alignmentPatternCenters, ECBlocks *ecBlocks1, ECBlocks *ecBlocks2,
+  Version(int versionNumber, std::vector<int> *alignmentPatternCenters, ECBlocks *ecBlocks1, ECBlocks *ecBlocks2,
           ECBlocks *ecBlocks3, ECBlocks *ecBlocks4);
 
 public:
@@ -71,7 +70,7 @@ public:
 
   ~Version();
   int getVersionNumber();
-  std::valarray<int> &getAlignmentPatternCenters();
+  std::vector<int> &getAlignmentPatternCenters();
   int getTotalCodewords();
   int getDimensionForVersion();
   ECBlocks &getECBlocksForLevel(ErrorCorrectionLevel &ecLevel);
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.cpp
index e4ef5e2..04cd06b 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.cpp
@@ -158,8 +158,8 @@ ArrayRef<unsigned char> BitMatrixParser::readCodewords() {
       x--;
     }
     // Read alternatingly from bottom to top then top to bottom
-    for (int count = 0; count < dimension; count++) {
-      int y = readingUp ? dimension - 1 - count : count;
+    for (int counter = 0; counter < dimension; counter++) {
+      int y = readingUp ? dimension - 1 - counter : counter;
       for (int col = 0; col < 2; col++) {
         // Ignore bits covered by the function pattern
         if (!functionPattern->get(x - col, y)) {
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.h
index 824556b..0939492 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/BitMatrixParser.h
@@ -44,6 +44,11 @@ public:
   Ref<FormatInformation> readFormatInformation();
   Version *readVersion();
   ArrayRef<unsigned char> readCodewords();
+
+private:
+  BitMatrixParser(const BitMatrixParser&);
+  BitMatrixParser& operator =(const BitMatrixParser&);
+  
 };
 
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DataBlock.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DataBlock.h
index df536f4..fed669c 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DataBlock.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DataBlock.h
@@ -21,7 +21,6 @@
  * limitations under the License.
  */
 
-#include <valarray>
 #include <vector>
 #include <zxing/common/Counted.h>
 #include <zxing/common/Array.h>
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.cpp
index ab32b2e..20232fe 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.cpp
@@ -20,7 +20,9 @@
 
 #include <zxing/qrcode/decoder/DecodedBitStreamParser.h>
 #include <iostream>
+#ifndef NO_ICONV
 #include <iconv.h>
+#endif
 
 // Required for compatibility. TODO: test on Symbian
 #ifdef ZXING_ICONV_CONST
@@ -50,7 +52,8 @@ const char *DecodedBitStreamParser::UTF8 = "UTF-8";
 const char *DecodedBitStreamParser::SHIFT_JIS = "SHIFT_JIS";
 const char *DecodedBitStreamParser::EUC_JP = "EUC-JP";
 
-void DecodedBitStreamParser::append(ostream &ost, const unsigned char *bufIn, size_t nIn, const char *src) {
+void DecodedBitStreamParser::append(std::string &result, const unsigned char *bufIn, size_t nIn, const char *src) {
+#ifndef NO_ICONV
   if (nIn == 0) {
     return;
   }
@@ -76,12 +79,14 @@ void DecodedBitStreamParser::append(ostream &ost, const unsigned char *bufIn, si
 
   int nResult = maxOut - nTo;
   bufOut[nResult] = '\0';
-
-  ost << bufOut;
+  result.append((const char *)bufOut);
   delete[] bufOut;
+ #else
+  result.append((const char *)bufIn, nIn);
+ #endif
 }
 
-void DecodedBitStreamParser::decodeKanjiSegment(Ref<BitSource> bits, ostringstream &result, int count) {
+void DecodedBitStreamParser::decodeKanjiSegment(Ref<BitSource> bits, std::string &result, int count) {
   // Each character will require 2 bytes. Read the characters as 2-byte pairs
   // and decode as Shift_JIS afterwards
   size_t nBytes = 2 * count;
@@ -109,7 +114,7 @@ void DecodedBitStreamParser::decodeKanjiSegment(Ref<BitSource> bits, ostringstre
   delete[] buffer;
 }
 
-void DecodedBitStreamParser::decodeByteSegment(Ref<BitSource> bits, ostringstream &result, int count) {
+void DecodedBitStreamParser::decodeByteSegment(Ref<BitSource> bits, std::string &result, int count) {
   int nBytes = count;
   unsigned char* readBytes = new unsigned char[nBytes];
   if (count << 3 > bits->available()) {
@@ -131,7 +136,7 @@ void DecodedBitStreamParser::decodeByteSegment(Ref<BitSource> bits, ostringstrea
   delete[] readBytes;
 }
 
-void DecodedBitStreamParser::decodeNumericSegment(Ref<BitSource> bits, ostringstream &result, int count) {
+void DecodedBitStreamParser::decodeNumericSegment(Ref<BitSource> bits, std::string &result, int count) {
   int nBytes = count;
   unsigned char* bytes = new unsigned char[nBytes];
   int i = 0;
@@ -176,7 +181,7 @@ void DecodedBitStreamParser::decodeNumericSegment(Ref<BitSource> bits, ostringst
   delete[] bytes;
 }
 
-void DecodedBitStreamParser::decodeAlphanumericSegment(Ref<BitSource> bits, ostringstream &result, int count) {
+void DecodedBitStreamParser::decodeAlphanumericSegment(Ref<BitSource> bits, std::string &result, int count) {
   int nBytes = count;
   unsigned char* bytes = new unsigned char[nBytes];
   int i = 0;
@@ -248,7 +253,7 @@ DecodedBitStreamParser::guessEncoding(unsigned char *bytes, int length) {
 }
 
 string DecodedBitStreamParser::decode(ArrayRef<unsigned char> bytes, Version *version) {
-  ostringstream result;
+  string result;
   Ref<BitSource> bits(new BitSource(bytes));
   Mode *mode = &Mode::TERMINATOR;
   do {
@@ -275,7 +280,7 @@ string DecodedBitStreamParser::decode(ArrayRef<unsigned char> bytes, Version *ve
       }
     }
   } while (mode != &Mode::TERMINATOR);
-  return result.str();
+  return result;
 }
 
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.h
index 8c4ab9b..83582e1 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/DecodedBitStreamParser.h
@@ -43,12 +43,12 @@ private:
   static const char *SHIFT_JIS;
   static const char *EUC_JP;
 
-  static void decodeKanjiSegment(Ref<BitSource> bits, std::ostringstream &result, int count);
-  static void decodeByteSegment(Ref<BitSource> bits, std::ostringstream &result, int count);
-  static void decodeAlphanumericSegment(Ref<BitSource> bits, std::ostringstream &result, int count);
-  static void decodeNumericSegment(Ref<BitSource> bits, std::ostringstream &result, int count);
+  static void decodeKanjiSegment(Ref<BitSource> bits, std::string &result, int count);
+  static void decodeByteSegment(Ref<BitSource> bits, std::string &result, int count);
+  static void decodeAlphanumericSegment(Ref<BitSource> bits, std::string &result, int count);
+  static void decodeNumericSegment(Ref<BitSource> bits, std::string &result, int count);
   static const char *guessEncoding(unsigned char *bytes, int length);
-  static void append(std::ostream &ost, const unsigned char *bufIn, size_t nIn, const char *src);
+  static void append(std::string &ost, const unsigned char *bufIn, size_t nIn, const char *src);
 
 public:
   static std::string decode(ArrayRef<unsigned char> bytes, Version *version);
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/Decoder.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/Decoder.h
index 96e1dc0..14053a3 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/Decoder.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/decoder/Decoder.h
@@ -27,7 +27,6 @@
 #include <zxing/common/Array.h>
 #include <zxing/common/DecoderResult.h>
 #include <zxing/common/BitMatrix.h>
-#include <valarray>
 
 namespace zxing {
 namespace qrcode {
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.cpp
index 0f6ee59..25baeb3 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.cpp
@@ -29,15 +29,15 @@ AlignmentPattern::AlignmentPattern(float posX, float posY, float estimatedModule
     posX_(posX), posY_(posY), estimatedModuleSize_(estimatedModuleSize) {
 }
 
-float AlignmentPattern::getX() {
+float AlignmentPattern::getX() const {
   return posX_;
 }
 
-float AlignmentPattern::getY() {
+float AlignmentPattern::getY() const {
   return posY_;
 }
 
-bool AlignmentPattern::aboutEquals(float moduleSize, float i, float j) {
+bool AlignmentPattern::aboutEquals(float moduleSize, float i, float j) const {
   return abs(i - posY_) <= moduleSize && abs(j - posX_) <= moduleSize && (abs(moduleSize - estimatedModuleSize_)
          <= 1.0f || abs(moduleSize - estimatedModuleSize_) / estimatedModuleSize_ <= 0.1f);
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.h
index 56a683f..b822afa 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPattern.h
@@ -35,9 +35,9 @@ namespace zxing {
 			
 		public:
 			AlignmentPattern(float posX, float posY, float estimatedModuleSize);
-			float getX();
-			float getY();
-			bool aboutEquals(float moduleSize, float i, float j);
+			float getX() const;
+			float getY() const;
+			bool aboutEquals(float moduleSize, float i, float j) const;
 		};
 		
 	}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.cpp
index b3d92d4..017e2ee 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.cpp
@@ -23,17 +23,18 @@
 #include <zxing/common/BitArray.h>
 #include <vector>
 #include <cmath>
+#include <cstdlib>
 
 namespace zxing {
 namespace qrcode {
 
 using namespace std;
 
-float AlignmentPatternFinder::centerFromEnd(valarray<int> &stateCount, int end) {
+float AlignmentPatternFinder::centerFromEnd(vector<int> &stateCount, int end) {
   return (float)(end - stateCount[2]) - stateCount[1] / 2.0f;
 }
 
-bool AlignmentPatternFinder::foundPatternCross(valarray<int> &stateCount) {
+bool AlignmentPatternFinder::foundPatternCross(vector<int> &stateCount) {
   float maxVariance = moduleSize_ / 2.0f;
   for (size_t i = 0; i < 3; i++) {
     if (abs(moduleSize_ - stateCount[i]) >= maxVariance) {
@@ -46,7 +47,7 @@ bool AlignmentPatternFinder::foundPatternCross(valarray<int> &stateCount) {
 float AlignmentPatternFinder::crossCheckVertical(size_t startI, size_t centerJ, int maxCount,
     int originalStateCountTotal) {
   int maxI = image_->getHeight();
-  valarray<int> stateCount(0, 3);
+  vector<int> stateCount(3, 0);
 
 
   // Start counting up from center
@@ -92,7 +93,7 @@ float AlignmentPatternFinder::crossCheckVertical(size_t startI, size_t centerJ,
   return foundPatternCross(stateCount) ? centerFromEnd(stateCount, i) : NAN;
 }
 
-Ref<AlignmentPattern> AlignmentPatternFinder::handlePossibleCenter(valarray<int> &stateCount, size_t i, size_t j) {
+Ref<AlignmentPattern> AlignmentPatternFinder::handlePossibleCenter(vector<int> &stateCount, size_t i, size_t j) {
   int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
   float centerJ = centerFromEnd(stateCount, j);
   float centerI = crossCheckVertical(i, (int)centerJ, 2 * stateCount[1], stateCountTotal);
@@ -136,7 +137,7 @@ Ref<AlignmentPattern> AlignmentPatternFinder::find() {
   //      Ref<BitArray> luminanceRow(new BitArray(width_));
   // We are looking for black/white/black modules in 1:1:1 ratio;
   // this tracks the number of black/white/black modules seen so far
-  valarray<int> stateCount(0, 3);
+  vector<int> stateCount(3, 0);
   for (size_t iGen = 0; iGen < height_; iGen++) {
     // Search from middle outwards
     size_t i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1));
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.h
index 2663643..6221b6c 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/AlignmentPatternFinder.h
@@ -43,18 +43,23 @@ private:
   size_t height_;
   float moduleSize_;
 
-  static float centerFromEnd(std::valarray<int> &stateCount, int end);
-  bool foundPatternCross(std::valarray<int> &stateCount);
+  static float centerFromEnd(std::vector<int> &stateCount, int end);
+  bool foundPatternCross(std::vector<int> &stateCount);
 
   float crossCheckVertical(size_t startI, size_t centerJ, int maxCount, int originalStateCountTotal);
 
-  Ref<AlignmentPattern> handlePossibleCenter(std::valarray<int> &stateCount, size_t i, size_t j);
+  Ref<AlignmentPattern> handlePossibleCenter(std::vector<int> &stateCount, size_t i, size_t j);
 
 public:
   AlignmentPatternFinder(Ref<BitMatrix> image, size_t startX, size_t startY, size_t width, size_t height,
                          float moduleSize);
   ~AlignmentPatternFinder();
   Ref<AlignmentPattern> find();
+  
+private:
+  AlignmentPatternFinder(const AlignmentPatternFinder&);
+  AlignmentPatternFinder& operator =(const AlignmentPatternFinder&);
+  
 };
 }
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/Detector.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/Detector.cpp
index 9dbc297..a50424c 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/Detector.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/Detector.cpp
@@ -27,6 +27,7 @@
 #include <zxing/common/GridSampler.h>
 #include <cmath>
 #include <sstream>
+#include <cstdlib>
 
 namespace zxing {
 namespace qrcode {
@@ -133,8 +134,8 @@ Ref<BitMatrix> Detector::sampleGrid(Ref<BitMatrix> image, int dimension, Ref<Per
 
 int Detector::computeDimension(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref<ResultPoint> bottomLeft,
                                float moduleSize) {
-  int tltrCentersDimension = lround(FinderPatternFinder::distance(topLeft, topRight) / moduleSize);
-  int tlblCentersDimension = lround(FinderPatternFinder::distance(topLeft, bottomLeft) / moduleSize);
+  int tltrCentersDimension = int(FinderPatternFinder::distance(topLeft, topRight) / moduleSize + 0.5f);
+  int tlblCentersDimension = int(FinderPatternFinder::distance(topLeft, bottomLeft) / moduleSize + 0.5f);
   int dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;
   switch (dimension & 0x03) { // mod 4
   case 0:
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.cpp
index 531d4e2..1c9a534 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.cpp
@@ -29,19 +29,19 @@ namespace zxing {
 		posX_(posX), posY_(posY), estimatedModuleSize_(estimatedModuleSize), counter_(1) {
 		}
 		
-		float FinderPattern::getX() {
+		float FinderPattern::getX() const {
 			return posX_;
 		}
 		
-		float FinderPattern::getY() {
+		float FinderPattern::getY() const {
 			return posY_;
 		}
 		
-		int FinderPattern::getCount() {
+		int FinderPattern::getCount() const {
 			return counter_;
 		}
 		
-		float FinderPattern::getEstimatedModuleSize() {
+		float FinderPattern::getEstimatedModuleSize() const {
 			return estimatedModuleSize_;
 		}
 		
@@ -49,7 +49,7 @@ namespace zxing {
 			counter_++;
 		}
 		
-		bool FinderPattern::aboutEquals(float moduleSize, float i, float j) {
+		bool FinderPattern::aboutEquals(float moduleSize, float i, float j) const {
 			return abs(i - posY_) <= moduleSize && abs(j - posX_) <= moduleSize && (abs(moduleSize - estimatedModuleSize_)
 																					<= 1.0f || abs(moduleSize - estimatedModuleSize_) / estimatedModuleSize_ <= 0.1f);
 		}
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.h b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.h
index 0b6615c..8b2ff59 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.h
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPattern.h
@@ -36,12 +36,12 @@ namespace zxing {
 			
 		public:
 			FinderPattern(float posX, float posY, float estimatedModuleSize);
-			float getX();
-			float getY();
-			int getCount();
-			float getEstimatedModuleSize();
+			float getX() const;
+			float getY() const;
+			int getCount() const;
+			float getEstimatedModuleSize() const;
 			void incrementCount();
-			bool aboutEquals(float moduleSize, float i, float j);
+			bool aboutEquals(float moduleSize, float i, float j) const;
 		};
 	}
 }
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPatternFinder.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPatternFinder.cpp
index 666c4f2..8b46b0f 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPatternFinder.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/FinderPatternFinder.cpp
@@ -22,6 +22,8 @@
 #include <zxing/ReaderException.h>
 #include <vector>
 #include <cmath>
+#include <cstdlib>
+#include <algorithm>
 
 namespace zxing {
 namespace qrcode {
@@ -32,6 +34,8 @@ class ClosestToAverageComparator {
 private:
   float averageModuleSize_;
 public:
+  ClosestToAverageComparator() : averageModuleSize_(0.0f) { }
+  
   ClosestToAverageComparator(float averageModuleSize) :
       averageModuleSize_(averageModuleSize) {
   }
@@ -393,7 +397,7 @@ Ref<FinderPatternInfo> FinderPatternFinder::find() {
   // We are looking for black/white/black/white/black modules in
   // 1:1:3:1:1 ratio; this tracks the number of such modules seen so far
 
-  // As this is used often, we use an integer array instead of valarray
+  // As this is used often, we use an integer array instead of vector
   int stateCount[5];
   bool done = false;
 
diff --git a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/QREdgeDetector.cpp b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/QREdgeDetector.cpp
index 18affe6..b2162ef 100644
--- a/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/QREdgeDetector.cpp
+++ b/symbian/ZXingBarcodeReader/group/zxing/qrcode/detector/QREdgeDetector.cpp
@@ -20,6 +20,7 @@
 
 #include <zxing/qrcode/detector/QREdgeDetector.h>
 #include <zxing/common/EdgeDetector.h>
+#include <cstdlib>
 
 using namespace std;
 
diff --git a/symbian/ZXingBarcodeReader/inc/CameraImage.h b/symbian/ZXingBarcodeReader/inc/CameraImage.h
index a919504..e8b1028 100644
--- a/symbian/ZXingBarcodeReader/inc/CameraImage.h
+++ b/symbian/ZXingBarcodeReader/inc/CameraImage.h
@@ -15,10 +15,10 @@ public:
     CameraImage(CameraImage& otherInstance);
     ~CameraImage();
     
-    int getWidth();
-    int getHeight();
+    int getWidth() const;
+    int getHeight() const;
     
-    unsigned char getPixel(int x, int y);
+    unsigned char getPixel(int x, int y) const;
     
     void setImage(CFbsBitmap* newImage);
     
diff --git a/symbian/ZXingBarcodeReader/sis/ZXingBarcodeReader_S60.sisx b/symbian/ZXingBarcodeReader/sis/ZXingBarcodeReader_S60.sisx
index abdf27b..81fdd02 100644
Binary files a/symbian/ZXingBarcodeReader/sis/ZXingBarcodeReader_S60.sisx and b/symbian/ZXingBarcodeReader/sis/ZXingBarcodeReader_S60.sisx differ
diff --git a/symbian/ZXingBarcodeReader/src/CameraImage.cpp b/symbian/ZXingBarcodeReader/src/CameraImage.cpp
index 4ebce64..d7a44c4 100644
--- a/symbian/ZXingBarcodeReader/src/CameraImage.cpp
+++ b/symbian/ZXingBarcodeReader/src/CameraImage.cpp
@@ -14,17 +14,17 @@ CameraImage::~CameraImage()
 {
 }
 
-int CameraImage::getWidth()
+int CameraImage::getWidth() const 
 {
      return image->SizeInPixels().iWidth;
 }
 
-int CameraImage::getHeight()
+int CameraImage::getHeight() const
 {
      return image->SizeInPixels().iHeight;
 }
 
-unsigned char CameraImage::getPixel(int x, int y)
+unsigned char CameraImage::getPixel(int x, int y) const
 {
 	TPoint pixelPosition(x,y);
 	TRgb color;
diff --git a/symbian/ZXingBarcodeReader/src/DecodingOperations.cpp b/symbian/ZXingBarcodeReader/src/DecodingOperations.cpp
index 47b8743..b7287a9 100644
--- a/symbian/ZXingBarcodeReader/src/DecodingOperations.cpp
+++ b/symbian/ZXingBarcodeReader/src/DecodingOperations.cpp
@@ -2,6 +2,7 @@
 #include <e32std.h>
 
 #include <zxing/qrcode/QRCodeReader.h>
+#include <zxing/MultiFormatReader.h>
 
 #include <zxing/common/GlobalHistogramBinarizer.h>
 #include <zxing/Binarizer.h>
@@ -35,7 +36,7 @@ TInt CZXingBarcodeReaderAppView::Tick(TAny* aObject)
 
 void CZXingBarcodeReaderAppView::decodeBackbufferImage()
 	{
-	QRCodeReader decoder;
+    MultiFormatReader decoder;
 
 	CameraImage image;
 	image.setImage(iBackBuffer);

-- 
Multi-format 1D/2D barcode image processing library



More information about the Pkg-google-commits mailing list