From 6dadef0381d8b7a63f40b185b3592f27b55453cd Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 9 Apr 2018 01:25:43 -0400 Subject: Use anonymous union --- torus.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'torus.h') diff --git a/torus.h b/torus.h index 72895f2..5e01aaa 100644 --- a/torus.h +++ b/torus.h @@ -99,20 +99,20 @@ struct ServerMessage { struct { uint8_t cellX; uint8_t cellY; - } m; + } move; struct { uint8_t cellX; uint8_t cellY; uint8_t color; char cell; - } p; + } put; struct { uint8_t oldCellX; uint8_t oldCellY; uint8_t newCellX; uint8_t newCellY; - } c; - } data; + } cursor; + }; }; static const uint8_t CURSOR_NONE = UINT8_MAX; @@ -127,13 +127,11 @@ struct ClientMessage { struct { int8_t dx; int8_t dy; - } m; + } move; struct { uint8_t color; char cell; - } p; - struct { - uint8_t spawn; - } s; - } data; + } put; + uint8_t spawn; + }; }; -- cgit 1.4.1