Ardupilot2/libraries/AP_HAL
Lucas De Marchi 97022a4161 AP_HAL: RingBuffer: fix macro expansion
Fix warning that reveals a real bug:

In file included from libraries/AP_HAL_Linux/UARTDriver.cpp:25:0:
libraries/AP_HAL_Linux/UARTDriver.cpp: In member function 'virtual bool Linux::UARTDriver::tx_pending()':
libraries/AP_HAL/utility/RingBuffer.h:21:35: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
 #define BUF_EMPTY(buf) buf##_head == buf##_tail
                                   ^
libraries/AP_HAL_Linux/UARTDriver.cpp:355:13: note: in expansion of macro 'BUF_EMPTY'
     return !BUF_EMPTY(_writebuf);

The problem is when there's a ! operator: without the parenthesis we would actually be doing

    return !_write_buf_head == _write_buf_tail

which is not what we want.
2015-12-28 21:50:27 -02:00
..
examples Global: don't link with AP_Progmem 2015-12-27 15:58:12 -02:00
utility AP_HAL: RingBuffer: fix macro expansion 2015-12-28 21:50:27 -02:00
AnalogIn.h AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
AP_HAL_Boards.h AP_HAL: enable HAL_QURT 2015-12-27 16:21:25 +11:00
AP_HAL_Macros.h AP_HAL: use noreturn attribute on panic 2015-06-08 21:09:08 +10:00
AP_HAL_Main.h AP_HAL: enable HAL_QURT 2015-12-27 16:21:25 +11:00
AP_HAL_Namespace.h AP_HAL: Add support for an Optflow driver 2015-12-18 17:56:03 +11:00
AP_HAL.h AP_HAL: Add support for an Optflow driver 2015-12-18 17:56:03 +11:00
GPIO.h AP_HAL: make new GPIO functions optional 2015-09-14 14:22:16 +10:00
HAL.cpp AP_HAL: add run() method 2015-10-21 09:16:07 +11:00
HAL.h AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
I2CDriver.h AP_HAL: fixed typo in do_transfer declaration 2015-12-01 07:18:10 +11:00
OpticalFlow.h AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
RCInput.h AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
RCOutput.h AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
Scheduler.h AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
Semaphores.h AP_HAL: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
SPIDriver.h AP_HAL: remove state leftover from SPIDeviceDriver 2015-12-08 11:10:23 +11:00
Storage.h AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
system.h Global: Rename printf format attribute 2015-12-01 07:22:12 +11:00
UARTDriver.cpp AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
UARTDriver.h Global: Rename printf format attribute 2015-12-01 07:22:12 +11:00
Util.cpp AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
Util.h AP_HAL: added a new_semaphore() interface to Util 2015-12-20 17:55:39 +11:00