From d0053422e9cb3acb3960d652532af01d311e9c8a Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Sun, 11 Nov 2018 19:25:06 +0100 Subject: [PATCH] Code review aftermath 2: Put defines into parentheses --- include/_antic.h | 56 ++++++++++---------- include/atari.h | 134 +++++++++++++++++++++++------------------------ 2 files changed, 95 insertions(+), 95 deletions(-) diff --git a/include/_antic.h b/include/_antic.h index 23a72609c..2aac3fccf 100644 --- a/include/_antic.h +++ b/include/_antic.h @@ -57,42 +57,42 @@ struct __antic { /* antic instruction set */ /* absolute instructions (non mode lines) */ -#define DL_JMP (unsigned char) 1 -#define DL_JVB (unsigned char) 65 +#define DL_JMP ((unsigned char) 1) +#define DL_JVB ((unsigned char) 65) -#define DL_BLK1 (unsigned char) 0 -#define DL_BLK2 (unsigned char) 16 -#define DL_BLK3 (unsigned char) 32 -#define DL_BLK4 (unsigned char) 48 -#define DL_BLK5 (unsigned char) 64 -#define DL_BLK6 (unsigned char) 80 -#define DL_BLK7 (unsigned char) 96 -#define DL_BLK8 (unsigned char) 112 +#define DL_BLK1 ((unsigned char) 0) +#define DL_BLK2 ((unsigned char) 16) +#define DL_BLK3 ((unsigned char) 32) +#define DL_BLK4 ((unsigned char) 48) +#define DL_BLK5 ((unsigned char) 64) +#define DL_BLK6 ((unsigned char) 80) +#define DL_BLK7 ((unsigned char) 96) +#define DL_BLK8 ((unsigned char) 112) /* absolute instructions (mode lines) */ -#define DL_CHR40x8x1 (unsigned char) 2 /* monochrome, 40 character & 8 scanlines per mode line (GR. 0) */ -#define DL_CHR40x10x1 (unsigned char) 3 /* monochrome, 40 character & 10 scanlines per mode line */ -#define DL_CHR40x8x4 (unsigned char) 4 /* colour, 40 character & 8 scanlines per mode line (GR. 12) */ -#define DL_CHR40x16x4 (unsigned char) 5 /* colour, 40 character & 16 scanlines per mode line (GR. 13) */ -#define DL_CHR20x8x2 (unsigned char) 6 /* colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1) */ -#define DL_CHR20x16x2 (unsigned char) 7 /* colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2) */ +#define DL_CHR40x8x1 ((unsigned char) 2) /* monochrome, 40 character & 8 scanlines per mode line (GR. 0) */ +#define DL_CHR40x10x1 ((unsigned char) 3) /* monochrome, 40 character & 10 scanlines per mode line */ +#define DL_CHR40x8x4 ((unsigned char) 4) /* colour, 40 character & 8 scanlines per mode line (GR. 12) */ +#define DL_CHR40x16x4 ((unsigned char) 5) /* colour, 40 character & 16 scanlines per mode line (GR. 13) */ +#define DL_CHR20x8x2 ((unsigned char) 6) /* colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1) */ +#define DL_CHR20x16x2 ((unsigned char) 7) /* colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2) */ -#define DL_MAP40x8x4 (unsigned char) 8 /* colour, 40 pixel & 8 scanlines per mode line (GR. 3) */ -#define DL_MAP80x4x2 (unsigned char) 9 /* 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4) */ -#define DL_MAP80x4x4 (unsigned char) 10 /* colour, 80 pixel & 4 scanlines per mode line (GR.5) */ -#define DL_MAP160x2x2 (unsigned char) 11 /* 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6) */ -#define DL_MAP160x1x2 (unsigned char) 12 /* 'duochrome', 160 pixel & 1 scanline per mode line (GR.14) */ -#define DL_MAP160x2x4 (unsigned char) 13 /* 4 colours, 160 pixel & 2 scanlines per mode line (GR.7) */ -#define DL_MAP160x1x4 (unsigned char) 14 /* 4 colours, 160 pixel & 1 scanline per mode line (GR.15) */ -#define DL_MAP320x1x1 (unsigned char) 15 /* monochrome, 320 pixel & 1 scanline per mode line (GR.8) */ +#define DL_MAP40x8x4 ((unsigned char) 8) /* colour, 40 pixel & 8 scanlines per mode line (GR. 3) */ +#define DL_MAP80x4x2 ((unsigned char) 9) /* 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4) */ +#define DL_MAP80x4x4 ((unsigned char) 10) /* colour, 80 pixel & 4 scanlines per mode line (GR.5) */ +#define DL_MAP160x2x2 ((unsigned char) 11) /* 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6) */ +#define DL_MAP160x1x2 ((unsigned char) 12) /* 'duochrome', 160 pixel & 1 scanline per mode line (GR.14) */ +#define DL_MAP160x2x4 ((unsigned char) 13) /* 4 colours, 160 pixel & 2 scanlines per mode line (GR.7) */ +#define DL_MAP160x1x4 ((unsigned char) 14) /* 4 colours, 160 pixel & 1 scanline per mode line (GR.15) */ +#define DL_MAP320x1x1 ((unsigned char) 15) /* monochrome, 320 pixel & 1 scanline per mode line (GR.8) */ /* modifiers on mode lines */ -#define DL_HSCROL(x) (unsigned char)((x) | 16) -#define DL_VSCROL(x) (unsigned char)((x) | 32) -#define DL_LMS(x) (unsigned char)((x) | 64) +#define DL_HSCROL(x) ((unsigned char)((x) | 16)) +#define DL_VSCROL(x) ((unsigned char)((x) | 32)) +#define DL_LMS(x) ((unsigned char)((x) | 64)) /* general modifier */ -#define DL_DLI(x) (unsigned char)((x) | 128) +#define DL_DLI(x) ((unsigned char)((x) | 128)) /* End of _antic.h */ #endif /* #ifndef __ANTIC_H */ diff --git a/include/atari.h b/include/atari.h index ca12a493a..0ca2dc577 100644 --- a/include/atari.h +++ b/include/atari.h @@ -160,73 +160,73 @@ #define JOY_FIRE(v) ((v) & JOY_FIRE_MASK) /* Keyboard values returned by kbcode / CH */ -#define KEY_NONE (unsigned char) 0xFF - -#define KEY_0 (unsigned char) 0x32 -#define KEY_1 (unsigned char) 0x1F -#define KEY_2 (unsigned char) 0x1E -#define KEY_3 (unsigned char) 0x1A -#define KEY_4 (unsigned char) 0x18 -#define KEY_5 (unsigned char) 0x1D -#define KEY_6 (unsigned char) 0x1B -#define KEY_7 (unsigned char) 0x33 -#define KEY_8 (unsigned char) 0x35 -#define KEY_9 (unsigned char) 0x30 - -#define KEY_A (unsigned char) 0x3F -#define KEY_B (unsigned char) 0x15 -#define KEY_C (unsigned char) 0x12 -#define KEY_D (unsigned char) 0x3A -#define KEY_E (unsigned char) 0x2A -#define KEY_F (unsigned char) 0x38 -#define KEY_G (unsigned char) 0x3D -#define KEY_H (unsigned char) 0x39 -#define KEY_I (unsigned char) 0x0D -#define KEY_J (unsigned char) 0x01 -#define KEY_K (unsigned char) 0x05 -#define KEY_L (unsigned char) 0x00 -#define KEY_M (unsigned char) 0x25 -#define KEY_N (unsigned char) 0x23 -#define KEY_O (unsigned char) 0x08 -#define KEY_P (unsigned char) 0x0A -#define KEY_Q (unsigned char) 0x2F -#define KEY_R (unsigned char) 0x28 -#define KEY_S (unsigned char) 0x3E -#define KEY_T (unsigned char) 0x2D -#define KEY_U (unsigned char) 0x0B -#define KEY_V (unsigned char) 0x10 -#define KEY_W (unsigned char) 0x2E -#define KEY_X (unsigned char) 0x16 -#define KEY_Y (unsigned char) 0x2B -#define KEY_Z (unsigned char) 0x17 - -#define KEY_COMMA (unsigned char) 0x20 -#define KEY_PERIOD (unsigned char) 0x22 -#define KEY_SLASH (unsigned char) 0x26 -#define KEY_SEMICOLON (unsigned char) 0x02 -#define KEY_PLUS (unsigned char) 0x06 -#define KEY_ASTERISK (unsigned char) 0x07 -#define KEY_DASH (unsigned char) 0x0E -#define KEY_EQUALS (unsigned char) 0x0F -#define KEY_LESSTHAN (unsigned char) 0x36 -#define KEY_GREATERTHAN (unsigned char) 0x37 - -#define KEY_ESC (unsigned char) 0x1C -#define KEY_TAB (unsigned char) 0x2C -#define KEY_SPACE (unsigned char) 0x21 -#define KEY_RETURN (unsigned char) 0x0C -#define KEY_DELETE (unsigned char) 0x34 -#define KEY_CAPS (unsigned char) 0x3C -#define KEY_INVERSE (unsigned char) 0x27 -#define KEY_HELP (unsigned char) 0x11 - -#define KEY_F1 (unsigned char) 0x03 -#define KEY_F2 (unsigned char) 0x04 -#define KEY_F3 (unsigned char) 0x13 -#define KEY_F4 (unsigned char) 0x14 - -#define KEY_CTRL (unsigned char) 0x80 -#define KEY_SHIFT (unsigned char) 0x40 +#define KEY_NONE ((unsigned char) 0xFF) + +#define KEY_0 ((unsigned char) 0x32) +#define KEY_1 ((unsigned char) 0x1F) +#define KEY_2 ((unsigned char) 0x1E) +#define KEY_3 ((unsigned char) 0x1A) +#define KEY_4 ((unsigned char) 0x18) +#define KEY_5 ((unsigned char) 0x1D) +#define KEY_6 ((unsigned char) 0x1B) +#define KEY_7 ((unsigned char) 0x33) +#define KEY_8 ((unsigned char) 0x35) +#define KEY_9 ((unsigned char) 0x30) + +#define KEY_A ((unsigned char) 0x3F) +#define KEY_B ((unsigned char) 0x15) +#define KEY_C ((unsigned char) 0x12) +#define KEY_D ((unsigned char) 0x3A) +#define KEY_E ((unsigned char) 0x2A) +#define KEY_F ((unsigned char) 0x38) +#define KEY_G ((unsigned char) 0x3D) +#define KEY_H ((unsigned char) 0x39) +#define KEY_I ((unsigned char) 0x0D) +#define KEY_J ((unsigned char) 0x01) +#define KEY_K ((unsigned char) 0x05) +#define KEY_L ((unsigned char) 0x00) +#define KEY_M ((unsigned char) 0x25) +#define KEY_N ((unsigned char) 0x23) +#define KEY_O ((unsigned char) 0x08) +#define KEY_P ((unsigned char) 0x0A) +#define KEY_Q ((unsigned char) 0x2F) +#define KEY_R ((unsigned char) 0x28) +#define KEY_S ((unsigned char) 0x3E) +#define KEY_T ((unsigned char) 0x2D) +#define KEY_U ((unsigned char) 0x0B) +#define KEY_V ((unsigned char) 0x10) +#define KEY_W ((unsigned char) 0x2E) +#define KEY_X ((unsigned char) 0x16) +#define KEY_Y ((unsigned char) 0x2B) +#define KEY_Z ((unsigned char) 0x17) + +#define KEY_COMMA ((unsigned char) 0x20) +#define KEY_PERIOD ((unsigned char) 0x22) +#define KEY_SLASH ((unsigned char) 0x26) +#define KEY_SEMICOLON ((unsigned char) 0x02) +#define KEY_PLUS ((unsigned char) 0x06) +#define KEY_ASTERISK ((unsigned char) 0x07) +#define KEY_DASH ((unsigned char) 0x0E) +#define KEY_EQUALS ((unsigned char) 0x0F) +#define KEY_LESSTHAN ((unsigned char) 0x36) +#define KEY_GREATERTHAN ((unsigned char) 0x37) + +#define KEY_ESC ((unsigned char) 0x1C) +#define KEY_TAB ((unsigned char) 0x2C) +#define KEY_SPACE ((unsigned char) 0x21) +#define KEY_RETURN ((unsigned char) 0x0C) +#define KEY_DELETE ((unsigned char) 0x34) +#define KEY_CAPS ((unsigned char) 0x3C) +#define KEY_INVERSE ((unsigned char) 0x27) +#define KEY_HELP ((unsigned char) 0x11) + +#define KEY_F1 ((unsigned char) 0x03) +#define KEY_F2 ((unsigned char) 0x04) +#define KEY_F3 ((unsigned char) 0x13) +#define KEY_F4 ((unsigned char) 0x14) + +#define KEY_CTRL ((unsigned char) 0x80) +#define KEY_SHIFT ((unsigned char) 0x40) /* Composed keys */ -- 2.39.5