From 8e973d3ab96d290a32ae3fdbdd1cf867b7060483 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Tue, 31 Oct 2017 09:56:11 -0700 Subject: 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 --- libglusterfs/src/common-utils.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libglusterfs') 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 +#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; -- cgit