texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/Converter.pm (set_conf, forc


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/Converter.pm (set_conf, force_conf): no need to encode in perl, it is done in C.
Date: Wed, 13 Dec 2023 05:39:23 -0500

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 98588512e3 * tp/Texinfo/Convert/Converter.pm (set_conf, force_conf): 
no need to encode in perl, it is done in C.
98588512e3 is described below

commit 98588512e3a17477e04f4ed0f61a2211d1a4f5d9
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Dec 13 11:39:16 2023 +0100

    * tp/Texinfo/Convert/Converter.pm (set_conf, force_conf): no need to
    encode in perl, it is done in C.
    
    * tp/Texinfo/XS/main/get_perl_info.c (add_svav_to_string_list)
    (html_get_button_specification_list),
    tp/maintain/regenerate_C_options_info.pl: clear strings list before
    setting them.  Handle undef value for all the types.
---
 ChangeLog                                | 10 ++++++++++
 man/pod2texi.1                           |  2 +-
 tp/Texinfo/Convert/Converter.pm          | 14 ++------------
 tp/Texinfo/XS/convert/ConvertXS.xs       |  2 +-
 tp/Texinfo/XS/main/get_perl_info.c       |  6 ++++++
 tp/maintain/regenerate_C_options_info.pl | 16 +++++++++++++---
 6 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 916f3c28ce..1820405f69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-12-13  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Converter.pm (set_conf, force_conf): no need to
+       encode in perl, it is done in C.
+
+       * tp/Texinfo/XS/main/get_perl_info.c (add_svav_to_string_list)
+       (html_get_button_specification_list),
+       tp/maintain/regenerate_C_options_info.pl: clear strings list before
+       setting them.  Handle undef value for all the types.
+
 2023-12-12  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/build_html_perl_state.c (build_simpletitle):
diff --git a/man/pod2texi.1 b/man/pod2texi.1
index 17f3cdab17..66b4266714 100644
--- a/man/pod2texi.1
+++ b/man/pod2texi.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "POD2TEXI 1"
-.TH POD2TEXI 1 "2023-10-25" "perl" "User Contributed Perl Documentation"
+.TH POD2TEXI 1 "2023-11-26" "perl" "User Contributed Perl Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 7db01dde28..f5d0ba4588 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -603,12 +603,7 @@ sub set_conf($$$)
     return 0;
   } else {
     if ($self->{'converter_descriptor'} and $XS_convert) {
-      if (ref($value) eq ''
-       and not $Texinfo::Common::non_decoded_customization_variables{$conf}) {
-        _XS_set_conf($self, $conf, Encode::encode("UTF-8", $value));
-      } else {
-        _XS_set_conf($self, $conf, $value);
-      }
+      _XS_set_conf($self, $conf, $value);
     }
     $self->{'conf'}->{$conf} = $value;
     return 1;
@@ -625,12 +620,7 @@ sub force_conf($$$)
     return undef;
   }
   if ($self->{'converter_descriptor'} and $XS_convert) {
-    if (ref($value) eq ''
-     and not $Texinfo::Common::non_decoded_customization_variables{$conf}) {
-      _XS_set_conf($self, $conf, Encode::encode("UTF-8", $value));
-    } else {
-      _XS_set_conf($self, $conf, $value);
-    }
+    _XS_set_conf($self, $conf, $value);
   }
   $self->{'conf'}->{$conf} = $value;
   return 1;
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 1ca7642879..c5695cf1c3 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -79,7 +79,7 @@ set_conf (SV *converter_in, conf, SV *value)
       PREINIT:
          CONVERTER *self;
       CODE:
-         /* warn? */
+         /* Warn? Calling code checks 'converter_descriptor' is set */
          self = get_sv_converter (converter_in, 0);
          if (self)
            set_conf (self, conf, value);
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index f2735ce53e..b241a01de8 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -174,6 +174,9 @@ add_svav_to_string_list (SV *sv, STRING_LIST *string_list, 
enum sv_string_type t
 
   dTHX;
 
+  if (!SvOK (sv))
+    return;
+
   AV *av = (AV *)SvRV (sv);
   strings_nr = av_top_index (av) +1;
   for (i = 0; i < strings_nr; i++)
@@ -871,6 +874,9 @@ html_get_button_specification_list (CONVERTER *converter, 
SV *buttons_sv)
 
   dTHX;
 
+  if (!SvOK (buttons_sv))
+    return 0;
+
   result = (BUTTON_SPECIFICATION_LIST *)
             malloc (sizeof (BUTTON_SPECIFICATION_LIST));
 
diff --git a/tp/maintain/regenerate_C_options_info.pl 
b/tp/maintain/regenerate_C_options_info.pl
index adb51c2cdf..54e8d9c011 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -280,7 +280,9 @@ print GET '
 
 ';
 
-print GET '#include <string.h>'."\n\n";
+# FIXME include before or after perl?  Include config.h?
+print GET '#include <string.h>'."\n";
+print GET '#include <stdlib.h>'."\n\n";
 
 print GET '#include "options_types.h"'."\n";
 print GET '#include "converter_types.h"'."\n";
@@ -322,12 +324,20 @@ foreach my $category (sort(keys(%option_categories))) {
         options->$option = 0;
     }\n";
     } elsif ($type eq 'int') {
-      print GET "    options->$option = SvIV (value);\n";
+      print GET "    {
+      if (SvOK (value))
+        options->$option = SvIV (value);
+      else
+        options->$option = -1;
+    }\n";
     } elsif ($type eq 'STRING_LIST') {
       my $dir_string_arg = 'svt_byte';
       $dir_string_arg = 'svt_dir'
         if ($option eq 'INCLUDE_DIRECTORIES');
-      print GET "    add_svav_to_string_list (value, &options->$option, 
$dir_string_arg);\n";
+      print GET "    {\n";
+      print GET "      clear_strings_list (&options->$option);\n";
+      print GET "      add_svav_to_string_list (value, &options->$option, 
$dir_string_arg);\n";
+      print GET "    }\n";
     } elsif ($type eq 'BUTTON_SPECIFICATION_LIST *') {
       print GET "    {\n";
       print GET "      html_free_button_specification_list 
(options->$option);\n";



reply via email to

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