From: Robert Kessl Date: Mon, 14 Jul 2014 08:36:54 +0000 (+0200) Subject: xtypes&tableprinter: basic cleanup X-Git-Tag: v6.1~3^2~99 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ee896c27ba0f6c0ad81f70d4937aaeef27ccede6;p=libucw.git xtypes&tableprinter: basic cleanup --- diff --git a/ucw/table-types.c b/ucw/table-types.c index fc8f6ed8..750aa942 100644 --- a/ucw/table-types.c +++ b/ucw/table-types.c @@ -106,7 +106,7 @@ void table_col_size(struct table *tbl, int col, u64 val) out_type = SIZE_UNIT_BYTE; } else if(curr_col->output_type == XTYPE_FMT_PRETTY) { curr_val = curr_val / unit_div[SIZE_UNIT_BYTE]; - out_type = SIZE_UNIT_BYTE; // curr_col->output_type; + out_type = SIZE_UNIT_BYTE; } else if((curr_col->output_type & SIZE_UNITS_FIXED) != 0) { curr_val = curr_val / unit_div[curr_col->output_type & ~SIZE_UNITS_FIXED]; out_type = curr_col->output_type & ~SIZE_UNITS_FIXED; diff --git a/ucw/table.h b/ucw/table.h index 885d64cd..89684c75 100644 --- a/ucw/table.h +++ b/ucw/table.h @@ -90,22 +90,6 @@ #define COL_TYPE_DOUBLE &xt_double #define COL_TYPE_ANY NULL -/* -enum column_type { - COL_TYPE_STR, // String - COL_TYPE_INT, // int - COL_TYPE_S64, // Signed 64-bit integer - COL_TYPE_INTMAX, // intmax_t - COL_TYPE_UINT, // unsigned int - COL_TYPE_U64, // Unsigned 64-bit integer - COL_TYPE_UINTMAX, // uintmax_t - COL_TYPE_BOOL, // bool - COL_TYPE_DOUBLE, // double - COL_TYPE_ANY, // Any type - COL_TYPE_LAST -}; -*/ - /** Justify cell contents to the left. **/ #define CELL_ALIGN_LEFT (1U << 31) @@ -114,11 +98,6 @@ enum column_type { #define CELL_FLAG_MASK (CELL_ALIGN_LEFT) #define CELL_WIDTH_MASK (~CELL_FLAG_MASK) -//#define CELL_OUT_UNINITIALIZED -1 -//#define CELL_OUT_HUMAN_READABLE -2 -//#define CELL_OUT_MACHINE_READABLE -3 -//#define CELL_OUT_USER_DEF_START 5 - struct table; /** @@ -129,8 +108,6 @@ struct table; struct table_column { const char *name; // [*] Name of the column displayed in table header int width; // [*] Width of the column (in characters) OR'ed with column flags - //const char *fmt; // [*] Default format of each cell in the column - //enum column_type type; // [*] Type of the cells in the column enum xtype_fmt fmt; int first_column; // head of linked list of columns of this type const struct xtype *type_def; @@ -307,9 +284,6 @@ TABLE_COL_PROTO(s64, s64); TABLE_COL_PROTO(u64, u64); TABLE_COL_PROTO(bool, bool); -//void table_col_bool(struct table *tbl, int col, bool val); -//void table_col_bool_name(struct table *tbl, const char *col_name, bool val); -//void table_col_bool_fmt(struct table *tbl, int col, enum xtype_fmt fmt, bool val); #undef TABLE_COL_PROTO /** diff --git a/ucw/xtypes-basic.c b/ucw/xtypes-basic.c index 5ddb359d..87fa2104 100644 --- a/ucw/xtypes-basic.c +++ b/ucw/xtypes-basic.c @@ -31,7 +31,6 @@ .format = xt_##_typename##_format,\ }; - #define XTYPE_NUM_DEF(_type, _fmt, _typename) XTYPE_NUM_FORMAT(_type, _fmt, _typename) \ XTYPE_NUM_PARSE(_typename)\ XTYPE_NUM_STRUCT(_type, _typename)