]> git.proxmox.com Git - mirror_edk2.git/commit
EmbeddedPkg/GdbSerialLib: avoid left shift of negative quantity
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 18 Jun 2018 20:46:36 +0000 (22:46 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 18 Jun 2018 22:05:26 +0000 (00:05 +0200)
commit02ec23abebcb271a16fae94f8e3659bb9282880d
treeee5ca40d013b282ec41acffcb0b3a554fd155c30
parent1f739a851ce8ea8c9c4d9c4c7a5862fd44ab6ab4
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>
EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c