remove unused variables for compilation

remove unsed variables and fix few compiler issues

CRs-fixed: 2175735
Change-Id: I635a7503326928f43070aa2224bc3c3d6e1ff929
diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp
index 0b66d38..43fed5c 100644
--- a/android/location_api/BatchingAPIClient.cpp
+++ b/android/location_api/BatchingAPIClient.cpp
@@ -153,7 +153,7 @@
     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 c951a83..61e2077 100644
--- a/android/location_api/BatchingAPIClient.h
+++ b/android/location_api/BatchingAPIClient.h
@@ -63,7 +63,6 @@
 private:
     sp<IGnssBatchingCallback> mGnssBatchingCbIface;
     uint32_t mDefaultId;
-    int mBatchSize;
     LocationCapabilitiesMask mLocationCapabilitiesMask;
 };
 
diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp
index 996bbee..fac5d0b 100644
--- a/android/location_api/GnssAPIClient.cpp
+++ b/android/location_api/GnssAPIClient.cpp
@@ -504,7 +504,7 @@
     memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus));
     out.numSvs = in.count;
     if (out.numSvs > static_cast<uint32_t>(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<uint32_t>(GnssMax::SVS_COUNT);
     }
diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp
index 731c7ed..fcdd693 100644
--- a/android/location_api/MeasurementAPIClient.cpp
+++ b/android/location_api/MeasurementAPIClient.cpp
@@ -115,7 +115,7 @@
 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 @@
 {
     out.measurementCount = in.count;
     if (out.measurementCount > static_cast<uint32_t>(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<uint32_t>(GnssMax::SVS_COUNT);
     }
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index 4bc38e2..ce0d1bc 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -118,7 +118,7 @@
         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 130eecf..e07b3cd 100644
--- a/core/data-items/DataItemsFactoryProxy.cpp
+++ b/core/data-items/DataItemsFactoryProxy.cpp
@@ -68,7 +68,7 @@
             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 5a627dd..856398f 100644
--- a/core/loc_core_log.cpp
+++ b/core/loc_core_log.cpp
@@ -100,26 +100,6 @@
     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 bda75e9..883922e 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -598,7 +598,7 @@
 
         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 @@
         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 6bf3f58..31d8083 100644
--- a/gnss/XtraSystemStatusObserver.h
+++ b/gnss/XtraSystemStatusObserver.h
@@ -47,8 +47,8 @@
     // 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 bb51238..343743a 100644
--- a/location/LocationAPIClientBase.cpp
+++ b/location/LocationAPIClientBase.cpp
@@ -153,7 +153,6 @@
 
         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 d2364f6..8b495b9 100644
--- a/utils/loc_cfg.cpp
+++ b/utils/loc_cfg.cpp
@@ -381,9 +381,6 @@
                    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 6d34b51..8201e11 100644
--- a/utils/loc_nmea.cpp
+++ b/utils/loc_nmea.cpp
@@ -992,12 +992,7 @@
     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 cf42932..77275d4 100644
--- a/utils/loc_target.cpp
+++ b/utils/loc_target.cpp
@@ -213,7 +213,6 @@
 */
 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);