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

Commit 860ef880 authored by Aditya Kumar's avatar Aditya Kumar
Browse files

Disable warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute

```
frameworks/native/services/surfaceflinger/Scheduler/Scheduler.cpp:492:29: error: ignoring tempora
ry created by a constructor declared with 'nodiscard' attribute [-Werror,-Wunused-value]
  492 |                            (std::scoped_lock(mDisplayLock), displayId == mPacesetterDispl
ayId));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
frameworks/native/include/ftl/fake_guard.h:85:72: note: expanded from macro 'FTL_FAKE_GUARD'
   85 |   FTL_MAKE_FAKE_GUARD(__VA_ARGS__, FTL_FAKE_GUARD2, FTL_FAKE_GUARD1, )(__VA_ARGS__)
      |                                                                        ^~~~~~~~~~~
frameworks/native/include/ftl/fake_guard.h:80:38: note: expanded from macro 'FTL_FAKE_GUARD2'
   80 |     (android::ftl::FakeGuard(mutex), expr)
      |                                      ^~~~
frameworks/native/services/surfaceflinger/Scheduler/Scheduler.cpp:916:27: error: ignoring temporary created by a constructor declared with 'nodiscard' attribute [-Werror,-Wunused-value]
```

Flag: EXEMPT b/369277774
Bug: b/369277774
Change-Id: I6b89de7a127753e435ab70b3ff392e0a84ecc31c
parent 521e071a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -486,6 +486,8 @@ void Scheduler::setDuration(Cycle cycle, std::chrono::nanoseconds workDuration,
    }
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
void Scheduler::updatePhaseConfiguration(PhysicalDisplayId displayId, Fps refreshRate) {
    const bool isPacesetter =
            FTL_FAKE_GUARD(kMainThreadContext,
@@ -497,6 +499,7 @@ void Scheduler::updatePhaseConfiguration(PhysicalDisplayId displayId, Fps refres
    setVsyncConfig(mVsyncModulator->setVsyncConfigSet(mVsyncConfiguration->getCurrentConfigs()),
                   refreshRate.getPeriod());
}
#pragma clang diagnostic pop

void Scheduler::setActiveDisplayPowerModeForRefreshRateStats(hal::PowerMode powerMode) {
    mRefreshRateStats->setPowerMode(powerMode);
@@ -912,6 +915,8 @@ void Scheduler::dumpVsync(std::string& out) const {
    }
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
void Scheduler::updateFrameRateOverrides(GlobalSignals consideredSignals, Fps displayRefreshRate) {
    const bool changed = (std::scoped_lock(mPolicyLock),
                          updateFrameRateOverridesLocked(consideredSignals, displayRefreshRate));
@@ -920,6 +925,7 @@ void Scheduler::updateFrameRateOverrides(GlobalSignals consideredSignals, Fps di
        onFrameRateOverridesChanged();
    }
}
#pragma clang diagnostic pop

bool Scheduler::updateFrameRateOverridesLocked(GlobalSignals consideredSignals,
                                               Fps displayRefreshRate) {