summaryrefslogtreecommitdiffstats
path: root/text-utils/column.c
diff options
context:
space:
mode:
authorKarel Zak2017-03-03 12:20:47 +0100
committerKarel Zak2017-05-02 12:18:00 +0200
commit739e58ffe04830fe6eed60b1f0bb03fe26aa861d (patch)
tree68eee5d512476f1c7a06bd2fdc84d20c7dcab896 /text-utils/column.c
parentcolumn: use libsmartcols for --table (diff)
downloadkernel-qcow2-util-linux-739e58ffe04830fe6eed60b1f0bb03fe26aa861d.tar.gz
kernel-qcow2-util-linux-739e58ffe04830fe6eed60b1f0bb03fe26aa861d.tar.xz
kernel-qcow2-util-linux-739e58ffe04830fe6eed60b1f0bb03fe26aa861d.zip
column: rename too generic macro
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/column.c')
-rw-r--r--text-utils/column.c11
1 files changed, 5 insertions, 6 deletions
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;
}