From: Lars Op den Kamp Date: Tue, 10 Jan 2012 09:15:16 +0000 (+0100) Subject: cec: silence all 'unused' compiler warnings X-Git-Tag: upstream/2.2.0~1^2~41^2~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1de6617c9b9b4c83f7d1318038dcd9a20b9612e6;p=deb_libcec.git cec: silence all 'unused' compiler warnings --- diff --git a/include/cectypes.h b/include/cectypes.h index f2b2f02..ab4dcd8 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -864,6 +864,15 @@ typedef struct cec_logical_addresses #endif } cec_logical_addresses; +#ifdef UNUSED +#elif defined(__GNUC__) +#define UNUSED(x) UNUSED_ ## x __attribute__((unused)) +#elif defined(__LCLINT__) +#define UNUSED(x) /*@unused@*/ x +#else +#define UNUSED(x) x +#endif + #ifdef __cplusplus }; }; diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index 54077d6..9364874 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -302,6 +302,9 @@ bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38 m_processor->AddLog(CEC_LOG_DEBUG, "could not create a communication thread"); } + //TODO implement the timeout. use the variable for now to silence the compiler warning + iTimeoutMs = 0; + return false; } diff --git a/src/lib/AdapterDetection.cpp b/src/lib/AdapterDetection.cpp index de1da7c..f068099 100644 --- a/src/lib/AdapterDetection.cpp +++ b/src/lib/AdapterDetection.cpp @@ -324,5 +324,7 @@ uint8_t CAdapterDetection::FindAdapters(cec_adapter *deviceList, uint8_t iBufSiz } #endif + iBufSize = 0; /* silence "unused" warning on linux/osx */ + return iFound; } diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 5071ec6..68e8fbf 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -1397,7 +1397,7 @@ const char *CCECProcessor::ToString(const cec_system_audio_status mode) } } -const char *CCECProcessor::ToString(const cec_audio_status status) +const char *CCECProcessor::ToString(const cec_audio_status UNUSED(status)) { // TODO this is a mask return "TODO"; diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 40b4f07..bed4ff9 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -639,6 +639,11 @@ bool CCECCommandHandler::HandleUserControlRelease(const cec_command &command) return true; } +bool CCECCommandHandler::HandleVendorCommand(const cec_command & UNUSED(command)) +{ + return true; +} + void CCECCommandHandler::UnhandledCommand(const cec_command &command) { CStdString strLog; diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index 0e3602d..71badde 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -122,7 +122,7 @@ namespace CEC virtual bool HandleTextViewOn(const cec_command &command); virtual bool HandleUserControlPressed(const cec_command &command); virtual bool HandleUserControlRelease(const cec_command &command); - virtual bool HandleVendorCommand(const cec_command &command) { return true; } + virtual bool HandleVendorCommand(const cec_command &command); virtual void UnhandledCommand(const cec_command &command); virtual unsigned int GetMyDevices(std::vector &devices) const; diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 9a0bf3a..953b6b1 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -423,7 +423,7 @@ bool ProcessCommandOSD(ICECAdapter *parser, const string &command, string &argum return false; } -bool ProcessCommandAS(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandAS(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "as") { @@ -435,7 +435,7 @@ bool ProcessCommandAS(ICECAdapter *parser, const string &command, string &argume } -bool ProcessCommandPING(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandPING(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "ping") { @@ -446,7 +446,7 @@ bool ProcessCommandPING(ICECAdapter *parser, const string &command, string &argu return false; } -bool ProcessCommandVOLUP(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandVOLUP(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "volup") { @@ -459,7 +459,7 @@ bool ProcessCommandVOLUP(ICECAdapter *parser, const string &command, string &arg return false; } -bool ProcessCommandVOLDOWN(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandVOLDOWN(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "voldown") { @@ -472,7 +472,7 @@ bool ProcessCommandVOLDOWN(ICECAdapter *parser, const string &command, string &a return false; } -bool ProcessCommandMUTE(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandMUTE(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "mute") { @@ -500,7 +500,7 @@ bool ProcessCommandMON(ICECAdapter *parser, const string &command, string &argum return false; } -bool ProcessCommandBL(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandBL(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "bl") { @@ -619,7 +619,7 @@ bool ProcessCommandNAME(ICECAdapter *parser, const string &command, string &argu return false; } -bool ProcessCommandLAD(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandLAD(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "lad") { @@ -674,7 +674,7 @@ bool ProcessCommandAT(ICECAdapter *parser, const string &command, string &argume return false; } -bool ProcessCommandR(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandR(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "r") { @@ -694,7 +694,7 @@ bool ProcessCommandR(ICECAdapter *parser, const string &command, string &argumen return false; } -bool ProcessCommandH(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandH(ICECAdapter * UNUSED(parser), const string &command, string & UNUSED(arguments)) { if (command == "h" || command == "help") { @@ -705,7 +705,7 @@ bool ProcessCommandH(ICECAdapter *parser, const string &command, string &argumen return false; } -bool ProcessCommandLOG(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandLOG(ICECAdapter * UNUSED(parser), const string &command, string &arguments) { if (command == "log") { @@ -725,7 +725,7 @@ bool ProcessCommandLOG(ICECAdapter *parser, const string &command, string &argum return false; } -bool ProcessCommandSCAN(ICECAdapter *parser, const string &command, string &arguments) +bool ProcessCommandSCAN(ICECAdapter *parser, const string &command, string & UNUSED(arguments)) { if (command == "scan") {