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/debug.c (debug_print_el


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/debug.c (debug_print_element): Do not construct dump string for element unless it will actually be printed. (print_element_debug): Declare as static.
Date: Sun, 09 Apr 2023 10:57:30 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new de6eefc66f * tp/Texinfo/XS/parsetexi/debug.c (debug_print_element): Do 
not construct dump string for element unless it will actually be printed. 
(print_element_debug): Declare as static.
de6eefc66f is described below

commit de6eefc66ffef946bad1b22d00a1fdd2f5f1b102
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Apr 9 15:56:14 2023 +0100

    * tp/Texinfo/XS/parsetexi/debug.c (debug_print_element):
    Do not construct dump string for element unless it will actually
    be printed.
    (print_element_debug): Declare as static.
---
 ChangeLog                       |  7 +++++++
 tp/Texinfo/XS/parsetexi/debug.c | 12 ++++++++----
 tp/Texinfo/XS/parsetexi/debug.h |  1 -
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 531cab479d..f3fc8c9d6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-04-09  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/parsetexi/debug.c (debug_print_element):
+       Do not construct dump string for element unless it will actually
+       be printed.
+       (print_element_debug): Declare as static.
+
 2023-04-09  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf):
diff --git a/tp/Texinfo/XS/parsetexi/debug.c b/tp/Texinfo/XS/parsetexi/debug.c
index 7377c16441..08e2600cf6 100644
--- a/tp/Texinfo/XS/parsetexi/debug.c
+++ b/tp/Texinfo/XS/parsetexi/debug.c
@@ -47,7 +47,7 @@ debug_nonl (char *s, ...)
   vfprintf (stderr, s, v);
 }
 
-char *
+static char *
 print_element_debug (ELEMENT *e, int print_parent)
 {
   TEXT text;
@@ -96,7 +96,11 @@ print_element_debug (ELEMENT *e, int print_parent)
 void
 debug_print_element (ELEMENT *e, int print_parent)
 {
-  char *result = print_element_debug (e, print_parent);
-  debug_nonl (result);
-  free (result);
+  if (debug_output)
+    {
+      char *result;
+      result = print_element_debug (e, print_parent);
+      debug_nonl (result);
+      free (result);
+    }
 }
diff --git a/tp/Texinfo/XS/parsetexi/debug.h b/tp/Texinfo/XS/parsetexi/debug.h
index 0556ef50b6..7b7664c2b5 100644
--- a/tp/Texinfo/XS/parsetexi/debug.h
+++ b/tp/Texinfo/XS/parsetexi/debug.h
@@ -22,6 +22,5 @@ void debug (char *s, ...);
 void debug_nonl (char *s, ...);
 extern int debug_output;
 void debug_print_element (ELEMENT *e, int print_parent);
-char *print_element_debug (ELEMENT *e, int print_parent);
 
 #endif



reply via email to

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