diff options
author | Jeff Darcy <jdarcy@fb.com> | 2017-10-31 09:56:11 -0700 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-11-03 05:04:11 +0000 |
commit | 8e973d3ab96d290a32ae3fdbdd1cf867b7060483 (patch) | |
tree | dc20dca53f16dba3489d65837007e87bb4c84650 /libglusterfs/src | |
parent | 917f84b01ff4c485ce548f0daa3d3d51dc81c195 (diff) |
core: make gf_boolean_t a C99 bool instead of an enum
This reduces the space used from four bytes to one, and allows
new code to use familiar C99 types/values interoperably with our
old cruft. It does *not* change current declarations or code;
that will be left for a separate - much larger - patch.
Updates: #80
Change-Id: I5baedd17d3fb05b38f0d8b8bb9dd62824475842e
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/common-utils.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 76dfe0666f9..18ab56aeb9b 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -136,11 +136,10 @@ void trap (void); #define GF_THREAD_NAME_PREFIX "gluster" #define GF_THREAD_NAME_PREFIX_LEN 7 -enum _gf_boolean -{ - _gf_false = 0, - _gf_true = 1 -}; +#include <stdbool.h> +#define gf_boolean_t bool +#define _gf_false false +#define _gf_true true /* * we could have initialized these as +ve values and treated @@ -170,7 +169,6 @@ enum _gf_xlator_ipc_targets { GF_IPC_TARGET_UPCALL = 2 }; -typedef enum _gf_boolean gf_boolean_t; typedef enum _gf_special_pid gf_special_pid_t; typedef enum _gf_xlator_ipc_targets _gf_xlator_ipc_targets_t; |