From 217e7544897c45976a7feff5fbe9c19627e94dfd Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 14 Mar 2016 15:30:09 +0530 Subject: [PATCH] Enabling CLANG compilation and fixing all resulting errors Removing statement to set LOCAL_CLANG flag explicity to true. It will be true by default. Change-Id: I2eaba5a89e64088e3383b962dceaaa7e975e997a CRs-Fixed: 989476 --- core/LBSProxyBase.h | 20 +++++++++++++++++--- core/LocAdapterBase.h | 10 ++++++++-- core/LocAdapterProxyBase.h | 5 +++++ core/LocApiBase.h | 10 ++++++++-- core/UlpProxyBase.h | 25 +++++++++++++++++++++++-- utils/Android.mk | 5 ++--- 6 files changed, 63 insertions(+), 12 deletions(-) diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 0faf8012..b3736c20 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -43,6 +43,10 @@ class LBSProxyBase { getLocApi(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, ContextBase* context) const { + + (void)msgTask; + (void)exMask; + (void)context; return NULL; } protected: @@ -50,11 +54,21 @@ protected: public: inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, - unsigned long capabilities) const {} + unsigned long capabilities) const { + + (void)adapter; + (void)capabilities; + } inline virtual bool hasAgpsExtendedCapabilities() const { return false; } inline virtual bool hasCPIExtendedCapabilities() const { return false; } - inline virtual void modemPowerVote(bool power) const {} - virtual void injectFeatureConfig(ContextBase* context) const {} + inline virtual void modemPowerVote(bool power) const { + + (void)power; + } + virtual void injectFeatureConfig(ContextBase* context) const { + + (void)context; + } inline virtual IzatDevId_t getIzatDevId() const { return 0; } }; diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 5f4660b8..4ed1704f 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -80,10 +80,16 @@ public: // This will be overridden by the individual adapters // if necessary. - inline virtual void setUlpProxy(UlpProxyBase* ulp) {} + inline virtual void setUlpProxy(UlpProxyBase* ulp) { + + (void)ulp; + } virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); - inline virtual void setPositionModeInt(LocPosMode& posMode) {} + inline virtual void setPositionModeInt(LocPosMode& posMode) { + + (void)posMode; + } virtual void startFixInt() {} virtual void stopFixInt() {} virtual void getZppInt() {} diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 1ddcca4c..11859de7 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -61,6 +61,11 @@ public: GpsLocationExtended &locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask) { + + (void)location; + (void)locationExtended; + (void)status; + (void)loc_technology_mask; return false; } }; diff --git a/core/LocApiBase.h b/core/LocApiBase.h index b1c3d30a..713ca916 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -214,9 +214,15 @@ public: virtual void installAGpsCert(const DerEncodedCertificate* pData, size_t length, uint32_t slotBitMask); - inline virtual void setInSession(bool inSession) {} + inline virtual void setInSession(bool inSession) { + + (void)inSession; + } inline bool isMessageSupported (LocCheckingMessagesID msgID) const { - if (msgID > (sizeof(mSupportedMsg) << 3)) { + + // confirm if msgID is not larger than the number of bits in + // mSupportedMsg + if ((uint64_t)msgID > (sizeof(mSupportedMsg) << 3)) { return false; } else { uint32_t messageChecker = 1 << msgID; diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 59e265e8..50a43fd9 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -57,24 +57,45 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask) { + (void)location; + (void)locationExtended; + (void)locationExt; + (void)status; + (void)loc_technology_mask; return false; } inline virtual bool reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { + (void)svStatus; + (void)locationExtended; + (void)svExt; return false; } inline virtual bool reportStatus(GpsStatusValue status) { + + (void)status; return false; } - inline virtual void setAdapter(LocAdapterBase* adapter) {} - inline virtual void setCapabilities(unsigned long capabilities) {} + inline virtual void setAdapter(LocAdapterBase* adapter) { + + (void)adapter; + } + inline virtual void setCapabilities(unsigned long capabilities) { + + (void)capabilities; + } inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, bool active) { + + (void)options; + (void)active; return false; } inline virtual bool reportPositions(const FlpExtLocation* locations, int32_t number_of_locations) { + (void)locations; + (void)number_of_locations; return false; } }; diff --git a/utils/Android.mk b/utils/Android.mk index 37512a58..240d11fa 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -25,10 +25,10 @@ LOCAL_SRC_FILES += \ MsgTask.cpp \ loc_misc_utils.cpp +# Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ \ - -std=c++11 + -D_ANDROID_ ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER @@ -60,7 +60,6 @@ LOCAL_COPY_HEADERS:= \ loc_misc_utils.h LOCAL_MODULE := libgps.utils -LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional