From 04d4c9e31eb4392b1e9cae91581661345c5ab7b3 Mon Sep 17 00:00:00 2001 From: mibi88 <76903855+mibi88@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:14:29 +0200 Subject: [PATCH] Cleaner enums with clang-format. --- .clang-format | 1 + src/events.h | 6 +++++- src/game.h | 13 +++++++++++-- src/npc.h | 1 - 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.clang-format b/.clang-format index 196c51c..e35924c 100644 --- a/.clang-format +++ b/.clang-format @@ -10,3 +10,4 @@ IndentCaseBlocks: true IncludeBlocks: Regroup AllowShortBlocksOnASingleLine: Empty ColumnLimit: 80 +AllowShortEnumsOnASingleLine: false diff --git a/src/events.h b/src/events.h index f4a19bf..a095283 100644 --- a/src/events.h +++ b/src/events.h @@ -15,7 +15,11 @@ typedef struct { unsigned int vars; } EventHandler; -typedef enum { T_NULL, T_VAR_EDIT, T_AMOUNT } Token; +typedef enum { + T_NULL, + T_VAR_EDIT, + T_AMOUNT +} Token; typedef enum { OP_NULL, diff --git a/src/game.h b/src/game.h index 0728ac5..f82c51b 100644 --- a/src/game.h +++ b/src/game.h @@ -8,9 +8,18 @@ #include /* The direction where the player is going to. */ -typedef enum { D_UP, D_DOWN, D_LEFT, D_RIGHT } Direction; +typedef enum { + D_UP, + D_DOWN, + D_LEFT, + D_RIGHT +} Direction; -typedef enum { P_LEFTUP = -1, P_CENTER = 0, P_RIGHTDOWN = 1 } Checkpos; +typedef enum { + P_LEFTUP = -1, + P_CENTER = 0, + P_RIGHTDOWN = 1 +} Checkpos; typedef enum { I_NONE, diff --git a/src/npc.h b/src/npc.h index 8c7f83e..2726e20 100644 --- a/src/npc.h +++ b/src/npc.h @@ -13,7 +13,6 @@ enum { NPC_FRIENDLY = 1, // The player's team NPC_HOSTILE = 2, // to the player NPC_ALL = 3 - }; /* /!\ Warning /!\