From 97f3f3905a46515ab852681268fcac155840f8b8 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 7 Feb 2018 12:09:33 +0530 Subject: [PATCH] remove unused variables for compilation remove unsed variables and fix few compiler issues CRs-fixed: 2175735 Change-Id: I635a7503326928f43070aa2224bc3c3d6e1ff929 --- android/location_api/BatchingAPIClient.cpp | 2 +- android/location_api/BatchingAPIClient.h | 1 - android/location_api/GnssAPIClient.cpp | 2 +- android/location_api/MeasurementAPIClient.cpp | 4 ++-- core/LocApiBase.cpp | 2 +- core/data-items/DataItemsFactoryProxy.cpp | 2 +- core/loc_core_log.cpp | 20 ------------------- gnss/GnssAdapter.cpp | 4 ++-- gnss/XtraSystemStatusObserver.h | 4 ++-- location/LocationAPIClientBase.cpp | 1 - utils/loc_cfg.cpp | 3 --- utils/loc_nmea.cpp | 5 ----- utils/loc_target.cpp | 1 - 13 files changed, 10 insertions(+), 41 deletions(-) diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 0b66d383..43fed5c7 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -153,7 +153,7 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa mLocationCapabilitiesMask = capabilitiesMask; } -void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) +void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions /*batchOptions*/) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); if (mGnssBatchingCbIface != nullptr && count > 0) { diff --git a/android/location_api/BatchingAPIClient.h b/android/location_api/BatchingAPIClient.h index c951a83c..61e20770 100644 --- a/android/location_api/BatchingAPIClient.h +++ b/android/location_api/BatchingAPIClient.h @@ -63,7 +63,6 @@ public: private: sp mGnssBatchingCbIface; uint32_t mDefaultId; - int mBatchSize; LocationCapabilitiesMask mLocationCapabilitiesMask; }; diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 996bbeea..fac5d0b3 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -504,7 +504,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); out.numSvs = in.count; if (out.numSvs > static_cast(GnssMax::SVS_COUNT)) { - LOC_LOGW("%s]: Too many satellites %zd. Clamps to %d.", + LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.", __FUNCTION__, out.numSvs, GnssMax::SVS_COUNT); out.numSvs = static_cast(GnssMax::SVS_COUNT); } diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 731c7eda..fcdd693d 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -115,7 +115,7 @@ void MeasurementAPIClient::measurementClose() { void MeasurementAPIClient::onGnssMeasurementsCb( GnssMeasurementsNotification gnssMeasurementsNotification) { - LOC_LOGD("%s]: (count: %zu active: %zu)", + LOC_LOGD("%s]: (count: %zu active: %d)", __FUNCTION__, gnssMeasurementsNotification.count, mTracking); if (mTracking) { mMutex.lock(); @@ -246,7 +246,7 @@ static void convertGnssData(GnssMeasurementsNotification& in, { out.measurementCount = in.count; if (out.measurementCount > static_cast(GnssMax::SVS_COUNT)) { - LOC_LOGW("%s]: Too many measurement %zd. Clamps to %d.", + LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.", __FUNCTION__, out.measurementCount, GnssMax::SVS_COUNT); out.measurementCount = static_cast(GnssMax::SVS_COUNT); } diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4bc38e2e..ce0d1bc4 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -118,7 +118,7 @@ struct LocOpenMsg : public LocMsg { mLocApi->open(mMask); } inline void locallog() const { - LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", + LOC_LOGV("%s:%d]: LocOpen Mask: %" PRIu64 "\n", __func__, __LINE__, mMask); } inline virtual void log() const { diff --git a/core/data-items/DataItemsFactoryProxy.cpp b/core/data-items/DataItemsFactoryProxy.cpp index 130eecf9..e07b3cd8 100644 --- a/core/data-items/DataItemsFactoryProxy.cpp +++ b/core/data-items/DataItemsFactoryProxy.cpp @@ -68,7 +68,7 @@ IDataItemCore* DataItemsFactoryProxy::createNewDataItem(DataItemId id) getConcreteDIFunc = (get_concrete_data_item_fn * ) dlsym(dataItemLibHandle, DATA_ITEMS_GET_CONCRETE_DI); if (NULL != getConcreteDIFunc) { - LOC_LOGD("Loaded function %s : %x",DATA_ITEMS_GET_CONCRETE_DI,getConcreteDIFunc); + LOC_LOGD("Loaded function %s : %p",DATA_ITEMS_GET_CONCRETE_DI,getConcreteDIFunc); mydi = (*getConcreteDIFunc)(id); } else { diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 5a627dd9..856398f7 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -100,26 +100,6 @@ const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur) return loc_get_name_from_val(loc_eng_position_recurrences, loc_eng_position_recurrence_num, (long) recur); } - - -static const loc_name_val_s_type loc_eng_aiding_data_bits[] = -{ - NAME_VAL( LOC_GPS_DELETE_EPHEMERIS ), - NAME_VAL( LOC_GPS_DELETE_ALMANAC ), - NAME_VAL( LOC_GPS_DELETE_POSITION ), - NAME_VAL( LOC_GPS_DELETE_TIME ), - NAME_VAL( LOC_GPS_DELETE_IONO ), - NAME_VAL( LOC_GPS_DELETE_UTC ), - NAME_VAL( LOC_GPS_DELETE_HEALTH ), - NAME_VAL( LOC_GPS_DELETE_SVDIR ), - NAME_VAL( LOC_GPS_DELETE_SVSTEER ), - NAME_VAL( LOC_GPS_DELETE_SADATA ), - NAME_VAL( LOC_GPS_DELETE_RTI ), - NAME_VAL( LOC_GPS_DELETE_CELLDB_INFO ), - NAME_VAL( LOC_GPS_DELETE_ALL) -}; -static const int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); - const char* loc_get_aiding_data_mask_names(LocGpsAidingData /*data*/) { return NULL; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index bda75e9c..883922e7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -598,7 +598,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port) if ((NULL == server) || (server[0] == 0) || (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { - serverUrl[0] = NULL; + serverUrl[0] = '\0'; length = 0; mServerUrl.clear(); } else if (port > 0) { @@ -1173,7 +1173,7 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; - LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%x", __func__, mask); + LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIu64 "", __func__, mask); } if (mAgpsCbInfo.statusV4Cb != NULL) { diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 6bf3f58e..31d80834 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -47,8 +47,8 @@ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this), - mIsConnectivityStatusKnown (false) { + mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), + mIsConnectivityStatusKnown (false), mDelayLocTimer(*this) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index bb51238f..343743ad 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -153,7 +153,6 @@ uint32_t LocationAPIControlClient::locAPIGnssUpdateConfig(GnssConfig config) memcpy(&mConfig, &config, sizeof(GnssConfig)); - uint32_t session = 0; uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); if (idArray != nullptr) { diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index d2364f69..8b495b92 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -381,9 +381,6 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta uint32_t table_length) { FILE *conf_fp = NULL; - char *lasts; - loc_param_v_type config_value; - uint32_t i; if((conf_fp = fopen(conf_file_name, "r")) != NULL) { diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 6d34b512..8201e119 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -992,12 +992,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, ENTRY_LOG(); char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - char* pMarker = sentence; - int lengthRemaining = sizeof(sentence); - int length = 0; int svCount = svNotify.count; - int sentenceCount = 0; - int sentenceNumber = 1; int svNumber = 1; //Count GPS SVs for saparating GPS from GLONASS and throw others diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index cf429321..77275d47 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -213,7 +213,6 @@ detected: */ int loc_identify_lean_target() { - int ret = 0; char lean_target[PROPERTY_VALUE_MAX]; property_get("ro.lean", lean_target, ""); LOC_LOGD("%s:%d]: lean target: %s\n", __func__, __LINE__, lean_target);