]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/xtypes-basic.c
tableprinter: removed some obsolete FIXME, added some comments
[libucw.git] / ucw / xtypes-basic.c
index 1c4696b3366483a736426ff85583d6ba4b7c5c5f..26d7cb1f54b191ac64cdbcd2014573d83ed09a73 100644 (file)
@@ -13,8 +13,8 @@
 #include <ucw/strtonum.h>
 #include <ucw/xtypes.h>
 #include <errno.h>
-#include <stdlib.h>
 #include <inttypes.h>
+#include <stdlib.h>
 
 #define XTYPE_NUM_FORMAT(_type, _fmt, _typename) static const char *xt_##_typename##_format(void *src, u32 fmt UNUSED, struct mempool *pool) \
 {\
@@ -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;
 }
 
@@ -111,9 +111,8 @@ static const char *xt_bool_format(void *src, u32 fmt UNUSED, struct mempool *poo
       return val ? "true" : "false";
     case XTYPE_FMT_DEFAULT:
     case XTYPE_FMT_RAW:
-      return val ? "1" : "0";
     default:
-      ASSERT(0);
+      return val ? "1" : "0";
     }
 }