[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * info/util.c (printed_representation): add a com
From: |
Patrice Dumas |
Subject: |
branch master updated: * info/util.c (printed_representation): add a comment to explain tab printed representation, based on Gavin explanation. |
Date: |
Sun, 13 Oct 2024 06:57:15 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 0fb5b96be2 * info/util.c (printed_representation): add a comment to
explain tab printed representation, based on Gavin explanation.
0fb5b96be2 is described below
commit 0fb5b96be21222e0c916259d2bb27aa0617d096d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Oct 13 12:57:09 2024 +0200
* info/util.c (printed_representation): add a comment to explain tab
printed representation, based on Gavin explanation.
---
ChangeLog | 5 +++++
info/util.c | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index bbc9eb451c..1e71278c83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-13 Patrice Dumas <pertusus@free.fr>
+
+ * info/util.c (printed_representation): add a comment to explain tab
+ printed representation, based on Gavin explanation.
+
2024-10-13 Patrice Dumas <pertusus@free.fr>
* info/nodes.c (make_file_buffer, info_create_tag, info_create_node):
diff --git a/info/util.c b/info/util.c
index 64f80e8299..7ecb90f06b 100644
--- a/info/util.c
+++ b/info/util.c
@@ -223,6 +223,17 @@ printed_representation (mbi_iterator_t *iter, int *delim,
size_t pl_chars,
{
int i = 0;
+ /* compute the number of columns to the next tab stop, assuming
+ 8 columns for a tab.
+
+ To determine the next tab stop, add 8 to the current column,
+ and then subtract the remainder of the division by 8.
+
+ (n & 0xf8) does (n - n mod 8) in one step as the binary
+ representation of 0xf8 is 1111 1000 so the result has
+ to be a multiple of 8.
+ TODO this doesn't work if there are more than 255 columns.
+ */
*pchars = ((pl_chars + 8) & 0xf8) - pl_chars;
*pbytes = *pchars;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * info/util.c (printed_representation): add a comment to explain tab printed representation, based on Gavin explanation.,
Patrice Dumas <=