Revert "libpayload: Define UCHAR_MAX/CHAR_MIN/CHAR_MAX"

This reverts commit 4f13f72dbc ("libpayload: Define UCHAR_MAX/CHAR_MIN/CHAR_MAX").

Reason for revert: char can be either signed or unsigned. If it's
unsigned, then CHAR_MIN would be incorrectly defined as 128.

Change-Id: Id49ddfff2d91029dc191b8b64e8e3f325ad0a462
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89469
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Yu-Ping Wu 2025-10-09 07:31:12 +00:00
commit af8b15ae04

View file

@ -41,10 +41,6 @@
#define CHAR_BIT 8
#define UCHAR_MAX ((unsigned char)~0U)
#define CHAR_MIN ((char)(UCHAR_MAX & ~(UCHAR_MAX >> 1)))
#define CHAR_MAX ((char)(UCHAR_MAX >> 1))
#define USHRT_MAX ((unsigned short int)~0U)
#define SHRT_MIN ((short int)(USHRT_MAX & ~(USHRT_MAX >> 1)))
#define SHRT_MAX ((short int)(USHRT_MAX >> 1))