Fix trivial warnings hidden by -isystem
Fix the trivial warnings that are hidden by the use of -isystem to
include frameworks/av and caught by -Werror.
Test: m -j checkbuild
Bug: 31751828
Change-Id: I155f9f772ce0a84b364313814cb7cf528b9de4eb
Merged-In: I155f9f772ce0a84b364313814cb7cf528b9de4eb
(cherry picked from commit b8c35f94470d1518e2def0582aaec4e038c92af0)
diff --git a/media/libmedia/MediaCodecInfo.cpp b/media/libmedia/MediaCodecInfo.cpp
index 1b3b3eb..2bc5984 100644
--- a/media/libmedia/MediaCodecInfo.cpp
+++ b/media/libmedia/MediaCodecInfo.cpp
@@ -85,13 +85,13 @@
}
status_t MediaCodecInfo::Capabilities::writeToParcel(Parcel *parcel) const {
- CHECK_LE(mProfileLevels.size(), INT32_MAX);
+ CHECK_LE(mProfileLevels.size(), static_cast<size_t>(INT32_MAX));
parcel->writeInt32(mProfileLevels.size());
for (size_t i = 0; i < mProfileLevels.size(); i++) {
parcel->writeInt32(mProfileLevels.itemAt(i).mProfile);
parcel->writeInt32(mProfileLevels.itemAt(i).mLevel);
}
- CHECK_LE(mColorFormats.size(), INT32_MAX);
+ CHECK_LE(mColorFormats.size(), static_cast<size_t>(INT32_MAX));
parcel->writeInt32(mColorFormats.size());
for (size_t i = 0; i < mColorFormats.size(); i++) {
parcel->writeInt32(mColorFormats.itemAt(i));
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index b742762..f8453eb 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -1028,7 +1028,7 @@
// (Case 1)
// Must be a multiple of the frame size. If it is not a multiple of a frame size, it
// needs to fail, as we should not carry over fractional frames between calls.
- CHECK_EQ(copy % mAudioSink->frameSize(), 0);
+ CHECK_EQ(copy % mAudioSink->frameSize(), 0u);
// (Case 2, 3, 4)
// Return early to the caller.
diff --git a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
index c4e5df7..79e157f 100644
--- a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
@@ -477,7 +477,7 @@
return;
}
- CHECK_EQ(msg->what(), (int)kWhatNotify);
+ CHECK_EQ(msg->what(), kWhatNotify);
int32_t what;
CHECK(msg->findInt32("what", &what));
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 9de5c26..5cf5863 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -133,7 +133,7 @@
mTotalNumTableEntries(0),
mNumValuesInCurrEntry(0),
mCurrTableEntriesElement(NULL) {
- CHECK_GT(mElementCapacity, 0);
+ CHECK_GT(mElementCapacity, 0u);
// Ensure no integer overflow on allocation in add().
CHECK_LT(ENTRY_SIZE, UINT32_MAX / mElementCapacity);
}
@@ -161,7 +161,7 @@
--iterations;
}
CHECK(it != mTableEntryList.end());
- CHECK_EQ(iterations, 0);
+ CHECK_EQ(iterations, 0u);
(*it)[(pos % (mElementCapacity * ENTRY_SIZE))] = value;
}
@@ -182,7 +182,7 @@
--iterations;
}
CHECK(it != mTableEntryList.end());
- CHECK_EQ(iterations, 0);
+ CHECK_EQ(iterations, 0u);
value = (*it)[(pos % (mElementCapacity * ENTRY_SIZE))];
return true;
@@ -230,12 +230,12 @@
// 2. followed by the values in the table enties in order
// @arg writer the writer to actual write to the storage
void write(MPEG4Writer *writer) const {
- CHECK_EQ(mNumValuesInCurrEntry % ENTRY_SIZE, 0);
+ CHECK_EQ(mNumValuesInCurrEntry % ENTRY_SIZE, 0u);
uint32_t nEntries = mTotalNumTableEntries;
writer->writeInt32(nEntries);
for (typename List<TYPE *>::iterator it = mTableEntryList.begin();
it != mTableEntryList.end(); ++it) {
- CHECK_GT(nEntries, 0);
+ CHECK_GT(nEntries, 0u);
if (nEntries >= mElementCapacity) {
writer->write(*it, sizeof(TYPE) * ENTRY_SIZE, mElementCapacity);
nEntries -= mElementCapacity;
@@ -1237,7 +1237,7 @@
mOffset += length + 4;
} else {
- CHECK_LT(length, 65536);
+ CHECK_LT(length, 65536u);
uint8_t x = length >> 8;
::write(mFd, &x, 1);
@@ -1297,7 +1297,7 @@
}
void MPEG4Writer::beginBox(const char *fourcc) {
- CHECK_EQ(strlen(fourcc), 4);
+ CHECK_EQ(strlen(fourcc), 4u);
mBoxes.push_back(mWriteMoovBoxToMemory?
mMoovBoxBufferOffset: mOffset);
@@ -1348,7 +1348,7 @@
}
void MPEG4Writer::writeFourcc(const char *s) {
- CHECK_EQ(strlen(s), 4);
+ CHECK_EQ(strlen(s), 4u);
write(s, 1, 4);
}
@@ -3129,10 +3129,10 @@
void MPEG4Writer::Track::writeMp4aEsdsBox() {
mOwner->beginBox("esds");
CHECK(mCodecSpecificData);
- CHECK_GT(mCodecSpecificDataSize, 0);
+ CHECK_GT(mCodecSpecificDataSize, 0u);
// Make sure all sizes encode to a single byte.
- CHECK_LT(mCodecSpecificDataSize + 23, 128);
+ CHECK_LT(mCodecSpecificDataSize + 23, 128u);
mOwner->writeInt32(0); // version=0, flags=0
mOwner->writeInt8(0x03); // ES_DescrTag
@@ -3171,10 +3171,10 @@
void MPEG4Writer::Track::writeMp4vEsdsBox() {
CHECK(mCodecSpecificData);
- CHECK_GT(mCodecSpecificDataSize, 0);
+ CHECK_GT(mCodecSpecificDataSize, 0u);
// Make sure all sizes encode to a single byte.
- CHECK_LT(23 + mCodecSpecificDataSize, 128);
+ CHECK_LT(23 + mCodecSpecificDataSize, 128u);
mOwner->beginBox("esds");
@@ -3349,7 +3349,7 @@
void MPEG4Writer::Track::writeAvccBox() {
CHECK(mCodecSpecificData);
- CHECK_GE(mCodecSpecificDataSize, 5);
+ CHECK_GE(mCodecSpecificDataSize, 5u);
// Patch avcc's lengthSize field to match the number
// of bytes we use to indicate the size of a nal unit.
@@ -3363,7 +3363,7 @@
void MPEG4Writer::Track::writeHvccBox() {
CHECK(mCodecSpecificData);
- CHECK_GE(mCodecSpecificDataSize, 5);
+ CHECK_GE(mCodecSpecificDataSize, 5u);
// Patch avcc's lengthSize field to match the number
// of bytes we use to indicate the size of a nal unit.
diff --git a/media/libstagefright/SampleIterator.cpp b/media/libstagefright/SampleIterator.cpp
index 4134698..4f31c5f 100644
--- a/media/libstagefright/SampleIterator.cpp
+++ b/media/libstagefright/SampleIterator.cpp
@@ -282,7 +282,7 @@
default:
{
- CHECK_EQ(mTable->mSampleSizeFieldSize, 4);
+ CHECK_EQ(mTable->mSampleSizeFieldSize, 4u);
uint8_t x;
if (mTable->mDataSource->readAt(
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 998a555..eadab86 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -167,7 +167,7 @@
mMaxAcquiredBufferCount = bufferCount;
}
- CHECK_GT(mMaxAcquiredBufferCount, 1);
+ CHECK_GT(mMaxAcquiredBufferCount, 1u);
status_t err =
mConsumer->setMaxAcquiredBufferCount(mMaxAcquiredBufferCount);
@@ -186,7 +186,7 @@
ALOGV("setMaxAcquiredBufferCount(%zu)", count);
Mutex::Autolock lock(mMutex);
- CHECK_GT(count, 1);
+ CHECK_GT(count, 1u);
mMaxAcquiredBufferCount = count;
return OK;
diff --git a/media/libstagefright/codecs/aacenc/AACEncoder.cpp b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
index 9e596ff..5656139 100644
--- a/media/libstagefright/codecs/aacenc/AACEncoder.cpp
+++ b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
@@ -296,7 +296,7 @@
memset(&inputData, 0, sizeof(inputData));
inputData.Buffer = (unsigned char*) mInputFrame;
inputData.Length = nSamples * sizeof(int16_t);
- CHECK(VO_ERR_NONE == mApiHandle->SetInputData(mEncoderHandle,&inputData));
+ CHECK((VO_U32)VO_ERR_NONE == mApiHandle->SetInputData(mEncoderHandle,&inputData));
VO_CODECBUFFER outputData;
memset(&outputData, 0, sizeof(outputData));
diff --git a/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp b/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp
index 96bbb85..1457242 100644
--- a/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp
+++ b/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp
@@ -65,7 +65,7 @@
onReset();
if (mEncoderHandle) {
- CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle));
+ CHECK_EQ((VO_U32)VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle));
mEncoderHandle = NULL;
}
@@ -524,7 +524,7 @@
memset(&inputData, 0, sizeof(inputData));
inputData.Buffer = (unsigned char *)mInputFrame;
inputData.Length = numBytesPerInputFrame;
- CHECK(VO_ERR_NONE ==
+ CHECK((VO_U32)VO_ERR_NONE ==
mApiHandle->SetInputData(mEncoderHandle, &inputData));
VO_CODECBUFFER outputData;
diff --git a/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp b/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp
index 9d50c4e..c7973d6 100644
--- a/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp
+++ b/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp
@@ -59,7 +59,7 @@
SoftAMRWBEncoder::~SoftAMRWBEncoder() {
if (mEncoderHandle != NULL) {
- CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle));
+ CHECK_EQ((VO_U32)VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle));
mEncoderHandle = NULL;
}
@@ -435,7 +435,7 @@
inputData.Buffer = (unsigned char *) mInputFrame;
inputData.Length = mInputSize;
- CHECK_EQ(VO_ERR_NONE,
+ CHECK_EQ((VO_U32)VO_ERR_NONE,
mApiHandle->SetInputData(mEncoderHandle, &inputData));
VO_CODECBUFFER outputData;
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index dd941c1..8c88fe9 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -690,7 +690,7 @@
}
if (mContinuation != NULL) {
- CHECK_GT(mContinuationCounter, 0);
+ CHECK_GT(mContinuationCounter, 0u);
if (--mContinuationCounter == 0) {
mContinuation->post();
}
diff --git a/media/libstagefright/webm/WebmFrameThread.cpp b/media/libstagefright/webm/WebmFrameThread.cpp
index 7eb4745..c33e0c7 100644
--- a/media/libstagefright/webm/WebmFrameThread.cpp
+++ b/media/libstagefright/webm/WebmFrameThread.cpp
@@ -118,7 +118,7 @@
void WebmFrameSinkThread::writeCluster(List<sp<WebmElement> >& children) {
// children must contain at least one simpleblock and its timecode
- CHECK_GE(children.size(), 2);
+ CHECK_GE(children.size(), 2u);
uint64_t size;
sp<WebmElement> cluster = new WebmMaster(kMkvCluster, children);
@@ -149,7 +149,7 @@
// flushing the second to last frame before we check its type. A audio frame
// should precede the aforementioned video key frame in the next sequence, a video
// frame should be the last frame in the current (to-be-flushed) sequence.
- CHECK_GE(n, 2);
+ CHECK_GE(n, 2u);
n -= 2;
}
diff --git a/media/libstagefright/webm/WebmWriter.cpp b/media/libstagefright/webm/WebmWriter.cpp
index 25d6821..d6c6930 100644
--- a/media/libstagefright/webm/WebmWriter.cpp
+++ b/media/libstagefright/webm/WebmWriter.cpp
@@ -488,7 +488,7 @@
params->findInt32(kKeyBitRate, &bitRate);
}
mEstimatedCuesSize = estimateCuesSize(bitRate);
- CHECK_GE(mEstimatedCuesSize, 8);
+ CHECK_GE(mEstimatedCuesSize, 8u);
cues = new EbmlVoid(mEstimatedCuesSize);
}
diff --git a/media/libstagefright/wifi-display/rtp/RTPSender.cpp b/media/libstagefright/wifi-display/rtp/RTPSender.cpp
index 83af393..ca9fdd2 100644
--- a/media/libstagefright/wifi-display/rtp/RTPSender.cpp
+++ b/media/libstagefright/wifi-display/rtp/RTPSender.cpp
@@ -247,7 +247,7 @@
status_t RTPSender::queueTSPackets(
const sp<ABuffer> &tsPackets, uint8_t packetType) {
- CHECK_EQ(0, tsPackets->size() % 188);
+ CHECK_EQ(0u, tsPackets->size() % 188);
int64_t timeUs;
CHECK(tsPackets->meta()->findInt64("timeUs", &timeUs));
diff --git a/media/libstagefright/wifi-display/source/TSPacketizer.cpp b/media/libstagefright/wifi-display/source/TSPacketizer.cpp
index 4c5ad17..865ba94 100644
--- a/media/libstagefright/wifi-display/source/TSPacketizer.cpp
+++ b/media/libstagefright/wifi-display/source/TSPacketizer.cpp
@@ -273,8 +273,8 @@
CHECK(mFormat->findInt32("profile-idc", &profileIdc));
CHECK(mFormat->findInt32("level-idc", &levelIdc));
CHECK(mFormat->findInt32("constraint-set", &constraintSet));
- CHECK_GE(profileIdc, 0u);
- CHECK_GE(levelIdc, 0u);
+ CHECK_GE(profileIdc, 0);
+ CHECK_GE(levelIdc, 0);
data[2] = profileIdc; // profile_idc
data[3] = constraintSet; // constraint_set*
data[4] = levelIdc; // level_idc
@@ -771,7 +771,7 @@
program_info_length += mProgramInfoDescriptors.itemAt(i)->size();
}
- CHECK_LT(program_info_length, 0x400);
+ CHECK_LT(program_info_length, 0x400u);
*ptr++ = 0xf0 | (program_info_length >> 8);
*ptr++ = (program_info_length & 0xff);
@@ -795,7 +795,7 @@
for (size_t i = 0; i < track->countDescriptors(); ++i) {
ES_info_length += track->descriptorAt(i)->size();
}
- CHECK_LE(ES_info_length, 0xfff);
+ CHECK_LE(ES_info_length, 0xfffu);
*ptr++ = 0xf0 | (ES_info_length >> 8);
*ptr++ = (ES_info_length & 0xff);
diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
index f0a4ded..191db93 100644
--- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
+++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
@@ -454,7 +454,7 @@
sp<ABuffer> data;
CHECK(msg->findBuffer("data", &data));
- CHECK_LE(channel, 0xffu);
+ CHECK_LE(channel, 0xff);
CHECK_LE(data->size(), 0xffffu);
int32_t sessionID;