From 430d2b65244a21ccedb714b87c3b71ded56dbf5d Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Thu, 2 Oct 2008 12:39:50 -0400
Subject: [PATCH] use GCC unused __attribute__to remove unused variables
 warnings

done in sipvoiplink, alsalayer
---
 configure.ac            | 2 +-
 src/audio/alsalayer.cpp | 6 ++++--
 src/global.h            | 2 ++
 src/sipvoiplink.cpp     | 8 ++++----
 src/useragent.h         | 4 ++--
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index c54c194eb1..a86a1df985 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ dnl Define C++ as default language
 AC_LANG(C++)
 
 dnl Setup C++ compiler flags
-CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $USER_INCLUDES -O0 -g -Wall -Weffc++ -Wfatal-errors -Werror"
+CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $USER_INCLUDES -O0 -g -Wall -Wextra"
 
 dnl Check for header files
 AC_FUNC_ALLOCA
diff --git a/src/audio/alsalayer.cpp b/src/audio/alsalayer.cpp
index 8df372658b..e1ba97a377 100644
--- a/src/audio/alsalayer.cpp
+++ b/src/audio/alsalayer.cpp
@@ -475,9 +475,11 @@ AlsaLayer::read( void* buffer, int toCopy)
 }
 
   int
-AlsaLayer::putInCache( char code, void *buffer, int toCopy )
+AlsaLayer::putInCache( char code UNUSED, 
+                        void *buffer UNUSED, 
+                        int toCopy UNUSED )
 {
-  return 1;
+    return 1;
 }
 
   void
diff --git a/src/global.h b/src/global.h
index afdbdaf05d..b68c72671d 100644
--- a/src/global.h
+++ b/src/global.h
@@ -126,4 +126,6 @@ typedef short int16;
 #define PULSEAUDIO		  1
 #define CHECK_INTERFACE( layer , api )		  (layer == api) 
 
+#define UNUSED          __attribute__((__unused__))      
+
 #endif	// __GLOBAL_H__
diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp
index 129ad5ee3a..11dd8f2007 100644
--- a/src/sipvoiplink.cpp
+++ b/src/sipvoiplink.cpp
@@ -355,7 +355,7 @@ SIPVoIPLink::refuse (const CallID& id)
 }
 
 bool 
-SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code)
+SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code UNUSED)
 {
   SIPCall* call = getSIPCall(id);
   if (call==0) { _debug("Call doesn't exist\n"); return false; }  
@@ -382,7 +382,7 @@ SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code)
 }
 
 bool
-SIPVoIPLink::sendMessage(const std::string& to, const std::string& body)
+SIPVoIPLink::sendMessage(const std::string& to UNUSED, const std::string& body UNUSED)
 {
     return true;
 }
@@ -406,7 +406,7 @@ SIPVoIPLink::SIPOutgoingInvite(SIPCall* call)
 }
 
 bool
-SIPVoIPLink::SIPStartCall(SIPCall* call, const std::string& subject) 
+SIPVoIPLink::SIPStartCall(SIPCall* call, const std::string& subject UNUSED) 
 {
   if (!call) return false;
 
@@ -475,7 +475,7 @@ SIPVoIPLink::SIPToHeader(const std::string& to)
 }
 
 bool
-SIPVoIPLink::SIPCheckUrl(const std::string& url)
+SIPVoIPLink::SIPCheckUrl(const std::string& url UNUSED)
 {
   return true;
 }
diff --git a/src/useragent.h b/src/useragent.h
index 655ba60f51..4f885bf8d0 100644
--- a/src/useragent.h
+++ b/src/useragent.h
@@ -125,11 +125,11 @@ public:
     bool makeOutgoingCall(const std::string& to, SIPCall* call, const AccountID& id);
     pj_pool_t *getAppPool() {return _pool;}
     static pj_bool_t mod_on_rx_request(pjsip_rx_data *rdata);
-    static pj_bool_t mod_on_rx_response(pjsip_rx_data *rdata) {return PJ_SUCCESS;}
+    static pj_bool_t mod_on_rx_response(pjsip_rx_data *rdata UNUSED) {return PJ_SUCCESS;}
     static void regc_cb(struct pjsip_regc_cbparam *param);
     static void xfer_func_cb( pjsip_evsub *sub, pjsip_event *event);
     static void xfer_svr_cb(pjsip_evsub *sub, pjsip_event *event);
-    static void call_on_media_update( pjsip_inv_session *inv, pj_status_t status) {}
+    static void call_on_media_update( pjsip_inv_session *inv UNUSED, pj_status_t status UNUSED) {}
     static void call_on_state_changed( pjsip_inv_session *inv, pjsip_event *e);
     static void call_on_forked(pjsip_inv_session *inv, pjsip_event *e);
     static void call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e);
-- 
GitLab