From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Cc: jani@nikula.org
Subject: [PATCH 2/2] cli: remove enum names from typedefs
Date: Wed, 13 Oct 2021 17:02:17 +0300 [thread overview]
Message-ID: <20211013140217.219926-2-jani@nikula.org> (raw)
In-Reply-To: <20211013140217.219926-1-jani@nikula.org>
There are some enum typedefs with the enum name:
typedef enum _name_t { ... } name_t;
We don't need or use the enum names _name_t for anything, and not all
of the enum typedefs have them. We have the typedefs specifically to
use the typedef name.
Use the anonymous enum in the typedefs:
typedef enum { ... } name_t;
---
notmuch-client.h | 4 ++--
util/hex-escape.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/notmuch-client.h b/notmuch-client.h
index 96d81166d2f5..82ae44e429fc 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -426,13 +426,13 @@ mime_node_seek_dfs (mime_node_t *node, int n);
const _notmuch_message_crypto_t *
mime_node_get_message_crypto_status (mime_node_t *node);
-typedef enum dump_formats {
+typedef enum {
DUMP_FORMAT_AUTO,
DUMP_FORMAT_BATCH_TAG,
DUMP_FORMAT_SUP
} dump_format_t;
-typedef enum dump_includes {
+typedef enum {
DUMP_INCLUDE_TAGS = 1,
DUMP_INCLUDE_CONFIG = 2,
DUMP_INCLUDE_PROPERTIES = 4
diff --git a/util/hex-escape.h b/util/hex-escape.h
index 8703334cda8d..83a4c6f146fe 100644
--- a/util/hex-escape.h
+++ b/util/hex-escape.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-typedef enum hex_status {
+typedef enum {
HEX_SUCCESS = 0,
HEX_SYNTAX_ERROR,
HEX_OUT_OF_MEMORY
--
2.30.2
next prev parent reply other threads:[~2021-10-13 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 14:02 [PATCH 1/2] lib: remove enum names from typedefs Jani Nikula
2021-10-13 14:02 ` Jani Nikula [this message]
2021-10-23 11:42 ` David Bremner
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211013140217.219926-2-jani@nikula.org \
--to=jani@nikula.org \
--cc=notmuch@notmuchmail.org \
/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://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).