[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Add const.
From: |
Patrice Dumas |
Subject: |
branch master updated: Add const. |
Date: |
Fri, 23 Feb 2024 20:41:02 -0500 |
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 90526394bb Add const.
90526394bb is described below
commit 90526394bb79131aac286d4bd708fa9a17feefce
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 24 02:40:57 2024 +0100
Add const.
---
ChangeLog | 4 +
tp/Texinfo/XS/convert/convert_html.c | 23 ++--
tp/Texinfo/XS/main/extra.c | 5 +-
tp/Texinfo/XS/main/extra.h | 2 +-
tp/Texinfo/XS/main/manipulate_tree.c | 12 +-
tp/Texinfo/XS/main/manipulate_tree.h | 6 +-
tp/Texinfo/XS/main/output_unit.c | 29 ++---
tp/Texinfo/XS/main/targets.c | 6 +-
tp/Texinfo/XS/main/targets.h | 4 +-
tp/Texinfo/XS/structuring_transfo/structuring.c | 124 +++++++++++----------
tp/Texinfo/XS/structuring_transfo/structuring.h | 16 +--
.../XS/structuring_transfo/transformations.c | 6 +-
12 files changed, 124 insertions(+), 113 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 666b132532..cf5344b8f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-02-23 Patrice Dumas <pertusus@free.fr>
+
+ Add const.
+
2024-02-23 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/extra.c (add_extra_contents)
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index bed2450c45..614c2a3f79 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -6030,8 +6030,8 @@ html_default_format_contents (CONVERTER *self, const enum
command_id cmd,
const char *filename_from;
int is_contents = (cmd == CM_contents);
TEXT result;
- ELEMENT_LIST *root_children;
- ELEMENT *section_root;
+ const ELEMENT_LIST *root_children;
+ const ELEMENT *section_root;
int min_root_level;
int max_root_level;
int status;
@@ -6126,7 +6126,7 @@ html_default_format_contents (CONVERTER *self, const enum
command_id cmd,
{
int section_level = lookup_extra_integer (section, "section_level",
&status);
- ELEMENT_LIST *section_childs
+ const ELEMENT_LIST *section_childs
= lookup_extra_contents (section, "section_childs");
if (section->cmd != CM_top)
{
@@ -6206,7 +6206,7 @@ html_default_format_contents (CONVERTER *self, const enum
command_id cmd,
}
else
{
- ELEMENT *section_directions
+ const ELEMENT *section_directions
= lookup_extra_directions (section, "section_directions");
if (section_directions
&& section_directions->contents.list[D_next]
@@ -6231,7 +6231,7 @@ html_default_format_contents (CONVERTER *self, const enum
command_id cmd,
int section_level;
int i;
- ELEMENT *section_directions
+ const ELEMENT *section_directions
= lookup_extra_directions (section,
"section_directions");
if (!section_directions
@@ -9763,9 +9763,7 @@ mini_toc_internal (CONVERTER *self, const ELEMENT
*element, TEXT *result)
{
int entry_index = 0;
- /* drop the const with a cast, but we know that it is not modified, with
- 0 as the third argument */
- ELEMENT_LIST *section_childs = lookup_extra_contents ((ELEMENT *) element,
+ const ELEMENT_LIST *section_childs = lookup_extra_contents (element,
"section_childs");
if (section_childs && section_childs->number > 0)
{
@@ -9932,12 +9930,12 @@ convert_heading_command (CONVERTER *self, const enum
command_id cmd,
}
else if (!strcmp (self->conf->FORMAT_MENU.string, "menu"))
{
- ELEMENT *node
+ const ELEMENT *node
= lookup_extra_element (element, "associated_node");
if (node)
{
int automatic_directions = (node->args.number <= 1);
- ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
+ const ELEMENT_LIST *menus = lookup_extra_contents (node,
"menus");
if (!menus && automatic_directions)
{
ELEMENT *menu_node
@@ -11237,7 +11235,7 @@ convert_quotation_command (CONVERTER *self, const enum
command_id cmd,
const HTML_ARGS_FORMATTED *args_formatted,
const char *content, TEXT *result)
{
- ELEMENT_LIST *authors;
+ const ELEMENT_LIST *authors;
char *cancelled = html_cancel_pending_formatted_inline_content (self,
builtin_command_name (cmd));
@@ -11281,8 +11279,7 @@ convert_quotation_command (CONVERTER *self, const enum
command_id cmd,
text_append (result, content);
}
- /* the cast is here to discard const */
- authors = lookup_extra_contents ((ELEMENT *) element, "authors");
+ authors = lookup_extra_contents (element, "authors");
if (authors)
{
int i;
diff --git a/tp/Texinfo/XS/main/extra.c b/tp/Texinfo/XS/main/extra.c
index 12d62547a2..c2583ae2ea 100644
--- a/tp/Texinfo/XS/main/extra.c
+++ b/tp/Texinfo/XS/main/extra.c
@@ -279,7 +279,6 @@ lookup_extra_integer (const ELEMENT *e, const char *key,
int *ret)
ELEMENT_LIST *
lookup_extra_contents (const ELEMENT *e, const char *key)
{
- ELEMENT_LIST *e_list = 0;
KEY_PAIR *k = lookup_extra (e, key);
if (!k)
return 0;
@@ -294,8 +293,8 @@ lookup_extra_contents (const ELEMENT *e, const char *key)
return k->list;
}
-ELEMENT *
-lookup_extra_directions (ELEMENT *e, const char *key)
+const ELEMENT *
+lookup_extra_directions (const ELEMENT *e, const char *key)
{
KEY_PAIR *k = lookup_extra (e, key);
if (!k)
diff --git a/tp/Texinfo/XS/main/extra.h b/tp/Texinfo/XS/main/extra.h
index 0d4a2d1f7f..5c5ed2598d 100644
--- a/tp/Texinfo/XS/main/extra.h
+++ b/tp/Texinfo/XS/main/extra.h
@@ -42,7 +42,7 @@ KEY_PAIR *lookup_info (const ELEMENT *e, const char *key);
ELEMENT *lookup_extra_element (const ELEMENT *e, const char *key);
ELEMENT *lookup_info_element (const ELEMENT *e, const char *key);
ELEMENT_LIST *lookup_extra_contents (const ELEMENT *e, const char *key);
-ELEMENT *lookup_extra_directions (ELEMENT *e, const char *key);
+const ELEMENT *lookup_extra_directions (const ELEMENT *e, const char *key);
int lookup_extra_integer (const ELEMENT *e, const char *key, int *ret);
char *lookup_extra_string (const ELEMENT *e, const char *key);
char *lookup_info_string (const ELEMENT *e, const char *key);
diff --git a/tp/Texinfo/XS/main/manipulate_tree.c
b/tp/Texinfo/XS/main/manipulate_tree.c
index 4c8493c9d6..8c3049dd6d 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.c
+++ b/tp/Texinfo/XS/main/manipulate_tree.c
@@ -976,7 +976,7 @@ protect_text (ELEMENT *current, char *to_protect)
char *
-normalized_menu_entry_internal_node (ELEMENT *entry)
+normalized_menu_entry_internal_node (const ELEMENT *entry)
{
int i;
for (i = 0; i < entry->contents.number; i++)
@@ -995,10 +995,10 @@ normalized_menu_entry_internal_node (ELEMENT *entry)
}
ELEMENT *
-normalized_entry_associated_internal_node (ELEMENT *entry,
- LABEL_LIST *identifiers_target)
+normalized_entry_associated_internal_node (const ELEMENT *entry,
+ const LABEL_LIST
*identifiers_target)
{
- char *normalized_entry_node = normalized_menu_entry_internal_node (entry);
+ const char *normalized_entry_node = normalized_menu_entry_internal_node
(entry);
if (normalized_entry_node)
{
ELEMENT *node = find_identifier_target (identifiers_target,
@@ -1011,13 +1011,13 @@ normalized_entry_associated_internal_node (ELEMENT
*entry,
ELEMENT *
first_menu_node (ELEMENT *node, LABEL_LIST *identifiers_target)
{
- ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
+ const ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
if (menus)
{
int i;
for (i = 0; i < menus->number; i++)
{
- ELEMENT *menu = menus->list[i];
+ const ELEMENT *menu = menus->list[i];
int j;
for (j = 0; j < menu->contents.number; j++)
{
diff --git a/tp/Texinfo/XS/main/manipulate_tree.h
b/tp/Texinfo/XS/main/manipulate_tree.h
index 2d228f1110..e8b3f95c33 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.h
+++ b/tp/Texinfo/XS/main/manipulate_tree.h
@@ -47,8 +47,8 @@ ELEMENT_LIST *protect_text (ELEMENT *current, char
*to_protect);
-char *normalized_menu_entry_internal_node (ELEMENT *entry);
-ELEMENT *normalized_entry_associated_internal_node (ELEMENT *entry,
- LABEL_LIST
*identifiers_target);
+char *normalized_menu_entry_internal_node (const ELEMENT *entry);
+ELEMENT *normalized_entry_associated_internal_node (const ELEMENT *entry,
+ const LABEL_LIST
*identifiers_target);
ELEMENT *first_menu_node (ELEMENT *node, LABEL_LIST *identifiers_target);
#endif
diff --git a/tp/Texinfo/XS/main/output_unit.c b/tp/Texinfo/XS/main/output_unit.c
index 7a8c5c87ed..d12f8e33ea 100644
--- a/tp/Texinfo/XS/main/output_unit.c
+++ b/tp/Texinfo/XS/main/output_unit.c
@@ -513,7 +513,7 @@ units_directions (OPTIONS *customization_information,
OUTPUT_UNIT *output_unit = output_units->list[i];
OUTPUT_UNIT **directions = output_unit->directions;
ELEMENT *node = output_unit_node (output_unit);
- ELEMENT *node_directions;
+ const ELEMENT *node_directions;
ELEMENT *section = output_unit_section (output_unit);
directions[RUD_type_This] = output_unit;
@@ -528,7 +528,7 @@ units_directions (OPTIONS *customization_information,
if (node)
{
- ELEMENT *menu_child = first_menu_node(node, identifiers_target);
+ ELEMENT *menu_child = first_menu_node (node, identifiers_target);
enum directions d;
node_directions = lookup_extra_directions (node, "node_directions");
if (node_directions)
@@ -545,14 +545,14 @@ units_directions (OPTIONS *customization_information,
if (menu_child)
{
directions[RUD_type_NodeForward]
- = label_target_unit_element(menu_child);
+ = label_target_unit_element (menu_child);
}
else
{
int automatic_directions = (node->args.number <= 1);
- ELEMENT *associated_section = lookup_extra_element (node,
+ const ELEMENT *associated_section = lookup_extra_element (node,
"associated_section");
- ELEMENT_LIST *section_childs = 0;
+ const ELEMENT_LIST *section_childs = 0;
if (associated_section)
section_childs = lookup_extra_contents (associated_section,
"section_childs");
@@ -565,7 +565,7 @@ units_directions (OPTIONS *customization_information,
else if (node_directions
&& node_directions->contents.list[D_next])
directions[RUD_type_NodeForward]
- = label_target_unit_element(
+ = label_target_unit_element (
node_directions->contents.list[D_next]);
else if (node_directions && node_directions->contents.list[D_up])
{
@@ -575,7 +575,7 @@ units_directions (OPTIONS *customization_information,
add_to_element_list (&up_list, node);
while (1)
{
- ELEMENT *up_node_directions;
+ const ELEMENT *up_node_directions;
int i;
int in_up = 0;
for (i = 0; i < up_list.number; i++)
@@ -593,7 +593,7 @@ units_directions (OPTIONS *customization_information,
&& up_node_directions->contents.list[D_next])
{
directions[RUD_type_NodeForward]
- = label_target_unit_element(
+ = label_target_unit_element (
up_node_directions->contents.list[D_next]);
break;
}
@@ -651,12 +651,12 @@ units_directions (OPTIONS *customization_information,
}
else
{
- ELEMENT *up = section;
- ELEMENT_LIST *up_section_childs;
+ const ELEMENT *up = section;
+ const ELEMENT_LIST *up_section_childs;
int up_section_level;
int status;
enum directions d;
- ELEMENT *section_directions = lookup_extra_directions (section,
+ const ELEMENT *section_directions = lookup_extra_directions (section,
"section_directions");
if (section_directions)
{
@@ -687,7 +687,7 @@ units_directions (OPTIONS *customization_information,
up_section_level
= lookup_extra_integer (up, "section_level", &status);
- ELEMENT *up_section_directions = lookup_extra_directions (up,
+ const ELEMENT *up_section_directions = lookup_extra_directions
(up,
"section_directions");
if (status >= 0 && up_section_level > 1
&& up_section_directions
@@ -707,7 +707,7 @@ units_directions (OPTIONS *customization_information,
}
else
{
- ELEMENT *toplevel_directions
+ const ELEMENT *toplevel_directions
= lookup_extra_directions (up, "toplevel_directions");
if (toplevel_directions
&& toplevel_directions->contents.list[D_next])
@@ -715,7 +715,8 @@ units_directions (OPTIONS *customization_information,
=
toplevel_directions->contents.list[D_next]->associated_unit;
else
{
- ELEMENT *up_section_directions = lookup_extra_directions (up,
+ const ELEMENT *up_section_directions
+ = lookup_extra_directions (up,
"section_directions");
if (up_section_directions
&& up_section_directions->contents.list[D_next])
diff --git a/tp/Texinfo/XS/main/targets.c b/tp/Texinfo/XS/main/targets.c
index 521e6c9669..5f5dc7351c 100644
--- a/tp/Texinfo/XS/main/targets.c
+++ b/tp/Texinfo/XS/main/targets.c
@@ -51,12 +51,12 @@ compare_targets (const void *a, const void *b)
}
ELEMENT *
-find_identifier_target (LABEL_LIST *identifiers_target,
- char *normalized)
+find_identifier_target (const LABEL_LIST *identifiers_target,
+ const char *normalized)
{
static LABEL target_key;
LABEL *result;
- target_key.identifier = normalized;
+ target_key.identifier = (char *) normalized;
result = (LABEL *)bsearch (&target_key, identifiers_target->list,
identifiers_target->number, sizeof(LABEL),
compare_targets);
diff --git a/tp/Texinfo/XS/main/targets.h b/tp/Texinfo/XS/main/targets.h
index 0f44691615..b0bdc53c2e 100644
--- a/tp/Texinfo/XS/main/targets.h
+++ b/tp/Texinfo/XS/main/targets.h
@@ -7,8 +7,8 @@
#include "tree_types.h"
#include "document_types.h"
-ELEMENT *find_identifier_target (LABEL_LIST *identifiers_target,
- char *normalized);
+ELEMENT *find_identifier_target (const LABEL_LIST *identifiers_target,
+ const char *normalized);
int register_label_element (int document_descriptor, ELEMENT *element,
ERROR_MESSAGE_LIST *error_messages);
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index c79177d70a..97ae9ff7cd 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -169,7 +169,7 @@ sectioning_structure (DOCUMENT *document)
int up_level;
while (1)
{
- ELEMENT *up_section_directions
+ const ELEMENT *up_section_directions
= lookup_extra_directions (up, "section_directions");
up_level = lookup_extra_integer (up, "section_level",
&status);
@@ -243,7 +243,7 @@ sectioning_structure (DOCUMENT *document)
= lookup_extra_contents (up, "section_childs");
ELEMENT *prev
= up_section_childs->list[up_section_childs->number -1];
- ELEMENT *prev_section_directions
+ const ELEMENT *prev_section_directions
= lookup_extra_directions (prev, "section_directions");
add_extra_directions (content, "section_directions",
section_directions);
@@ -361,7 +361,7 @@ sectioning_structure (DOCUMENT *document)
if (previous_toplevel)
{
- ELEMENT *prev_toplvl_directions
+ const ELEMENT *prev_toplvl_directions
= lookup_extra_directions (previous_toplevel,
"toplevel_directions");
if (!prev_toplvl_directions)
@@ -460,21 +460,23 @@ check_menu_entry (DOCUMENT *document, enum command_id cmd,
}
ELEMENT_LIST *
-get_node_node_childs_from_sectioning (ELEMENT *node)
+get_node_node_childs_from_sectioning (const ELEMENT *node)
{
ELEMENT_LIST *node_childs = new_list ();
- ELEMENT *associated_section = lookup_extra_element (node,
"associated_section");
+ const ELEMENT *associated_section
+ = lookup_extra_element (node, "associated_section");
if (associated_section)
{
- ELEMENT_LIST *section_childs = lookup_extra_contents (associated_section,
- "section_childs");
+ const ELEMENT_LIST *section_childs
+ = lookup_extra_contents (associated_section,
+ "section_childs");
if (section_childs)
{
int i;
for (i = 0; i < section_childs->number; i++)
{
- ELEMENT *child = section_childs->list[i];
+ const ELEMENT *child = section_childs->list[i];
ELEMENT *associated_node = lookup_extra_element (child,
"associated_node");
if (associated_node)
@@ -485,10 +487,11 @@ get_node_node_childs_from_sectioning (ELEMENT *node)
@top. */
if (associated_section->cmd == CM_top)
{
- ELEMENT *current = associated_section;
+ const ELEMENT *current = associated_section;
while (1)
{
- ELEMENT *section_directions = lookup_extra_directions (current,
+ const ELEMENT *section_directions
+ = lookup_extra_directions (current,
"section_directions");
if (section_directions
&& section_directions->contents.list[D_next])
@@ -614,11 +617,11 @@ check_nodes_are_referenced (DOCUMENT *document)
for (i = 0; i < nodes_list->number; i++)
{
int status;
- ELEMENT *node = nodes_list->list[i];
+ const ELEMENT *node = nodes_list->list[i];
int is_target = lookup_extra_integer (node, "is_target", &status);
- ELEMENT *node_directions = lookup_extra_directions (node,
+ const ELEMENT *node_directions = lookup_extra_directions (node,
"node_directions");
- ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
+ const ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
if (is_target)
nr_nodes_to_find++;
@@ -835,7 +838,7 @@ set_menus_node_directions (DOCUMENT *document)
{
int j;
ELEMENT *node = nodes_list->list[i];
- ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
+ const ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
if (!menus)
continue;
@@ -885,7 +888,7 @@ set_menus_node_directions (DOCUMENT *document)
normalized);
if (menu_node)
{
- ELEMENT *menu_directions
+ const ELEMENT *menu_directions
= lookup_extra_directions (menu_node,
"menu_directions");
if (!menu_directions)
@@ -915,7 +918,7 @@ set_menus_node_directions (DOCUMENT *document)
"manual_content");
if (!manual_content)
{
- ELEMENT *menu_directions
+ const ELEMENT *menu_directions
= lookup_extra_directions (menu_node,
"menu_directions");
if (!menu_directions)
@@ -927,7 +930,7 @@ set_menus_node_directions (DOCUMENT *document)
}
if (!prev_manual_content)
{
- ELEMENT *menu_directions
+ const ELEMENT *menu_directions
= lookup_extra_directions (previous_node,
"menu_directions");
if (!menu_directions)
@@ -983,13 +986,15 @@ set_menus_node_directions (DOCUMENT *document)
static char *direction_bases[] = {"section_directions", "toplevel_directions"};
ELEMENT *
-section_direction_associated_node (ELEMENT *section, enum directions direction)
+section_direction_associated_node (const ELEMENT *section,
+ enum directions direction)
{
int i;
for (i = 0; i < sizeof (direction_bases) / sizeof (direction_bases[0]);
i++)
{
- ELEMENT *directions = lookup_extra_directions (section,
direction_bases[i]);
+ const ELEMENT *directions
+ = lookup_extra_directions (section, direction_bases[i]);
if (directions && directions->contents.list[direction])
{
ELEMENT *section_to = directions->contents.list[direction];
@@ -1029,13 +1034,13 @@ complete_node_tree_with_menus (DOCUMENT *document)
{
ELEMENT *node = nodes_list->list[i];
char *normalized = lookup_extra_string (node, "normalized");
- ELEMENT *menu_directions = lookup_extra_directions (node,
+ const ELEMENT *menu_directions = lookup_extra_directions (node,
"menu_directions");
int automatic_directions = (node->args.number <= 1);
if (automatic_directions)
{
- ELEMENT *node_directions = lookup_extra_directions (node,
+ const ELEMENT *node_directions = lookup_extra_directions (node,
"node_directions");
if (strcmp (normalized, "Top"))
{
@@ -1060,9 +1065,9 @@ complete_node_tree_with_menus (DOCUMENT *document)
&& ((!options)
|| options->CHECK_NORMAL_MENU_STRUCTURE.integer > 0))
{
- ELEMENT *node_direction_section = section;
- ELEMENT *part_section;
- ELEMENT *direction_associated_node;
+ const ELEMENT *node_direction_section = section;
+ const ELEMENT *part_section;
+ const ELEMENT *direction_associated_node;
/* Prefer the section associated with a @part for node directions. */
part_section = lookup_extra_element (section,
"part_associated_section");
@@ -1073,16 +1078,17 @@ complete_node_tree_with_menus (DOCUMENT *document)
node_direction_section, d);
if (direction_associated_node)
{
- ELEMENT_LIST *menus = 0;
- ELEMENT *section_directions
+ const ELEMENT_LIST *menus = 0;
+ const ELEMENT *section_directions
= lookup_extra_directions (node_direction_section,
"section_directions");
if (section_directions
&& section_directions->contents.list[D_up])
{
- ELEMENT *up_sec
+ const ELEMENT *up_sec
= section_directions->contents.list[D_up];
- ELEMENT *up_node = lookup_extra_element (up_sec,
+ const ELEMENT *up_node
+ = lookup_extra_element (up_sec,
"associated_node");
if (up_node)
menus
@@ -1121,7 +1127,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
{
ELEMENT *elt_menu_direction
= menu_directions->contents.list[d];
- ELEMENT *menu_direction_manual_content
+ const ELEMENT *menu_direction_manual_content
= lookup_extra_element (elt_menu_direction,
"manual_content");
if (!menu_direction_manual_content)
@@ -1168,11 +1174,11 @@ complete_node_tree_with_menus (DOCUMENT *document)
"node_directions", 0);
node_directions->contents.list[D_next] = menu_child;
- ELEMENT *menu_child_manual_content
+ const ELEMENT *menu_child_manual_content
= lookup_extra_element (menu_child, "manual_content");
if (!menu_child_manual_content)
{
- ELEMENT *child_node_directions
+ const ELEMENT *child_node_directions
= lookup_extra_directions (menu_child,
"node_directions");
if (!child_node_directions)
@@ -1204,7 +1210,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
= (first_non_top_node->args.number <= 1);
if (first_non_top_node_automatic)
{
- ELEMENT *non_top_node_directions
+ const ELEMENT *non_top_node_directions
= lookup_extra_directions (first_non_top_node,
"node_directions");
if (!non_top_node_directions)
@@ -1225,7 +1231,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
|| options->CHECK_NORMAL_MENU_STRUCTURE.integer > 0)
&& strcmp (normalized, "Top"))
{
- ELEMENT *node_directions = lookup_extra_directions (node,
+ const ELEMENT *node_directions = lookup_extra_directions (node,
"node_directions");
if (node_directions && menu_directions)
{
@@ -1266,9 +1272,9 @@ complete_node_tree_with_menus (DOCUMENT *document)
if ((!options)
|| options->CHECK_MISSING_MENU_ENTRY.integer > 0)
{
- ELEMENT *node_directions = lookup_extra_directions (node,
+ const ELEMENT *node_directions = lookup_extra_directions (node,
"node_directions");
- ELEMENT *up_node = 0;
+ const ELEMENT *up_node = 0;
if (node_directions && node_directions->contents.list[D_up])
up_node = node_directions->contents.list[D_up];
if (up_node)
@@ -1369,12 +1375,12 @@ nodes_tree (DOCUMENT *document)
if (!top_node || node != top_node)
{
enum directions d;
- ELEMENT *node_directions = lookup_extra_directions (node,
+ const ELEMENT *node_directions = lookup_extra_directions (node,
"node_directions");
for (d = 0; d < directions_length; d++)
{
- ELEMENT *section;
- ELEMENT *part_section;
+ const ELEMENT *section;
+ const ELEMENT *part_section;
ELEMENT *direction_associated_node;
/* prev already defined for the node first Top node menu entry */
if (d == D_prev && node_directions
@@ -1427,7 +1433,8 @@ nodes_tree (DOCUMENT *document)
= lookup_extra_element (first_sec, "associated_node");
if (top_node_section_child)
{
- ELEMENT *top_directions = lookup_extra_directions
(node,
+ const ELEMENT *top_directions
+ = lookup_extra_directions (node,
"node_directions");
if (!top_directions)
top_directions = add_extra_directions (node,
@@ -1436,7 +1443,7 @@ nodes_tree (DOCUMENT *document)
= top_node_section_child;
if (top_node_section_child->args.number <= 1)
{
- ELEMENT *top_section_child_directions
+ const ELEMENT *top_section_child_directions
= lookup_extra_directions (top_node_section_child,
"node_directions");
if (!top_section_child_directions)
@@ -1457,12 +1464,13 @@ nodes_tree (DOCUMENT *document)
{
ELEMENT *direction_element = node->args.list[i];
int direction = i - 1;
- ELEMENT *manual_content
+ const ELEMENT *manual_content
= lookup_extra_element (direction_element,
"manual_content");
if (manual_content)
{
- ELEMENT *node_directions = lookup_extra_directions (node,
+ const ELEMENT *node_directions
+ = lookup_extra_directions (node,
"node_directions");
if (!node_directions)
node_directions = add_extra_directions (node,
@@ -1481,7 +1489,7 @@ nodes_tree (DOCUMENT *document)
direction_normalized);
if (node_target)
{
- ELEMENT *node_directions
+ const ELEMENT *node_directions
= lookup_extra_directions (node,
"node_directions");
if (!node_directions)
@@ -1638,7 +1646,7 @@ associate_internal_references (DOCUMENT *document)
void
number_floats (DOCUMENT *document)
{
- LISTOFFLOATS_TYPE_LIST *listoffloats_list = document->listoffloats;
+ const LISTOFFLOATS_TYPE_LIST *listoffloats_list = document->listoffloats;
size_t i;
if (!listoffloats_list)
@@ -1646,17 +1654,19 @@ number_floats (DOCUMENT *document)
for (i = 0; i < listoffloats_list->number; i++)
{
- LISTOFFLOATS_TYPE *listoffloats = &listoffloats_list->float_types[i];
+ const LISTOFFLOATS_TYPE *listoffloats
+ = &listoffloats_list->float_types[i];
int float_index = 0;
int nr_in_chapter = 0;
- ELEMENT *current_chapter = 0;
+ const ELEMENT *current_chapter = 0;
size_t j;
for (j = 0; j < listoffloats->float_list.number; j++)
{
static TEXT number;
ELEMENT *float_elt = listoffloats->float_list.list[j];
- char *normalized = lookup_extra_string (float_elt, "normalized");
- ELEMENT *up;
+ const char *normalized
+ = lookup_extra_string (float_elt, "normalized");
+ const ELEMENT *up;
if (!normalized)
continue;
@@ -1668,7 +1678,7 @@ number_floats (DOCUMENT *document)
{
while (1)
{
- ELEMENT *section_directions
+ const ELEMENT *section_directions
= lookup_extra_directions (up, "section_directions");
if (section_directions
&& section_directions->contents.list[D_up])
@@ -1690,7 +1700,7 @@ number_floats (DOCUMENT *document)
}
if (!(command_other_flags (up) & CF_unnumbered))
{
- char *section_number
+ const char *section_number
= lookup_extra_string (up, "section_number");
nr_in_chapter++;
text_printf (&number, "%s.%zu", section_number,
@@ -1864,8 +1874,8 @@ insert_menu_comment_content (ELEMENT_LIST *element_list,
int position,
}
ELEMENT *
-new_complete_node_menu (ELEMENT *node, DOCUMENT *document,
- OPTIONS *options, int use_sections)
+new_complete_node_menu (const ELEMENT *node, DOCUMENT *document,
+ const OPTIONS *options, int use_sections)
{
ELEMENT_LIST *node_childs = get_node_node_childs_from_sectioning (node);
ELEMENT *section;
@@ -1975,7 +1985,7 @@ new_complete_node_menu (ELEMENT *node, DOCUMENT *document,
}
ELEMENT_LIST *
-print_down_menus (ELEMENT *node, LABEL_LIST *identifiers_target,
+print_down_menus (const ELEMENT *node, const LABEL_LIST *identifiers_target,
int use_sections)
{
ELEMENT_LIST *master_menu_contents = new_list ();
@@ -2068,7 +2078,7 @@ print_down_menus (ELEMENT *node, LABEL_LIST
*identifiers_target,
}
ELEMENT *
-new_master_menu (OPTIONS *options, LABEL_LIST *identifiers_target,
+new_master_menu (const OPTIONS *options, const LABEL_LIST *identifiers_target,
const ELEMENT_LIST *menus, int use_sections)
{
/* only holds contents here, will be turned into a proper block
@@ -2173,9 +2183,9 @@ protect_colon_in_tree (ELEMENT *tree)
}
ELEMENT *
-new_complete_menu_master_menu (OPTIONS *options,
- LABEL_LIST *identifiers_target,
- ELEMENT *node)
+new_complete_menu_master_menu (const OPTIONS *options,
+ const LABEL_LIST *identifiers_target,
+ const ELEMENT *node)
{
ELEMENT *menu_node = new_complete_node_menu (node, 0, options, 0);
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.h
b/tp/Texinfo/XS/structuring_transfo/structuring.h
index 74e64120bd..6528509951 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.h
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.h
@@ -9,8 +9,8 @@
void associate_internal_references (DOCUMENT *document);
ELEMENT_LIST *sectioning_structure (DOCUMENT *document);
ELEMENT_LIST *nodes_tree (DOCUMENT *document);
-ELEMENT_LIST *get_node_node_childs_from_sectioning (ELEMENT *node);
-char *normalized_menu_entry_internal_node (ELEMENT *entry);
+ELEMENT_LIST *get_node_node_childs_from_sectioning (const ELEMENT *node);
+char *normalized_menu_entry_internal_node (const ELEMENT *entry);
void warn_non_empty_parts (DOCUMENT *document);
void set_menus_node_directions (DOCUMENT *document);
void complete_node_tree_with_menus (DOCUMENT *document);
@@ -18,15 +18,15 @@ void check_nodes_are_referenced (DOCUMENT *document);
void number_floats (DOCUMENT *document);
ELEMENT *new_node_menu_entry (ELEMENT *node, int use_sections);
-ELEMENT *new_complete_node_menu (ELEMENT *node, DOCUMENT *document,
- OPTIONS *options, int use_sections);
+ELEMENT *new_complete_node_menu (const ELEMENT *node, DOCUMENT *document,
+ const OPTIONS *options, int use_sections);
void new_block_command (ELEMENT *element, enum command_id cmd);
-ELEMENT *new_master_menu (OPTIONS *options, LABEL_LIST *identifiers_target,
+ELEMENT *new_master_menu (const OPTIONS *options, const LABEL_LIST
*identifiers_target,
const ELEMENT_LIST *menus, int use_sections);
-ELEMENT *new_complete_menu_master_menu (OPTIONS *options,
- LABEL_LIST *identifiers_target,
- ELEMENT *node);
+ELEMENT *new_complete_menu_master_menu (const OPTIONS *options,
+ const LABEL_LIST *identifiers_target,
+ const ELEMENT *node);
ELEMENT *protect_colon_in_tree (ELEMENT *tree);
#endif
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 6c64cc6ce3..a98f09558f 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -940,7 +940,7 @@ complete_node_menu (ELEMENT *node, int use_sections)
ELEMENT *current_menu = 0;
int i;
- ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
+ const ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
if (menus)
{
@@ -1110,7 +1110,7 @@ complete_tree_nodes_missing_menu (ELEMENT *root, DOCUMENT
*document,
for (i = 0; i < non_automatic_nodes->number; i++)
{
ELEMENT *node = non_automatic_nodes->list[i];
- ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
+ const ELEMENT_LIST *menus = lookup_extra_contents (node, "menus");
if (!(menus && menus->number > 0))
{
ELEMENT *section = lookup_extra_element (node, "associated_section");
@@ -1134,7 +1134,7 @@ regenerate_master_menu (DOCUMENT *document, int
use_sections)
LABEL_LIST *identifiers_target = document->identifiers_target;
ELEMENT *top_node = find_identifier_target (identifiers_target, "Top");
- ELEMENT_LIST *menus;
+ const ELEMENT_LIST *menus;
ELEMENT *master_menu;
ELEMENT *last_menu;
ELEMENT *last_content;
- branch master updated: Add const.,
Patrice Dumas <=