[Pkg-gnupg-commit] [gnupg2] 48/159: gpg: Use enums instead of defines.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Jan 27 13:23:52 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit ee8a8ec1cf4605e5af427f9c8b01b3609c82cbe7
Author: Neal H. Walfield <neal at g10code.com>
Date: Thu Dec 17 10:36:27 2015 +0100
gpg: Use enums instead of defines.
* g10/keydb.h (PK_LIST_ENCRYPT_TO): Change from a macro to an enum.
(PK_LIST_HIDDEN): Likewise.
(PK_LIST_CONFIG): Likewise.
(PK_LIST_SHIFT): Likewise.n
--
Signed-off-by: Neal H. Walfield <neal at g10code.com>
Using an enum has the advantage that the symbol can be used in gdb.
---
g10/keydb.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/g10/keydb.h b/g10/keydb.h
index d7aa432..4164767 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -70,12 +70,18 @@ enum resource_type {
/* Bit flags used with build_pk_list. */
-#define PK_LIST_ENCRYPT_TO 1 /* This is an encrypt-to recipient. */
-#define PK_LIST_HIDDEN 2 /* This is a hidden recipient. */
-#define PK_LIST_CONFIG 4 /* Specified via config file. */
+enum
+ {
+ PK_LIST_ENCRYPT_TO=1, /* This is an encrypt-to recipient. */
+ PK_LIST_HIDDEN=2, /* This is a hidden recipient. */
+ PK_LIST_CONFIG=4 /* Specified via config file. */
+ };
/* To store private data in the flags they must be left shifted by
this value. */
-#define PK_LIST_SHIFT 3
+enum
+ {
+ PK_LIST_SHIFT=3
+ };
/****************
* A data structure to hold information about the external position
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list