From 460a35cbcb33fbc56f5a658b96a793b9bb8963e9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 28 Apr 2023 10:33:53 -0300 Subject: New type name 'uint' (unsigned int) --- lptypes.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lptypes.h') diff --git a/lptypes.h b/lptypes.h index e10d88b..3f860b9 100644 --- a/lptypes.h +++ b/lptypes.h @@ -83,6 +83,8 @@ typedef size_t lua_Unsigned; typedef unsigned char byte; +typedef unsigned int uint; + #define BITSPERCHAR 8 @@ -102,7 +104,7 @@ typedef struct Charset { #define clearset(s) fillset(s,0) /* number of slots needed for 'n' bytes */ -#define bytes2slots(n) (((n) - 1u) / (unsigned int)sizeof(TTree) + 1u) +#define bytes2slots(n) (((n) - 1u) / (uint)sizeof(TTree) + 1u) /* set 'b' bit in charset 'cs' */ #define setchar(cs,b) ((cs)[(b) >> 3] |= (1 << ((b) & 7))) @@ -129,8 +131,8 @@ typedef struct Charset { /* size (in instructions) for l bytes (l > 0) */ -#define instsize(l) ((int)(((l) + (unsigned int)sizeof(Instruction) - 1u) \ - / (unsigned int)sizeof(Instruction))) +#define instsize(l) ((int)(((l) + (uint)sizeof(Instruction) - 1u) \ + / (uint)sizeof(Instruction))) /* size (in elements) for a ISet instruction */ @@ -141,7 +143,7 @@ typedef struct Charset { -#define testchar(st,c) ((((unsigned int)(st)[((c) >> 3)]) >> ((c) & 7)) & 1) +#define testchar(st,c) ((((uint)(st)[((c) >> 3)]) >> ((c) & 7)) & 1) #endif -- cgit v1.2.3-55-g6feb