FP4: gps: Reorder initializations list to satisfy warnings
-Wreorder-ctor is a compile-time, Clang-only flag which is enabled by
default since Clang 12, which will warn whenever a specified field will
be initialized right after field specified below it. However, since it
doesn't sweep through all fields, compiler may miss some of them.
This order has been checked thoroughly through many trial and errors to
ensure that no such warns will be triggered anymore.
Change-Id: Id24cbb7277dc8d6c02767f8f365818ab6c017683
diff --git a/gps/gnss/GnssAdapter.cpp b/gps/gnss/GnssAdapter.cpp
index f3ccd99..d5f4db0 100644
--- a/gps/gnss/GnssAdapter.cpp
+++ b/gps/gnss/GnssAdapter.cpp
@@ -94,15 +94,13 @@
LocContext::getLocContext(LocContext::mLocationHalName),
true, nullptr, true),
mEngHubProxy(new EngineHubProxyBase()),
- mQDgnssListenerHDL(nullptr),
- mCdfwInterface(nullptr),
- mDGnssNeedReport(false),
- mDGnssDataUsage(false),
- mLocPositionMode(),
mNHzNeeded(false),
mSPEAlreadyRunningAtHighestInterval(false),
+ mLocPositionMode(),
mGnssSvIdUsedInPosition(),
mGnssSvIdUsedInPosAvail(false),
+ mGnssMbSvIdUsedInPosition{},
+ mGnssMbSvIdUsedInPosAvail(false),
mControlCallbacks(),
mAfwControlId(0),
mNmeaMask(0),
@@ -110,37 +108,39 @@
mGnssSeconaryBandConfig(),
mGnssSvTypeConfig(),
mGnssSvTypeConfigCb(nullptr),
+ mSupportNfwControl(true),
mLocConfigInfo{},
mNiData(),
mAgpsManager(),
+ mNfwCb(NULL),
+ mIsE911Session(NULL),
+ mIsMeasCorrInterfaceOpen(false),
+ mIsAntennaInfoInterfaceOpened(false),
+ mQDgnssListenerHDL(nullptr),
+ mCdfwInterface(nullptr),
+ mDGnssNeedReport(false),
+ mDGnssDataUsage(false),
mOdcpiRequestCb(nullptr),
mOdcpiRequestActive(false),
+ mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW),
mOdcpiTimer(this),
mOdcpiRequest(),
- mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW),
+ mLastDeleteAidingDataTime(0),
mSystemStatus(SystemStatus::getInstance(mMsgTask)),
mServerUrl(":"),
mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask),
- mBlockCPIInfo{},
- mDreIntEnabled(false),
mLocSystemInfo{},
- mNfwCb(NULL),
+ mSystemPowerState(POWER_STATE_UNKNOWN),
+ mBlockCPIInfo{},
mPowerOn(false),
mAllowFlpNetworkFixes(0),
+ mDreIntEnabled(false),
+ mNativeAgpsHandler(mSystemStatus->getOsObserver(), *this),
mGnssEnergyConsumedCb(nullptr),
mPowerStateCb(nullptr),
- mIsE911Session(NULL),
- mGnssMbSvIdUsedInPosition{},
- mGnssMbSvIdUsedInPosAvail(false),
- mSupportNfwControl(true),
- mSystemPowerState(POWER_STATE_UNKNOWN),
- mIsMeasCorrInterfaceOpen(false),
- mIsAntennaInfoInterfaceOpened(false),
- mLastDeleteAidingDataTime(0),
- mDgnssState(0),
mSendNmeaConsent(false),
- mDgnssLastNmeaBootTimeMilli(0),
- mNativeAgpsHandler(mSystemStatus->getOsObserver(), *this)
+ mDgnssState(0),
+ mDgnssLastNmeaBootTimeMilli(0)
{
LOC_LOGD("%s]: Constructor %p", __func__, this);
mLocPositionMode.mode = LOC_POSITION_MODE_INVALID;
@@ -1570,8 +1570,8 @@
mAdapter(adapter),
mApi(api),
mConfigMask(configMask),
- mCount(count),
- mIds(nullptr) {
+ mIds(nullptr),
+ mCount(count) {
if (mCount > 0) {
mIds = new uint32_t[count];
if (mIds) {
@@ -4064,8 +4064,8 @@
GnssLatencyInfo mGnssLatencyInfo;
inline MsgReportLatencyInfo(GnssAdapter& adapter,
const GnssLatencyInfo& gnssLatencyInfo) :
- mGnssLatencyInfo(gnssLatencyInfo),
- mAdapter(adapter) {}
+ mAdapter(adapter),
+ mGnssLatencyInfo(gnssLatencyInfo) {}
inline virtual void proc() const {
mAdapter.mGnssLatencyInfoQueue.push(mGnssLatencyInfo);
LOC_LOGv("mGnssLatencyInfoQueue.size after push=%zu",
@@ -5238,9 +5238,9 @@
inline MsgReportAtlPdn(GnssAdapter& adapter, int pdnType,
AgpsManager* agpsManager, AGpsExtType agpsType,
const string& apnName, AGpsBearerType bearerType) :
- LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType),
- mApnName(apnName), mBearerType(bearerType),
- mAdapter(adapter), mPdnType(pdnType) {}
+ LocMsg(), mAdapter(adapter), mPdnType(pdnType),
+ mAgpsManager(agpsManager), mAgpsType(agpsType),
+ mApnName(apnName), mBearerType(bearerType) {}
inline virtual void proc() const {
mAgpsManager->reportAtlOpenSuccess(mAgpsType,
const_cast<char*>(mApnName.c_str()),
@@ -5269,8 +5269,8 @@
inline AgpsMsgAtlOpenSuccess(GnssAdapter& adapter, AgpsManager* agpsManager,
AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType) :
- LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), mApnName(
- new char[apnLen + 1]), mBearerType(bearerType), mAdapter(adapter) {
+ LocMsg(), mAdapter(adapter), mAgpsManager(agpsManager), mAgpsType(agpsType),
+ mApnName(new char[apnLen + 1]), mBearerType(bearerType) {
LOC_LOGV("AgpsMsgAtlOpenSuccess");
if (mApnName == nullptr) {