From ad8cf65cc8e117524c8b6647b671b0f6904fa947 Mon Sep 17 00:00:00 2001 From: Albert I Date: Fri, 25 Jun 2021 19:34:31 +0800 Subject: [PATCH] sm7325-common: 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 --- gps/core/LocAdapterBase.cpp | 8 ++--- gps/gnss/Agps.h | 2 +- gps/gnss/GnssAdapter.cpp | 60 ++++++++++++++++++------------------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp index e741f74..94edd58 100644 --- a/gps/core/LocAdapterBase.cpp +++ b/gps/core/LocAdapterBase.cpp @@ -82,10 +82,10 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context, bool isMaster, LocAdapterProxyBase *adapterProxyBase, bool waitForDoneInit) : - mIsMaster(isMaster), mEvtMask(mask), mContext(context), - mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), - mMsgTask(context->getMsgTask()), - mIsEngineCapabilitiesKnown(ContextBase::sIsEngineCapabilitiesKnown) + mIsMaster(isMaster), + mIsEngineCapabilitiesKnown(ContextBase::sIsEngineCapabilitiesKnown), + mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()), + mLocAdapterProxyBase(adapterProxyBase), mMsgTask(context->getMsgTask()) { LOC_LOGd("waitForDoneInit: %d", waitForDoneInit); if (!waitForDoneInit) { diff --git a/gps/gnss/Agps.h b/gps/gnss/Agps.h index 8a27cd9..39aea7d 100644 --- a/gps/gnss/Agps.h +++ b/gps/gnss/Agps.h @@ -157,9 +157,9 @@ private: public: /* CONSTRUCTOR */ AgpsStateMachine(AgpsManager* agpsManager, AGpsExtType agpsType): - mFrameworkStatusV4Cb(NULL), mAgpsManager(agpsManager), mSubscriberList(), mCurrentSubscriber(NULL), mState(AGPS_STATE_RELEASED), + mFrameworkStatusV4Cb(NULL), mAgpsType(agpsType), mAPN(NULL), mAPNLen(0), mBearer(AGPS_APN_BEARER_INVALID) {}; diff --git a/gps/gnss/GnssAdapter.cpp b/gps/gnss/GnssAdapter.cpp index 22e0bf5..7a52bc0 100644 --- a/gps/gnss/GnssAdapter.cpp +++ b/gps/gnss/GnssAdapter.cpp @@ -94,15 +94,13 @@ GnssAdapter::GnssAdapter() : 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,38 +108,40 @@ GnssAdapter::GnssAdapter() : 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(), - mOdcpiStateMask(0), - mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW), + mOdcpiStateMask(0), + 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 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) { mAdapter(adapter), mApi(api), mConfigMask(configMask), - mCount(count), - mIds(nullptr) { + mIds(nullptr), + mCount(count) { if (mCount > 0) { mIds = new uint32_t[count]; if (mIds) { @@ -4022,8 +4022,8 @@ GnssAdapter::reportLatencyInfoEvent(const GnssLatencyInfo& gnssLatencyInfo) 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", @@ -5256,9 +5256,9 @@ void GnssAdapter::reportPdnTypeFromWds(int pdnType, AGpsExtType agpsType, std::s 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(mApnName.c_str()), @@ -5287,8 +5287,8 @@ void GnssAdapter::dataConnOpenCommand( 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) {