]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add typedefs for 8bit (un)signed
authorNorbert Lange <nolange79@gmail.com>
Tue, 14 Dec 2021 21:33:39 +0000 (22:33 +0100)
committerNorbert Lange <nolange79@gmail.com>
Tue, 14 Dec 2021 22:47:57 +0000 (23:47 +0100)
To make code more expressive, add U8 and S8 typedefs

contrib/linux-kernel/mem.h
lib/common/mem.h

index dcdd586a9fd91555d3fb75e48ea2b4a2b5c8aa41..1d9cc03924ca9aacb3c1f1a6b4f5ad5f1eabbc9f 100644 (file)
@@ -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;
index 1c61b7e52f1b61085e96a3762aeb12cc9bb00968..85581c38478ed75a8dd2c830b73c97209cbef543 100644 (file)
@@ -51,6 +51,8 @@ extern "C" {
 #    include <stdint.h> /* 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