diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp index f3f26ac94..36e3c06a5 100644 --- a/libs/gui/BufferQueueConsumer.cpp +++ b/libs/gui/BufferQueueConsumer.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #define LOG_TAG "BufferQueueConsumer" #define ATRACE_TAG ATRACE_TAG_GRAPHICS //#define LOG_NDEBUG 0 @@ -104,14 +106,16 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer, // This buffer is set to display in the near future, or // desiredPresent is garbage. Either way we don't want to drop // the previous buffer just to get this on the screen sooner. - BQ_LOGV("acquireBuffer: nodrop desire=%lld expect=%lld " - "(%lld) now=%lld", desiredPresent, expectedPresent, + BQ_LOGV("acquireBuffer: nodrop desire=%" PRId64 " expect=%" + PRId64 " (%" PRId64 ") now=%" PRId64, + desiredPresent, expectedPresent, desiredPresent - expectedPresent, systemTime(CLOCK_MONOTONIC)); break; } - BQ_LOGV("acquireBuffer: drop desire=%lld expect=%lld size=%d", + BQ_LOGV("acquireBuffer: drop desire=%" PRId64 " expect=%" PRId64 + " size=%zu", desiredPresent, expectedPresent, mCore->mQueue.size()); if (mCore->stillTracking(front)) { // Front buffer is still in mSlots, so mark the slot as free @@ -125,15 +129,16 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer, nsecs_t desiredPresent = front->mTimestamp; if (desiredPresent > expectedPresent && desiredPresent < expectedPresent + MAX_REASONABLE_NSEC) { - BQ_LOGV("acquireBuffer: defer desire=%lld expect=%lld " - "(%lld) now=%lld", desiredPresent, expectedPresent, + BQ_LOGV("acquireBuffer: defer desire=%" PRId64 " expect=%" PRId64 + " (%" PRId64 ") now=%" PRId64, + desiredPresent, expectedPresent, desiredPresent - expectedPresent, systemTime(CLOCK_MONOTONIC)); return PRESENT_LATER; } - BQ_LOGV("acquireBuffer: accept desire=%lld expect=%lld " - "(%lld) now=%lld", desiredPresent, expectedPresent, + BQ_LOGV("acquireBuffer: accept desire=%" PRId64 " expect=%" PRId64 " " + "(%" PRId64 ") now=%" PRId64, desiredPresent, expectedPresent, desiredPresent - expectedPresent, systemTime(CLOCK_MONOTONIC)); } @@ -142,7 +147,7 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer, *outBuffer = *front; ATRACE_BUFFER_INDEX(slot); - BQ_LOGV("acquireBuffer: acquiring { slot=%d/%llu buffer=%p }", + BQ_LOGV("acquireBuffer: acquiring { slot=%d/%" PRIu64 " buffer=%p }", slot, front->mFrameNumber, front->mGraphicBuffer->handle); // If the front buffer is still being tracked, update its slot state if (mCore->stillTracking(front)) { diff --git a/libs/gui/BufferQueueCore.cpp b/libs/gui/BufferQueueCore.cpp index 593b6f167..40e6884e3 100644 --- a/libs/gui/BufferQueueCore.cpp +++ b/libs/gui/BufferQueueCore.cpp @@ -173,7 +173,8 @@ status_t BufferQueueCore::setDefaultMaxBufferCountLocked(int count) { const int minBufferCount = mUseAsyncBuffer ? 2 : 1; if (count < minBufferCount || count > BufferQueueDefs::NUM_BUFFER_SLOTS) { BQ_LOGV("setDefaultMaxBufferCount: invalid count %d, should be in " - "[%d, %d]", minBufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS); + "[%d, %d]", + count, minBufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS); return BAD_VALUE; } @@ -212,8 +213,8 @@ void BufferQueueCore::freeAllBuffersLocked() { bool BufferQueueCore::stillTracking(const BufferItem* item) const { const BufferSlot& slot = mSlots[item->mSlot]; - BQ_LOGV("stillTracking: item { slot=%d/%llu buffer=%p } " - "slot { slot=%d/%llu buffer=%p }", + BQ_LOGV("stillTracking: item { slot=%d/%" PRIu64 " buffer=%p } " + "slot { slot=%d/%" PRIu64 " buffer=%p }", item->mSlot, item->mFrameNumber, (item->mGraphicBuffer.get() ? item->mGraphicBuffer->handle : 0), item->mSlot, slot.mFrameNumber, diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index f536a59c7..7017ddf81 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #define LOG_TAG "BufferQueueProducer" #define ATRACE_TAG ATRACE_TAG_GRAPHICS //#define LOG_NDEBUG 0 @@ -209,9 +211,10 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller, // our slots are empty but we have many buffers in the queue. This can // cause us to run out of memory if we outrun the consumer. Wait here if // it looks like we have too many buffers queued up. - bool tooManyBuffers = mCore->mQueue.size() > maxBufferCount; + bool tooManyBuffers = mCore->mQueue.size() + > static_cast(maxBufferCount); if (tooManyBuffers) { - BQ_LOGV("%s: queue size is %d, waiting", caller, + BQ_LOGV("%s: queue size is %zu, waiting", caller, mCore->mQueue.size()); } @@ -367,7 +370,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, eglDestroySyncKHR(eglDisplay, eglFence); } - BQ_LOGV("dequeueBuffer: returning slot=%d/%llu buf=%p flags=%#x", *outSlot, + BQ_LOGV("dequeueBuffer: returning slot=%d/%" PRIu64 " buf=%p flags=%#x", + *outSlot, mSlots[*outSlot].mFrameNumber, mSlots[*outSlot].mGraphicBuffer->handle, returnFlags); @@ -560,8 +564,8 @@ status_t BufferQueueProducer::queueBuffer(int slot, return BAD_VALUE; } - BQ_LOGV("queueBuffer: slot=%d/%llu time=%llu crop=[%d,%d,%d,%d] " - "transform=%#x scale=%s", + BQ_LOGV("queueBuffer: slot=%d/%" PRIu64 " time=%" PRIu64 + " crop=[%d,%d,%d,%d] transform=%#x scale=%s", slot, mCore->mFrameCounter + 1, timestamp, crop.left, crop.top, crop.right, crop.bottom, transform, BufferItem::scalingModeName(scalingMode)); diff --git a/libs/gui/Sensor.cpp b/libs/gui/Sensor.cpp index 70180f8a7..f161aebbe 100644 --- a/libs/gui/Sensor.cpp +++ b/libs/gui/Sensor.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -67,7 +68,8 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion) if (hwSensor->maxDelay > INT_MAX) { // Max delay is declared as a 64 bit integer for 64 bit architectures. But it should // always fit in a 32 bit integer, log error and cap it to INT_MAX. - ALOGE("Sensor maxDelay overflow error %s %lld", mName.string(), hwSensor->maxDelay); + ALOGE("Sensor maxDelay overflow error %s %" PRId64, mName.string(), + static_cast(hwSensor->maxDelay)); mMaxDelay = INT_MAX; } else { mMaxDelay = (int32_t) hwSensor->maxDelay; diff --git a/libs/gui/StreamSplitter.cpp b/libs/gui/StreamSplitter.cpp index 83e08fb87..771b263e7 100644 --- a/libs/gui/StreamSplitter.cpp +++ b/libs/gui/StreamSplitter.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #define LOG_TAG "StreamSplitter" #define ATRACE_TAG ATRACE_TAG_GRAPHICS //#define LOG_NDEBUG 0 @@ -63,7 +65,7 @@ StreamSplitter::~StreamSplitter() { } if (mBuffers.size() > 0) { - ALOGE("%d buffers still being tracked", mBuffers.size()); + ALOGE("%zu buffers still being tracked", mBuffers.size()); } } @@ -126,7 +128,7 @@ void StreamSplitter::onFrameAvailable() { LOG_ALWAYS_FATAL_IF(status != NO_ERROR, "acquiring buffer from input failed (%d)", status); - ALOGV("acquired buffer %#llx from input", + ALOGV("acquired buffer %#" PRIx64 " from input", bufferItem.mGraphicBuffer->getId()); status = mInput->detachBuffer(bufferItem.mBuf); @@ -176,7 +178,7 @@ void StreamSplitter::onFrameAvailable() { "queueing buffer to output failed (%d)", status); } - ALOGV("queued buffer %#llx to output %p", + ALOGV("queued buffer %#" PRIx64 " to output %p", bufferItem.mGraphicBuffer->getId(), output->get()); } } @@ -199,7 +201,8 @@ void StreamSplitter::onBufferReleasedByOutput( "detaching buffer from output failed (%d)", status); } - ALOGV("detached buffer %#llx from output %p", buffer->getId(), from.get()); + ALOGV("detached buffer %#" PRIx64 " from output %p", + buffer->getId(), from.get()); const sp& tracker = mBuffers.editValueFor(buffer->getId()); @@ -209,7 +212,7 @@ void StreamSplitter::onBufferReleasedByOutput( // Check to see if this is the last outstanding reference to this buffer size_t releaseCount = tracker->incrementReleaseCountLocked(); - ALOGV("buffer %#llx reference count %d (of %d)", buffer->getId(), + ALOGV("buffer %#" PRIx64 " reference count %zu (of %zu)", buffer->getId(), releaseCount, mOutputs.size()); if (releaseCount < mOutputs.size()) { return; @@ -233,7 +236,7 @@ void StreamSplitter::onBufferReleasedByOutput( LOG_ALWAYS_FATAL_IF(status != NO_ERROR, "releasing buffer to input failed (%d)", status); - ALOGV("released buffer %#llx to input", buffer->getId()); + ALOGV("released buffer %#" PRIx64 " to input", buffer->getId()); // We no longer need to track the buffer once it has been returned to the // input