From f948ffccbafdf23f34b87cf53ae14125f7d5354a Mon Sep 17 00:00:00 2001 From: "Andrew J. Kroll" Date: Fri, 1 Dec 2017 10:43:31 -0500 Subject: [PATCH] clean up annoying bogus warnings --- BTD.cpp | 6 +++--- BTHID.h | 2 +- PSBuzz.cpp | 2 +- UsbCore.h | 12 ++++++------ XBOXOLD.cpp | 2 +- XBOXRECV.cpp | 4 ++-- adk.cpp | 2 +- cdcacm.cpp | 2 +- cdcacm.h | 12 ++++++------ cdcftdi.cpp | 2 +- cdcftdi.h | 4 ++-- confdescparser.h | 4 ++-- hexdump.h | 2 +- hidboot.cpp | 4 ++-- hidboot.h | 20 ++++++++++---------- hidcomposite.h | 2 +- hidescriptorparser.cpp | 4 ++-- hiduniversal.h | 2 +- masstorage.cpp | 6 +++--- max_LCD.cpp | 2 +- message.h | 2 +- printhex.h | 2 +- usbhid.h | 4 ++-- usbhub.cpp | 2 +- 24 files changed, 53 insertions(+), 53 deletions(-) diff --git a/BTD.cpp b/BTD.cpp index df1de1b8..a465edd3 100644 --- a/BTD.cpp +++ b/BTD.cpp @@ -131,7 +131,7 @@ FailGetDevDescr: return rcode; }; -uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) { +uint8_t BTD::Init(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed) { uint8_t rcode; uint8_t num_of_conf = epInfo[1].epAddr; // Number of configurations epInfo[1].epAddr = 0; @@ -324,7 +324,7 @@ void BTD::Initialize() { } /* Extracts interrupt-IN, bulk-IN, bulk-OUT endpoint information from config descriptor */ -void BTD::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) { +void BTD::EndpointXtract(uint8_t conf, uint8_t iface __attribute__((unused)), uint8_t alt, uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *pep) { //ErrorMessage(PSTR("Conf.Val"),conf); //ErrorMessage(PSTR("Iface Num"),iface); //ErrorMessage(PSTR("Alt.Set"),alt); @@ -356,7 +356,7 @@ void BTD::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto bNumEP++; } -void BTD::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) { +void BTD::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr __attribute__((unused))) { #ifdef EXTRADEBUG Notify(PSTR("\r\nEndpoint descriptor:"), 0x80); Notify(PSTR("\r\nLength:\t\t"), 0x80); diff --git a/BTHID.h b/BTHID.h index 282b832e..7d1d1116 100644 --- a/BTHID.h +++ b/BTHID.h @@ -122,7 +122,7 @@ protected: * @param len The length of the incoming data. * @param buf Pointer to the data buffer. */ - virtual void ParseBTHIDData(uint8_t len, uint8_t *buf) { + virtual void ParseBTHIDData(uint8_t len __attribute__((unused)), uint8_t *buf __attribute__((unused))) { return; }; /** Called when a device is connected */ diff --git a/PSBuzz.cpp b/PSBuzz.cpp index 3e184de9..2d4f2123 100644 --- a/PSBuzz.cpp +++ b/PSBuzz.cpp @@ -20,7 +20,7 @@ // To enable serial debugging see "settings.h" //#define PRINTREPORT // Uncomment to print the report send by the PS Buzz Controllers -void PSBuzz::ParseHIDData(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { +void PSBuzz::ParseHIDData(USBHID *hid __attribute__((unused)), bool is_rpt_id __attribute__((unused)), uint8_t len, uint8_t *buf) { if (HIDUniversal::VID == PSBUZZ_VID && HIDUniversal::PID == PSBUZZ_PID && len > 2 && buf) { #ifdef PRINTREPORT Notify(PSTR("\r\n"), 0x80); diff --git a/UsbCore.h b/UsbCore.h index f78300ca..efa20da9 100644 --- a/UsbCore.h +++ b/UsbCore.h @@ -123,11 +123,11 @@ typedef MAX3421e MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega class USBDeviceConfig { public: - virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed) { + virtual uint8_t Init(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed __attribute__((unused))) { return 0; } - virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) { + virtual uint8_t ConfigureDevice(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed __attribute__((unused))) { return 0; } @@ -143,19 +143,19 @@ public: return 0; } - virtual void ResetHubPort(uint8_t port) { + virtual void ResetHubPort(uint8_t port __attribute__((unused))) { return; } // Note used for hubs only! - virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) { + virtual bool VIDPIDOK(uint16_t vid __attribute__((unused)), uint16_t pid __attribute__((unused))) { return false; } - virtual bool DEVCLASSOK(uint8_t klass) { + virtual bool DEVCLASSOK(uint8_t klass __attribute__((unused))) { return false; } - virtual bool DEVSUBCLASSOK(uint8_t subklass) { + virtual bool DEVSUBCLASSOK(uint8_t subklass __attribute__((unused))) { return true; } diff --git a/XBOXOLD.cpp b/XBOXOLD.cpp index 3d88ea97..bcc353b3 100644 --- a/XBOXOLD.cpp +++ b/XBOXOLD.cpp @@ -280,7 +280,7 @@ void XBOXOLD::readReport() { } } -void XBOXOLD::printReport(uint16_t length) { //Uncomment "#define PRINTREPORT" to print the report send by the Xbox controller +void XBOXOLD::printReport(uint16_t length __attribute__((unused))) { //Uncomment "#define PRINTREPORT" to print the report send by the Xbox controller #ifdef PRINTREPORT if(readBuf == NULL) return; diff --git a/XBOXRECV.cpp b/XBOXRECV.cpp index 39346b12..031713d4 100644 --- a/XBOXRECV.cpp +++ b/XBOXRECV.cpp @@ -135,7 +135,7 @@ Fail: return rcode; }; -uint8_t XBOXRECV::Init(uint8_t parent, uint8_t port, bool lowspeed) { +uint8_t XBOXRECV::Init(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed) { uint8_t rcode; AddressPool &addrPool = pUsb->GetAddressPool(); @@ -392,7 +392,7 @@ void XBOXRECV::readReport(uint8_t controller) { } } -void XBOXRECV::printReport(uint8_t controller, uint8_t nBytes) { //Uncomment "#define PRINTREPORT" to print the report send by the Xbox 360 Controller +void XBOXRECV::printReport(uint8_t controller __attribute__((unused)), uint8_t nBytes __attribute__((unused))) { //Uncomment "#define PRINTREPORT" to print the report send by the Xbox 360 Controller #ifdef PRINTREPORT if(readBuf == NULL) return; diff --git a/adk.cpp b/adk.cpp index f9631ae8..a68363bd 100644 --- a/adk.cpp +++ b/adk.cpp @@ -309,7 +309,7 @@ Fail: } /* Extracts bulk-IN and bulk-OUT endpoint information from config descriptor */ -void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) { +void ADK::EndpointXtract(uint8_t conf, uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *pep) { //ErrorMessage(PSTR("Conf.Val"), conf); //ErrorMessage(PSTR("Iface Num"), iface); //ErrorMessage(PSTR("Alt.Set"), alt); diff --git a/cdcacm.cpp b/cdcacm.cpp index 6611cd3c..a4ade113 100644 --- a/cdcacm.cpp +++ b/cdcacm.cpp @@ -228,7 +228,7 @@ Fail: return rcode; } -void ACM::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) { +void ACM::EndpointXtract(uint8_t conf, uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *pep) { //ErrorMessage (PSTR("Conf.Val"), conf); //ErrorMessage (PSTR("Iface Num"), iface); //ErrorMessage (PSTR("Alt.Set"), alt); diff --git a/cdcacm.h b/cdcacm.h index e403928e..8ef95c26 100644 --- a/cdcacm.h +++ b/cdcacm.h @@ -128,7 +128,7 @@ class ACM; class CDCAsyncOper { public: - virtual uint8_t OnInit(ACM *pacm) { + virtual uint8_t OnInit(ACM *pacm __attribute__((unused))) { return 0; }; //virtual void OnDataRcvd(ACM *pacm, uint8_t nbytes, uint8_t *dataptr) = 0; @@ -229,19 +229,19 @@ public: return rv; }; - virtual void autoflowRTS(bool s) { + virtual void autoflowRTS(bool s __attribute__((unused))) { }; - virtual void autoflowDSR(bool s) { + virtual void autoflowDSR(bool s __attribute__((unused))) { }; - virtual void autoflowXON(bool s) { + virtual void autoflowXON(bool s __attribute__((unused))) { }; - virtual void half_duplex(bool s) { + virtual void half_duplex(bool s __attribute__((unused))) { }; - virtual void wide(bool s) { + virtual void wide(bool s __attribute__((unused))) { }; // UsbConfigXtracter implementation diff --git a/cdcftdi.cpp b/cdcftdi.cpp index 14420847..9873ca88 100644 --- a/cdcftdi.cpp +++ b/cdcftdi.cpp @@ -220,7 +220,7 @@ Fail: return rcode; } -void FTDI::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) { +void FTDI::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *pep) { ErrorMessage (PSTR("Conf.Val"), conf); ErrorMessage (PSTR("Iface Num"), iface); ErrorMessage (PSTR("Alt.Set"), alt); diff --git a/cdcftdi.h b/cdcftdi.h index 0faebe6a..f6ee7e8c 100644 --- a/cdcftdi.h +++ b/cdcftdi.h @@ -79,11 +79,11 @@ class FTDI; class FTDIAsyncOper { public: - virtual uint8_t OnInit(FTDI *pftdi) { + virtual uint8_t OnInit(FTDI *pftdi __attribute__((unused))) { return 0; }; - virtual uint8_t OnRelease(FTDI *pftdi) { + virtual uint8_t OnRelease(FTDI *pftdi __attribute__((unused))) { return 0; }; }; diff --git a/confdescparser.h b/confdescparser.h index ed69b029..03366afc 100644 --- a/confdescparser.h +++ b/confdescparser.h @@ -25,7 +25,7 @@ public: //virtual void ConfigXtract(const USB_CONFIGURATION_DESCRIPTOR *conf) = 0; //virtual void InterfaceXtract(uint8_t conf, const USB_INTERFACE_DESCRIPTOR *iface) = 0; - virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) { + virtual void EndpointXtract(uint8_t conf __attribute__((unused)), uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *ep __attribute__((unused))) { }; }; @@ -81,7 +81,7 @@ UseOr(false) { }; template -void ConfigDescParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) { +void ConfigDescParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset __attribute__((unused))) { uint16_t cntdn = (uint16_t)len; uint8_t *p = (uint8_t*)pbuf; diff --git a/hexdump.h b/hexdump.h index ffa7248b..c9c7d7d0 100644 --- a/hexdump.h +++ b/hexdump.h @@ -40,7 +40,7 @@ public: }; template -void HexDumper::Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset) { +void HexDumper::Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset __attribute__((unused))) { if(UsbDEBUGlvl >= 0x80) { // Fully bypass this block of code if we do not debug. for(LEN_TYPE j = 0; j < len; j++, byteCount++, byteTotal++) { if(!byteCount) { diff --git a/hidboot.cpp b/hidboot.cpp index 757c3051..534303de 100644 --- a/hidboot.cpp +++ b/hidboot.cpp @@ -16,7 +16,7 @@ e-mail : support@circuitsathome.com */ #include "hidboot.h" -void MouseReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { +void MouseReportParser::Parse(USBHID *hid __attribute__((unused)), bool is_rpt_id __attribute__((unused)), uint8_t len __attribute__((unused)), uint8_t *buf) { MOUSEINFO *pmi = (MOUSEINFO*)buf; // Future: // bool event; @@ -124,7 +124,7 @@ void MouseReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t }; -void KeyboardReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { +void KeyboardReportParser::Parse(USBHID *hid, bool is_rpt_id __attribute__((unused)), uint8_t len __attribute__((unused)), uint8_t *buf) { // On error - return if (buf[2] == 1) return; diff --git a/hidboot.h b/hidboot.h index 6c192dac..a56ae74d 100644 --- a/hidboot.h +++ b/hidboot.h @@ -60,25 +60,25 @@ public: protected: - virtual void OnMouseMove(MOUSEINFO *mi) { + virtual void OnMouseMove(MOUSEINFO *mi __attribute__((unused))) { }; - virtual void OnLeftButtonUp(MOUSEINFO *mi) { + virtual void OnLeftButtonUp(MOUSEINFO *mi __attribute__((unused))) { }; - virtual void OnLeftButtonDown(MOUSEINFO *mi) { + virtual void OnLeftButtonDown(MOUSEINFO *mi __attribute__((unused))) { }; - virtual void OnRightButtonUp(MOUSEINFO *mi) { + virtual void OnRightButtonUp(MOUSEINFO *mi __attribute__((unused))) { }; - virtual void OnRightButtonDown(MOUSEINFO *mi) { + virtual void OnRightButtonDown(MOUSEINFO *mi __attribute__((unused))) { }; - virtual void OnMiddleButtonUp(MOUSEINFO *mi) { + virtual void OnMiddleButtonUp(MOUSEINFO *mi __attribute__((unused))) { }; - virtual void OnMiddleButtonDown(MOUSEINFO *mi) { + virtual void OnMiddleButtonDown(MOUSEINFO *mi __attribute__((unused))) { }; }; @@ -171,13 +171,13 @@ protected: return 0; }; - virtual void OnControlKeysChanged(uint8_t before, uint8_t after) { + virtual void OnControlKeysChanged(uint8_t before __attribute__((unused)), uint8_t after __attribute__((unused))) { }; - virtual void OnKeyDown(uint8_t mod, uint8_t key) { + virtual void OnKeyDown(uint8_t mod __attribute__((unused)), uint8_t key __attribute__((unused))) { }; - virtual void OnKeyUp(uint8_t mod, uint8_t key) { + virtual void OnKeyUp(uint8_t mod __attribute__((unused)), uint8_t key __attribute__((unused))) { }; virtual const uint8_t *getNumKeys() { diff --git a/hidcomposite.h b/hidcomposite.h index 515e033d..d108f45a 100644 --- a/hidcomposite.h +++ b/hidcomposite.h @@ -72,7 +72,7 @@ protected: return 0; }; - virtual void ParseHIDData(USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf) { + virtual void ParseHIDData(USBHID *hid __attribute__((unused)), uint8_t ep __attribute__((unused)), bool is_rpt_id __attribute__((unused)), uint8_t len __attribute__((unused)), uint8_t *buf __attribute__((unused))) { return; }; diff --git a/hidescriptorparser.cpp b/hidescriptorparser.cpp index 62c8dac5..43e3f7d6 100644 --- a/hidescriptorparser.cpp +++ b/hidescriptorparser.cpp @@ -990,7 +990,7 @@ const char * const ReportDescParserBase::medInstrTitles4[] PROGMEM = { pstrUsageSoftControlAdjust }; -void ReportDescParserBase::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) { +void ReportDescParserBase::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset __attribute__((unused))) { uint16_t cntdn = (uint16_t)len; uint8_t *p = (uint8_t*)pbuf; @@ -1578,7 +1578,7 @@ void ReportDescParser2::OnInputItem(uint8_t itm) { E_Notify(PSTR("\r\n"), 0x80); } -void UniversalReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { +void UniversalReportParser::Parse(USBHID *hid, bool is_rpt_id __attribute__((unused)), uint8_t len, uint8_t *buf) { ReportDescParser2 prs(len, buf); uint8_t ret = hid->GetReportDescr(0, &prs); diff --git a/hiduniversal.h b/hiduniversal.h index d64ad4cc..3aa4690a 100644 --- a/hiduniversal.h +++ b/hiduniversal.h @@ -75,7 +75,7 @@ protected: return 0; }; - virtual void ParseHIDData(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { + virtual void ParseHIDData(USBHID *hid __attribute__((unused)), bool is_rpt_id __attribute__((unused)), uint8_t len __attribute__((unused)), uint8_t *buf __attribute__((unused))) { return; }; diff --git a/masstorage.cpp b/masstorage.cpp index 4c0c37ad..0b89bc51 100644 --- a/masstorage.cpp +++ b/masstorage.cpp @@ -323,7 +323,7 @@ FailGetDevDescr: * @param lowspeed true if device is low speed * @return 0 for success */ -uint8_t BulkOnly::Init(uint8_t parent, uint8_t port, bool lowspeed) { +uint8_t BulkOnly::Init(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed) { uint8_t rcode; uint8_t num_of_conf = epInfo[1].epAddr; // number of configurations epInfo[1].epAddr = 0; @@ -540,7 +540,7 @@ Fail: * @param proto * @param pep */ -void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR * pep) { +void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR * pep) { ErrorMessage (PSTR("Conf.Val"), conf); ErrorMessage (PSTR("Iface Num"), iface); ErrorMessage (PSTR("Alt.Set"), alt); @@ -1238,7 +1238,7 @@ void BulkOnly::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) { //////////////////////////////////////////////////////////////////////////////// /* We won't be needing this... */ -uint8_t BulkOnly::Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser * prs) { +uint8_t BulkOnly::Read(uint8_t lun __attribute__((unused)), uint32_t addr __attribute__((unused)), uint16_t bsize __attribute__((unused)), uint8_t blocks __attribute__((unused)), USBReadParser * prs __attribute__((unused))) { #if MS_WANT_PARSER if(!LUNOk[lun]) return MASS_ERR_NO_MEDIA; Notify(PSTR("\r\nRead (With parser)\r\n"), 0x80); diff --git a/max_LCD.cpp b/max_LCD.cpp index 7a9b1707..f517b755 100644 --- a/max_LCD.cpp +++ b/max_LCD.cpp @@ -51,7 +51,7 @@ void Max_LCD::init() { begin(16, 1); } -void Max_LCD::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { +void Max_LCD::begin(uint8_t cols __attribute__((unused)), uint8_t lines, uint8_t dotsize) { if(lines > 1) { _displayfunction |= LCD_2LINE; } diff --git a/message.h b/message.h index c26628e7..903429a1 100644 --- a/message.h +++ b/message.h @@ -66,7 +66,7 @@ void ErrorMessage(uint8_t level, char const * msg, ERROR_TYPE rcode = 0) { } template -void ErrorMessage(char const * msg, ERROR_TYPE rcode = 0) { +void ErrorMessage(char const * msg __attribute__((unused)), ERROR_TYPE rcode __attribute__((unused)) = 0) { #ifdef DEBUG_USB_HOST Notify(msg, 0x80); Notify(PSTR(": "), 0x80); diff --git a/printhex.h b/printhex.h index 369d7e1f..b2f0af76 100644 --- a/printhex.h +++ b/printhex.h @@ -66,7 +66,7 @@ void PrintHex2(Print *prn, T val) { prn->print((T)val, HEX); } -template void D_PrintHex(T val, int lvl) { +template void D_PrintHex(T val __attribute__((unused)), int lvl __attribute__((unused))) { #ifdef DEBUG_USB_HOST PrintHex (val, lvl); #endif diff --git a/usbhid.h b/usbhid.h index feca84db..791bed35 100644 --- a/usbhid.h +++ b/usbhid.h @@ -156,7 +156,7 @@ protected: void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc); - virtual HIDReportParser* GetReportParser(uint8_t id) { + virtual HIDReportParser* GetReportParser(uint8_t id __attribute__((unused))) { return NULL; }; @@ -169,7 +169,7 @@ public: return pUsb; }; - virtual bool SetReportParser(uint8_t id, HIDReportParser *prs) { + virtual bool SetReportParser(uint8_t id __attribute__((unused)), HIDReportParser *prs __attribute__((unused))) { return false; }; diff --git a/usbhub.cpp b/usbhub.cpp index e994fadb..e4d9d79e 100644 --- a/usbhub.cpp +++ b/usbhub.cpp @@ -375,7 +375,7 @@ uint8_t USBHub::PortStatusChange(uint8_t port, HubEvent &evt) { return 0; } -void PrintHubPortStatus(USBHub *hubptr, uint8_t addr, uint8_t port, bool print_changes) { +void PrintHubPortStatus(USBHub *hubptr, uint8_t addr __attribute__((unused)), uint8_t port, bool print_changes) { uint8_t rcode = 0; HubEvent evt;