[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 4 Oct 2024 06:31:33 -0400 (EDT) |
branch: master
commit 8fa9367c40adfdc3bd58e41eb84875ad687a776a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Aug 12 11:52:52 2024 +0200
* tp/Texinfo/XS/main/tree.c (insert_list_slice_into_list)
(insert_slice_into_contents, insert_list_slice_into_args)
(insert_list_slice_into_contents): use size_t for indices.
* tp/Texinfo/XS/structuring_transfo/structuring.c
(insert_menu_comment_content): use size_t for index_in_preformatted.
* tp/Texinfo/XS/parsetexi/def.c: reindent.
---
ChangeLog | 11 +++++++++++
tp/Texinfo/XS/main/tree.c | 18 ++++++++++--------
tp/Texinfo/XS/main/tree.h | 19 +++++++++++--------
tp/Texinfo/XS/parsetexi/def.c | 6 ++----
tp/Texinfo/XS/structuring_transfo/structuring.c | 2 +-
5 files changed, 35 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 90c17d42a4..b32c813fb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-12 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/tree.c (insert_list_slice_into_list)
+ (insert_slice_into_contents, insert_list_slice_into_args)
+ (insert_list_slice_into_contents): use size_t for indices.
+
+ * tp/Texinfo/XS/structuring_transfo/structuring.c
+ (insert_menu_comment_content): use size_t for index_in_preformatted.
+
+ * tp/Texinfo/XS/parsetexi/def.c: reindent.
+
2024-08-12 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/parsetexi/menus.c (handle_menu_entry_separators):
diff --git a/tp/Texinfo/XS/main/tree.c b/tp/Texinfo/XS/main/tree.c
index 741b673c29..1a7acb4acc 100644
--- a/tp/Texinfo/XS/main/tree.c
+++ b/tp/Texinfo/XS/main/tree.c
@@ -438,8 +438,8 @@ insert_into_args (ELEMENT *parent, ELEMENT *e, size_t where)
/* Insert elements to TO at position WHERE from FROM from START inclusive
to END exclusive. */
void
-insert_list_slice_into_list (ELEMENT_LIST *to, int where, const ELEMENT_LIST
*from,
- int start, int end)
+insert_list_slice_into_list (ELEMENT_LIST *to, size_t where,
+ const ELEMENT_LIST *from, size_t start, size_t
end)
{
int num = end - start;
reallocate_list_for (num, to);
@@ -457,8 +457,8 @@ insert_list_slice_into_list (ELEMENT_LIST *to, int where,
const ELEMENT_LIST *fr
/* Insert elements to the contents of TO at position WHERE from FROM contents
from START inclusive to END exclusive. Do not set the parent fields. */
void
-insert_slice_into_contents (ELEMENT *to, int where, const ELEMENT *from,
- int start, int end)
+insert_slice_into_contents (ELEMENT *to, size_t where, const ELEMENT *from,
+ size_t start, size_t end)
{
insert_list_slice_into_list (&to->e.c->contents, where,
&from->e.c->contents, start, end);
@@ -467,8 +467,9 @@ insert_slice_into_contents (ELEMENT *to, int where, const
ELEMENT *from,
/* Insert elements to the args of TO at position WHERE from FROM
from START inclusive to END exclusive. */
void
-insert_list_slice_into_args (ELEMENT *to, int where, ELEMENT_LIST *from,
- int start, int end)
+insert_list_slice_into_args (ELEMENT *to, size_t where,
+ const ELEMENT_LIST *from,
+ size_t start, size_t end)
{
insert_list_slice_into_list (&to->e.c->args, where, from, start, end);
}
@@ -476,8 +477,9 @@ insert_list_slice_into_args (ELEMENT *to, int where,
ELEMENT_LIST *from,
/* Insert elements to the contents of TO at position WHERE from FROM
from START inclusive to END exclusive. */
void
-insert_list_slice_into_contents (ELEMENT *to, int where, ELEMENT_LIST *from,
- int start, int end)
+insert_list_slice_into_contents (ELEMENT *to, size_t where,
+ const ELEMENT_LIST *from,
+ size_t start, size_t end)
{
insert_list_slice_into_list (&to->e.c->contents, where, from, start, end);
}
diff --git a/tp/Texinfo/XS/main/tree.h b/tp/Texinfo/XS/main/tree.h
index 16cc50513b..cf6963becd 100644
--- a/tp/Texinfo/XS/main/tree.h
+++ b/tp/Texinfo/XS/main/tree.h
@@ -23,14 +23,17 @@ void insert_into_contents (ELEMENT *parent, ELEMENT *e,
size_t where);
void insert_into_args (ELEMENT *parent, ELEMENT *e, size_t where);
ELEMENT *remove_element_from_list (ELEMENT_LIST *list, const ELEMENT *e);
void add_element_if_not_in_list (ELEMENT_LIST *list, ELEMENT *e);
-void insert_list_slice_into_list (ELEMENT_LIST *to, int where,
- const ELEMENT_LIST *from, int start, int
end);
-void insert_slice_into_contents (ELEMENT *to, int idx, const ELEMENT *from,
- int start, int end);
-void insert_list_slice_into_contents (ELEMENT *to, int idx, ELEMENT_LIST *from,
- int start, int end);
-void insert_list_slice_into_args (ELEMENT *to, int where, ELEMENT_LIST *from,
- int start, int end);
+void insert_list_slice_into_list (ELEMENT_LIST *to, size_t where,
+ const ELEMENT_LIST *from,
+ size_t start, size_t end);
+void insert_slice_into_contents (ELEMENT *to, size_t idx, const ELEMENT *from,
+ size_t start, size_t end);
+void insert_list_slice_into_contents (ELEMENT *to, size_t idx,
+ const ELEMENT_LIST *from,
+ size_t start, size_t end);
+void insert_list_slice_into_args (ELEMENT *to, size_t where,
+ const ELEMENT_LIST *from,
+ size_t start, size_t end);
void list_set_empty_contents (ELEMENT_LIST *e_list, size_t n);
ELEMENT *remove_from_element_list (ELEMENT_LIST *list, size_t where);
const ELEMENT *remove_from_const_element_list (CONST_ELEMENT_LIST *list,
diff --git a/tp/Texinfo/XS/parsetexi/def.c b/tp/Texinfo/XS/parsetexi/def.c
index 70318e6e5c..80b34c576b 100644
--- a/tp/Texinfo/XS/parsetexi/def.c
+++ b/tp/Texinfo/XS/parsetexi/def.c
@@ -86,15 +86,13 @@ gather_def_item (ELEMENT *current, enum command_id
next_command)
def_item = new_element (type);
- insert_slice_into_contents (def_item, 0, current,
- pos, contents_count);
+ insert_slice_into_contents (def_item, 0, current, pos, contents_count);
for (j = contents_count; j > pos; j--)
{
ELEMENT *e = contents_child_by_index (current, j-1);
e->parent = def_item;
}
- remove_slice_from_contents (current,
- pos, contents_count);
+ remove_slice_from_contents (current, pos, contents_count);
add_to_element_contents (current, def_item);
}
}
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 4e4a3801b2..7fe174097d 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -1799,7 +1799,7 @@ insert_menu_comment_content (ELEMENT_LIST *element_list,
size_t position,
ELEMENT *preformatted = new_element (ET_preformatted);
ELEMENT *empty_line_first_after = new_text_element (ET_empty_line);
ELEMENT *empty_line_second_after = new_text_element (ET_empty_line);
- int index_in_preformatted = 0;
+ size_t index_in_preformatted = 0;
size_t i;
add_to_element_contents (menu_comment, preformatted);