toolbox

Check-in [80086d35a4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:retab: remove superfluous cast
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 80086d35a4b83c32f9816eea14565af7cf112de283a8a3f1bfeffb332004eb27
User & Date: jef 2020-07-26 19:43:43
Context
2020-07-28
20:00
retab: remove unused include pragma Leaf check-in: 2ee6344ac4 user: jef tags: trunk
2020-07-26
19:43
retab: remove superfluous cast check-in: 80086d35a4 user: jef tags: trunk
2020-07-23
16:18
lib: cleanup jtlst_iter_start() check-in: da11de00e7 user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/retab/retab.c.

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
	char *space, *line;
	jtbuf buf;
	struct jtlst_iter i1, i2;
	struct colwidth *colwidth;
	struct jtlst_str *col;

	jtlst_foreach(colwidth, maxwidths)
		wsum += (size_t) colwidth->width;

	if (row->is_line) {
		nchars = wsum + (jtlst_size(maxwidths) -1) * 3 + 4;
		line = str_repeat("-", nchars);
		puts(line);
		xfree(line);
	} else {
................................................................................
			if (first) {
				buf = jtbuf_append_str(buf, "| ");
				first = 0;
			} else {
				buf = jtbuf_append_str(buf, " | ");
			}
			buf = jtbuf_append_str(buf, col->str);
			space = str_repeat(" ", (size_t) colwidth->width - utf8len(col->str));
			buf = jtbuf_append_str(buf, space);
			xfree(space);
		}
		buf = jtbuf_append_str(buf, " |");
		puts(buf);
		jtbuf_free(buf);
	}







|







 







|







132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
	char *space, *line;
	jtbuf buf;
	struct jtlst_iter i1, i2;
	struct colwidth *colwidth;
	struct jtlst_str *col;

	jtlst_foreach(colwidth, maxwidths)
		wsum += colwidth->width;

	if (row->is_line) {
		nchars = wsum + (jtlst_size(maxwidths) -1) * 3 + 4;
		line = str_repeat("-", nchars);
		puts(line);
		xfree(line);
	} else {
................................................................................
			if (first) {
				buf = jtbuf_append_str(buf, "| ");
				first = 0;
			} else {
				buf = jtbuf_append_str(buf, " | ");
			}
			buf = jtbuf_append_str(buf, col->str);
			space = str_repeat(" ", colwidth->width - utf8len(col->str));
			buf = jtbuf_append_str(buf, space);
			xfree(space);
		}
		buf = jtbuf_append_str(buf, " |");
		puts(buf);
		jtbuf_free(buf);
	}