texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (build_tar


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (build_target_elements_list) (build_internal_xref_list, build_float_types_list) (BUILD_PERL_DOCUMENT_LIST): use a list as input argument. Update callers. Modify BUILD_PERL_DOCUMENT_LIST to use a list too, using the address of the fieldname.
Date: Sat, 18 May 2024 11:20:12 -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 82b05e2fbe * tp/Texinfo/XS/main/build_perl_info.c 
(build_target_elements_list) (build_internal_xref_list, build_float_types_list) 
(BUILD_PERL_DOCUMENT_LIST): use a list as input argument.  Update callers.  
Modify BUILD_PERL_DOCUMENT_LIST to use a list too, using the address of the 
fieldname.
82b05e2fbe is described below

commit 82b05e2fbeeae57bb15e3031ca5b75dd768b89dc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat May 18 17:20:13 2024 +0200

    * tp/Texinfo/XS/main/build_perl_info.c (build_target_elements_list)
    (build_internal_xref_list, build_float_types_list)
    (BUILD_PERL_DOCUMENT_LIST): use a list as input argument.  Update
    callers.  Modify BUILD_PERL_DOCUMENT_LIST to use a list too, using the
    address of the fieldname.
    
    * tp/Texinfo/XS/convert/convert_html.c,
    tp/Texinfo/XS/convert/get_html_perl_info.c,
    tp/Texinfo/XS/main/IndicesXS.xs, tp/Texinfo/XS/main/document.c
    (new_document, destroy_document_information_except_tree),
    tp/Texinfo/XS/main/document_types.h (DOCUMENT),
    tp/Texinfo/XS/main/floats.c (float_list_to_listoffloats_list)
    (free_listoffloats_list), tp/Texinfo/XS/main/targets.c
    (set_labels_identifiers_target, sort_labels_identifiers_target)
    (add_element_to_identifiers_target), tp/Texinfo/XS/main/utils.c
    (free_indices_info), tp/Texinfo/XS/parsetexi/end_line.c,
    tp/Texinfo/XS/parsetexi/indices.c, tp/Texinfo/XS/parsetexi/labels.c,
    tp/Texinfo/XS/parsetexi/parser.c (parse_texi),
    tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
    (relate_index_entries_to_table_items_in_tree),
    tp/Texinfo/XS/structuring_transfo/structuring.c,
    tp/Texinfo/XS/structuring_transfo/transformations.c: put directly
    structures in DOCUMENT instead of pointers for some fields that are
    not moved around.  Modify float_list_to_listoffloats_list and
    set_labels_identifiers_target to take in argument the list where the
    generated structure will be put instead of returning it.  Replace
    destroy_listoffloats_list by free_listoffloats_list, which does not
    destroy the argument.  Modify sort_labels_identifiers_target and
    add_element_to_identifiers_target to change only the list of
    identifiers_target, not the LABEL_LIST.  Replace wipe_index_names by
    free_indices_info that does not destroy the argument.
---
 ChangeLog                                          | 34 +++++++++++++++
 tp/Texinfo/XS/convert/convert_html.c               | 39 +++++++++--------
 tp/Texinfo/XS/convert/get_html_perl_info.c         | 18 ++++----
 tp/Texinfo/XS/main/IndicesXS.xs                    |  2 +-
 tp/Texinfo/XS/main/build_perl_info.c               | 51 ++++++++++------------
 tp/Texinfo/XS/main/build_perl_info.h               |  4 --
 tp/Texinfo/XS/main/document.c                      | 33 +++++---------
 tp/Texinfo/XS/main/document_types.h                | 15 ++++---
 tp/Texinfo/XS/main/floats.c                        | 35 +++++----------
 tp/Texinfo/XS/main/floats.h                        |  6 +--
 tp/Texinfo/XS/main/get_perl_info.c                 |  8 ++--
 tp/Texinfo/XS/main/targets.c                       | 42 +++++++++---------
 tp/Texinfo/XS/main/targets.h                       |  4 +-
 tp/Texinfo/XS/main/utils.c                         |  8 ++--
 tp/Texinfo/XS/main/utils.h                         |  2 +-
 tp/Texinfo/XS/parsetexi/end_line.c                 |  8 ++--
 tp/Texinfo/XS/parsetexi/indices.c                  | 12 +++--
 tp/Texinfo/XS/parsetexi/indices.h                  |  2 +-
 tp/Texinfo/XS/parsetexi/labels.c                   |  4 +-
 tp/Texinfo/XS/parsetexi/parser.c                   | 12 ++---
 .../XS/structuring_transfo/StructuringTransfoXS.xs | 16 ++-----
 tp/Texinfo/XS/structuring_transfo/structuring.c    | 18 ++++----
 .../XS/structuring_transfo/transformations.c       | 13 +++---
 23 files changed, 188 insertions(+), 198 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dc15ed1a0c..e1e1c8ef36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2024-05-18  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/build_perl_info.c (build_target_elements_list)
+       (build_internal_xref_list, build_float_types_list)
+       (BUILD_PERL_DOCUMENT_LIST): use a list as input argument.  Update
+       callers.  Modify BUILD_PERL_DOCUMENT_LIST to use a list too, using the
+       address of the fieldname.
+
+       * tp/Texinfo/XS/convert/convert_html.c,
+       tp/Texinfo/XS/convert/get_html_perl_info.c,
+       tp/Texinfo/XS/main/IndicesXS.xs, tp/Texinfo/XS/main/document.c
+       (new_document, destroy_document_information_except_tree),
+       tp/Texinfo/XS/main/document_types.h (DOCUMENT),
+       tp/Texinfo/XS/main/floats.c (float_list_to_listoffloats_list)
+       (free_listoffloats_list), tp/Texinfo/XS/main/targets.c
+       (set_labels_identifiers_target, sort_labels_identifiers_target)
+       (add_element_to_identifiers_target), tp/Texinfo/XS/main/utils.c
+       (free_indices_info), tp/Texinfo/XS/parsetexi/end_line.c,
+       tp/Texinfo/XS/parsetexi/indices.c, tp/Texinfo/XS/parsetexi/labels.c,
+       tp/Texinfo/XS/parsetexi/parser.c (parse_texi),
+       tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+       (relate_index_entries_to_table_items_in_tree),
+       tp/Texinfo/XS/structuring_transfo/structuring.c,
+       tp/Texinfo/XS/structuring_transfo/transformations.c: put directly
+       structures in DOCUMENT instead of pointers for some fields that are
+       not moved around.  Modify float_list_to_listoffloats_list and
+       set_labels_identifiers_target to take in argument the list where the
+       generated structure will be put instead of returning it.  Replace
+       destroy_listoffloats_list by free_listoffloats_list, which does not
+       destroy the argument.  Modify sort_labels_identifiers_target and
+       add_element_to_identifiers_target to change only the list of
+       identifiers_target, not the LABEL_LIST.  Replace wipe_index_names by
+       free_indices_info that does not destroy the argument.
+
 2024-05-18  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/document.c (document_list, retrieve_document)
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 8bcd7345a8..758b5c4b58 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -287,7 +287,7 @@ static OUTPUT_UNIT *
 get_top_unit (DOCUMENT *document, const OUTPUT_UNIT_LIST *output_units)
 {
   const ELEMENT *node_top = find_identifier_target
-                          (document->identifiers_target, "Top");
+                          (&document->identifiers_target, "Top");
   const ELEMENT *section_top = document->global_commands->top;
 
   if (section_top)
@@ -2075,7 +2075,7 @@ void
 set_root_commands_targets_node_files (CONVERTER *self)
 {
 
-  if (self->document->identifiers_target)
+  if (self->document->identifiers_target.number > 0)
     {
       const char *extension = 0;
 
@@ -2083,7 +2083,7 @@ set_root_commands_targets_node_files (CONVERTER *self)
         extension = self->conf->EXTENSION.string;
       /* use labels_list and not identifiers_target to process in the
          document order */
-      LABEL_LIST *label_targets = self->document->labels_list;
+      const LABEL_LIST *label_targets = &self->document->labels_list;
       int i;
       for (i = 0; i < label_targets->number; i++)
         {
@@ -4693,7 +4693,7 @@ compare_index_name (const void *a, const void *b)
 void
 prepare_index_entries_targets (CONVERTER *self)
 {
-  if (self->document->indices_info->number)
+  if (self->document->indices_info.number > 0)
     {
       size_t i;
       self->shared_conversion_state.formatted_index_entries
@@ -5297,8 +5297,8 @@ html_set_pages_files (CONVERTER *self, const 
OUTPUT_UNIT_LIST *output_units,
       int i;
 
       /* first determine the top node file name. */
-      if (self->document->identifiers_target)
-        node_top = find_identifier_target (self->document->identifiers_target,
+      if (self->document->identifiers_target.number > 0)
+        node_top = find_identifier_target (&self->document->identifiers_target,
                                            "Top");
 
       top_node_filename_str = top_node_filename (self, document_name);
@@ -5348,7 +5348,7 @@ html_set_pages_files (CONVERTER *self, const 
OUTPUT_UNIT_LIST *output_units,
                       if (normalized)
                         node_target
                          = find_identifier_target (
-                                  self->document->identifiers_target,
+                                  &self->document->identifiers_target,
                                   normalized);
                    /* double node are not normalized, they are handled here */
                       if (!node_target)
@@ -5804,7 +5804,7 @@ html_prepare_units_directions_files (CONVERTER *self,
     setup_output_simple_page (self, output_filename);
 
 
-  units_directions (self->document->identifiers_target, output_units,
+  units_directions (&self->document->identifiers_target, output_units,
                     self->conf->DEBUG.integer);
 
   prepare_special_units_directions (self, special_units);
@@ -10051,7 +10051,7 @@ convert_heading_command (CONVERTER *self, const enum 
command_id cmd,
                 {
                   ELEMENT *menu_node
                    = new_complete_menu_master_menu (&self->error_messages,
-                         self->conf, self->document->identifiers_target, node);
+                         self->conf, &self->document->identifiers_target, 
node);
 
                   if (menu_node)
                     {
@@ -11012,7 +11012,7 @@ convert_listoffloats_command (CONVERTER *self, const 
enum command_id cmd,
   if (html_in_string (self))
     return;
 
-  listoffloats = self->document->listoffloats;
+  listoffloats = &self->document->listoffloats;
 
   if (!listoffloats->number)
     return;
@@ -12058,7 +12058,7 @@ convert_xref_commands (CONVERTER *self, const enum 
command_id cmd,
       if (normalized && !manual_content)
         {
           target_node = find_identifier_target (
-                                  self->document->identifiers_target,
+                                  &self->document->identifiers_target,
                                   normalized);
         }
     }
@@ -14337,7 +14337,7 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
       if (normalized)
         {
           const ELEMENT *node
-           = find_identifier_target (self->document->identifiers_target,
+           = find_identifier_target (&self->document->identifiers_target,
                                      normalized);
           if (node)
             {
@@ -16923,11 +16923,11 @@ html_initialize_output_state (CONVERTER *self, const 
char *context)
 
   html_new_document_context (self, context, 0, 0);
 
-  if (self->document && self->document->indices_info->number)
+  if (self->document && self->document->indices_info.number)
     {
       size_t i;
       size_t j;
-      INDEX_LIST *indices_info = self->document->indices_info;
+      INDEX_LIST *indices_info = &self->document->indices_info;
       const INDEX **sorted_index_names;
       size_t index_nr = indices_info->number;
       size_t non_empty_index_nr = 0;
@@ -16966,9 +16966,9 @@ html_initialize_output_state (CONVERTER *self, const 
char *context)
   if (self->document)
     {
       const LISTOFFLOATS_TYPE_LIST *listoffloats
-         = self->document->listoffloats;
+         = &self->document->listoffloats;
 
-      if (listoffloats && listoffloats->number)
+      if (listoffloats->number)
         {
           self->shared_conversion_state.formatted_listoffloats_nr
            = (int *) malloc (listoffloats->number * sizeof (int));
@@ -17083,7 +17083,7 @@ html_reset_converter (CONVERTER *self)
   free (self->shared_conversion_state.formatted_listoffloats_nr);
   self->shared_conversion_state.formatted_listoffloats_nr = 0;
 
-  if (self->document->indices_info->number)
+  if (self->document->indices_info.number)
     {
       for (i = 0; i < self->sorted_index_names.number; i++)
         {
@@ -18973,10 +18973,11 @@ html_node_redirections (CONVERTER *self,
 {
   FILE_SOURCE_INFO_LIST *files_source_info = &self->files_source_info;
   int redirection_files_done = 0;
-  if (self->document->identifiers_target && self->conf->NODE_FILES.integer > 0
+  if (self->document->identifiers_target.number > 0
+      && self->conf->NODE_FILES.integer > 0
       && strlen (output_file) > 0)
     {
-      const LABEL_LIST *label_targets = self->document->labels_list;
+      const LABEL_LIST *label_targets = &self->document->labels_list;
       int i;
       const ENCODING_CONVERSION *conversion = 0;
 
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c 
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index eee3b1b3b6..0b9ed96b5e 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -1364,7 +1364,7 @@ find_index_entry_numbers_index_entry_sv (CONVERTER 
*converter,
 
   dTHX;
 
-  if (!converter->document->indices_info->number)
+  if (!converter->document->indices_info.number)
     return 0;
 
   index_entry_hv = (HV *) SvRV (index_entry_sv);
@@ -1492,11 +1492,11 @@ html_set_shared_conversion_state (CONVERTER *converter, 
SV *converter_in,
     {
       char *type = (char *)SvPVutf8_nolen (args_sv[0]);
       int number = SvIV (args_sv[1]);
-      if (converter->document && converter->document->listoffloats)
+      if (converter->document && converter->document->listoffloats.number > 0)
         {
           int i;
-          LISTOFFLOATS_TYPE_LIST
-            *listoffloats = converter->document->listoffloats;
+          const LISTOFFLOATS_TYPE_LIST
+            *listoffloats = &converter->document->listoffloats;
           for (i = 0; i < listoffloats->number; i++)
             {
               LISTOFFLOATS_TYPE *float_types = &listoffloats->float_types[i];
@@ -1579,14 +1579,14 @@ html_get_shared_conversion_state (CONVERTER *converter, 
SV *converter_in,
   else if (!strcmp (state_name, "formatted_listoffloats"))
     {
       char *type = (char *)SvPVutf8_nolen (args_sv[0]);
-      if (converter->document && converter->document->listoffloats)
+      if (converter->document && converter->document->listoffloats.number > 0)
         {
-          int i;
-          LISTOFFLOATS_TYPE_LIST *listoffloats
-            = converter->document->listoffloats;
+          size_t i;
+          const LISTOFFLOATS_TYPE_LIST *listoffloats
+            = &converter->document->listoffloats;
           for (i = 0; i < listoffloats->number; i++)
             {
-              LISTOFFLOATS_TYPE *float_types = &listoffloats->float_types[i];
+              const LISTOFFLOATS_TYPE *float_types = 
&listoffloats->float_types[i];
               if (!strcmp (float_types->type, type))
                 {
                   if (float_types->float_list.number >= 0)
diff --git a/tp/Texinfo/XS/main/IndicesXS.xs b/tp/Texinfo/XS/main/IndicesXS.xs
index 1851de96ad..46809feaa6 100644
--- a/tp/Texinfo/XS/main/IndicesXS.xs
+++ b/tp/Texinfo/XS/main/IndicesXS.xs
@@ -121,7 +121,7 @@ index_entry_element_sort_string (SV *customization_info_sv, 
SV *main_entry_sv, S
             const ELEMENT *element = find_element_from_sv (0, document,
                                                            element_sv, 0);
             INDEX_ENTRY *main_entry = find_index_entry_sv (main_entry_sv,
-                                          document->indices_info, 0,
+                                          &document->indices_info, 0,
                                           &entry_idx, &entry_number);
             in_code = entry_idx->in_code;
 
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index ffd0e62280..64366b2f38 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -740,7 +740,7 @@ build_texinfo_tree (ELEMENT *root, int avoid_recursion)
 /* Return array of target elements.  build_texinfo_tree must
    be called first. */
 AV *
-build_target_elements_list (LABEL *labels_list, size_t labels_number)
+build_target_elements_list (LABEL_LIST *labels_list)
 {
   AV *target_array;
   SV *sv;
@@ -749,11 +749,11 @@ build_target_elements_list (LABEL *labels_list, size_t 
labels_number)
   dTHX;
 
   target_array = newAV ();
-  av_unshift (target_array, labels_number);
+  av_unshift (target_array, labels_list->number);
 
-  for (i = 0; i < labels_number; i++)
+  for (i = 0; i < labels_list->number; i++)
     {
-      sv = newRV_inc (labels_list[i].element->hv);
+      sv = newRV_inc (labels_list->list[i].element->hv);
       av_store (target_array, i, sv);
     }
 
@@ -784,8 +784,7 @@ build_identifiers_target (LABEL_LIST *identifiers_target)
 }
 
 AV *
-build_internal_xref_list (ELEMENT **internal_xref_list,
-                          size_t internal_xref_number)
+build_internal_xref_list (ELEMENT_LIST *internal_xref_list)
 {
   AV *list_av;
   SV *sv;
@@ -794,11 +793,11 @@ build_internal_xref_list (ELEMENT **internal_xref_list,
   dTHX;
 
   list_av = newAV ();
-  av_unshift (list_av, internal_xref_number);
+  av_unshift (list_av, internal_xref_list->number);
 
-  for (i = 0; i < internal_xref_number; i++)
+  for (i = 0; i < internal_xref_list->number; i++)
     {
-      sv = newRV_inc (internal_xref_list[i]->hv);
+      sv = newRV_inc (internal_xref_list->list[i]->hv);
       av_store (list_av, i, sv);
     }
 
@@ -829,7 +828,7 @@ build_elements_list (ELEMENT_LIST *list)
 
 /* Return hash for list of @float's that appeared in the file. */
 HV *
-build_float_types_list (FLOAT_RECORD *floats_list, size_t floats_number)
+build_float_types_list (const FLOAT_RECORD_LIST *floats)
 {
   HV *float_hash;
   SV *sv;
@@ -839,10 +838,10 @@ build_float_types_list (FLOAT_RECORD *floats_list, size_t 
floats_number)
 
   float_hash = newHV ();
 
-  for (i = 0; i < floats_number; i++)
+  for (i = 0; i < floats->number; i++)
     {
       AV *av = 0;
-      SV *float_type = newSVpv_utf8 (floats_list[i].type, 0);
+      SV *float_type = newSVpv_utf8 (floats->list[i].type, 0);
       /* use hv_fetch_ent to be able to pass a SV string for the key and
          not a char to be able to signal that it is UTF-8 encoded.  In recent
          perlapi, it is said that a negative len can be used to specify
@@ -864,7 +863,7 @@ build_float_types_list (FLOAT_RECORD *floats_list, size_t 
floats_number)
           hv_store_ent (float_hash, float_type,
                         newRV_noinc ((SV *)av), 0);
         }
-      sv = newRV_inc ((SV *)floats_list[i].element->hv);
+      sv = newRV_inc ((SV *)floats->list[i].element->hv);
       av_push (av, sv);
     }
 
@@ -1433,7 +1432,7 @@ fill_document_hv (HV *hv, size_t document_descriptor, int 
no_store)
 
   hv_commands_info = build_global_commands (document->global_commands);
 
-  hv_index_names = build_index_data (document->indices_info);
+  hv_index_names = build_index_data (&document->indices_info);
 
   /* NOTE there is also a document->listoffloats which structure
      is more like the hv_listoffloats_list, so it could be
@@ -1441,17 +1440,13 @@ fill_document_hv (HV *hv, size_t document_descriptor, 
int no_store)
      for example build_listoffloats_list that would create the
      hv_listoffloats_list based on document->listoffloats. */
   hv_listoffloats_list
-         = build_float_types_list (document->floats->list,
-                                   document->floats->number);
+         = build_float_types_list (&document->floats);
 
-  av_internal_xref = build_internal_xref_list (
-                    document->internal_references->list,
-                    document->internal_references->number);
+  av_internal_xref = build_internal_xref_list (&document->internal_references);
 
-  hv_identifiers_target = build_identifiers_target 
(document->identifiers_target);
+  hv_identifiers_target = build_identifiers_target 
(&document->identifiers_target);
 
-  av_labels_list = build_target_elements_list (document->labels_list->list,
-                                               document->labels_list->number);
+  av_labels_list = build_target_elements_list (&document->labels_list);
 
   if (document->nodes_list)
     av_nodes_list = build_elements_list (document->nodes_list);
@@ -1632,11 +1627,8 @@ funcname (SV *document_in) \
 BUILD_PERL_DOCUMENT_ITEM(funcname,fieldname,keyname,flagname,buildname,HVAV)
  */
 
-BUILD_PERL_DOCUMENT_ITEM(document_indices_information,indices_info,"indices",F_DOCM_index_names,build_index_data,HV)
-
 
BUILD_PERL_DOCUMENT_ITEM(document_global_commands_information,global_commands,"commands_info",F_DOCM_global_commands,build_global_commands,HV)
 
-BUILD_PERL_DOCUMENT_ITEM(document_labels_information,identifiers_target,"identifiers_target",F_DOCM_identifiers_target,build_identifiers_target,HV)
 
 
BUILD_PERL_DOCUMENT_ITEM(document_nodes_list,nodes_list,"nodes_list",F_DOCM_nodes_list,build_elements_list,AV)
 
@@ -1657,13 +1649,12 @@ funcname (SV *document_in) \
   document_hv = (HV *) SvRV (document_in); \
   DOCUMENT *document = get_sv_document_document (document_in, #funcname); \
 \
-  if (document && document->fieldname)\
+  if (document)\
     {\
       store_texinfo_tree (document, document_hv);\
       if (document->modified_information & flagname)\
         {\
-          HVAV *result_av_hv = buildname (document->fieldname->list,\
-                                     document->fieldname->number);\
+          HVAV *result_av_hv = buildname (&document->fieldname);\
           result_sv = newRV_inc ((SV *) result_av_hv);\
           hv_store (document_hv, key, strlen (key), result_sv, 0);\
           document->modified_information &= ~flagname;\
@@ -1697,6 +1688,10 @@ 
BUILD_PERL_DOCUMENT_LIST(document_internal_references_information,internal_refer
 
 
BUILD_PERL_DOCUMENT_LIST(document_labels_list,labels_list,"labels_list",F_DOCM_labels_list,build_target_elements_list,AV)
 
+BUILD_PERL_DOCUMENT_LIST(document_indices_information,indices_info,"indices",F_DOCM_index_names,build_index_data,HV)
+
+BUILD_PERL_DOCUMENT_LIST(document_labels_information,identifiers_target,"identifiers_target",F_DOCM_identifiers_target,build_identifiers_target,HV)
+
 #undef BUILD_PERL_DOCUMENT_LIST
 
 SV *
diff --git a/tp/Texinfo/XS/main/build_perl_info.h 
b/tp/Texinfo/XS/main/build_perl_info.h
index 0d67b45cdf..237a0344bb 100644
--- a/tp/Texinfo/XS/main/build_perl_info.h
+++ b/tp/Texinfo/XS/main/build_perl_info.h
@@ -37,11 +37,7 @@ void rebuild_document (SV *document_in, int no_store);
 HV *build_texinfo_tree (ELEMENT *root, int avoid_recursion);
 SV *store_texinfo_tree (DOCUMENT *document, HV *document_hv);
 AV *build_errors (ERROR_MESSAGE* error_list, size_t error_number);
-AV *build_target_elements_list (LABEL *labels_list,
-                                size_t labels_number);
 HV* build_identifiers_target (LABEL_LIST *identifiers_target);
-AV *build_internal_xref_list (ELEMENT **internal_xref_list,
-                              size_t internal_xref_number);
 HV *build_float_list (FLOAT_RECORD *floats_list, size_t floats_number);
 HV *build_index_data (INDEX_LIST *indices_info);
 HV *build_global_info (GLOBAL_INFO *global_info_ref,
diff --git a/tp/Texinfo/XS/main/document.c b/tp/Texinfo/XS/main/document.c
index 01e7240ba3..9777b63ddd 100644
--- a/tp/Texinfo/XS/main/document.c
+++ b/tp/Texinfo/XS/main/document.c
@@ -52,8 +52,8 @@ DOCUMENT *
 new_document (void)
 {
   size_t document_index;
+  size_t i;
   int slot_found = 0;
-  int i;
   DOCUMENT *document = (DOCUMENT *) malloc (sizeof (DOCUMENT));
 
   for (i = 0; i < document_number; i++)
@@ -88,15 +88,6 @@ new_document (void)
 
   document->global_commands = malloc (sizeof (GLOBAL_COMMANDS));
   memset (document->global_commands, 0, sizeof (GLOBAL_COMMANDS));
-  document->labels_list = malloc (sizeof (LABEL_LIST));
-  memset (document->labels_list, 0, sizeof (LABEL_LIST));
-  /* Array of recorded @float's. */
-  document->floats = malloc (sizeof (FLOAT_RECORD_LIST));
-  memset (document->floats, 0, sizeof (FLOAT_RECORD_LIST));
-  document->internal_references = malloc (sizeof (ELEMENT_LIST));
-  memset (document->internal_references, 0, sizeof (ELEMENT_LIST));
-  document->indices_info = malloc (sizeof (INDEX_LIST));
-  memset (document->indices_info, 0, sizeof (INDEX_LIST));
   /* For filenames and macro names, it is possible that they won't be 
referenced
    in the line number of any element.  It would be too much work to keep track,
    so just keep them all here, and free them all together at the end. */
@@ -142,12 +133,12 @@ register_document_options (DOCUMENT *document, OPTIONS 
*options)
 const MERGED_INDICES *
 document_merged_indices (DOCUMENT *document)
 {
-  if (document->indices_info->number)
+  if (document->indices_info.number)
     {
       if (!document->merged_indices)
         {
           document->merged_indices
-            = merge_indices (document->indices_info);
+            = merge_indices (&document->indices_info);
           document->modified_information |= F_DOCM_merged_indices;
         }
     }
@@ -176,7 +167,7 @@ document_indices_sort_strings (DOCUMENT *document,
 
       document->indices_sort_strings
        = setup_index_entries_sort_strings (error_messages, options,
-                        merged_indices, document->indices_info, 0);
+                        merged_indices, &document->indices_info, 0);
 
       document->modified_information |= F_DOCM_indices_sort_strings;
     }
@@ -414,16 +405,12 @@ destroy_document_information_except_tree (DOCUMENT 
*document)
       free (document->global_info);
       delete_global_commands (document->global_commands);
       free (document->global_commands);
-      free (document->internal_references->list);
-      free (document->internal_references);
-      free (document->floats->list);
-      free (document->floats);
-      destroy_listoffloats_list (document->listoffloats);
-      free (document->labels_list->list);
-      free (document->labels_list);
-      free (document->identifiers_target->list);
-      free (document->identifiers_target);
-      wipe_index_names (document->indices_info);
+      free (document->internal_references.list);
+      free (document->floats.list);
+      free_listoffloats_list (&document->listoffloats);
+      free (document->labels_list.list);
+      free (document->identifiers_target.list);
+      free_indices_info (&document->indices_info);
       wipe_error_message_list (document->error_messages);
       free (document->error_messages);
       wipe_error_message_list (document->parser_error_messages);
diff --git a/tp/Texinfo/XS/main/document_types.h 
b/tp/Texinfo/XS/main/document_types.h
index 10ea7aecc9..cc19381dc1 100644
--- a/tp/Texinfo/XS/main/document_types.h
+++ b/tp/Texinfo/XS/main/document_types.h
@@ -175,16 +175,17 @@ typedef struct COLLATIONS_INDICES_SORTED_BY_LETTER {
 } COLLATIONS_INDICES_SORTED_BY_LETTER;
 
 typedef struct DOCUMENT {
-    int descriptor;
+    size_t descriptor;
     ELEMENT *tree;
-    INDEX_LIST *indices_info;
+    INDEX_LIST indices_info;
     MERGED_INDICES *merged_indices;
-    FLOAT_RECORD_LIST *floats;
-    LISTOFFLOATS_TYPE_LIST *listoffloats;
-    ELEMENT_LIST *internal_references;
-    LABEL_LIST *labels_list;
+  /* Array of recorded @float's. */
+    FLOAT_RECORD_LIST floats;
+    LISTOFFLOATS_TYPE_LIST listoffloats;
+    ELEMENT_LIST internal_references;
+    LABEL_LIST labels_list;
   /* Array of target elements with unique identifiers, sorted by identifier */
-    LABEL_LIST *identifiers_target;
+    LABEL_LIST identifiers_target;
     GLOBAL_INFO *global_info;
     GLOBAL_COMMANDS *global_commands;
     STRING_LIST *small_strings;
diff --git a/tp/Texinfo/XS/main/floats.c b/tp/Texinfo/XS/main/floats.c
index d75eed13ca..b017965595 100644
--- a/tp/Texinfo/XS/main/floats.c
+++ b/tp/Texinfo/XS/main/floats.c
@@ -87,37 +87,27 @@ add_to_listoffloats_list (LISTOFFLOATS_TYPE_LIST 
*listoffloats_list, char *type)
   return result;
 }
 
-LISTOFFLOATS_TYPE_LIST *
-float_list_to_listoffloats_list (FLOAT_RECORD_LIST *floats_list)
+void
+float_list_to_listoffloats_list (FLOAT_RECORD_LIST *floats_list,
+                                 LISTOFFLOATS_TYPE_LIST *result)
 {
-  LISTOFFLOATS_TYPE_LIST *result = malloc (sizeof (LISTOFFLOATS_TYPE_LIST));
-  memset (result, 0, sizeof (LISTOFFLOATS_TYPE_LIST));
-
-  /* a zero floats_list is unusual, it cannot happen when a document
-     comes from parsing of Texinfo, but it may happen with a document
-     created from code */
+  size_t i;
 
-  if (floats_list && floats_list->number > 0)
+  for (i = 0; i < floats_list->number; i++)
     {
-      size_t i;
+      FLOAT_RECORD *float_record = &floats_list->list[i];
+      char *float_type = float_record->type;
 
-      for (i = 0; i < floats_list->number; i++)
-        {
-          FLOAT_RECORD *float_record = &floats_list->list[i];
-          char *float_type = float_record->type;
-
-          LISTOFFLOATS_TYPE *listoffloats_type
-            = add_to_listoffloats_list (result, float_type);
+      LISTOFFLOATS_TYPE *listoffloats_type
+        = add_to_listoffloats_list (result, float_type);
 
-          add_to_element_list (&listoffloats_type->float_list,
-                               float_record->element);
-        }
+      add_to_element_list (&listoffloats_type->float_list,
+                           float_record->element);
     }
-  return result;
 }
 
 void
-destroy_listoffloats_list (LISTOFFLOATS_TYPE_LIST *listoffloats_list)
+free_listoffloats_list (LISTOFFLOATS_TYPE_LIST *listoffloats_list)
 {
   size_t i;
   for (i = 0; i < listoffloats_list->number; i++)
@@ -128,7 +118,6 @@ destroy_listoffloats_list (LISTOFFLOATS_TYPE_LIST 
*listoffloats_list)
       free (listoffloats_type->float_list.list);
     }
   free (listoffloats_list->float_types);
-  free (listoffloats_list);
 }
 
 
diff --git a/tp/Texinfo/XS/main/floats.h b/tp/Texinfo/XS/main/floats.h
index cfaa232a2d..2b417791d9 100644
--- a/tp/Texinfo/XS/main/floats.h
+++ b/tp/Texinfo/XS/main/floats.h
@@ -20,11 +20,11 @@
 #include "tree_types.h"
 
 char *parse_float_type (ELEMENT *current);
-LISTOFFLOATS_TYPE_LIST *float_list_to_listoffloats_list (
-                                      FLOAT_RECORD_LIST *floats_list);
+void float_list_to_listoffloats_list (FLOAT_RECORD_LIST *floats_list,
+                                 LISTOFFLOATS_TYPE_LIST *result);
 void add_to_float_record_list (FLOAT_RECORD_LIST *float_records,
                                char *type, ELEMENT *element);
 
-void destroy_listoffloats_list (LISTOFFLOATS_TYPE_LIST *listoffloats_list);
+void free_listoffloats_list (LISTOFFLOATS_TYPE_LIST *listoffloats_list);
 
 #endif
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index 314d76d671..a13704aa32 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -1271,7 +1271,7 @@ find_document_index_entry_extra_index_entry_sv (const 
DOCUMENT *document,
   SV **index_name_sv;
   char *index_name = 0;
   const INDEX *idx = 0;
-  INDEX_LIST *indices_info = document->indices_info;
+  const INDEX_LIST *indices_info = &document->indices_info;
 
   dTHX;
 
@@ -1309,7 +1309,7 @@ find_element_extra_index_entry_sv (const DOCUMENT 
*document,
                                    const SV *extra_index_entry_sv)
 {
   const INDEX_ENTRY *index_entry;
-  if (!converter || !converter->document || !converter->document->indices_info)
+  if (!converter || !converter->document)
     {
       if (document)
         index_entry
@@ -1570,7 +1570,7 @@ find_element_from_sv (const CONVERTER *converter, const 
DOCUMENT *document_in,
             }
         }
 
-      if (document && document->identifiers_target)
+      if (document && document->identifiers_target.number)
         {
           SV **normalized_sv;
           EXTRA(normalized)
@@ -1579,7 +1579,7 @@ find_element_from_sv (const CONVERTER *converter, const 
DOCUMENT *document_in,
               char *normalized = SvPVutf8_nolen (*normalized_sv);
               ELEMENT *element_found
                 = find_identifier_target
-                      (document->identifiers_target, normalized);
+                      (&document->identifiers_target, normalized);
          /* check the element found in case of multiple defined identifier */
               if (element_found && element_hv == element_found->hv)
                 return element_found;
diff --git a/tp/Texinfo/XS/main/targets.c b/tp/Texinfo/XS/main/targets.c
index 308c431b07..2e0a190636 100644
--- a/tp/Texinfo/XS/main/targets.c
+++ b/tp/Texinfo/XS/main/targets.c
@@ -100,17 +100,17 @@ some_fun (LABEL_LIST *labels_list)
 }
  */
 
-/* returns a LABEL_LIST that is sorted with unique identifiers such that
+/* fill a LABEL_LIST that is sorted with unique identifiers such that
    elements are easy to find.
    Called from parser */
-LABEL_LIST *
-set_labels_identifiers_target (LABEL *list_of_labels, size_t labels_number)
+void
+set_labels_identifiers_target (LABEL *list_of_labels, size_t labels_number,
+                               LABEL_LIST *result)
 {
   LABEL *targets = malloc (labels_number * sizeof (LABEL));
-  LABEL_LIST *result = malloc (sizeof (LABEL_LIST));
   size_t targets_number = labels_number;
 
-  int i;
+  size_t i;
 
   memcpy (targets, list_of_labels, labels_number * sizeof (LABEL));
   qsort (targets, labels_number, sizeof (LABEL), compare_labels);
@@ -171,22 +171,17 @@ set_labels_identifiers_target (LABEL *list_of_labels, 
size_t labels_number)
   result->list = targets;
   result->number = targets_number;
   result->space = labels_number;
-  return result;
 }
 
-LABEL_LIST *
+LABEL *
 sort_labels_identifiers_target (LABEL *list_of_labels, size_t labels_number)
 {
   LABEL *targets = malloc (labels_number * sizeof (LABEL));
-  LABEL_LIST *result = malloc (sizeof (LABEL_LIST));
 
   memcpy (targets, list_of_labels, labels_number * sizeof (LABEL));
   qsort (targets, labels_number, sizeof (LABEL), compare_labels);
 
-  result->list = targets;
-  result->number = labels_number;
-  result->space = labels_number;
-  return result;
+  return targets;
 }
 
 
@@ -201,7 +196,7 @@ register_label_in_list (LABEL_LIST *labels_list, ELEMENT 
*element,
       labels_list->space *= 1.5;
       labels_list->list = realloc (labels_list->list,
                              labels_list->space * sizeof (LABEL));
-      if (!labels_list)
+      if (!labels_list->list)
         fatal ("realloc failed");
     }
   labels_list->list[labels_number].element = element;
@@ -219,22 +214,25 @@ add_element_to_identifiers_target (DOCUMENT *document, 
ELEMENT *element,
   *status = 2;
   if (normalized)
     {
-      LABEL_LIST *identifiers_target = document->identifiers_target;
+      LABEL_LIST *identifiers_target = &document->identifiers_target;
       ELEMENT *target = find_identifier_target (identifiers_target,
                                                 normalized);
       if (!target)
         {
-          LABEL_LIST *sorted_identifiers_target;
+          LABEL *sorted_identifiers_target;
 
           add_extra_integer (element, "is_target", 1);
           register_label_in_list (identifiers_target, element,
                                   normalized);
           sorted_identifiers_target
-            = sort_labels_identifiers_target (
-                           identifiers_target->list,
-                           identifiers_target->number);
-          destroy_label_list (identifiers_target);
-          document->identifiers_target = sorted_identifiers_target;
+            = sort_labels_identifiers_target (identifiers_target->list,
+                                              identifiers_target->number);
+          free (identifiers_target->list);
+          identifiers_target->list = sorted_identifiers_target;
+          /* knowing that space is the same as number requires looking at
+             sort_labels_identifiers_target to know the space
+             allocated for sorted_identifiers_target in that function */
+          identifiers_target->space = identifiers_target->number;
           *status = 0;
           document->modified_information |= F_DOCM_labels_list
                                    | F_DOCM_identifiers_target;
@@ -256,7 +254,7 @@ existing_label_error (DOCUMENT* document, ELEMENT *element, 
char *normalized,
   if (normalized && error_messages)
     {
       ELEMENT *existing_target
-        = find_identifier_target (document->identifiers_target, normalized);
+        = find_identifier_target (&document->identifiers_target, normalized);
       const ELEMENT *label_element = get_label_element (element);
       char *label_element_texi = convert_contents_to_texinfo (label_element);
       message_list_command_error (error_messages, document->options,
@@ -285,7 +283,7 @@ register_label_element (int document_descriptor, ELEMENT 
*element,
     {
       existing_label_error (document, element, normalized, error_messages);
     }
-  register_label_in_list (document->labels_list, element,
+  register_label_in_list (&document->labels_list, element,
                           normalized);
   return !status;
 }
diff --git a/tp/Texinfo/XS/main/targets.h b/tp/Texinfo/XS/main/targets.h
index b0bdc53c2e..bcb1e77da7 100644
--- a/tp/Texinfo/XS/main/targets.h
+++ b/tp/Texinfo/XS/main/targets.h
@@ -12,7 +12,7 @@ ELEMENT *find_identifier_target (const LABEL_LIST 
*identifiers_target,
 int register_label_element (int document_descriptor, ELEMENT *element,
                             ERROR_MESSAGE_LIST *error_messages);
 
-LABEL_LIST *set_labels_identifiers_target (LABEL *list_of_labels,
-                                           size_t labels_number);
+void set_labels_identifiers_target (LABEL *list_of_labels, size_t 
labels_number,
+                                    LABEL_LIST *result);
 
 #endif
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index d0d6377061..2ba0437d31 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -853,16 +853,16 @@ wipe_index (INDEX *idx)
 }
 
 void
-wipe_index_names (INDEX_LIST *indices_information)
+free_indices_info (INDEX_LIST *indices_info)
 {
   size_t i;
-  for (i = 0; i < indices_information->number; i++)
+  for (i = 0; i < indices_info->number; i++)
     {
-      INDEX *idx = indices_information->list[i];
+      INDEX *idx = indices_info->list[i];
       wipe_index (idx);
       free (idx);
     }
-  free (indices_information);
+  free (indices_info->list);
 }
 
 
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index 7256b744f7..e54889bdfd 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -204,7 +204,7 @@ size_t find_string (const STRING_LIST *strings_list, const 
char *string);
 void destroy_accent_stack (ACCENTS_STACK *accent_stack);
 
 void wipe_index (INDEX *idx);
-void wipe_index_names (INDEX_LIST *indices_information);
+void free_indices_info (INDEX_LIST *indices_info);
 
 /* in options_init_free.c */
 void initialize_options (OPTIONS *options);
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 3e0e88880b..f1fe6ed85f 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -408,9 +408,9 @@ parse_line_command_args (ELEMENT *line_command)
             break;
           }
 
-        from_index = indices_info_index_by_name (parsed_document->indices_info,
+        from_index = indices_info_index_by_name 
(&parsed_document->indices_info,
                                                  index_name_from);
-        to_index = indices_info_index_by_name (parsed_document->indices_info,
+        to_index = indices_info_index_by_name (&parsed_document->indices_info,
                                                index_name_to);
         if (!from_index)
           line_error ("unknown source index in @%s: %s",
@@ -462,7 +462,7 @@ parse_line_command_args (ELEMENT *line_command)
         else
           {
             INDEX *idx
-             = indices_info_index_by_name (parsed_document->indices_info, arg);
+             = indices_info_index_by_name (&parsed_document->indices_info, 
arg);
             if (!idx)
               line_error ("unknown index `%s' in @printindex", arg);
             else
@@ -876,7 +876,7 @@ end_line_starting_block (ELEMENT *current)
       float_type = parse_float_type (current);
 
       /* add to global 'floats' array */
-      add_to_float_record_list (parsed_document->floats, float_type, current);
+      add_to_float_record_list (&parsed_document->floats, float_type, current);
 
       if (current_section)
         add_extra_element (current, "float_section", current_section);
diff --git a/tp/Texinfo/XS/parsetexi/indices.c 
b/tp/Texinfo/XS/parsetexi/indices.c
index afc82ece90..578f33a045 100644
--- a/tp/Texinfo/XS/parsetexi/indices.c
+++ b/tp/Texinfo/XS/parsetexi/indices.c
@@ -99,7 +99,7 @@ add_index_command (char *cmdname, INDEX *idx)
 static INDEX *
 add_index_internal (char *name, int in_code)
 {
-  INDEX_LIST *indices = parsed_document->indices_info;
+  INDEX_LIST *indices = &parsed_document->indices_info;
   INDEX *idx = (INDEX *) malloc (sizeof (INDEX));
 
   memset (idx, 0, sizeof (INDEX));
@@ -127,7 +127,7 @@ void
 add_index (const char *name, int in_code)
 {
   INDEX *idx
-    = indices_info_index_by_name (parsed_document->indices_info, name);
+    = indices_info_index_by_name (&parsed_document->indices_info, name);
   char *cmdname;
 
   if (!idx)
@@ -143,7 +143,7 @@ void
 init_index_commands (void)
 {
   INDEX *idx;
-  INDEX_LIST *indices;
+  INDEX_LIST *indices = &parsed_document->indices_info;
 
   struct def { char *name; int in_code;
                enum command_id cmd2; enum command_id cmd1;}
@@ -204,8 +204,6 @@ init_index_commands (void)
       associate_command_to_index (p->cmd2, idx);
       associate_command_to_index (p->cmd1, idx);
     }
-  /* set the variable now that the realloc have been done */
-  indices = parsed_document->indices_info;
 
   associate_command_to_index (CM_vtable,
     indices_info_index_by_name (indices, "vr"));
@@ -350,7 +348,7 @@ forget_indices (void)
 }
 
 void
-resolve_indices_merged_in (INDEX_LIST *indices_info)
+resolve_indices_merged_in (const INDEX_LIST *indices_info)
 {
   size_t i;
   for (i = 0; i < indices_info->number; i++)
@@ -376,7 +374,7 @@ complete_indices (int document_descriptor, int debug_level)
   size_t i;
 
   document = retrieve_document (document_descriptor);
-  indices = document->indices_info;
+  indices = &document->indices_info;
 
   for (i = 0; i < indices->number; i++)
     {
diff --git a/tp/Texinfo/XS/parsetexi/indices.h 
b/tp/Texinfo/XS/parsetexi/indices.h
index fc579c7195..58175932dd 100644
--- a/tp/Texinfo/XS/parsetexi/indices.h
+++ b/tp/Texinfo/XS/parsetexi/indices.h
@@ -14,7 +14,7 @@ void set_non_ignored_space_in_index_before_command (ELEMENT 
*content);
 
 void forget_indices (void);
 
-void resolve_indices_merged_in (INDEX_LIST *indices_info);
+void resolve_indices_merged_in (const INDEX_LIST *indices_info);
 void complete_indices (int document_descriptor, int debug_level);
 
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/labels.c b/tp/Texinfo/XS/parsetexi/labels.c
index e580d9e5a7..8d4b75c6a5 100644
--- a/tp/Texinfo/XS/parsetexi/labels.c
+++ b/tp/Texinfo/XS/parsetexi/labels.c
@@ -38,7 +38,7 @@
 void
 register_label (ELEMENT *target_element, char *normalized)
 {
-  LABEL_LIST *labels_list = parsed_document->labels_list;
+  LABEL_LIST *labels_list = &parsed_document->labels_list;
   LABEL *label;
   /* register the element in the list. */
   if (labels_list->number == labels_list->space)
@@ -102,6 +102,6 @@ check_register_target_element_label (ELEMENT *label_element,
 void
 remember_internal_xref (ELEMENT *element)
 {
-  add_to_element_list (parsed_document->internal_references, element);
+  add_to_element_list (&parsed_document->internal_references, element);
 }
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index eae59a8d4a..248352a5d1 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -2660,16 +2660,16 @@ parse_texi (ELEMENT *root_elt, ELEMENT *current_elt)
 
   /* update merged_in.  Only needed for merging happening after first
      index merge */
-  resolve_indices_merged_in (parsed_document->indices_info);
+  resolve_indices_merged_in (&parsed_document->indices_info);
 
-  parsed_document->identifiers_target
-    = set_labels_identifiers_target (parsed_document->labels_list->list,
-                                     parsed_document->labels_list->number);
+  set_labels_identifiers_target (parsed_document->labels_list.list,
+                                 parsed_document->labels_list.number,
+                                 &parsed_document->identifiers_target);
 
   parsed_document->tree = current;
 
-  parsed_document->listoffloats
-    = float_list_to_listoffloats_list (parsed_document->floats);
+  float_list_to_listoffloats_list (&parsed_document->floats,
+                                   &parsed_document->listoffloats);
 
   document_descriptor = parsed_document->descriptor;
 
diff --git a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs 
b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
index 195ae4565e..ad9f74d29f 100644
--- a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+++ b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
@@ -114,18 +114,10 @@ relate_index_entries_to_table_items_in_tree (SV 
*document_in)
                    "relate_index_entries_to_table_items_in_tree");
         if (document)
           {
-            if (!document->indices_info)
-              {
-                fprintf (stderr, "ERROR: %d: no indices_info\n",
-                                          document->descriptor);
-              }
-            else
-              {
-                relate_index_entries_to_table_items_in_tree (document->tree,
-                                                      document->indices_info);
-                document->modified_information |= F_DOCM_tree
-                                                 | F_DOCM_index_names;
-              }
+            relate_index_entries_to_table_items_in_tree (document->tree,
+                                                  &document->indices_info);
+            document->modified_information |= F_DOCM_tree
+                                             | F_DOCM_index_names;
           }
 
 void
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c 
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 68d62590aa..b38f897180 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -415,7 +415,7 @@ check_menu_entry (DOCUMENT *document, enum command_id cmd,
                   ELEMENT *menu_content, ELEMENT *menu_entry_node)
 {
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
-  LABEL_LIST *identifiers_target = document->identifiers_target;
+  LABEL_LIST *identifiers_target = &document->identifiers_target;
   OPTIONS *options = document->options;
 
   char *normalized_menu_node = lookup_extra_string (menu_entry_node,
@@ -572,8 +572,8 @@ void
 check_nodes_are_referenced (DOCUMENT *document)
 {
   ELEMENT_LIST *nodes_list = document->nodes_list;
-  LABEL_LIST *identifiers_target = document->identifiers_target;
-  ELEMENT_LIST *refs = document->internal_references;
+  LABEL_LIST *identifiers_target = &document->identifiers_target;
+  ELEMENT_LIST *refs = &document->internal_references;
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
   OPTIONS *options = document->options;
 
@@ -804,7 +804,7 @@ set_menus_node_directions (DOCUMENT *document)
 {
   GLOBAL_COMMANDS *global_commands = document->global_commands;
   ELEMENT_LIST *nodes_list = document->nodes_list;
-  LABEL_LIST *identifiers_target = document->identifiers_target;
+  LABEL_LIST *identifiers_target = &document->identifiers_target;
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
   OPTIONS *options = document->options;
 
@@ -1000,7 +1000,7 @@ void
 complete_node_tree_with_menus (DOCUMENT *document)
 {
   ELEMENT_LIST *nodes_list = document->nodes_list;
-  LABEL_LIST *identifiers_target = document->identifiers_target;
+  LABEL_LIST *identifiers_target = &document->identifiers_target;
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
   OPTIONS *options = document->options;
 
@@ -1312,7 +1312,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
 ELEMENT_LIST *
 nodes_tree (DOCUMENT *document)
 {
-  LABEL_LIST *identifiers_target = document->identifiers_target;
+  LABEL_LIST *identifiers_target = &document->identifiers_target;
   ELEMENT *root = document->tree;
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
   OPTIONS *options = document->options;
@@ -1504,8 +1504,8 @@ nodes_tree (DOCUMENT *document)
 void
 associate_internal_references (DOCUMENT *document)
 {
-  LABEL_LIST *identifiers_target = document->identifiers_target;
-  ELEMENT_LIST *refs = document->internal_references;
+  LABEL_LIST *identifiers_target = &document->identifiers_target;
+  ELEMENT_LIST *refs = &document->internal_references;
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
   OPTIONS *options = document->options;
 
@@ -1602,7 +1602,7 @@ associate_internal_references (DOCUMENT *document)
 void
 number_floats (DOCUMENT *document)
 {
-  const LISTOFFLOATS_TYPE_LIST *listoffloats_list = document->listoffloats;
+  const LISTOFFLOATS_TYPE_LIST *listoffloats_list = &document->listoffloats;
   size_t i;
 
   if (!listoffloats_list)
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 064ab7baef..72735ed7d9 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -549,7 +549,7 @@ ELEMENT *
 new_node (ERROR_MESSAGE_LIST *error_messages, ELEMENT *node_tree,
           DOCUMENT *document)
 {
-  LABEL_LIST *identifiers_target = document->identifiers_target;
+  const LABEL_LIST *identifiers_target = &document->identifiers_target;
   int document_descriptor = document->descriptor;
   int empty_node = 0;
   int appended_number;
@@ -651,7 +651,7 @@ new_node (ERROR_MESSAGE_LIST *error_messages, ELEMENT 
*node_tree,
       non_hyphen_char = normalized + strspn (normalized, "-");
       if (*non_hyphen_char)
         {
-          if (identifiers_target)
+          if (identifiers_target->number > 0)
             {
               target = find_identifier_target (identifiers_target, normalized);
             }
@@ -883,11 +883,10 @@ reference_to_arg_internal (const char *type,
             }
           index++;
         }
-      if (document && document->internal_references
-          && document->internal_references->number > 0)
+      if (document && document->internal_references.number > 0)
         {
           const ELEMENT *removed_internal_ref =
-              remove_element_from_list (document->internal_references, e);
+              remove_element_from_list (&document->internal_references, e);
           if (removed_internal_ref)
             document->modified_information |= F_DOCM_internal_references;
         }
@@ -1134,7 +1133,7 @@ complete_tree_nodes_missing_menu (DOCUMENT *document, int 
use_sections)
 int
 regenerate_master_menu (DOCUMENT *document, int use_sections)
 {
-  const LABEL_LIST *identifiers_target = document->identifiers_target;
+  const LABEL_LIST *identifiers_target = &document->identifiers_target;
 
   const ELEMENT *top_node = find_identifier_target (identifiers_target, "Top");
   const ELEMENT_LIST *menus;
@@ -1191,7 +1190,7 @@ regenerate_master_menu (DOCUMENT *document, int 
use_sections)
                             {
                               const ELEMENT *removed_internal_ref =
                                 remove_element_from_list (
-                                        document->internal_references,
+                                        &document->internal_references,
                                                         entry_content);
                               if (removed_internal_ref)
                                 document->modified_information



reply via email to

[Prev in Thread] Current Thread [Next in Thread]