texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/parsetexi/source_marks.c (source_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/source_marks.c (source_marks_names): setup the source_marks_names table in the file using it and not in the header file defining the macro used to setup the table, to have the table defined only where it is used.
Date: Sat, 12 Aug 2023 10:26:35 -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 307fae7982 * tp/Texinfo/XS/parsetexi/source_marks.c 
(source_marks_names): setup the source_marks_names table in the file using it 
and not in the header file defining the macro used to setup the table, to have 
the table defined only where it is used.
307fae7982 is described below

commit 307fae79827e2f1afc1c2ec5ba1b0df2a1441e03
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 12 16:26:25 2023 +0200

    * tp/Texinfo/XS/parsetexi/source_marks.c (source_marks_names): setup
    the source_marks_names table in the file using it and not in the
    header file defining the macro used to setup the table, to have the
    table defined only where it is used.
---
 ChangeLog                              |  7 +++++++
 tp/Texinfo/XS/parsetexi/source_marks.c | 10 ++++++++++
 tp/Texinfo/XS/parsetexi/tree_types.h   |  7 -------
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b574fa5b38..5114227fa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-12  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/source_marks.c (source_marks_names): setup
+       the source_marks_names table in the file using it and not in the
+       header file defining the macro used to setup the table, to have the
+       table defined only where it is used.
+
 2023-08-12  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block),
diff --git a/tp/Texinfo/XS/parsetexi/source_marks.c 
b/tp/Texinfo/XS/parsetexi/source_marks.c
index e5d7f5401f..347221c753 100644
--- a/tp/Texinfo/XS/parsetexi/source_marks.c
+++ b/tp/Texinfo/XS/parsetexi/source_marks.c
@@ -31,6 +31,16 @@ int value_expansion_counter = 0;
 int ignored_conditional_block_counter = 0;
 int expanded_conditional_command_counter = 0;
 
+/* it isn't much readable to use here the SM_TYPES_LIST macro defined
+   in a header file, but the table should be allocated in files using
+   it only if static (or in only one file if extern) */
+static char *source_marks_names[SM_type_expanded_conditional_command + 1] =
+{
+  #define sm_type(name) [SM_type_ ## name] = #name,
+    SM_TYPES_LIST
+  #undef sm_type
+};
+
 char *
 source_mark_name(enum source_mark_type type)
 {
diff --git a/tp/Texinfo/XS/parsetexi/tree_types.h 
b/tp/Texinfo/XS/parsetexi/tree_types.h
index 06d5188114..b6536e8b45 100644
--- a/tp/Texinfo/XS/parsetexi/tree_types.h
+++ b/tp/Texinfo/XS/parsetexi/tree_types.h
@@ -55,13 +55,6 @@ enum source_mark_type {
   #undef sm_type
 };
 
-static char *source_marks_names[SM_type_expanded_conditional_command + 1] =
-{
-  #define sm_type(name) [SM_type_ ## name] = #name,
-    SM_TYPES_LIST
-  #undef sm_type
-};
-
 enum source_mark_status {
     SM_status_none,
     SM_status_start,



reply via email to

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