From: Arran Cudbard-Bell Date: Tue, 8 Nov 2011 14:40:24 +0000 (+0100) Subject: Convert bare enums into types, in C they don't do anything, but it does help make... X-Git-Tag: release_3_0_0_beta0~517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7bdeab0c5b1dcfebfd7d780b797a003c38c6caa;p=thirdparty%2Ffreeradius-server.git Convert bare enums into types, in C they don't do anything, but it does help make the code self documenting --- diff --git a/src/include/modules.h b/src/include/modules.h index dbb17f3de65..4e504be7504 100644 --- a/src/include/modules.h +++ b/src/include/modules.h @@ -19,7 +19,7 @@ extern "C" { typedef int (*packetmethod)(void *instance, REQUEST *request); -enum { +typedef enum rlm_components { RLM_COMPONENT_AUTH = 0, RLM_COMPONENT_AUTZ, /* 1 */ RLM_COMPONENT_PREACCT, /* 2 */ @@ -33,7 +33,7 @@ enum { RLM_COMPONENT_SEND_COA, /* 9 */ #endif RLM_COMPONENT_COUNT /* 8 / 10: How many components are there */ -}; +} rlm_components_t; #define RLM_TYPE_THREAD_SAFE (0 << 0) #define RLM_TYPE_THREAD_UNSAFE (1 << 0) @@ -52,7 +52,7 @@ typedef struct module_t { packetmethod methods[RLM_COMPONENT_COUNT]; } module_t; -enum { +typedef enum rlm_rcodes { RLM_MODULE_REJECT, /* immediately reject the request */ RLM_MODULE_FAIL, /* module failed, don't reply */ RLM_MODULE_OK, /* the module is OK, continue */ @@ -63,7 +63,7 @@ enum { RLM_MODULE_NOOP, /* module succeeded without doing anything */ RLM_MODULE_UPDATED, /* OK (pairs modified) */ RLM_MODULE_NUMCODES /* How many return codes there are */ -}; +} rlm_rcodes_t; int setup_modules(int, CONF_SECTION *); int detach_modules(void);