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/DocumentXS.xs (set_document_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/DocumentXS.xs (set_document_global_info): fix format.
Date: Sat, 18 May 2024 12:06:25 -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 410451b87b * tp/Texinfo/XS/main/DocumentXS.xs 
(set_document_global_info): fix format.
410451b87b is described below

commit 410451b87bbee18294a9228105cda71547e3dfc6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat May 18 18:06:26 2024 +0200

    * tp/Texinfo/XS/main/DocumentXS.xs (set_document_global_info): fix
    format.
    
    * tp/Texinfo/XS/convert/converter.c,
    tp/Texinfo/XS/main/build_perl_info.c,
    tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.c: add
    const.
---
 ChangeLog                            | 10 ++++++++++
 tp/Texinfo/XS/convert/converter.c    |  2 +-
 tp/Texinfo/XS/main/DocumentXS.xs     |  2 +-
 tp/Texinfo/XS/main/build_perl_info.c | 30 +++++++++++++++---------------
 tp/Texinfo/XS/main/build_perl_info.h |  4 ----
 tp/Texinfo/XS/main/get_perl_info.c   |  2 +-
 tp/Texinfo/XS/main/utils.c           | 22 +++++++++++-----------
 tp/Texinfo/XS/main/utils.h           | 15 +++++++++------
 8 files changed, 48 insertions(+), 39 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e1e1c8ef36..1cf5658bc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-05-18  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/DocumentXS.xs (set_document_global_info): fix
+       format.
+
+       * tp/Texinfo/XS/convert/converter.c,
+       tp/Texinfo/XS/main/build_perl_info.c,
+       tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.c: add
+       const.
+
 2024-05-18  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/build_perl_info.c (build_target_elements_list)
diff --git a/tp/Texinfo/XS/convert/converter.c 
b/tp/Texinfo/XS/convert/converter.c
index 9e72c4ea00..2c5ce7b135 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -221,7 +221,7 @@ set_global_document_commands (CONVERTER *converter,
       int i;
       for (i = 0; cmd_list[i] > 0; i++)
         {
-          ELEMENT *element;
+          const ELEMENT *element;
           enum command_id cmd = cmd_list[i];
           if (converter->conf->DEBUG.integer > 0)
             {
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index df348a9b3d..970ec0eeae 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -178,7 +178,7 @@ set_document_global_info (SV *document_in, char *key, SV 
*value_sv)
                 if (document->global_info->input_file_name)
                   {
                     fprintf (stderr,
-                        "BUG: %d: reset input_file_name '%s' -> '%s'\n",
+                        "BUG: %zu: reset input_file_name '%s' -> '%s'\n",
                         document->descriptor,
                         document->global_info->input_file_name, value);
                     non_perl_free (document->global_info->input_file_name);
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 64366b2f38..4fd50315f3 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -289,8 +289,8 @@ newSVpv_byte (const char *str, STRLEN len)
 }
 
 static void
-build_additional_info (HV *extra, ASSOCIATED_INFO *a, int avoid_recursion,
-                       int *nr_info)
+build_additional_info (HV *extra, const ASSOCIATED_INFO *a,
+                       int avoid_recursion, int *nr_info)
 {
   dTHX;
 
@@ -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_LIST *labels_list)
+build_target_elements_list (const LABEL_LIST *labels_list)
 {
   AV *target_array;
   SV *sv;
@@ -761,7 +761,7 @@ build_target_elements_list (LABEL_LIST *labels_list)
 }
 
 HV *
-build_identifiers_target (LABEL_LIST *identifiers_target)
+build_identifiers_target (const LABEL_LIST *identifiers_target)
 {
   HV* hv;
 
@@ -784,7 +784,7 @@ build_identifiers_target (LABEL_LIST *identifiers_target)
 }
 
 AV *
-build_internal_xref_list (ELEMENT_LIST *internal_xref_list)
+build_internal_xref_list (const ELEMENT_LIST *internal_xref_list)
 {
   AV *list_av;
   SV *sv;
@@ -805,7 +805,7 @@ build_internal_xref_list (ELEMENT_LIST *internal_xref_list)
 }
 
 AV *
-build_elements_list (ELEMENT_LIST *list)
+build_elements_list (const ELEMENT_LIST *list)
 {
   AV *list_av;
   SV *sv;
@@ -873,7 +873,7 @@ build_float_types_list (const FLOAT_RECORD_LIST *floats)
 /* returns a hash for a single entry in $self->{'index_names'}, containing
    information about a single index. */
 static HV *
-build_single_index_data (INDEX *index)
+build_single_index_data (const INDEX *index)
 {
 #define STORE(key, value) hv_store (hv, key, strlen (key), value, 0)
 
@@ -906,7 +906,7 @@ build_single_index_data (INDEX *index)
         {
 #define STORE2(key, value) hv_store (entry, key, strlen (key), value, 0)
           HV *entry;
-          INDEX_ENTRY *e;
+          const INDEX_ENTRY *e;
 
           e = &index->index_entries[j];
           entry = newHV ();
@@ -932,7 +932,7 @@ build_single_index_data (INDEX *index)
    build_texinfo_tree must be called before this so all the 'hv' fields
    are set on the elements in the tree. */
 HV *
-build_index_data (INDEX_LIST *indices_info)
+build_index_data (const INDEX_LIST *indices_info)
 {
   size_t i;
   HV *hv;
@@ -943,7 +943,7 @@ build_index_data (INDEX_LIST *indices_info)
 
   for (i = 0; i < indices_info->number; i++)
     {
-      INDEX *idx = indices_info->list[i];
+      const INDEX *idx = indices_info->list[i];
       HV *hv2 = build_single_index_data (idx);
       hv_store (hv, idx->name, strlen (idx->name),
                 newRV_noinc ((SV *)hv2), 0);
@@ -980,13 +980,13 @@ build_string_list (const STRING_LIST *strings_list, enum 
sv_string_type type)
 /* Return object to be used as 'info', retrievable with the
    'global_information' function. */
 HV *
-build_global_info (GLOBAL_INFO *global_info_ref,
-                   GLOBAL_COMMANDS *global_commands_ref)
+build_global_info (const GLOBAL_INFO *global_info_ref,
+                   const GLOBAL_COMMANDS *global_commands_ref)
 {
   HV *hv;
-  GLOBAL_INFO global_info = *global_info_ref;
-  GLOBAL_COMMANDS global_commands = *global_commands_ref;
-  ELEMENT *document_language;
+  const GLOBAL_INFO global_info = *global_info_ref;
+  const GLOBAL_COMMANDS global_commands = *global_commands_ref;
+  const ELEMENT *document_language;
   int nr_info;
 
   dTHX;
diff --git a/tp/Texinfo/XS/main/build_perl_info.h 
b/tp/Texinfo/XS/main/build_perl_info.h
index 237a0344bb..3c95cb3646 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);
-HV* build_identifiers_target (LABEL_LIST *identifiers_target);
 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,
-                       GLOBAL_COMMANDS *global_commands_ref);
 void build_global_info_tree_info (HV *hv, GLOBAL_INFO *global_info_ref);
 HV *build_global_commands (GLOBAL_COMMANDS *global_commands_ref);
 
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index a13704aa32..e9bd846ad4 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -1560,7 +1560,7 @@ find_element_from_sv (const CONVERTER *converter, const 
DOCUMENT *document_in,
           if (global_command_number_sv)
             {
               int global_command_number = SvIV (*global_command_number_sv);
-              ELEMENT_LIST *global_cmd_list
+              const ELEMENT_LIST *global_cmd_list
                 = get_cmd_global_multi_command (
                               document->global_commands, cmd);
 
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 2ba0437d31..ece8562801 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -1088,8 +1088,8 @@ delete_global_commands (GLOBAL_COMMANDS 
*global_commands_ref)
 #undef GLOBAL_CASE
 }
 
-ELEMENT_LIST *
-get_cmd_global_multi_command (GLOBAL_COMMANDS *global_commands_ref,
+const ELEMENT_LIST *
+get_cmd_global_multi_command (const GLOBAL_COMMANDS *global_commands_ref,
                               enum command_id cmd)
 {
 
@@ -1113,8 +1113,8 @@ get_cmd_global_multi_command (GLOBAL_COMMANDS 
*global_commands_ref,
    }
 }
 
-ELEMENT *
-get_cmd_global_uniq_command (GLOBAL_COMMANDS *global_commands_ref,
+const ELEMENT *
+get_cmd_global_uniq_command (const GLOBAL_COMMANDS *global_commands_ref,
                              enum command_id cmd)
 {
 
@@ -1244,18 +1244,18 @@ in_preamble (ELEMENT *element)
 
   For unique command, the last may be considered to be the same as the first.
 */
-ELEMENT *
-get_global_document_command (GLOBAL_COMMANDS *global_commands,
+const ELEMENT *
+get_global_document_command (const GLOBAL_COMMANDS *global_commands,
                              enum command_id cmd,
                              enum command_location command_location)
 {
-  ELEMENT *element = 0;
+  const ELEMENT *element = 0;
   if (command_location != CL_last && command_location != CL_preamble_or_first
       && command_location != CL_preamble)
     fprintf (stderr, "BUG: get_global_document_command: unknown CL: %d\n",
                      command_location);
 
-  ELEMENT_LIST *command_list
+  const ELEMENT_LIST *command_list
      = get_cmd_global_multi_command (global_commands, cmd);
   if (builtin_command_data[cmd].flags & CF_global)
     {
@@ -1291,7 +1291,7 @@ get_global_document_command (GLOBAL_COMMANDS 
*global_commands,
     }
   else
     {
-      ELEMENT *command
+      const ELEMENT *command
         = get_cmd_global_uniq_command (global_commands, cmd);
       if (command)
         element = command;
@@ -1304,12 +1304,12 @@ get_global_document_command (GLOBAL_COMMANDS 
*global_commands,
   set_informative_command_value), no @-commands setting side effects are done
   and associated customization variables are not set/reset either.
  */
-ELEMENT *
+const ELEMENT *
 set_global_document_command (GLOBAL_COMMANDS *global_commands, OPTIONS 
*options,
                              enum command_id cmd,
                              enum command_location command_location)
 {
-  ELEMENT *element
+  const ELEMENT *element
      = get_global_document_command (global_commands, cmd,
                                     command_location);
   if (element)
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index e54889bdfd..5ab90d07e1 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -241,18 +241,21 @@ void set_expanded_formats_from_options (EXPANDED_FORMAT 
*formats,
 
 char *enumerate_item_representation (char *specification, int number);
 
-ELEMENT *get_global_document_command (GLOBAL_COMMANDS *global_commands,
+const ELEMENT *get_global_document_command (
+                                      const GLOBAL_COMMANDS *global_commands,
                                       enum command_id cmd,
                                       enum command_location command_location);
 char *informative_command_value (const ELEMENT *element);
 void set_informative_command_value (OPTIONS *options, const ELEMENT *element);
-ELEMENT *set_global_document_command (GLOBAL_COMMANDS *global_commands,
+const ELEMENT *set_global_document_command (GLOBAL_COMMANDS *global_commands,
                              OPTIONS *options, enum command_id cmd,
                              enum command_location command_location);
-ELEMENT_LIST *get_cmd_global_multi_command (GLOBAL_COMMANDS 
*global_commands_ref,
-                                      enum command_id cmd);
-ELEMENT *get_cmd_global_uniq_command (GLOBAL_COMMANDS *global_commands_ref,
-                                      enum command_id cmd);
+const ELEMENT_LIST *get_cmd_global_multi_command (
+                                    const GLOBAL_COMMANDS *global_commands_ref,
+                                    enum command_id cmd);
+const ELEMENT *get_cmd_global_uniq_command (
+                                    const GLOBAL_COMMANDS *global_commands_ref,
+                                    enum command_id cmd);
 
 void html_free_button_specification_list (BUTTON_SPECIFICATION_LIST *buttons);
 void html_clear_direction_icons (DIRECTION_ICON_LIST *direction_icons);



reply via email to

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