Fix compile warnings for goldfish camera and hwcomposer

Bug: 80194417
Test: check warnings are gone when compile
Change-Id: Iaba227444accfb552fae1c333d29dc26e3cdd736
diff --git a/camera/CallbackNotifier.cpp b/camera/CallbackNotifier.cpp
index e7fea45..fca2a80 100755
--- a/camera/CallbackNotifier.cpp
+++ b/camera/CallbackNotifier.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_CallbackNotifier"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <MetadataBufferType.h>
 #include "EmulatedCameraDevice.h"
 #undef min
diff --git a/camera/Converters.cpp b/camera/Converters.cpp
index 4765bf2..cb09946 100755
--- a/camera/Converters.cpp
+++ b/camera/Converters.cpp
@@ -20,7 +20,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Converter"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "Converters.h"
 
 #include "Alignment.h"
diff --git a/camera/EmulatedBaseCamera.cpp b/camera/EmulatedBaseCamera.cpp
index 5fe7d73..0b85dcf 100644
--- a/camera/EmulatedBaseCamera.cpp
+++ b/camera/EmulatedBaseCamera.cpp
@@ -26,7 +26,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_BaseCamera"
-#include <cutils/log.h>
+#include <log/log.h>
 
 #include "EmulatedBaseCamera.h"
 
diff --git a/camera/EmulatedBaseCamera.h b/camera/EmulatedBaseCamera.h
index 3b8a6a0..abaed98 100644
--- a/camera/EmulatedBaseCamera.h
+++ b/camera/EmulatedBaseCamera.h
@@ -52,7 +52,7 @@
      */
     virtual status_t Initialize() = 0;
 
-    /****************************************************************************
+   /****************************************************************************
      * Camera API implementation
      ***************************************************************************/
 
diff --git a/camera/EmulatedCamera.cpp b/camera/EmulatedCamera.cpp
index fe4fcae..b13a5c3 100755
--- a/camera/EmulatedCamera.cpp
+++ b/camera/EmulatedCamera.cpp
@@ -25,8 +25,8 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Camera"
-#include <cutils/log.h>
- #include <stdio.h>
+#include <log/log.h>
+#include <stdio.h>
 #include "EmulatedCamera.h"
 //#include "EmulatedFakeCameraDevice.h"
 #include "Converters.h"
@@ -57,17 +57,6 @@
 #define PrintParamDiff(current, new_par)   (void(0))
 #endif  /* DEBUG_PARAM */
 
-/* A helper routine that adds a value to the camera parameter.
- * Param:
- *  param - Camera parameter to add a value to.
- *  val - Value to add.
- * Return:
- *  A new string containing parameter with the added value on success, or NULL on
- *  a failure. If non-NULL string is returned, the caller is responsible for
- *  freeing it with 'free'.
- */
-static char* AddValue(const char* param, const char* val);
-
 /*
  * Check if a given string |value| equals at least one of the strings in |list|
  */
@@ -495,7 +484,6 @@
 {
     ALOGV("%s", __FUNCTION__);
 
-    status_t res;
     int width, height;
     uint32_t org_fmt;
 
@@ -1236,25 +1224,6 @@
 const char EmulatedCamera::FACING_FRONT[]     = "front";
 
 /****************************************************************************
- * Helper routines
- ***************************************************************************/
-
-static char* AddValue(const char* param, const char* val)
-{
-    const size_t len1 = strlen(param);
-    const size_t len2 = strlen(val);
-    char* ret = reinterpret_cast<char*>(malloc(len1 + len2 + 2));
-    ALOGE_IF(ret == NULL, "%s: Memory failure", __FUNCTION__);
-    if (ret != NULL) {
-        memcpy(ret, param, len1);
-        ret[len1] = ',';
-        memcpy(ret + len1 + 1, val, len2);
-        ret[len1 + len2 + 1] = '\0';
-    }
-    return ret;
-}
-
-/****************************************************************************
  * Parameter debugging helpers
  ***************************************************************************/
 
diff --git a/camera/EmulatedCamera2.cpp b/camera/EmulatedCamera2.cpp
index ea7424b..72e1c07 100644
--- a/camera/EmulatedCamera2.cpp
+++ b/camera/EmulatedCamera2.cpp
@@ -24,7 +24,7 @@
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera2_Camera"
-#include <cutils/log.h>
+#include <log/log.h>
 
 #include "EmulatedCamera2.h"
 #include "system/camera_metadata.h"
diff --git a/camera/EmulatedCamera3.cpp b/camera/EmulatedCamera3.cpp
index e9110cc..0cc373a 100644
--- a/camera/EmulatedCamera3.cpp
+++ b/camera/EmulatedCamera3.cpp
@@ -24,7 +24,7 @@
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera3_Camera"
-#include <cutils/log.h>
+#include <log/log.h>
 
 #include "EmulatedCamera3.h"
 #include "system/camera_metadata.h"
diff --git a/camera/EmulatedCameraDevice.cpp b/camera/EmulatedCameraDevice.cpp
index 31e2aff..f1aced4 100755
--- a/camera/EmulatedCameraDevice.cpp
+++ b/camera/EmulatedCameraDevice.cpp
@@ -25,7 +25,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Device"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <sys/select.h>
 #include <cmath>
 #include "Alignment.h"
diff --git a/camera/EmulatedCameraFactory.cpp b/camera/EmulatedCameraFactory.cpp
index cf26a9e..414289a 100755
--- a/camera/EmulatedCameraFactory.cpp
+++ b/camera/EmulatedCameraFactory.cpp
@@ -30,7 +30,7 @@
 #include "EmulatedQemuCamera.h"
 #include "EmulatedQemuCamera3.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 
 extern camera_module_t HAL_MODULE_INFO_SYM;
@@ -580,7 +580,7 @@
 
 // Entry point for camera HAL API.
 struct hw_module_methods_t EmulatedCameraFactory::mCameraModuleMethods = {
-    open: EmulatedCameraFactory::device_open
+    .open = EmulatedCameraFactory::device_open
 };
 
 }; // end of namespace android
diff --git a/camera/EmulatedCameraFactory.h b/camera/EmulatedCameraFactory.h
index fe70401..4091bfc 100755
--- a/camera/EmulatedCameraFactory.h
+++ b/camera/EmulatedCameraFactory.h
@@ -27,7 +27,7 @@
 
 namespace android {
 
-struct EmulatedCameraHotplugThread;
+class EmulatedCameraHotplugThread;
 
 /*
  * Contains declaration of a class EmulatedCameraFactory that manages cameras
diff --git a/camera/EmulatedCameraHal.cpp b/camera/EmulatedCameraHal.cpp
index b1f8b3a..f60b0d2 100755
--- a/camera/EmulatedCameraHal.cpp
+++ b/camera/EmulatedCameraHal.cpp
@@ -29,20 +29,20 @@
  * Required HAL header.
  */
 camera_module_t HAL_MODULE_INFO_SYM = {
-    common: {
-         tag:                HARDWARE_MODULE_TAG,
-         module_api_version: CAMERA_MODULE_API_VERSION_2_3,
-         hal_api_version:    HARDWARE_HAL_API_VERSION,
-         id:                 CAMERA_HARDWARE_MODULE_ID,
-         name:               "Emulated Camera Module",
-         author:             "The Android Open Source Project",
-         methods:            &android::EmulatedCameraFactory::mCameraModuleMethods,
-         dso:                NULL,
-         reserved:           {0},
+    .common = {
+         .tag = HARDWARE_MODULE_TAG,
+         .module_api_version = CAMERA_MODULE_API_VERSION_2_3,
+         .hal_api_version = HARDWARE_HAL_API_VERSION,
+         .id = CAMERA_HARDWARE_MODULE_ID,
+         .name = "Emulated Camera Module",
+         .author = "The Android Open Source Project",
+         .methods = &android::EmulatedCameraFactory::mCameraModuleMethods,
+         .dso = NULL,
+         .reserved = {0},
     },
-    get_number_of_cameras:  android::EmulatedCameraFactory::get_number_of_cameras,
-    get_camera_info:        android::EmulatedCameraFactory::get_camera_info,
-    set_callbacks:          android::EmulatedCameraFactory::set_callbacks,
-    get_vendor_tag_ops:     android::EmulatedCameraFactory::get_vendor_tag_ops,
-    open_legacy:            android::EmulatedCameraFactory::open_legacy
+    .get_number_of_cameras = android::EmulatedCameraFactory::get_number_of_cameras,
+    .get_camera_info = android::EmulatedCameraFactory::get_camera_info,
+    .set_callbacks = android::EmulatedCameraFactory::set_callbacks,
+    .get_vendor_tag_ops = android::EmulatedCameraFactory::get_vendor_tag_ops,
+    .open_legacy = android::EmulatedCameraFactory::open_legacy
 };
diff --git a/camera/EmulatedCameraHotplugThread.cpp b/camera/EmulatedCameraHotplugThread.cpp
index de94429..f7782be 100644
--- a/camera/EmulatedCameraHotplugThread.cpp
+++ b/camera/EmulatedCameraHotplugThread.cpp
@@ -15,7 +15,7 @@
  */
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_HotplugThread"
-#include <cutils/log.h>
+#include <log/log.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/camera/EmulatedFakeCamera.cpp b/camera/EmulatedFakeCamera.cpp
index ff19fd0..bf41fb6 100755
--- a/camera/EmulatedFakeCamera.cpp
+++ b/camera/EmulatedFakeCamera.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_FakeCamera"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 #include "EmulatedFakeCamera.h"
 #include "EmulatedCameraFactory.h"
diff --git a/camera/EmulatedFakeCamera2.cpp b/camera/EmulatedFakeCamera2.cpp
index dad384c..6bff5eb 100644
--- a/camera/EmulatedFakeCamera2.cpp
+++ b/camera/EmulatedFakeCamera2.cpp
@@ -23,7 +23,7 @@
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_FakeCamera2"
-#include <utils/Log.h>
+#include <log/log.h>
 
 #include "EmulatedFakeCamera2.h"
 #include "EmulatedCameraFactory.h"
@@ -114,8 +114,8 @@
     int32_t width = 0, height = 0;
     size_t rawSizeCount = sizeof(kAvailableRawSizes)/sizeof(kAvailableRawSizes[0]);
     for (size_t index = 0; index + 1 < rawSizeCount; index += 2) {
-        if (width <= kAvailableRawSizes[index] &&
-            height <= kAvailableRawSizes[index+1]) {
+        if (width <= (int32_t)kAvailableRawSizes[index] &&
+            height <= (int32_t)kAvailableRawSizes[index+1]) {
             width = kAvailableRawSizes[index];
             height = kAvailableRawSizes[index+1];
         }
@@ -377,7 +377,6 @@
     if (format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
         unsigned int numFormats = sizeof(kAvailableFormats) / sizeof(uint32_t);
         unsigned int formatIdx = 0;
-        unsigned int sizeOffsetIdx = 0;
         for (; formatIdx < numFormats; formatIdx++) {
             if (format == (int)kAvailableFormats[formatIdx]) break;
         }
@@ -1789,8 +1788,6 @@
         mLockAfterPassiveScan = false;
     }
 
-    uint8_t oldAfState = afState;
-
     if (afTriggered) {
         afState = processAfTrigger(afMode, afState);
     }
@@ -2090,7 +2087,7 @@
     // 5 m hyperfocal distance for back camera, infinity (fixed focus) for front
     const float hyperFocalDistance = mFacingBack ? 1.0/5.0 : 0.0;
     ADD_OR_SIZE(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,
-            &minFocusDistance, 1);
+            &hyperFocalDistance, 1);
 
     static const float focalLength = 3.30f; // mm
     ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
@@ -2679,7 +2676,6 @@
         uint32_t tag,
         const void *entryData,
         size_t entryDataCount) {
-    status_t res;
     if (!sizeRequest) {
         return add_camera_metadata_entry(request, tag, entryData,
                 entryDataCount);
diff --git a/camera/EmulatedFakeCamera3.cpp b/camera/EmulatedFakeCamera3.cpp
index 296d06e..4330c02 100644
--- a/camera/EmulatedFakeCamera3.cpp
+++ b/camera/EmulatedFakeCamera3.cpp
@@ -25,7 +25,7 @@
 //#define LOG_NNDEBUG 0
 #define LOG_TAG "EmulatedCamera_FakeCamera3"
 #include <cutils/properties.h>
-#include <utils/Log.h>
+#include <log/log.h>
 
 #include "EmulatedFakeCamera3.h"
 #include "EmulatedCameraFactory.h"
@@ -53,7 +53,6 @@
 
 const int64_t USEC = 1000LL;
 const int64_t MSEC = USEC * 1000LL;
-const int64_t SEC = MSEC * 1000LL;
 
 const int32_t EmulatedFakeCamera3::kAvailableFormats[] = {
         HAL_PIXEL_FORMAT_RAW16,
@@ -292,8 +291,10 @@
             }
         }
 
-        if (newStream->width <= 0 || newStream->width > mSensorWidth ||
-            newStream->height <= 0 || newStream->height > mSensorHeight) {
+        if (newStream->width <= 0 ||
+            (int32_t)newStream->width > mSensorWidth ||
+            newStream->height <= 0 ||
+            (int32_t)newStream->height > mSensorHeight) {
             ALOGE("%s: Unsupported stream width 0x%x height 0x%x",
                   __FUNCTION__, newStream->width, newStream->height);
             return BAD_VALUE;
@@ -1158,8 +1159,8 @@
     int32_t width = 0, height = 0;
     size_t rawSizeCount = sizeof(kAvailableRawSizes)/sizeof(kAvailableRawSizes[0]);
     for (size_t index = 0; index + 1 < rawSizeCount; index += 2) {
-        if (width <= kAvailableRawSizes[index] &&
-            height <= kAvailableRawSizes[index+1]) {
+        if (width <= (int32_t)kAvailableRawSizes[index] &&
+            height <= (int32_t)kAvailableRawSizes[index+1]) {
             width = kAvailableRawSizes[index];
             height = kAvailableRawSizes[index+1];
         }
@@ -1940,8 +1941,6 @@
      */
     status_t res;
 
-    bool facePriority = false;
-
     camera_metadata_entry e;
 
     e = settings.find(ANDROID_CONTROL_MODE);
diff --git a/camera/EmulatedFakeCameraDevice.cpp b/camera/EmulatedFakeCameraDevice.cpp
index 747c55a..85f0e79 100755
--- a/camera/EmulatedFakeCameraDevice.cpp
+++ b/camera/EmulatedFakeCameraDevice.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_FakeDevice"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "EmulatedFakeCamera.h"
 #include "EmulatedFakeCameraDevice.h"
 
diff --git a/camera/EmulatedFakeRotatingCameraDevice.cpp b/camera/EmulatedFakeRotatingCameraDevice.cpp
index 0e54b6c..fc1951e 100755
--- a/camera/EmulatedFakeRotatingCameraDevice.cpp
+++ b/camera/EmulatedFakeRotatingCameraDevice.cpp
@@ -23,7 +23,7 @@
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_FakeDevice"
 #define FAKE_CAMERA_SENSOR "FakeRotatingCameraSensor"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "EmulatedFakeCamera.h"
 #include "EmulatedFakeRotatingCameraDevice.h"
 #include "qemud.h"
@@ -94,7 +94,6 @@
 
 static void nv21_to_rgba8888(uint8_t* input, uint32_t * output, int width, int height) {
     int align = 16;
-    uint32_t* output0 = output;
     int yStride = (width + (align -1)) & ~(align-1);
     uint8_t* inputVU = input + height*yStride;
     uint8_t Y, U, V;
@@ -117,8 +116,6 @@
 {
     update_scene((float)width, (float)height);
     create_texture_dotx(1280, 720);
-    int i, j;
-    int quads = 1;
 
     int w= 992/2;
     int h = 1280/2;
@@ -402,7 +399,6 @@
     checkEglError("eglQuerySurface");
     eglQuerySurface(mEglDisplay, mEglSurface, EGL_HEIGHT, &h);
     checkEglError("eglQuerySurface");
-    GLint dim = w < h ? w : h;
 
     ALOGD("Window dimensions: %d x %d\n", w, h);
 
diff --git a/camera/EmulatedQemuCamera.cpp b/camera/EmulatedQemuCamera.cpp
index 496954b..d08baad 100755
--- a/camera/EmulatedQemuCamera.cpp
+++ b/camera/EmulatedQemuCamera.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_QemuCamera"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "EmulatedQemuCamera.h"
 #include "EmulatedCameraFactory.h"
 
diff --git a/camera/EmulatedQemuCamera2.cpp b/camera/EmulatedQemuCamera2.cpp
index 2c94f0e..77d8ff8 100644
--- a/camera/EmulatedQemuCamera2.cpp
+++ b/camera/EmulatedQemuCamera2.cpp
@@ -22,7 +22,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_QemuCamera2"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 #include "EmulatedQemuCamera2.h"
 #include "EmulatedCameraFactory.h"
diff --git a/camera/EmulatedQemuCamera3.cpp b/camera/EmulatedQemuCamera3.cpp
index 123ab1c..7cc3d86 100644
--- a/camera/EmulatedQemuCamera3.cpp
+++ b/camera/EmulatedQemuCamera3.cpp
@@ -42,7 +42,7 @@
 #include <inttypes.h>
 #include <sstream>
 #include <ui/Fence.h>
-#include <utils/Log.h>
+#include <log/log.h>
 #include <vector>
 
 namespace android {
@@ -53,7 +53,6 @@
 
 const int64_t USEC = 1000LL;
 const int64_t MSEC = USEC * 1000LL;
-const int64_t SEC = MSEC * 1000LL;
 
 const int32_t EmulatedQemuCamera3::kAvailableFormats[] = {
     HAL_PIXEL_FORMAT_BLOB,
@@ -165,7 +164,8 @@
 
     // Remove any resolution with a dimension exceeding the sensor size.
     for (auto res = mResolutions.begin(); res != mResolutions.end(); ) {
-        if (res->first > mSensorWidth || res->second > mSensorHeight) {
+        if (res->first > (int32_t)mSensorWidth ||
+            res->second > (int32_t)mSensorHeight) {
             // Width and/or height larger than sensor. Remove it.
             res = mResolutions.erase(res);
         } else {
@@ -1630,8 +1630,6 @@
      */
     status_t res;
 
-    bool facePriority = false;
-
     camera_metadata_entry e;
 
     e = settings.find(ANDROID_CONTROL_MODE);
diff --git a/camera/EmulatedQemuCameraDevice.cpp b/camera/EmulatedQemuCameraDevice.cpp
index 0ff6df2..c416454 100755
--- a/camera/EmulatedQemuCameraDevice.cpp
+++ b/camera/EmulatedQemuCameraDevice.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_QemuDevice"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "EmulatedQemuCamera.h"
 #include "EmulatedQemuCameraDevice.h"
 
diff --git a/camera/Exif.cpp b/camera/Exif.cpp
index f7f85f5..0f451ff 100644
--- a/camera/Exif.cpp
+++ b/camera/Exif.cpp
@@ -16,7 +16,7 @@
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Exif"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 
 #include <inttypes.h>
@@ -151,12 +151,12 @@
 
 // Create an entry and place it in |exifData|, the entry is initialized with a
 // single byte in |value|
-static bool createEntry(ExifData* exifData,
-                        ExifIfd ifd,
-                        int tag,
-                        uint8_t value) {
-    return createEntry(exifData, ifd, tag, &value, 1, EXIF_FORMAT_BYTE);
-}
+//static bool createEntry(ExifData* exifData,
+//                        ExifIfd ifd,
+//                        int tag,
+//                        uint8_t value) {
+//    return createEntry(exifData, ifd, tag, &value, 1, EXIF_FORMAT_BYTE);
+//}
 
 // Create an entry and place it in |exifData|, the entry is default initialized
 // by the exif library based on |tag|
diff --git a/camera/GrallocModule.h b/camera/GrallocModule.h
index 72b6322..c6d4840 100644
--- a/camera/GrallocModule.h
+++ b/camera/GrallocModule.h
@@ -2,7 +2,7 @@
 #define EMU_CAMERA_GRALLOC_MODULE_H
 
 #include <hardware/gralloc.h>
-#include <utils/Log.h>
+#include <log/log.h>
 
 class GrallocModule
 {
diff --git a/camera/JpegCompressor.cpp b/camera/JpegCompressor.cpp
index d757a3d..3a5b15e 100644
--- a/camera/JpegCompressor.cpp
+++ b/camera/JpegCompressor.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_JPEG"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <assert.h>
 #include <dlfcn.h>
 #include "JpegCompressor.h"
diff --git a/camera/PreviewWindow.cpp b/camera/PreviewWindow.cpp
index 4c7ee24..aad54e2 100755
--- a/camera/PreviewWindow.cpp
+++ b/camera/PreviewWindow.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Preview"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "EmulatedCameraDevice.h"
 #include "PreviewWindow.h"
 #include "GrallocModule.h"
diff --git a/camera/QemuClient.cpp b/camera/QemuClient.cpp
index f5cfe6b..18beb69 100755
--- a/camera/QemuClient.cpp
+++ b/camera/QemuClient.cpp
@@ -21,7 +21,7 @@
 
 #define LOG_NDEBUG 1
 #define LOG_TAG "EmulatedCamera_QemuClient"
-#include <cutils/log.h>
+#include <log/log.h>
 #include "EmulatedCamera.h"
 #include "QemuClient.h"
 
diff --git a/camera/Thumbnail.cpp b/camera/Thumbnail.cpp
index 4d66f10..8f901a3 100644
--- a/camera/Thumbnail.cpp
+++ b/camera/Thumbnail.cpp
@@ -18,7 +18,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Thumbnail"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <libexif/exif-data.h>
 #include <libyuv.h>
 
diff --git a/camera/WorkerThread.cpp b/camera/WorkerThread.cpp
index 2b5fe92..42505a3 100644
--- a/camera/WorkerThread.cpp
+++ b/camera/WorkerThread.cpp
@@ -18,7 +18,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_WorkerThread"
-#include <cutils/log.h>
+#include <log/log.h>
 
 #include <algorithm>
 
diff --git a/camera/fake-pipeline2/JpegCompressor.cpp b/camera/fake-pipeline2/JpegCompressor.cpp
index f4952b2..51de0c0 100644
--- a/camera/fake-pipeline2/JpegCompressor.cpp
+++ b/camera/fake-pipeline2/JpegCompressor.cpp
@@ -17,7 +17,7 @@
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera2_JpegCompressor"
 
-#include <utils/Log.h>
+#include <log/log.h>
 
 #include "gralloc_cb.h"
 #include "JpegCompressor.h"
@@ -131,7 +131,7 @@
 status_t JpegCompressor::compress() {
     // Find source and target buffers. Assumes only one buffer matches
     // each condition!
-    bool foundJpeg = false, mFoundAux = false;
+    bool mFoundAux = false;
     int thumbWidth = 0, thumbHeight = 0;
     unsigned char thumbJpegQuality = 90;
     unsigned char jpegQuality = 90;
@@ -223,7 +223,6 @@
 }
 
 void JpegCompressor::cleanUp() {
-    status_t res;
     Mutex::Autolock lock(mBusyMutex);
 
     if (mFoundAux) {
diff --git a/camera/fake-pipeline2/Scene.cpp b/camera/fake-pipeline2/Scene.cpp
index 81dcd31..0fea38e 100644
--- a/camera/fake-pipeline2/Scene.cpp
+++ b/camera/fake-pipeline2/Scene.cpp
@@ -16,7 +16,7 @@
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_Scene"
-#include <utils/Log.h>
+#include <log/log.h>
 #include <stdlib.h>
 #include <cmath>
 #include "Scene.h"
@@ -87,8 +87,8 @@
         mSensorWidth(sensorWidthPx),
         mSensorHeight(sensorHeightPx),
         mHour(12),
-        mExposureDuration(0.033f),
-        mSensorSensitivity(sensorSensitivity)
+        mExposureDuration(0.033f)
+        //mSensorSensitivity(sensorSensitivity)
 {
     // Map scene to sensor pixels
     if (mSensorWidth > mSensorHeight) {
diff --git a/camera/fake-pipeline2/Scene.h b/camera/fake-pipeline2/Scene.h
index 66d1a69..3a7a001 100644
--- a/camera/fake-pipeline2/Scene.h
+++ b/camera/fake-pipeline2/Scene.h
@@ -108,7 +108,7 @@
 
     int mHour;
     float mExposureDuration;
-    float mSensorSensitivity;
+    //float mSensorSensitivity;
 
     enum Materials {
         GRASS = 0,
diff --git a/camera/fake-pipeline2/Sensor.cpp b/camera/fake-pipeline2/Sensor.cpp
index b480022..c555275 100644
--- a/camera/fake-pipeline2/Sensor.cpp
+++ b/camera/fake-pipeline2/Sensor.cpp
@@ -24,7 +24,7 @@
 #define ALOGVV(...) ((void)0)
 #endif
 
-#include <utils/Log.h>
+#include <log/log.h>
 
 #include "../EmulatedFakeCamera2.h"
 #include "Sensor.h"
@@ -190,7 +190,6 @@
 bool Sensor::waitForNewFrame(nsecs_t reltime,
         nsecs_t *captureTime) {
     Mutex::Autolock lock(mReadoutMutex);
-    uint8_t *ret;
     if (mCapturedBuffers == NULL) {
         int res;
         res = mReadoutAvailable.waitRelative(mReadoutMutex, reltime);
@@ -270,8 +269,6 @@
     // time on that.
     nsecs_t simulatedTime    = startRealTime;
     nsecs_t frameEndRealTime = startRealTime + frameDuration;
-    nsecs_t frameReadoutEndRealTime = startRealTime +
-            mRowReadoutTime * mResolution[1];
 
     if (mNextCapturedBuffers != NULL) {
         ALOGVV("Sensor starting readout");
@@ -380,9 +377,8 @@
             ret = nanosleep(&t, &t);
         } while (ret != 0);
     }
-    nsecs_t endRealTime = systemTime();
     ALOGVV("Frame cycle took %d ms, target %d ms",
-            (int)((endRealTime - startRealTime)/1000000),
+            (int)((systemTime() - startRealTime)/1000000),
             (int)(frameDuration / 1000000));
     return true;
 };
diff --git a/camera/jpeg-stub/Compressor.cpp b/camera/jpeg-stub/Compressor.cpp
index 76c4a24..3fe0bd6 100644
--- a/camera/jpeg-stub/Compressor.cpp
+++ b/camera/jpeg-stub/Compressor.cpp
@@ -18,7 +18,7 @@
 
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_JPEGStub_Compressor"
-#include <cutils/log.h>
+#include <log/log.h>
 #include <libexif/exif-data.h>
 
 Compressor::Compressor() {
diff --git a/camera/jpeg-stub/JpegStub.cpp b/camera/jpeg-stub/JpegStub.cpp
index 1eef9e2..3e02de0 100644
--- a/camera/jpeg-stub/JpegStub.cpp
+++ b/camera/jpeg-stub/JpegStub.cpp
@@ -19,7 +19,7 @@
 #define LOG_NDEBUG 0
 #define LOG_TAG "EmulatedCamera_JPEGStub"
 #include <errno.h>
-#include <cutils/log.h>
+#include <log/log.h>
 #include <stdlib.h>
 
 #include "Compressor.h"
diff --git a/camera/qemu-pipeline3/QemuSensor.cpp b/camera/qemu-pipeline3/QemuSensor.cpp
index d52bffd..529bf96 100644
--- a/camera/qemu-pipeline3/QemuSensor.cpp
+++ b/camera/qemu-pipeline3/QemuSensor.cpp
@@ -34,7 +34,7 @@
 #include <cmath>
 #include <cstdlib>
 #include <linux/videodev2.h>
-#include <utils/Log.h>
+#include <log/log.h>
 
 namespace android {
 
@@ -55,8 +55,8 @@
         mLastRequestWidth(-1),
         mLastRequestHeight(-1),
         mCameraQemuClient(),
-        mGotVSync(false),
         mDeviceName(deviceName),
+        mGotVSync(false),
         mFrameDuration(kFrameDurationRange[0]),
         mNextBuffers(nullptr),
         mFrameNumber(0),
@@ -153,7 +153,6 @@
 
 bool QemuSensor::waitForNewFrame(nsecs_t reltime, nsecs_t *captureTime) {
     Mutex::Autolock lock(mReadoutMutex);
-    uint8_t *ret;
     if (mCapturedBuffers == nullptr) {
         int res;
         res = mReadoutAvailable.waitRelative(mReadoutMutex, reltime);
@@ -336,9 +335,8 @@
             ret = nanosleep(&t, &t);
         } while (ret != 0);
     }
-    nsecs_t endRealTime = systemTime();
     ALOGVV("Frame cycle took %d ms, target %d ms",
-            (int) ((endRealTime - startRealTime) / 1000000),
+            (int) ((systemTime() - startRealTime) / 1000000),
             (int) (frameDuration / 1000000));
     return true;
 }
@@ -346,7 +344,8 @@
 void QemuSensor::captureRGBA(uint8_t *img, uint32_t width, uint32_t height,
         uint32_t stride, int64_t *timestamp) {
     status_t res;
-    if (width != mLastRequestWidth || height != mLastRequestHeight) {
+    if (width != (uint32_t)mLastRequestWidth ||
+        height != (uint32_t)mLastRequestHeight) {
         ALOGI("%s: Dimensions for the current request (%dx%d) differ "
               "from the previous request (%dx%d). Restarting camera",
                 __FUNCTION__, width, height, mLastRequestWidth,
@@ -414,7 +413,8 @@
 
 void QemuSensor::captureNV21(uint8_t *img, uint32_t width, uint32_t height, uint32_t stride, int64_t *timestamp) {
     status_t res;
-    if (width != mLastRequestWidth || height != mLastRequestHeight) {
+    if (width != (uint32_t)mLastRequestWidth ||
+        height != (uint32_t)mLastRequestHeight) {
         ALOGI("%s: Dimensions for the current request (%dx%d) differ "
               "from the previous request (%dx%d). Restarting camera",
                 __FUNCTION__, width, height, mLastRequestWidth,
diff --git a/hwcomposer/hwcomposer.cpp b/hwcomposer/hwcomposer.cpp
index 702527f..cc0dc66 100644
--- a/hwcomposer/hwcomposer.cpp
+++ b/hwcomposer/hwcomposer.cpp
@@ -271,7 +271,8 @@
         int64_t timestamp = int64_t(rt.tv_sec) * 1e9 + rt.tv_nsec;
         pdev->procs->vsync(pdev->procs, 0, timestamp);
         if (rt.tv_sec - last_logged >= log_interval) {
-            ALOGD("hw_composer sent %d syncs in %ds", sent - last_sent, rt.tv_sec - last_logged);
+            ALOGD("hw_composer sent %d syncs in %ds", (uint32_t)(sent - last_sent),
+                  (uint32_t)(rt.tv_sec - last_logged));
             last_logged = rt.tv_sec;
             last_sent = sent;
         }
@@ -345,17 +346,17 @@
 
 
 static struct hw_module_methods_t hwc_module_methods = {
-    open: hwc_open,
+    .open = hwc_open,
 };
 
 hwc_module_t HAL_MODULE_INFO_SYM = {
-    common: {
-        tag: HARDWARE_MODULE_TAG,
-        module_api_version: HWC_MODULE_API_VERSION_0_1,
-        hal_api_version: HARDWARE_HAL_API_VERSION,
-        id: HWC_HARDWARE_MODULE_ID,
-        name: "Android Emulator hwcomposer module",
-        author: "The Android Open Source Project",
-        methods: &hwc_module_methods,
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .module_api_version = HWC_MODULE_API_VERSION_0_1,
+        .hal_api_version = HARDWARE_HAL_API_VERSION,
+        .id = HWC_HARDWARE_MODULE_ID,
+        .name = "Android Emulator hwcomposer module",
+        .author = "The Android Open Source Project",
+        .methods = &hwc_module_methods,
     }
 };