From 739e58ffe04830fe6eed60b1f0bb03fe26aa861d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 3 Mar 2017 12:20:47 +0100 Subject: column: rename too generic macro Signed-off-by: Karel Zak --- text-utils/column.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'text-utils/column.c') diff --git a/text-utils/column.c b/text-utils/column.c index 9b5e770de..b05bb3c6c 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -53,7 +53,7 @@ #include "libsmartcols.h" -#define TAB 8 +#define TABCHAR_CELLS 8 enum { COLUMN_MODE_FILLCOLS = 0, @@ -219,7 +219,6 @@ static int read_input(struct column_control *ctl, FILE *fp) break; err(EXIT_FAILURE, _("read failed")); } - str = (char *) skip_space(buf); if (str) { p = strchr(str, '\n'); @@ -264,7 +263,7 @@ static void columnate_fillrows(struct column_control *ctl) size_t chcnt, col, cnt, endcol, numcols; wchar_t **lp; - ctl->maxlength = (ctl->maxlength + TAB) & ~(TAB - 1); + ctl->maxlength = (ctl->maxlength + TABCHAR_CELLS) & ~(TABCHAR_CELLS - 1); numcols = ctl->termwidth / ctl->maxlength; endcol = ctl->maxlength; for (chcnt = col = 0, lp = ctl->ents;; ++lp) { @@ -277,7 +276,7 @@ static void columnate_fillrows(struct column_control *ctl) endcol = ctl->maxlength; putwchar('\n'); } else { - while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) { + while ((cnt = ((chcnt + TABCHAR_CELLS) & ~(TABCHAR_CELLS - 1))) <= endcol) { putwchar('\t'); chcnt = cnt; } @@ -292,7 +291,7 @@ static void columnate_fillcols(struct column_control *ctl) { size_t base, chcnt, cnt, col, endcol, numcols, numrows, row; - ctl->maxlength = (ctl->maxlength + TAB) & ~(TAB - 1); + ctl->maxlength = (ctl->maxlength + TABCHAR_CELLS) & ~(TABCHAR_CELLS - 1); numcols = ctl->termwidth / ctl->maxlength; if (!numcols) numcols = 1; @@ -307,7 +306,7 @@ static void columnate_fillcols(struct column_control *ctl) chcnt += width(ctl->ents[base]); if ((base += numrows) >= ctl->nents) break; - while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) { + while ((cnt = ((chcnt + TABCHAR_CELLS) & ~(TABCHAR_CELLS - 1))) <= endcol) { putwchar('\t'); chcnt = cnt; } -- cgit v1.2.3-55-g7522