From bbb56541f8157ff58bbf7166fc55a27340739c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 28 Jan 2017 01:17:13 +0100 Subject: [PATCH] packed screen struct to 2 bytes, saved 2 kB of RAM --- user/screen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/user/screen.c b/user/screen.c index 22503a4..e60324b 100644 --- a/user/screen.c +++ b/user/screen.c @@ -10,12 +10,12 @@ #define COLOR_MAX 15 /** - * Screen cell data type + * Screen cell data type (16 bits) */ -typedef struct { - char c; - Color fg; - Color bg; +typedef struct __attribute__((packed)){ + char c : 8; + Color fg : 4; + Color bg : 4; } Cell; /**