3030#include < string>
3131#include < memory>
3232#include < mutex>
33+ #include < cstdint>
3334
3435// FIX - split Terminal into core class and PosTerm
3536
4647#define EOD_NOSETTLE 4
4748
4849
49- enum page_id {
50+ enum page_id : std:: int8_t {
5051/* ************************************************************
5152 * NOTE: enums always increment. Initializing this structure to
5253 * -10 is done for consistancy with original #define
@@ -66,7 +67,7 @@ enum page_id {
6667 PAGEID_LOGIN
6768};
6869
69- enum jump_tags {
70+ enum jump_tags : std:: uint8_t {
7071 JUMP_NONE, // Don't jump
7172 JUMP_NORMAL, // Jump to page, push current page onto stack
7273 JUMP_STEALTH, // Jump to page (don't put current page on stack)
@@ -83,7 +84,7 @@ constexpr int SCRIPT_STACK_SIZE = 32;
8384constexpr int TITLE_HEIGHT = 32 ;
8485
8586// Terminal Types
86- enum term_types {
87+ enum term_types : std:: uint8_t {
8788 TERMINAL_ORDER_ONLY, // can order but no settling at this term
8889 TERMINAL_NORMAL, // normal operation
8990 TERMINAL_BAR, // alternate menu index, pay & settle at once
@@ -150,7 +151,7 @@ constexpr int COLOR_PAGE_DEFAULT = 254; // color determined by page setting
150151constexpr int COLOR_CLEAR = 253 ; // text not rendered
151152constexpr int COLOR_UNCHANGED = 252 ; // don't change value (or treat as default)
152153
153- enum colors {
154+ enum colors : std:: uint8_t {
154155 COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN,
155156 COLOR_BLUE, COLOR_YELLOW, COLOR_BROWN, COLOR_ORANGE,
156157 COLOR_PURPLE, COLOR_TEAL, COLOR_GRAY, COLOR_MAGENTA,
@@ -162,14 +163,14 @@ enum colors {
162163constexpr int SHADOW_DEFAULT = 256 ;
163164
164165// Text Alignment
165- enum text_align {
166+ enum text_align : std:: uint8_t {
166167 ALIGN_LEFT,
167168 ALIGN_CENTER,
168169 ALIGN_RIGHT
169170};
170171
171172// Shape Types
172- enum shapes {
173+ enum shapes : std:: uint8_t {
173174 SHAPE_RECTANGLE = 1 ,
174175 SHAPE_DIAMOND,
175176 SHAPE_CIRCLE,
@@ -184,7 +185,7 @@ constexpr int FRAME_INSET = 32; // top-bottom, left-right colors switched
184185constexpr int FRAME_2COLOR = 64 ; // 2 colors used instead of 4
185186
186187// Fonts
187- enum font_info {
188+ enum font_info : std:: uint8_t {
188189 FONT_DEFAULT = 0 ,
189190 FONT_TIMES_48 = 1 ,
190191 FONT_TIMES_48B = 2 ,
@@ -259,7 +260,7 @@ enum font_info {
259260#define TABOPEN_CANCEL 4
260261
261262// Cursor Types
262- enum cursors_style {
263+ enum cursors_style : std:: uint8_t {
263264 CURSOR_DEFAULT,
264265 CURSOR_BLANK,
265266 CURSOR_POINTER,
@@ -287,6 +288,11 @@ class CharQueue;
287288class Settings ;
288289struct BatchItem ;
289290
291+ #if defined(__clang__)
292+ #pragma clang diagnostic push
293+ #pragma clang diagnostic ignored "-Wanalyzer-optin.performance.Padding"
294+ #endif
295+
290296class Terminal
291297{
292298// private data
@@ -688,6 +694,10 @@ public:
688694 friend int CloneTerminal (Terminal *, const char * , const char * );
689695};
690696
697+ #if defined(__clang__)
698+ #pragma clang diagnostic pop
699+ #endif
700+
691701
692702/* *** Funtions ****/
693703int OpenTerminalSocket (const char * hostname, int hardware_type = 0 , int isserver = 0 ,
0 commit comments