summaryrefslogtreecommitdiffstats
path: root/media/img_utils
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2014-05-17 01:09:04 -0700
committerRuben Brunk <rubenbrunk@google.com>2014-05-17 08:10:19 +0000
commit272b7f26c300d2029f278cf2af523cf94e513b89 (patch)
treed0c676b5575138fa0c096c3fa3ba9897806dc5e8 /media/img_utils
parent22fcacaf30e157037e6651241c7b3a45f075daa0 (diff)
downloadframeworks_av-272b7f26c300d2029f278cf2af523cf94e513b89.zip
frameworks_av-272b7f26c300d2029f278cf2af523cf94e513b89.tar.gz
frameworks_av-272b7f26c300d2029f278cf2af523cf94e513b89.tar.bz2
Fix warnings, re-enable -Werror.
Change-Id: Ic6b1a10f46f980f9a9d8d130600419a792703c44
Diffstat (limited to 'media/img_utils')
-rw-r--r--media/img_utils/include/img_utils/TiffEntryImpl.h4
-rw-r--r--media/img_utils/include/img_utils/TiffIfd.h2
-rw-r--r--media/img_utils/src/Android.mk1
-rw-r--r--media/img_utils/src/TiffEntryImpl.cpp2
-rw-r--r--media/img_utils/src/TiffIfd.cpp20
5 files changed, 15 insertions, 14 deletions
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 @@ class TiffEntryImpl : public TiffEntry {
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 @@ const void* TiffEntryImpl<T>::getDataHelper() const {
}
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 @@ class ANDROID_API TiffIfd : public TiffWritable {
* 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_C_INCLUDES += \
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 android {
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 @@ TiffIfd::~TiffIfd() {}
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 @@ status_t TiffIfd::addEntry(const sp<TiffEntry>& entry) {
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 @@ uint32_t TiffIfd::checkAndGetOffset(uint32_t offset) const {
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 @@ status_t TiffIfd::writeData(uint32_t offset, /*out*/EndianOutput* out) const {
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 @@ status_t TiffIfd::writeData(uint32_t offset, /*out*/EndianOutput* out) const {
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 @@ uint32_t TiffIfd::getComparableValue() const {
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 @@ String8 TiffIfd::toString() const {
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());
}