EmbeddedPkg/GdbSerialLib: avoid left shift of negative quantity

Clang complains about left shifting a negative value being undefined.

  EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c:151:30:
  error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
  OutputData = (UINT8)((~DLAB<<7)|((BreakSet<<6)|((Parity<<3)|((StopBits<<2)| Data))));

Redefine all bit pattern constants as unsigned to work around this.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel 2018-06-18 22:46:36 +02:00
parent 1f739a851c
commit 02ec23abeb
1 changed files with 5 additions and 5 deletions

View File

@ -40,11 +40,11 @@
//---------------------------------------------
// UART Register Bit Defines
//---------------------------------------------
#define LSR_TXRDY 0x20
#define LSR_RXDA 0x01
#define DLAB 0x01
#define ENABLE_FIFO 0x01
#define CLEAR_FIFOS 0x06
#define LSR_TXRDY 0x20U
#define LSR_RXDA 0x01U
#define DLAB 0x01U
#define ENABLE_FIFO 0x01U
#define CLEAR_FIFOS 0x06U