sm8350-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
This commit is contained in:
Albert I 2021-06-25 19:34:31 +08:00 committed by Arian
parent c3b3bc2886
commit e05f48f56c
4 changed files with 35 additions and 35 deletions

View File

@ -45,10 +45,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) {

View File

@ -293,7 +293,7 @@ public:
mConnected(connected),
mRoaming(roaming),
mNetworkHandle(networkHandle),
mId(NETWORKINFO_DATA_ITEM_ID), mApn(apn) {
mApn(apn), mId(NETWORKINFO_DATA_ITEM_ID) {
mAllNetworkHandles[0].networkHandle = networkHandle;
mAllNetworkHandles[0].networkType = initialType;
}

View File

@ -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) {};

View File

@ -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,37 +108,39 @@ 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(),
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 @@ 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) {
@ -4064,8 +4064,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",
@ -5238,9 +5238,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<char*>(mApnName.c_str()),
@ -5269,8 +5269,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) {