From 2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 18 Jan 2014 21:18:04 +0100 Subject: Replaced some of the hardcoded values with constants (misc) - Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru --- src/common/db.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/common/db.h') diff --git a/src/common/db.h b/src/common/db.h index cd61e1543..4883489d7 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -71,10 +71,10 @@ * @see #db_custom_release(DBRelease) */ typedef enum DBRelease { - DB_RELEASE_NOTHING = 0, - DB_RELEASE_KEY = 1, - DB_RELEASE_DATA = 2, - DB_RELEASE_BOTH = 3 + DB_RELEASE_NOTHING = 0x0, + DB_RELEASE_KEY = 0x1, + DB_RELEASE_DATA = 0x2, + DB_RELEASE_BOTH = DB_RELEASE_KEY|DB_RELEASE_DATA, } DBRelease; /** @@ -127,13 +127,13 @@ typedef enum DBType { * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short) */ typedef enum DBOptions { - DB_OPT_BASE = 0, - DB_OPT_DUP_KEY = 1, - DB_OPT_RELEASE_KEY = 2, - DB_OPT_RELEASE_DATA = 4, - DB_OPT_RELEASE_BOTH = 6, - DB_OPT_ALLOW_NULL_KEY = 8, - DB_OPT_ALLOW_NULL_DATA = 16, + DB_OPT_BASE = 0x00, + DB_OPT_DUP_KEY = 0x01, + DB_OPT_RELEASE_KEY = 0x02, + DB_OPT_RELEASE_DATA = 0x04, + DB_OPT_RELEASE_BOTH = DB_OPT_RELEASE_KEY|DB_OPT_RELEASE_DATA, + DB_OPT_ALLOW_NULL_KEY = 0x08, + DB_OPT_ALLOW_NULL_DATA = 0x10, } DBOptions; /** -- cgit v1.2.3-60-g2f50