From e1497e22bb9f68e3d396784b1ae319bcb72555a7 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 25 Jul 2014 13:25:34 +0200 Subject: [PATCH] Extended types: Introduced naming convention for xtype format macros For xt_something, let's use XT_SOMETHING_FMT_... --- ucw/xtypes-basic.c | 6 +++--- ucw/xtypes.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ucw/xtypes-basic.c b/ucw/xtypes-basic.c index 14c77d21..26d7cb1f 100644 --- a/ucw/xtypes-basic.c +++ b/ucw/xtypes-basic.c @@ -50,9 +50,9 @@ static const char *xt_double_format(void *src, u32 fmt, struct mempool *pool) { double val = *((double *)src); - if (fmt & XTYPE_FMT_DBL_PREC) + if (fmt & XT_DOUBLE_FMT_PREC_FLAG) { - uint prec = fmt & ~XTYPE_FMT_DBL_PREC; + uint prec = fmt & ~XT_DOUBLE_FMT_PREC_FLAG; return mp_printf(pool, "%.*lf", prec, val); } @@ -88,7 +88,7 @@ static const char * xt_double_fmt_parse(const char *str, u32 *dest, struct mempo if (tmp_err) return mp_printf(pool, "Could not parse floating point number precision: %s", tmp_err); - *dest = XTYPE_FMT_DBL_FIXED_PREC(precision); + *dest = XT_DOUBLE_FMT_PREC(precision); return NULL; } diff --git a/ucw/xtypes.h b/ucw/xtypes.h index f0e89277..06ecd808 100644 --- a/ucw/xtypes.h +++ b/ucw/xtypes.h @@ -114,8 +114,8 @@ extern const struct xtype xt_bool; extern const struct xtype xt_double; // Fixed-precision formats for xt_double -#define XTYPE_FMT_DBL_FIXED_PREC(_prec) (_prec | XTYPE_FMT_DBL_PREC) -#define XTYPE_FMT_DBL_PREC XTYPE_FMT_CUSTOM +#define XT_DOUBLE_FMT_PREC(_prec) (_prec | XT_DOUBLE_FMT_PREC_FLAG) +#define XT_DOUBLE_FMT_PREC_FLAG XTYPE_FMT_CUSTOM /* Tables of units, provided as convenience for the implementations of xtypes */ -- 2.39.2