mirror of https://github.com/ARMmbed/mbed-os.git
Eliminate complier warning and remove superfluous call to empty()
Appears when complied with -O3 optimization level Compile: UARTSerial.cpp ../drivers/UARTSerial.cpp: In member function 'void mbed::UARTSerial::tx_irq()': ../drivers/UARTSerial.cpp:314:31: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized] SerialBase::_base_putc(data);pull/6611/head
parent
a463b075db
commit
d6c5f16fd3
|
@ -305,12 +305,11 @@ void UARTSerial::rx_irq(void)
|
|||
void UARTSerial::tx_irq(void)
|
||||
{
|
||||
bool was_full = _txbuf.full();
|
||||
char data;
|
||||
|
||||
/* Write to the peripheral if there is something to write
|
||||
* and if the peripheral is available to write. */
|
||||
while (!_txbuf.empty() && SerialBase::writeable()) {
|
||||
char data;
|
||||
_txbuf.pop(data);
|
||||
while (SerialBase::writeable() && _txbuf.pop(data)) {
|
||||
SerialBase::_base_putc(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue