Fix warnings, re-enable -Werror.

Change-Id: Ic6b1a10f46f980f9a9d8d130600419a792703c44
diff --git a/media/img_utils/include/img_utils/TiffEntryImpl.h b/media/img_utils/include/img_utils/TiffEntryImpl.h
index 0e713dc..cbe0e9a 100644
--- a/media/img_utils/include/img_utils/TiffEntryImpl.h
+++ b/media/img_utils/include/img_utils/TiffEntryImpl.h
@@ -43,7 +43,7 @@
         uint16_t getTag() const;
         TagType getType() const;
         Endianness getEndianness() const;
-        uint32_t getSize() const;
+        size_t getSize() const;
         uint32_t getComparableValue() const;
 
     protected:
@@ -97,7 +97,7 @@
 }
 
 template<typename T>
-uint32_t TiffEntryImpl<T>::getSize() const {
+size_t TiffEntryImpl<T>::getSize() const {
     uint32_t total = getActualSize();
     WORD_ALIGN(total)
     return (total <= OFFSET_SIZE) ? 0 : total;
diff --git a/media/img_utils/include/img_utils/TiffIfd.h b/media/img_utils/include/img_utils/TiffIfd.h
index c35f858..9400456 100644
--- a/media/img_utils/include/img_utils/TiffIfd.h
+++ b/media/img_utils/include/img_utils/TiffIfd.h
@@ -82,7 +82,7 @@
          * and the corresponding values for each entry (recursively including
          * any sub-IFDs).
          */
-        virtual uint32_t getSize() const;
+        virtual size_t getSize() const;
 
         /**
          * Get the id of this IFD.
diff --git a/media/img_utils/src/Android.mk b/media/img_utils/src/Android.mk
index 29c011f..80893be 100644
--- a/media/img_utils/src/Android.mk
+++ b/media/img_utils/src/Android.mk
@@ -46,6 +46,7 @@
 LOCAL_CFLAGS += \
   -Wall \
   -Wextra \
+  -Werror \
   -fvisibility=hidden
 
 ifneq ($(filter userdebug eng,$(TARGET_BUILD_VARIANT)),)
diff --git a/media/img_utils/src/TiffEntryImpl.cpp b/media/img_utils/src/TiffEntryImpl.cpp
index 2052ceb..6efa458 100644
--- a/media/img_utils/src/TiffEntryImpl.cpp
+++ b/media/img_utils/src/TiffEntryImpl.cpp
@@ -23,7 +23,7 @@
 namespace img_utils {
 
 template<>
-uint32_t TiffEntryImpl<TiffIfd>::getSize() const {
+size_t TiffEntryImpl<TiffIfd>::getSize() const {
     uint32_t total = 0;
     for (uint32_t i = 0; i < mCount; ++i) {
         total += mData[i].getSize();
diff --git a/media/img_utils/src/TiffIfd.cpp b/media/img_utils/src/TiffIfd.cpp
index b75309b..1b3b40d 100644
--- a/media/img_utils/src/TiffIfd.cpp
+++ b/media/img_utils/src/TiffIfd.cpp
@@ -30,13 +30,13 @@
 status_t TiffIfd::addEntry(const sp<TiffEntry>& entry) {
     size_t size = mEntries.size();
     if (size >= MAX_IFD_ENTRIES) {
-        ALOGW("%s: Failed to add entry for tag 0x%x to IFD %d, too many entries in IFD!",
+        ALOGW("%s: Failed to add entry for tag 0x%x to IFD %u, too many entries in IFD!",
                 __FUNCTION__, entry->getTag(), mIfdId);
         return BAD_INDEX;
     }
 
     if (mEntries.add(entry) < 0) {
-        ALOGW("%s: Failed to add entry for tag 0x%x to ifd %d.", __FUNCTION__, entry->getTag(),
+        ALOGW("%s: Failed to add entry for tag 0x%x to ifd %u.", __FUNCTION__, entry->getTag(),
                 mIfdId);
         return BAD_INDEX;
     }
@@ -46,7 +46,7 @@
 sp<TiffEntry> TiffIfd::getEntry(uint16_t tag) const {
     ssize_t index = mEntries.indexOfTag(tag);
     if (index < 0) {
-        ALOGW("%s: No entry for tag 0x%x in ifd %d.", __FUNCTION__, tag, mIfdId);
+        ALOGW("%s: No entry for tag 0x%x in ifd %u.", __FUNCTION__, tag, mIfdId);
         return NULL;
     }
     return mEntries[index];
@@ -64,19 +64,19 @@
     size_t size = mEntries.size();
 
     if (size > MAX_IFD_ENTRIES) {
-        ALOGW("%s: Could not calculate IFD offsets, IFD %d contains too many entries.",
+        ALOGW("%s: Could not calculate IFD offsets, IFD %u contains too many entries.",
                 __FUNCTION__, mIfdId);
         return BAD_OFFSET;
     }
 
     if (size <= 0) {
-        ALOGW("%s: Could not calculate IFD offsets, IFD %d contains no entries.", __FUNCTION__,
+        ALOGW("%s: Could not calculate IFD offsets, IFD %u contains no entries.", __FUNCTION__,
                 mIfdId);
         return BAD_OFFSET;
     }
 
     if (offset == BAD_OFFSET) {
-        ALOGW("%s: Could not calculate IFD offsets, IFD %d had a bad initial offset.",
+        ALOGW("%s: Could not calculate IFD offsets, IFD %u had a bad initial offset.",
                 __FUNCTION__, mIfdId);
         return BAD_OFFSET;
     }
@@ -128,7 +128,7 @@
         size_t diff = (next - last);
         size_t actual = mEntries[i]->getSize();
         if (diff != actual) {
-            ALOGW("Sizes do not match for tag %x. Expected %d, received %d",
+            ALOGW("Sizes do not match for tag %x. Expected %zu, received %zu",
                     mEntries[i]->getTag(), actual, diff);
         }
     }
@@ -138,7 +138,7 @@
     return ret;
 }
 
-uint32_t TiffIfd::getSize() const {
+size_t TiffIfd::getSize() const {
     size_t size = mEntries.size();
     uint32_t total = calculateIfdSize(size);
     WORD_ALIGN(total);
@@ -159,7 +159,7 @@
 String8 TiffIfd::toString() const {
     size_t s = mEntries.size();
     String8 output;
-    output.appendFormat("[ifd: %x, num_entries: %u, entries:\n", getId(), s);
+    output.appendFormat("[ifd: %x, num_entries: %zu, entries:\n", getId(), s);
     for(size_t i = 0; i < mEntries.size(); ++i) {
         output.append("\t");
         output.append(mEntries[i]->toString());
@@ -171,7 +171,7 @@
 
 void TiffIfd::log() const {
     size_t s = mEntries.size();
-    ALOGI("[ifd: %x, num_entries: %u, entries:\n", getId(), s);
+    ALOGI("[ifd: %x, num_entries: %zu, entries:\n", getId(), s);
     for(size_t i = 0; i < s; ++i) {
         ALOGI("\t%s", mEntries[i]->toString().string());
     }