about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--torus.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/torus.h b/torus.h
index 9c047b9..775670c 100644
--- a/torus.h
+++ b/torus.h
@@ -15,15 +15,13 @@
  */
 
 #include <assert.h>
+#include <stdalign.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <time.h>
 
-#define PACKED __attribute__((packed))
-#define ALIGNED(x) __attribute__((aligned(x)))
-
 #define ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0]))
 
 #undef COLOR_BLACK
@@ -64,8 +62,8 @@ struct Meta {
 	uint32_t accessCount;
 };
 
-struct ALIGNED(4096) Tile {
-	char cells[CELL_ROWS][CELL_COLS];
+struct Tile {
+	alignas(4096) char cells[CELL_ROWS][CELL_COLS];
 	uint8_t colors[CELL_ROWS][CELL_COLS];
 	struct Meta meta;
 };
@@ -90,7 +88,7 @@ struct Map {
 };
 
 struct ServerMessage {
-	enum PACKED {
+	enum {
 		SERVER_TILE,
 		SERVER_MOVE,
 		SERVER_PUT,
@@ -120,7 +118,7 @@ struct ServerMessage {
 static const uint8_t CURSOR_NONE = UINT8_MAX;
 
 struct ClientMessage {
-	enum PACKED {
+	enum {
 		CLIENT_MOVE,
 		CLIENT_PUT,
 		CLIENT_MAP,
f='/cgit-pink/commit/ui-ssdiff.c?id=0899eb644fab415e9a3b304f53da9da50aaf91aa&follow=1'>ui-ssdiff: ban strncpy()Christian Hesse 2018-09-11ui-shared: ban strcat()Christian Hesse 2018-09-11ui-patch: ban sprintf()Christian Hesse 2018-09-11ui-log: ban strncpy()Christian Hesse 2018-09-11ui-log: ban strcpy()Christian Hesse 2018-09-11parsing: ban sprintf()Christian Hesse 2018-09-11parsing: ban strncpy()Christian Hesse 2018-08-28filters: generate anchor links from markdownChristian Hesse 2018-08-03Bump version.Jason A. Donenfeld 2018-08-03clone: fix directory traversalJason A. Donenfeld 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev