texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sun, 29 Oct 2023 04:37:23 -0400 (EDT)

branch: master
commit e743ed37c089c45d63a713f142dfd89cbd2c043d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Oct 29 09:37:24 2023 +0100

    * tp/Texinfo/XS/parsetexi/parser.c: inline and remove
    element_type_name function.  Inline in callers.
---
 ChangeLog                                 | 5 +++++
 tp/TODO                                   | 2 --
 tp/Texinfo/XS/parsetexi/close.c           | 2 +-
 tp/Texinfo/XS/parsetexi/handle_commands.c | 2 +-
 tp/Texinfo/XS/parsetexi/parser.c          | 8 +-------
 tp/Texinfo/XS/parsetexi/parser.h          | 1 -
 tp/Texinfo/XS/parsetexi/source_marks.h    | 2 +-
 7 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index add7ae825e..f02dbc2d2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-10-29  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/parser.c: inline and remove
+       element_type_name function.  Inline in callers.
+
 2023-10-28  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/ConvertXS.xs (plain_texinfo_convert_tree)
diff --git a/tp/TODO b/tp/TODO
index e234a409e7..e8dbab44e0 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,8 +10,6 @@ This is the todo list for texi2any
 Before next release
 ===================
 
-inline element_type_name from parser.c
-
 check $(native_tools) variable in Makefile.am does not seems to be
 set and seems useless.
 
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index 35d660117b..cf71e75adf 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -439,7 +439,7 @@ close_current (ELEMENT *current,
     {
       ELEMENT *close_brace;
 
-      debug ("CLOSING type %s", element_type_name (current));
+      debug ("CLOSING type %s", element_type_names[current->type]);
 
       switch (current->type)
         {
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 0b43813555..b8661f2805 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -1044,7 +1044,7 @@ handle_block_command (ELEMENT *current, char **line_inout,
               else
                 {
                   bug_message ("menu description parent not a menu_entry: %s",
-                               element_type_name (current));
+                               element_type_names[current->type]);
                   abort ();
                 }
             }
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 19a0616a4f..47c262ff93 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -129,12 +129,6 @@ parse_command_name (char **ptr, int *single_char)
   return ret;
 }
 
-char *
-element_type_name (ELEMENT *e)
-{
-  return element_type_names[(e)->type];
-}
-
 /* the pointer returned is past @c/@comment, whether there is indeed
    a comment or not.  If there is a comment, *has_comment is set to 1 */
 char *
@@ -787,7 +781,7 @@ abort_empty_line (ELEMENT **current_inout, char 
*additional_spaces)
       debug_parser_print_element (current, 0);
       debug_nonl ("(p:%d): %s; add |%s| to |%s|",
                   in_paragraph_context (current_context ()),
-                  element_type_name (last_child), additional_spaces,
+                  element_type_names[last_child->type], additional_spaces,
                   last_child->text.end > 0 ? last_child->text.text : "");
       debug ("");
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index 1d1086a635..82f98ee2a1 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -110,7 +110,6 @@ ELEMENT *begin_paragraph (ELEMENT *current);
 int is_end_current_command (ELEMENT *current, char **line,
                             enum command_id *end_cmd);
 void set_documentlanguage (char *);
-char *element_type_name (ELEMENT *e);
 int check_space_element (ELEMENT *e);
 void gather_spaces_after_cmd_before_arg (ELEMENT *current);
 char *parse_command_name (char **ptr, int *single_char);
diff --git a/tp/Texinfo/XS/parsetexi/source_marks.h 
b/tp/Texinfo/XS/parsetexi/source_marks.h
index 51a74013de..008a312521 100644
--- a/tp/Texinfo/XS/parsetexi/source_marks.h
+++ b/tp/Texinfo/XS/parsetexi/source_marks.h
@@ -19,9 +19,9 @@
 #include "tree_types.h"
 
 SOURCE_MARK *new_source_mark (enum source_mark_type type);
+void place_source_mark (ELEMENT *e, SOURCE_MARK *source_mark);
 void register_source_mark (ELEMENT *e, SOURCE_MARK *source_mark);
 void transfer_source_marks (ELEMENT *from_e, ELEMENT *e);
-void place_source_mark (ELEMENT *e, SOURCE_MARK *source_mark);
 
 void source_marks_reset_counters (void);
 



reply via email to

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