texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sat, 24 Feb 2024 11:03:44 -0500 (EST)

branch: master
commit 46043a4f96db9f8ea807b186a9d0540d8ecf0d72
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 24 17:03:23 2024 +0100

    Add const.
---
 ChangeLog                                 |  6 +++++-
 tp/Texinfo/XS/main/build_perl_info.c      | 36 +++++++++++++++----------------
 tp/Texinfo/XS/main/build_perl_info.h      |  4 ++--
 tp/Texinfo/XS/main/document_types.h       |  2 +-
 tp/Texinfo/XS/main/get_perl_info.c        | 28 ++++++++----------------
 tp/Texinfo/XS/main/get_perl_info.h        | 10 ++++-----
 tp/Texinfo/XS/main/utils.c                | 26 +++++++++++++---------
 tp/Texinfo/XS/main/utils.h                | 17 +++++++++------
 tp/Texinfo/XS/parsetexi/api.c             | 19 ++++++++--------
 tp/Texinfo/XS/parsetexi/api.h             | 22 +++++++++----------
 tp/Texinfo/XS/parsetexi/handle_commands.c |  8 +++----
 tp/Texinfo/XS/parsetexi/handle_commands.h |  7 +++---
 tp/Texinfo/XS/parsetexi/input.c           | 10 ++++-----
 tp/Texinfo/XS/parsetexi/input.h           | 10 ++++-----
 tp/Texinfo/XS/parsetexi/macro.c           |  2 +-
 tp/Texinfo/XS/parsetexi/macro.h           |  2 +-
 tp/Texinfo/XS/parsetexi/multitable.c      |  7 ++----
 tp/Texinfo/XS/parsetexi/parser.c          |  2 +-
 tp/Texinfo/XS/parsetexi/parser.h          |  2 +-
 tp/maintain/regenerate_C_options_info.pl  |  2 +-
 20 files changed, 112 insertions(+), 110 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7d01fa4a41..477a0198c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-02-24  Patrice Dumas  <pertusus@free.fr>
+
+       Add const.
+
 2024-02-24  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/extra.c (add_extra_contents): replace the input
@@ -13,7 +17,7 @@
 2024-02-24  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/extra.c (add_extra_directions): remove input
-       element list argumnet, it is never set.  Update callers.
+       element list argument, it is never set.  Update callers.
 
 2024-02-24  Patrice Dumas  <pertusus@free.fr>
 
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index f34957d4bd..5a81179dfa 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -167,7 +167,7 @@ build_perl_container (ELEMENT *e, int avoid_recursion)
 }
 
 static SV *
-build_perl_directions (ELEMENT_LIST *e, int avoid_recursion)
+build_perl_directions (const ELEMENT_LIST *e, int avoid_recursion)
 {
   SV *sv;
   HV *hv;
@@ -888,7 +888,7 @@ build_index_data (INDEX **index_names_in)
 
 
 AV *
-build_string_list (STRING_LIST *strings_list, enum sv_string_type type)
+build_string_list (const STRING_LIST *strings_list, enum sv_string_type type)
 {
   AV *av;
   int i;
@@ -899,7 +899,7 @@ build_string_list (STRING_LIST *strings_list, enum 
sv_string_type type)
 
   for (i = 0; i < strings_list->number; i++)
     {
-      char *value = strings_list->list[i];
+      const char *value = strings_list->list[i];
       if (!value)
         av_push (av, newSV (0));
       else if (type == svt_char)
@@ -1382,7 +1382,7 @@ output_unit_to_perl_hash (OUTPUT_UNIT *output_unit)
     {
       if (output_unit->directions[i])
         {
-          char *direction_name = relative_unit_direction_name[i];
+          const char *direction_name = relative_unit_direction_name[i];
           OUTPUT_UNIT *direction_unit = output_unit->directions[i];
           SV *unit_sv;
           /* should ony happen for reference to external nodes that have
@@ -1407,22 +1407,22 @@ output_unit_to_perl_hash (OUTPUT_UNIT *output_unit)
 
   if (output_unit->unit_command)
     {
-      ELEMENT *command = output_unit->unit_command;
-      if (!command->hv)
+      const ELEMENT *command;
+      if (!output_unit->unit_command->hv
+          && output_unit->unit_command->type == ET_special_unit_element)
         {
-          if (command->type == ET_special_unit_element)
-            {
-              SV *unit_sv;
+          SV *unit_sv;
 
-              /* a virtual out of tree element, add it to perl */
-              element_to_perl_hash (command, 0);
+          /* a virtual out of tree element, add it to perl */
+          element_to_perl_hash (output_unit->unit_command, 0);
 
-              unit_sv = newRV_inc ((SV *) output_unit->hv);
-              hv_store (command->hv, "associated_unit",
-                        strlen ("associated_unit"), unit_sv, 0);
-            }
+          unit_sv = newRV_inc ((SV *) output_unit->hv);
+          hv_store (output_unit->unit_command->hv, "associated_unit",
+                    strlen ("associated_unit"), unit_sv, 0);
         }
 
+      command = output_unit->unit_command;
+
       if (!command->hv)
         fatal ("Missing output unit unit_command hv");
 
@@ -1518,7 +1518,7 @@ static int
 fill_output_units_descriptor_av (AV *av_output_units,
                                  size_t output_units_descriptor)
 {
-  OUTPUT_UNIT_LIST *output_units;
+  const OUTPUT_UNIT_LIST *output_units;
   size_t i;
 
   dTHX;
@@ -1575,7 +1575,7 @@ rebuild_output_units_list (SV *output_units_sv, size_t 
output_units_descriptor)
 
   if (!SvOK (output_units_sv))
     {
-      OUTPUT_UNIT_LIST *output_units
+      const OUTPUT_UNIT_LIST *output_units
          = retrieve_output_units (output_units_descriptor);
       if (output_units && output_units->number)
         fprintf (stderr, "BUG: no input sv for %zu output units (%zu)",
@@ -1680,7 +1680,7 @@ pass_converter_errors (ERROR_MESSAGE_LIST *error_messages,
 }
 
 AV *
-build_integer_stack (INTEGER_STACK *integer_stack)
+build_integer_stack (const INTEGER_STACK *integer_stack)
 {
   AV *av;
   int i;
diff --git a/tp/Texinfo/XS/main/build_perl_info.h 
b/tp/Texinfo/XS/main/build_perl_info.h
index 26fea9cbc1..56a621f518 100644
--- a/tp/Texinfo/XS/main/build_perl_info.h
+++ b/tp/Texinfo/XS/main/build_perl_info.h
@@ -45,8 +45,8 @@ SV *build_output_units_list (size_t output_units_descriptor);
 void rebuild_output_units_list (SV *output_units_sv,
                                 size_t output_units_descriptor);
 
-AV *build_integer_stack (INTEGER_STACK *integer_stack);
-AV *build_string_list (STRING_LIST *strings_list, enum sv_string_type);
+AV *build_integer_stack (const INTEGER_STACK *integer_stack);
+AV *build_string_list (const STRING_LIST *strings_list, enum sv_string_type);
 
 void pass_output_unit_files (SV *converter_sv,
                         FILE_NAME_PATH_COUNTER_LIST *output_unit_files);
diff --git a/tp/Texinfo/XS/main/document_types.h 
b/tp/Texinfo/XS/main/document_types.h
index 96d95208ea..984c6c9b76 100644
--- a/tp/Texinfo/XS/main/document_types.h
+++ b/tp/Texinfo/XS/main/document_types.h
@@ -182,7 +182,7 @@ typedef struct DOCUMENT {
 } DOCUMENT;
 
 /* not in document, but used in parser */
-typedef struct expanded_format {
+typedef struct EXPANDED_FORMAT {
     char *format;
     int expandedp;
 } EXPANDED_FORMAT;
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index c9dbf826ad..bd8f796f86 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -231,7 +231,8 @@ get_sv_output_units (SV *output_units_in, char *warn_string)
 }
 
 void
-add_svav_to_string_list (SV *sv, STRING_LIST *string_list, enum sv_string_type 
type)
+add_svav_to_string_list (const SV *sv, STRING_LIST *string_list,
+                         enum sv_string_type type)
 {
   int i;
   SSize_t strings_nr;
@@ -248,7 +249,7 @@ add_svav_to_string_list (SV *sv, STRING_LIST *string_list, 
enum sv_string_type t
       SV** string_sv = av_fetch (av, i, 0);
       if (string_sv)
         {
-          char *string;
+          const char *string;
           if (type == svt_char)
             string = SvPVutf8_nolen (*string_sv);
           else
@@ -1003,8 +1004,8 @@ copy_sv_options_for_convert_text (SV *sv_in)
 }
 #undef FETCH
 
-int
-html_get_direction_index (CONVERTER *converter, const char *direction)
+static int
+html_get_direction_index (const CONVERTER *converter, const char *direction)
 {
   int i;
   if (converter && converter->direction_unit_direction_name)
@@ -1015,18 +1016,6 @@ html_get_direction_index (CONVERTER *converter, const 
char *direction)
             return i;
         }
     }
-   /* we could do the following, but there is no point in getting the
-      buttons if not all can be determined */
-   /*
-  else
-    {
-      for (i = 0; i < NON_SPECIAL_DIRECTIONS_NR; i++)
-        {
-          if (!strcmp (direction, html_button_direction_names[i]))
-            return i;
-        }
-    }
-    */
   return -1;
 }
 
@@ -1041,7 +1030,8 @@ static const char *button_function_type_string[] = {
 
 /* HTML specific, but needs to be there for options_get_perl.c */
 BUTTON_SPECIFICATION_LIST *
-html_get_button_specification_list (CONVERTER *converter, SV *buttons_sv)
+html_get_button_specification_list (const CONVERTER *converter,
+                                    const SV *buttons_sv)
 {
   BUTTON_SPECIFICATION_LIST *result;
   AV *buttons_av;
@@ -1183,9 +1173,9 @@ html_get_button_specification_list (CONVERTER *converter, 
SV *buttons_sv)
 
 /* HTML specific, but needs to be there for options_get_perl.c */
 void
-html_get_direction_icons_sv (CONVERTER *converter,
+html_get_direction_icons_sv (const CONVERTER *converter,
                              DIRECTION_ICON_LIST *direction_icons,
-                             SV *icons_sv)
+                             const SV *icons_sv)
 {
   HV *icons_hv;
   int i;
diff --git a/tp/Texinfo/XS/main/get_perl_info.h 
b/tp/Texinfo/XS/main/get_perl_info.h
index 2d8f49f55d..d820963e4e 100644
--- a/tp/Texinfo/XS/main/get_perl_info.h
+++ b/tp/Texinfo/XS/main/get_perl_info.h
@@ -14,7 +14,7 @@
 
 /* in options_get_perl.c */
 void get_sv_option (OPTIONS *options, const char *key, SV *value,
-                    int force, CONVERTER *converter);
+                    int force, const CONVERTER *converter);
 /* in options_init_free.c */
 void set_option_key_configured (OPTIONS *options, const char *key,
                                 int configured);
@@ -26,7 +26,7 @@ DOCUMENT *get_sv_document_document (SV *document_in, char 
*warn_string);
 OUTPUT_UNIT_LIST *get_sv_output_units (SV *output_units_in, char *warn_string);
 int get_sv_output_units_descriptor (SV *output_units_in, char *warn_string);
 
-void add_svav_to_string_list (SV *sv, STRING_LIST *string_list,
+void add_svav_to_string_list (const SV *sv, STRING_LIST *string_list,
                               enum sv_string_type type);
 
 SOURCE_INFO *get_source_info (SV *source_info_sv);
@@ -54,10 +54,10 @@ INDEX_SORTED_BY_LETTER 
*get_sv_index_entries_sorted_by_letter
 TEXT_OPTIONS *copy_sv_options_for_convert_text (SV *sv_in);
 
 BUTTON_SPECIFICATION_LIST *html_get_button_specification_list
-                                (CONVERTER *converter, SV *buttons_sv);
-void html_get_direction_icons_sv (CONVERTER *converter,
+                                (const CONVERTER *converter, const SV 
*buttons_sv);
+void html_get_direction_icons_sv (const CONVERTER *converter,
                              DIRECTION_ICON_LIST *direction_icons,
-                             SV *icons_sv);
+                             const SV *icons_sv);
 
 const ELEMENT *find_element_from_sv (const CONVERTER *converter,
                                      const DOCUMENT *document_in,
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 687cf75b40..86dd676402 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -670,10 +670,10 @@ read_flag_name (char **ptr)
 
 /* s/\s+/ /g with re => '/a' in perl */
 char *
-collapse_spaces (char *text)
+collapse_spaces (const char *text)
 {
   TEXT result;
-  char *p = text;
+  const char *p = text;
 
   if (!text)
     return 0;
@@ -706,11 +706,16 @@ collapse_spaces (char *text)
    The filename of the line directive is returned.
    The line number value is in OUT_LINE_NO.
    RETVAL value is 1 for valid line directive, 0 otherwise.
+
+   TODO would be good to have line const, but it is not possible
+   because of strtoul and because of the transient modification to
+   have a \0.
 */
 char *
 parse_line_directive (char *line, int *retval, int *out_line_no)
 {
-  char *p = line, *q;
+  char *p = line;
+  char *q;
   char *filename = 0;
   int line_no = 0;
 
@@ -824,7 +829,8 @@ wipe_index_names (INDEX **index_names)
 /* include directories and include file */
 
 void
-add_include_directory (char *input_filename, STRING_LIST *include_dirs_list)
+add_include_directory (const char *input_filename,
+                       STRING_LIST *include_dirs_list)
 {
   int len;
   char *filename = strdup (input_filename);
@@ -851,7 +857,7 @@ add_string (const char *string, STRING_LIST *strings_list)
 }
 
 void
-merge_strings (STRING_LIST *strings_list, STRING_LIST *merged_strings)
+merge_strings (STRING_LIST *strings_list, const STRING_LIST *merged_strings)
 {
   int i;
   if (strings_list->number + merged_strings->number > strings_list->space)
@@ -868,7 +874,7 @@ merge_strings (STRING_LIST *strings_list, STRING_LIST 
*merged_strings)
 }
 
 void
-copy_strings (STRING_LIST *dest_list, STRING_LIST *source_list)
+copy_strings (STRING_LIST *dest_list, const STRING_LIST *source_list)
 {
   int i;
   if (dest_list->number + source_list->number > dest_list->space)
@@ -885,7 +891,7 @@ copy_strings (STRING_LIST *dest_list, STRING_LIST 
*source_list)
 
 /* return the index +1, to return 0 if not found */
 size_t
-find_string (STRING_LIST *strings_list, const char *target)
+find_string (const STRING_LIST *strings_list, const char *target)
 {
   size_t j;
   for (j = 0; j < strings_list->number; j++)
@@ -902,7 +908,7 @@ find_string (STRING_LIST *strings_list, const char *target)
 /* try to locate a file called FILENAME, looking for it in the list of include
    directories. */
 char *
-locate_include_file (char *filename, STRING_LIST *include_dirs_list)
+locate_include_file (const char *filename, const STRING_LIST 
*include_dirs_list)
 {
   char *fullpath;
   struct stat dummy;
@@ -1320,7 +1326,7 @@ section_level_adjusted_command_name (const ELEMENT 
*element)
 
 /* corresponding perl function in Common.pm */
 int
-is_content_empty (ELEMENT *tree, int do_not_ignore_index_entries)
+is_content_empty (const ELEMENT *tree, int do_not_ignore_index_entries)
 {
   int i;
   if (!tree || !tree->contents.number)
@@ -1328,7 +1334,7 @@ is_content_empty (ELEMENT *tree, int 
do_not_ignore_index_entries)
 
   for (i = 0; i < tree->contents.number; i++)
     {
-      ELEMENT *content = tree->contents.list[i];
+      const ELEMENT *content = tree->contents.list[i];
       enum command_id data_cmd = element_builtin_data_cmd (content);
 
       if (data_cmd)
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index 095689c529..706cef0681 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -178,17 +178,18 @@ size_t index_number_index_by_name (const 
SORTED_INDEX_NAMES *sorted_indices,
 char *read_flag_name (char **ptr);
 int section_level (const ELEMENT *section);
 enum command_id section_level_adjusted_command_name (const ELEMENT *element);
-char *collapse_spaces (char *text);
+char *collapse_spaces (const char *text);
 char *parse_line_directive (char *line, int *retval, int *out_line_no);
-int is_content_empty (ELEMENT *tree, int do_not_ignore_index_entries);
+int is_content_empty (const ELEMENT *tree, int do_not_ignore_index_entries);
 
 void clear_strings_list (STRING_LIST *strings);
 void free_strings_list (STRING_LIST *strings);
 void destroy_strings_list (STRING_LIST *strings);
 char *add_string (const char *string, STRING_LIST *strings_list);
-void merge_strings (STRING_LIST *strings_list, STRING_LIST *merged_strings);
-void copy_strings (STRING_LIST *dest_list, STRING_LIST *source_list);
-size_t find_string (STRING_LIST *strings_list, const char *string);
+void merge_strings (STRING_LIST *strings_list,
+                    const STRING_LIST *merged_strings);
+void copy_strings (STRING_LIST *dest_list, const STRING_LIST *source_list);
+size_t find_string (const STRING_LIST *strings_list, const char *string);
 
 void destroy_accent_stack (ACCENTS_STACK *accent_stack);
 
@@ -205,8 +206,10 @@ void set_output_encoding (OPTIONS 
*customization_information,
                           DOCUMENT *document);
 OPTION *get_command_option (OPTIONS *options, enum command_id cmd);
 
-void add_include_directory (char *filename, STRING_LIST *include_dirs_list);
-char *locate_include_file (char *filename, STRING_LIST *include_dirs_list);
+void add_include_directory (const char *filename,
+                            STRING_LIST *include_dirs_list);
+char *locate_include_file (const char *filename,
+                           const STRING_LIST *include_dirs_list);
 
 ENCODING_CONVERSION *get_encoding_conversion (const char *encoding,
                                     ENCODING_CONVERSION_LIST *encodings_list);
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 48e3259954..c20621e92e 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -131,7 +131,8 @@ reset_parser (int local_debug_output)
    tree and document obtained by parsing FILENAME.
    Used for parse_texi_file. */
 int
-parse_file (char *filename, char *input_file_name, char *input_directory)
+parse_file (char *filename, const char *input_file_name,
+            const char *input_directory)
 {
   int document_descriptor;
   char *p, *q;
@@ -172,7 +173,7 @@ parse_file (char *filename, char *input_file_name, char 
*input_directory)
 
 /* Used for parse_texi_text.  STRING should be a UTF-8 buffer. */
 int
-parse_text (char *string, int line_nr)
+parse_text (const char *string, int line_nr)
 {
   int document_descriptor;
 
@@ -186,7 +187,7 @@ parse_text (char *string, int line_nr)
    obtained by parsing the Texinfo code in STRING.
    STRING should be a UTF-8 buffer.  Used for parse_texi_line. */
 int
-parse_string (char *string, int line_nr)
+parse_string (const char *string, int line_nr)
 {
   ELEMENT *root_elt;
   int document_descriptor;
@@ -200,7 +201,7 @@ parse_string (char *string, int line_nr)
 
 /* Used for parse_texi_piece.  STRING should be a UTF-8 buffer. */
 int
-parse_piece (char *string, int line_nr)
+parse_piece (const char *string, int line_nr)
 {
   int document_descriptor;
   ELEMENT *before_node_section, *document_root;
@@ -222,7 +223,7 @@ parser_set_debug (int value)
 }
 
 void
-parser_set_documentlanguage_override (char *value)
+parser_set_documentlanguage_override (const char *value)
 {
   set_documentlanguage_override (value);
 }
@@ -234,19 +235,19 @@ parser_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
 }
 
 void
-parser_set_input_file_name_encoding (char *value)
+parser_set_input_file_name_encoding (const char *value)
 {
   set_input_file_name_encoding (value);
 }
 
 void
-parser_set_locale_encoding (char *value)
+parser_set_locale_encoding (const char *value)
 {
   set_locale_encoding (value);
 }
 
 void
-parser_store_value (char *name, char *value)
+parser_store_value (const char *name, const char *value)
 {
   store_value (name, value);
 }
@@ -258,7 +259,7 @@ parser_clear_expanded_formats (void)
 }
 
 void
-parser_add_expanded_format (char *format)
+parser_add_expanded_format (const char *format)
 {
   add_parser_expanded_format (format);
 }
diff --git a/tp/Texinfo/XS/parsetexi/api.h b/tp/Texinfo/XS/parsetexi/api.h
index 7070cc02aa..d93807a0a0 100644
--- a/tp/Texinfo/XS/parsetexi/api.h
+++ b/tp/Texinfo/XS/parsetexi/api.h
@@ -2,26 +2,26 @@
 #ifndef API_H
 #define API_H
 
-#include <config.h>
 #include "tree_types.h"
 
-int parse_file (char *filename, char *input_file_name, char *input_directory);
-int parse_piece (char *, int line_nr);
-int parse_string (char *, int line_nr);
-int parse_text (char *, int line_nr);
+int parse_file (char *filename, const char *input_file_name,
+                                const char *input_directory);
+int parse_piece (const char *, int line_nr);
+int parse_string (const char *, int line_nr);
+int parse_text (const char *, int line_nr);
 void reset_parser (int debug_output);
 void reset_parser_except_conf (void);
 
 void parser_set_debug (int value);
-void parser_store_value (char *name, char *value);
-void parser_add_include_directory (char *filename);
-void parser_add_expanded_format (char *format);
+void parser_store_value (const char *name, const char *value);
+void parser_add_include_directory (const char *filename);
+void parser_add_expanded_format (const char *format);
 void parser_clear_expanded_formats (void);
 void parser_set_accept_internalvalue (int value);
 void parser_set_restricted (int value);
 void parser_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i);
-void parser_set_input_file_name_encoding (char *value);
-void parser_set_locale_encoding (char *value);
-void parser_set_documentlanguage_override (char *value);
+void parser_set_input_file_name_encoding (const char *value);
+void parser_set_locale_encoding (const char *value);
+void parser_set_documentlanguage_override (const char *value);
 
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index dc77c6ce93..43ac2391df 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -44,8 +44,8 @@
 #include "extra.h"
 
 /* Return a containing @itemize or @enumerate if inside it. */
-ELEMENT *
-item_container_parent (ELEMENT *current)
+static ELEMENT *
+item_container_parent (const ELEMENT *current)
 {
   if ((current->cmd == CM_item
        || current->type == ET_before_item)
@@ -61,7 +61,7 @@ item_container_parent (ELEMENT *current)
 /* Check that there are no text holding environments (currently
    checking only paragraphs and preformatted) in contents. */
 int
-check_no_text (ELEMENT *current)
+check_no_text (const ELEMENT *current)
 {
   int after_paragraph = 0;
   int i, j;
@@ -992,7 +992,7 @@ clear_parser_expanded_formats (void)
 }
 
 void
-add_parser_expanded_format (char *format)
+add_parser_expanded_format (const char *format)
 {
   add_expanded_format (parser_expanded_formats, format);
 }
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.h 
b/tp/Texinfo/XS/parsetexi/handle_commands.h
index c67d1f7c68..ce9024b3ae 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.h
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.h
@@ -3,6 +3,7 @@
 #define HANDLE_COMMANDS_H
 
 #include "tree_types.h"
+#include "document_types.h"
 
 ELEMENT *handle_other_command (ELEMENT *current, char **line_inout,
                                enum command_id cmd_id, int *status,
@@ -15,12 +16,12 @@ ELEMENT *handle_block_command (ELEMENT *current, char 
**line_inout,
                                ELEMENT **command_element);
 ELEMENT *handle_brace_command (ELEMENT *current, char **line_inout,
                              enum command_id cmd_id, ELEMENT 
**command_element);
-int check_no_text (ELEMENT *current);
+int check_no_text (const ELEMENT *current);
 
 void clear_parser_expanded_formats (void);
-void add_parser_expanded_format (char *format);
+void add_parser_expanded_format (const char *format);
 int parser_format_expanded_p (const char *format);
 
-extern struct expanded_format parser_expanded_formats[7];
+extern EXPANDED_FORMAT parser_expanded_formats[7];
 
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index 87e8467845..f3ed051f39 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -64,7 +64,7 @@ static ENCODING_CONVERSION *current_encoding_conversion = 0;
    set_input_encoding to be for "utf-8" as the codes assume
    a conversion to UTF-8 in encodings_list[0]. */
 int
-set_input_encoding (char *encoding)
+set_input_encoding (const char *encoding)
 {
   int encoding_set = 0;
 
@@ -170,14 +170,14 @@ static char *input_file_name_encoding = 0;
 static char *locale_encoding = 0;
 
 void
-set_input_file_name_encoding (char *value)
+set_input_file_name_encoding (const char *value)
 {
   free (input_file_name_encoding);
   input_file_name_encoding = value ? strdup (value) : 0;
 }
 
 void
-set_locale_encoding (char *value)
+set_locale_encoding (const char *value)
 {
   free (locale_encoding);
   locale_encoding =  value ? strdup (value) : 0;
@@ -599,7 +599,7 @@ top_file_index (void)
 static STRING_LIST parser_include_dirs_list = {0, 0, 0};
 
 void
-parser_add_include_directory (char *filename)
+parser_add_include_directory (const char *filename)
 {
   add_include_directory (filename, &parser_include_dirs_list);
 }
@@ -611,7 +611,7 @@ parser_clear_include_directories (void)
 }
 
 char *
-parser_locate_include_file (char *filename)
+parser_locate_include_file (const char *filename)
 {
   return locate_include_file (filename, &parser_include_dirs_list);
 }
diff --git a/tp/Texinfo/XS/parsetexi/input.h b/tp/Texinfo/XS/parsetexi/input.h
index 08e72b4d19..8ecfb708e8 100644
--- a/tp/Texinfo/XS/parsetexi/input.h
+++ b/tp/Texinfo/XS/parsetexi/input.h
@@ -21,11 +21,11 @@ void parser_reset_encoding_list (void);
 int expanding_macro (const char *macro);
 int top_file_index (void);
 
-char *parser_locate_include_file (char *filename);
+char *parser_locate_include_file (const char *filename);
 char *encode_file_name (char *filename);
 char *convert_to_utf8 (char *s);
-int set_input_encoding (char *encoding);
-void parser_add_include_directory (char *filename);
+int set_input_encoding (const char *encoding);
+void parser_add_include_directory (const char *filename);
 void parser_clear_include_directories (void);
 
 extern char **small_strings;
@@ -39,8 +39,8 @@ extern int input_number;
 extern int macro_expansion_nr;
 extern int value_expansion_nr;
 
-void set_input_file_name_encoding (char *value);
-void set_locale_encoding (char *value);
+void set_input_file_name_encoding (const char *value);
+void set_locale_encoding (const char *value);
 void set_doc_encoding_for_input_file_name (int value);
 
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index 7be37b6001..3bd4eb8b14 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -1026,7 +1026,7 @@ wipe_values (void)
 }
 
 void
-store_value (char *name, char *value)
+store_value (const char *name, const char *value)
 {
   int i;
   VALUE *v = 0;
diff --git a/tp/Texinfo/XS/parsetexi/macro.h b/tp/Texinfo/XS/parsetexi/macro.h
index 26fc0c3d61..91f659ac68 100644
--- a/tp/Texinfo/XS/parsetexi/macro.h
+++ b/tp/Texinfo/XS/parsetexi/macro.h
@@ -43,7 +43,7 @@ void expand_macro_body (MACRO *macro_record, ELEMENT 
*arguments,
 MACRO *lookup_macro (enum command_id cmd);
 void wipe_macros (void);
 
-void store_value (char *name, char *value);
+void store_value (const char *name, const char *value);
 char *fetch_value (char *name);
 void clear_value (char *name);
 void wipe_values (void);
diff --git a/tp/Texinfo/XS/parsetexi/multitable.c 
b/tp/Texinfo/XS/parsetexi/multitable.c
index 0b9bcac094..0e1950c210 100644
--- a/tp/Texinfo/XS/parsetexi/multitable.c
+++ b/tp/Texinfo/XS/parsetexi/multitable.c
@@ -17,11 +17,8 @@
 
 #include "tree_types.h"
 #include "tree.h"
-#include "errors_parser.h"
-/* for item_line_parent */
-#include "utils.h"
-#include "builtin_commands.h"
 #include "commands.h"
+#include "errors_parser.h"
 /* check_no_text */
 #include "handle_commands.h"
 
@@ -67,7 +64,7 @@ gather_previous_item (ELEMENT *current, enum command_id 
next_command)
       && last_contents_child(current)->type == ET_before_item)
     {
       if (next_command == CM_itemx)
-        line_error ("@itemx should not begin @%s", command_name(current->cmd));
+        line_error ("@itemx should not begin @%s", command_name 
(current->cmd));
       return;
     }
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index d9711a0412..7a7e7db351 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -327,7 +327,7 @@ set_documentlanguage (char *value)
 }
 
 void
-set_documentlanguage_override (char *value)
+set_documentlanguage_override (const char *value)
 {
   free (global_documentlanguage);
   global_documentlanguage = value ? strdup (value) : 0;
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index 8ffa111854..d236bf4895 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -79,7 +79,7 @@ typedef struct {
 ELEMENT *setup_document_root_and_before_node_section (void);
 int parse_texi (ELEMENT *root_elt, ELEMENT *current_elt);
 int parse_texi_document (void);
-void set_documentlanguage_override (char *value);
+void set_documentlanguage_override (const char *value);
 void set_accept_internalvalue (int value);
 void set_restricted (int value);
 
diff --git a/tp/maintain/regenerate_C_options_info.pl 
b/tp/maintain/regenerate_C_options_info.pl
index 4b405087d1..0e31902e23 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -288,7 +288,7 @@ print GET '#include "get_perl_info.h"'."\n";
 print GET '#include "build_perl_info.h"'."\n\n";
 
 print GET 'void
-get_sv_option (OPTIONS *options, const char *key, SV *value, int force, 
CONVERTER *converter)
+get_sv_option (OPTIONS *options, const char *key, SV *value, int force, const 
CONVERTER *converter)
 {
   dTHX;
 



reply via email to

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