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 07:00:21 -0500 (EST)

branch: master
commit a72e82b47fff5c0c96977c92a73369bbc8e0b3b5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 24 12:46:13 2024 +0100

    * tp/Texinfo/XS/main/extra.c (add_extra_directions): remove input
    element list argumnet, it is never set.  Update callers.
---
 ChangeLog                                       |  5 ++++
 tp/Texinfo/XS/main/extra.c                      | 18 ++++++------
 tp/Texinfo/XS/main/extra.h                      |  3 +-
 tp/Texinfo/XS/structuring_transfo/structuring.c | 38 ++++++++++++-------------
 4 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 45d0b3a088..1457586a31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
 2024-02-24  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/tree.c: remove now unused
diff --git a/tp/Texinfo/XS/main/extra.c b/tp/Texinfo/XS/main/extra.c
index 226937e82c..0e31f54643 100644
--- a/tp/Texinfo/XS/main/extra.c
+++ b/tp/Texinfo/XS/main/extra.c
@@ -113,18 +113,16 @@ add_extra_contents (ELEMENT *e, const char *key, 
ELEMENT_LIST *value)
   return value;
 }
 
-/* similar to extra_contents, but holds 3 elements corresponding to
-   directions in enum directions.  Another difference, more
-   generally with other elements, is that a pointer to the element
-   in the list set to 0 is ok, it means that there is no such direction
-   In other elements, in general, all the pointer elements are non
-   NULL in contents for the first contents.number elements.
+/* Holds 3 elements corresponding to directions in enum directions.
+   A general difference other element lists, is that an element
+   pointer set to 0 is ok, it means that there is no such direction
+   In general, all the pointer elements are non NULL in element lists
+   for the first number elements.
 */
-ELEMENT_LIST *
-add_extra_directions (ELEMENT *e, const char *key, ELEMENT_LIST *value)
+const ELEMENT_LIST *
+add_extra_directions (ELEMENT *e, const char *key)
 {
-  if (!value)
-    value = new_list ();
+  ELEMENT_LIST *value = new_list ();
   list_set_empty_contents (value, directions_length);
   KEY_PAIR *k = get_associated_info_key (&e->extra_info, key,
                                          extra_directions);
diff --git a/tp/Texinfo/XS/main/extra.h b/tp/Texinfo/XS/main/extra.h
index 6aa1dabcbb..c398471f61 100644
--- a/tp/Texinfo/XS/main/extra.h
+++ b/tp/Texinfo/XS/main/extra.h
@@ -24,8 +24,7 @@ void add_extra_element_oot (ELEMENT *e, char *key, ELEMENT 
*value);
 ELEMENT_LIST *add_extra_contents (ELEMENT *e, const char *key,
                                   ELEMENT_LIST *value);
 void add_extra_container (ELEMENT *e, char *key, ELEMENT *value);
-ELEMENT_LIST *add_extra_directions (ELEMENT *e, const char *key,
-                                    ELEMENT_LIST *value);
+const ELEMENT_LIST *add_extra_directions (ELEMENT *e, const char *key);
 void add_extra_text (ELEMENT *e, char *key, ELEMENT *value);
 void add_extra_misc_args (ELEMENT *e, char *key, ELEMENT *value);
 void add_extra_string (ELEMENT *e, const char *key, char *value);
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c 
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 3f31d20640..ed4c3106bd 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -130,7 +130,7 @@ sectioning_structure (DOCUMENT *document)
           /* new command is below */
             {
               const ELEMENT_LIST *section_directions
-                  = add_extra_directions (content, "section_directions", 0);
+                  = add_extra_directions (content, "section_directions");
               ELEMENT_LIST *section_childs = new_list ();
               if (level - prev_section_level > 1)
                 {
@@ -243,8 +243,8 @@ sectioning_structure (DOCUMENT *document)
                     = up_section_childs->list[up_section_childs->number -1];
                   const ELEMENT_LIST *prev_section_directions
                     = lookup_extra_directions (prev, "section_directions");
-                  ELEMENT_LIST *section_directions
-                    = add_extra_directions (content, "section_directions", 0);
+                  const ELEMENT_LIST *section_directions
+                    = add_extra_directions (content, "section_directions");
               /* do not set sec_root as up, but always put in section_childs */
                   if (up != sec_root)
                     section_directions->list[D_up] = up;
@@ -252,7 +252,7 @@ sectioning_structure (DOCUMENT *document)
 
                   if (!prev_section_directions)
                     prev_section_directions = add_extra_directions (prev,
-                                                     "section_directions", 0);
+                                                     "section_directions");
                   prev_section_directions->list[D_next] = content;
                   add_to_element_list (up_section_childs, content);
                 }
@@ -354,7 +354,7 @@ sectioning_structure (DOCUMENT *document)
           if (previous_toplevel || (section_top && section_top != content))
             {
               const ELEMENT_LIST *toplevel_directions
-                = add_extra_directions (content, "toplevel_directions", 0);
+                = add_extra_directions (content, "toplevel_directions");
 
               if (previous_toplevel)
                 {
@@ -364,7 +364,7 @@ sectioning_structure (DOCUMENT *document)
                   if (!prev_toplvl_directions)
                     prev_toplvl_directions
                       = add_extra_directions (previous_toplevel,
-                                              "toplevel_directions", 0);
+                                              "toplevel_directions");
  
                   prev_toplvl_directions->list[D_next] = content;
                   toplevel_directions->list[D_prev] = previous_toplevel;
@@ -891,7 +891,7 @@ set_menus_node_directions (DOCUMENT *document)
                                       if (!menu_directions)
                                         menu_directions
                                           = add_extra_directions (menu_node,
-                                                           "menu_directions", 
0);
+                                                           "menu_directions");
                                       menu_directions->list[D_up]
                                         = node;
                                     }
@@ -921,7 +921,7 @@ set_menus_node_directions (DOCUMENT *document)
                               if (!menu_directions)
                                 menu_directions
                                   = add_extra_directions (menu_node,
-                                                      "menu_directions", 0);
+                                                      "menu_directions");
                               menu_directions->list[D_prev]
                                  = previous_node;
                             }
@@ -933,7 +933,7 @@ set_menus_node_directions (DOCUMENT *document)
                               if (!menu_directions)
                                 menu_directions
                                   = add_extra_directions (previous_node,
-                                                      "menu_directions", 0);
+                                                      "menu_directions");
                               menu_directions->list[D_next]
                                  = menu_node;
                             }
@@ -1150,7 +1150,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
                                                       "node_directions");
                           if (!node_directions)
                             node_directions = add_extra_directions (node,
-                                                    "node_directions", 0);
+                                                    "node_directions");
                           node_directions->list[d]
                              = elt_menu_direction;
                         }
@@ -1168,7 +1168,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
                                                 "node_directions");
                   if (!node_directions)
                     node_directions = add_extra_directions (node,
-                                                  "node_directions", 0);
+                                                  "node_directions");
 
                   node_directions->list[D_next] = menu_child;
                   const ELEMENT *menu_child_manual_content
@@ -1181,7 +1181,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
                       if (!child_node_directions)
                         child_node_directions
                           = add_extra_directions (menu_child,
-                                                   "node_directions", 0);
+                                                   "node_directions");
                       if (!child_node_directions->list[D_prev])
                         child_node_directions->list[D_prev] = node;
                     }
@@ -1200,7 +1200,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
                                                       "node_directions");
                           if (!node_directions)
                             node_directions = add_extra_directions (node,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                           node_directions->list[D_next]
                               = first_non_top_node;
                           int first_non_top_node_automatic
@@ -1213,7 +1213,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
                               if (!non_top_node_directions)
                                 non_top_node_directions
                                   = add_extra_directions (first_non_top_node,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                               non_top_node_directions->list[D_prev]
                                = node;
                             }
@@ -1408,7 +1408,7 @@ nodes_tree (DOCUMENT *document)
                                                     "node_directions");
                         if (!node_directions)
                           node_directions = add_extra_directions (node,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                         node_directions->list[d]
                            = direction_associated_node;
                       }
@@ -1435,7 +1435,7 @@ nodes_tree (DOCUMENT *document)
                                                     "node_directions");
                         if (!top_directions)
                           top_directions = add_extra_directions (node,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                         top_directions->list[D_next]
                           = top_node_section_child;
                         if (top_node_section_child->args.number <= 1)
@@ -1446,7 +1446,7 @@ nodes_tree (DOCUMENT *document)
                             if (!top_section_child_directions)
                               top_section_child_directions
                                 = add_extra_directions (top_node_section_child,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                             top_section_child_directions->list[D_prev]
                               = node;
                           }
@@ -1471,7 +1471,7 @@ nodes_tree (DOCUMENT *document)
                                                     "node_directions");
                   if (!node_directions)
                     node_directions = add_extra_directions (node,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                   node_directions->list[direction]
                       = direction_element;
                 }
@@ -1491,7 +1491,7 @@ nodes_tree (DOCUMENT *document)
                                                     "node_directions");
                           if (!node_directions)
                             node_directions = add_extra_directions (node,
-                                                      "node_directions", 0);
+                                                      "node_directions");
                           node_directions->list[direction]
                             = node_target;
                           if ((!options)



reply via email to

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