From f5e21dce16dd8611b6c0adc577ec44155b0eb164 Mon Sep 17 00:00:00 2001
From: Iliyan Malchev <malchev@google.com>
Date: Wed, 10 Jun 2009 16:46:51 -0700
Subject: [PATCH] remove floats from libcamera2

Signed-off-by: Iliyan Malchev <malchev@google.com>
---
 libcamera2/QualcommCameraHardware.cpp | 12 ++++++------
 libcamera2/QualcommCameraHardware.h   | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libcamera2/QualcommCameraHardware.cpp b/libcamera2/QualcommCameraHardware.cpp
index c5231ca..708a62d 100755
--- a/libcamera2/QualcommCameraHardware.cpp
+++ b/libcamera2/QualcommCameraHardware.cpp
@@ -958,9 +958,9 @@ bool QualcommCameraHardware::initRaw(bool initJpegHeap)
         return false;
     }
 
-    mRawSize = mRawWidth * mRawHeight * 1.5;
+    mRawSize = mRawWidth * mRawHeight * 3 / 2;
 
-    mJpegMaxSize = mRawWidth * mRawHeight * 1.5;
+    mJpegMaxSize = mRawWidth * mRawHeight * 3 / 2;
 
     LOGE("initRaw: clearing old mJpegHeap.");
     mJpegHeap.clear();
@@ -1412,7 +1412,7 @@ status_t QualcommCameraHardware::setParameters(
             {
                 ZoomDirectionIn = true;
             }
-            LOGV("new zoom value: %2.2f direction = %s",
+            LOGV("new zoom value: %d direction = %s",
                  mZoomValueCurr, (ZoomDirectionIn ? "in" : "out"));
             mZoomValuePrev = mZoomValueCurr;
             performZoom(ZoomDirectionIn);
@@ -1547,7 +1547,7 @@ void QualcommCameraHardware::receivePreviewFrame(struct msm_frame *frame)
 
     memcpy((uint8_t *)mPreviewHeap->mHeap->base() + offset,
            (uint8_t *)frame->buffer,
-           mPreviewWidth * mPreviewHeight * 1.5);
+           mPreviewWidth * mPreviewHeight * 3 / 2);
 
     mInPreviewCallback = true;
     if (pcb != NULL)
@@ -1655,10 +1655,10 @@ QualcommCameraHardware::receiveRawPicture()
             LOGE("getPicture failed!");
             return;
         }
-        ssize_t offset = (mRawWidth * mRawHeight  * 1.5 * snapshot_offset);
+        ssize_t offset = (mRawWidth * mRawHeight  * snapshot_offset * 3 / 2);
 #if CAPTURE_RAW
         dump_to_file("/sdcard/photo.raw",
-                     (uint8_t *)mMainImageBuf, mRawWidth * mRawHeight * 1.5 );
+                     (uint8_t *)mMainImageBuf, mRawWidth * mRawHeight * 3 / 2);
 #endif
         mRawPictureCallback(mRawHeap->mBuffers[offset],
                             mPictureCallbackCookie);
diff --git a/libcamera2/QualcommCameraHardware.h b/libcamera2/QualcommCameraHardware.h
index 06c38a2..b5707b6 100755
--- a/libcamera2/QualcommCameraHardware.h
+++ b/libcamera2/QualcommCameraHardware.h
@@ -125,12 +125,12 @@ private:
     int mPreviewWidth;
     int mRawHeight;
     int mRawWidth;
-	unsigned int frame_size;
-	int mBrightness;
-	float mZoomValuePrev;
-    float mZoomValueCurr;
-	bool mZoomInitialised;
-	bool mCameraRunning;
+    unsigned int frame_size;
+    int mBrightness;
+    int mZoomValuePrev;
+    int mZoomValueCurr;
+    bool mZoomInitialised;
+    bool mCameraRunning;
     bool mPreviewInitialized;
     
     // This class represents a heap which maintains several contiguous