Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3ce49da authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Remove some clang warnings

Fix some clang warnings:
1. Unused variable (use constexpr instead of #define)
2. -Wextra warnings
3. Remove unused import

Bug: 167947340
Test: compile and observe warnings

Change-Id: Ie4a7bb1aad30f0e6556d23621ec6268185bec536
parent 5c78b180
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include <input/InputTransport.h>

#include <android/os/BnInputFlinger.h>
#include <android/os/IInputFlinger.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#define DEBUG_VIRTUAL_KEYS 0

// Log debug messages about pointers.
#define DEBUG_POINTERS 0
static constexpr bool DEBUG_POINTERS = false;

// Log debug messages about pointer assignment calculations.
#define DEBUG_POINTER_ASSIGNMENT 0
+15 −15
Original line number Diff line number Diff line
@@ -95,13 +95,13 @@ void MultiTouchMotionAccumulator::process(const RawEvent* rawEvent) {
        }

        if (mCurrentSlot < 0 || size_t(mCurrentSlot) >= mSlotCount) {
#if DEBUG_POINTERS
            if (DEBUG_POINTERS) {
                if (newSlot) {
                    ALOGW("MultiTouch device emitted invalid slot index %d but it "
                          "should be between 0 and %zd; ignoring this slot.",
                          mCurrentSlot, mSlotCount - 1);
                }
#endif
            }
        } else {
            Slot* slot = &mSlots[mCurrentSlot];
            // If mUsingSlotsProtocol is true, it means the raw pointer has axis info of
@@ -273,19 +273,19 @@ void MultiTouchInputMapper::syncTouch(nsecs_t when, RawState* outState) {
            if (id) {
                outState->rawPointerData.canceledIdBits.markBit(id.value());
            }
#if DEBUG_POINTERS
            ALOGI("Stop processing slot %zu for it received a palm event from device %s", inIndex,
                  getDeviceName().c_str());
#endif
            if (DEBUG_POINTERS) {
                ALOGI("Stop processing slot %zu for it received a palm event from device %s",
                      inIndex, getDeviceName().c_str());
            }
            continue;
        }

        if (outCount >= MAX_POINTERS) {
#if DEBUG_POINTERS
            if (DEBUG_POINTERS) {
                ALOGD("MultiTouch device %s emitted more than maximum of %d pointers; "
                      "ignoring the rest.",
                      getDeviceName().c_str(), MAX_POINTERS);
#endif
            }
            break; // too many fingers!
        }

+3 −4
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wextra"

#undef LOG_TAG
#define LOG_TAG "BufferQueueLayer"
@@ -171,7 +170,7 @@ uint64_t BufferQueueLayer::getFrameNumber(nsecs_t expectedPresentTime) const {
        expectedPresentTime = 0;
    }

    for (int i = 1; i < mQueueItems.size(); i++) {
    for (size_t i = 1; i < mQueueItems.size(); i++) {
        const bool fenceSignaled =
                mQueueItems[i].item.mFenceTime->getSignalTime() != Fence::SIGNAL_TIME_PENDING;
        if (!fenceSignaled) {
@@ -243,7 +242,7 @@ status_t BufferQueueLayer::updateTexImage(bool& recomputeVisibleRegions, nsecs_t
    uint64_t lastSignaledFrameNumber = mLastFrameNumberReceived;
    {
        Mutex::Autolock lock(mQueueItemLock);
        for (int i = 0; i < mQueueItems.size(); i++) {
        for (size_t i = 0; i < mQueueItems.size(); i++) {
            bool fenceSignaled =
                    mQueueItems[i].item.mFenceTime->getSignalTime() != Fence::SIGNAL_TIME_PENDING;
            if (!fenceSignaled) {
@@ -629,4 +628,4 @@ void BufferQueueLayer::ContentsChangedListener::abandon() {
} // namespace android

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop // ignored "-Wconversion -Wextra"
#pragma clang diagnostic pop // ignored "-Wconversion"