From: Carlos Maniero <carlos@maniero.me>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Carlos Maniero <carlos@maniero.me>
Subject: [PATCH olang v1 4/6] codestyle: do not allow single line enums
Date: Thu, 10 Oct 2024 01:33:40 +0000 (UTC) [thread overview]
Message-ID: <20241010013318.222905-5-carlos@maniero.me> (raw)
In-Reply-To: <20241010013318.222905-1-carlos@maniero.me>
Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
.clang-format | 2 +-
src/ast.h | 4 +++-
src/type.h | 13 +++++++++++--
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.clang-format b/.clang-format
index f106b8f..a1e9892 100644
--- a/.clang-format
+++ b/.clang-format
@@ -33,7 +33,7 @@ AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortEnumsOnASingleLine: true
+AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
diff --git a/src/ast.h b/src/ast.h
index b220708..98e035f 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -89,7 +89,9 @@ typedef struct ast_var_definition {
scope_t *scope;
} ast_var_definition_t;
-typedef enum { AST_LITERAL_U32 } ast_literal_kind_t;
+typedef enum {
+ AST_LITERAL_U32
+} ast_literal_kind_t;
typedef struct ast_literal {
ast_node_meta_t meta;
diff --git a/src/type.h b/src/type.h
index edc421b..204f849 100644
--- a/src/type.h
+++ b/src/type.h
@@ -21,9 +21,18 @@
typedef union type type_t;
-typedef enum { TYPE_UNKNOWN, TYPE_PRIMITIVE, TYPE_PTR } type_kind_t;
+typedef enum {
+ TYPE_UNKNOWN,
+ TYPE_PRIMITIVE,
+ TYPE_PTR
+} type_kind_t;
-typedef enum { TYPE_U8, TYPE_U16, TYPE_U32, TYPE_U64 } type_primitive_kind_t;
+typedef enum {
+ TYPE_U8,
+ TYPE_U16,
+ TYPE_U32,
+ TYPE_U64
+} type_primitive_kind_t;
typedef struct type_primitive {
type_kind_t _type_kind;
--
2.46.0
next prev parent reply other threads:[~2024-10-10 1:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 1:33 [PATCH olang 0/6] Suggestions in code style Carlos Maniero
2024-10-10 1:33 ` [PATCH olang v1 1/6] codestyle: change AlignAfterOpenBracket to BlockIndent Carlos Maniero
2024-10-10 1:33 ` [PATCH olang v1 2/6] codestyle: never BreakBeforeBraces Carlos Maniero
2024-10-10 1:33 ` [PATCH olang v1 3/6] codestyle: prevent extra empty lines at EOF Carlos Maniero
2024-10-10 1:33 ` Carlos Maniero [this message]
2024-10-10 1:33 ` [PATCH olang v1 5/6] codestyle: add trailing comma on struct initializer Carlos Maniero
2024-10-10 1:34 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-10 1:33 ` [PATCH olang v1 6/6] codestyle: limit the code to 80 characters Carlos Maniero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241010013318.222905-5-carlos@maniero.me \
--to=carlos@maniero.me \
--cc=~johnnyrichard/olang-devel@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.johnnyrichard.com/olang.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox