From 1231a63a4c7277d222096a5ff61033cda5ab0033 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Fri, 15 Jun 2018 18:55:00 -0500 Subject: [PATCH] Fix various USB warnings Fix the following warnings: -[Warning] USBTester.cpp@45,0: #1299-D: members and base-classes will be initialized in declaration order, not in member initialisation list order -[Warning] USBTester.h@41,0: #1300-D: ~USBTester inherits implicit virtual -[Warning] USBAudio.cpp@345,0: #1035-D: single-precision operand implicitly converted to double-precision -[Warning] USBHID.cpp@29,0: #1300-D: ~AsyncSend inherits implicit virtual -[Warning] USBHID.cpp@61,0: #1300-D: ~AsyncRead inherits implicit virtual -[Warning] USBHID.cpp@93,0: #1300-D: ~AsyncWait inherits implicit virtual -[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] --- TESTS/usb_device/basic/USBTester.cpp | 5 +++-- TESTS/usb_device/basic/USBTester.h | 2 +- usb/device/USBAudio/USBAudio.cpp | 2 +- usb/device/USBDevice/EndpointResolver.cpp | 2 +- usb/device/USBHID/USBHID.cpp | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/TESTS/usb_device/basic/USBTester.cpp b/TESTS/usb_device/basic/USBTester.cpp index fa484115607..4a62b91f0c2 100644 --- a/TESTS/usb_device/basic/USBTester.cpp +++ b/TESTS/usb_device/basic/USBTester.cpp @@ -41,8 +41,9 @@ USBTester::USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint16_t product_release): - USBDevice(phy, vendor_id, product_id, product_release), reset_count(0), suspend_count(0), - resume_count(0), interface_0_alt_set(NONE), interface_1_alt_set(NONE), configuration_set(NONE) + USBDevice(phy, vendor_id, product_id, product_release), interface_0_alt_set(NONE), + interface_1_alt_set(NONE), configuration_set(NONE), reset_count(0), + suspend_count(0), resume_count(0) { EndpointResolver resolver(endpoint_table()); diff --git a/TESTS/usb_device/basic/USBTester.h b/TESTS/usb_device/basic/USBTester.h index 5cae22ac2b1..1f9349387eb 100644 --- a/TESTS/usb_device/basic/USBTester.h +++ b/TESTS/usb_device/basic/USBTester.h @@ -38,7 +38,7 @@ class USBTester: public USBDevice { */ USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint16_t product_release); - ~USBTester(); + virtual ~USBTester(); /* * diff --git a/usb/device/USBAudio/USBAudio.cpp b/usb/device/USBAudio/USBAudio.cpp index dfd04ced263..abd899ab45f 100644 --- a/usb/device/USBAudio/USBAudio.cpp +++ b/usb/device/USBAudio/USBAudio.cpp @@ -342,7 +342,7 @@ float USBAudio::get_volume() { lock(); - float ret = _mute ? 0.0 : _volume; + float ret = _mute ? 0.0f : _volume; unlock(); return ret; diff --git a/usb/device/USBDevice/EndpointResolver.cpp b/usb/device/USBDevice/EndpointResolver.cpp index ad45006bb2e..e06b8929600 100644 --- a/usb/device/USBDevice/EndpointResolver.cpp +++ b/usb/device/USBDevice/EndpointResolver.cpp @@ -122,7 +122,7 @@ int EndpointResolver::next_index(usb_ep_type_t type, bool in_not_out) continue; } - if (shared && (1 << other)) { + if (shared && (_used & (1 << other))) { // This endpoint can only be one direction at a time and is in // use by the other direction continue; diff --git a/usb/device/USBHID/USBHID.cpp b/usb/device/USBHID/USBHID.cpp index 8045459f161..14bc74ee06f 100644 --- a/usb/device/USBHID/USBHID.cpp +++ b/usb/device/USBHID/USBHID.cpp @@ -26,7 +26,7 @@ class USBHID::AsyncSend: public AsyncOp { } - ~AsyncSend() + virtual ~AsyncSend() { } @@ -58,7 +58,7 @@ class USBHID::AsyncRead: public AsyncOp { } - ~AsyncRead() + virtual ~AsyncRead() { } @@ -90,7 +90,7 @@ class USBHID::AsyncWait: public AsyncOp { } - ~AsyncWait() + virtual ~AsyncWait() { }