From 99923dfc1a93479d7024289a87ac5a4749c701a7 Mon Sep 17 00:00:00 2001 From: Norbert Lange Date: Tue, 14 Dec 2021 22:33:39 +0100 Subject: [PATCH] Add typedefs for 8bit (un)signed To make code more expressive, add U8 and S8 typedefs --- contrib/linux-kernel/mem.h | 2 ++ lib/common/mem.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/contrib/linux-kernel/mem.h b/contrib/linux-kernel/mem.h index dcdd586a9..1d9cc0392 100644 --- a/contrib/linux-kernel/mem.h +++ b/contrib/linux-kernel/mem.h @@ -30,6 +30,8 @@ * Basic Types *****************************************************************/ typedef uint8_t BYTE; +typedef uint8_t U8; +typedef int8_t S8; typedef uint16_t U16; typedef int16_t S16; typedef uint32_t U32; diff --git a/lib/common/mem.h b/lib/common/mem.h index 1c61b7e52..85581c384 100644 --- a/lib/common/mem.h +++ b/lib/common/mem.h @@ -51,6 +51,8 @@ extern "C" { # include /* intptr_t */ # endif typedef uint8_t BYTE; + typedef uint8_t U8; + typedef int8_t S8; typedef uint16_t U16; typedef int16_t S16; typedef uint32_t U32; @@ -63,6 +65,8 @@ extern "C" { # error "this implementation requires char to be exactly 8-bit type" #endif typedef unsigned char BYTE; + typedef unsigned char U8; + typedef signed char S8; #if USHRT_MAX != 65535 # error "this implementation requires short to be exactly 16-bit type" #endif