[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/convert/ConvertXS.xs (html_finali
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/convert/ConvertXS.xs (html_finalize_output_state), tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state) (html_check_transfer_state_finalization): add checks on final converter output state and on state used to sync perl converter state after the last sync of perl state. |
Date: |
Sat, 11 Nov 2023 05:27:55 -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 ad870fd0c6 * tp/Texinfo/XS/convert/ConvertXS.xs
(html_finalize_output_state), tp/Texinfo/XS/convert/convert_html.c
(html_finalize_output_state) (html_check_transfer_state_finalization): add
checks on final converter output state and on state used to sync perl converter
state after the last sync of perl state.
ad870fd0c6 is described below
commit ad870fd0c6b4486c930308319dacad257b65f2a6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Nov 11 11:27:48 2023 +0100
* tp/Texinfo/XS/convert/ConvertXS.xs (html_finalize_output_state),
tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state)
(html_check_transfer_state_finalization): add checks on final
converter output state and on state used to sync perl converter state
after the last sync of perl state.
---
ChangeLog | 8 +++++++
tp/TODO | 16 +++----------
tp/Texinfo/XS/convert/ConvertXS.xs | 1 +
tp/Texinfo/XS/convert/convert_html.c | 45 ++++++++++++++++++++++++++++++++++++
tp/Texinfo/XS/convert/convert_html.h | 1 +
tp/Texinfo/XS/main/converter_types.h | 17 +++++++-------
6 files changed, 67 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0787cbce7d..2d17638df7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-11-11 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/ConvertXS.xs (html_finalize_output_state),
+ tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state)
+ (html_check_transfer_state_finalization): add checks on final
+ converter output state and on state used to sync perl converter state
+ after the last sync of perl state.
+
2023-11-11 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state),
diff --git a/tp/TODO b/tp/TODO
index f4a578fae4..485a3ac348 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -70,19 +70,9 @@ no_arg_formatted_cmd
pre_class_types
special_unit_varieties
html_command_conversion
-no_arg_formatted_cmd_translated + check
-reset_target_commands + check
-file_changed_counter + check
-
-to check as it should be reset as the HTML state is always synced
-tree_to_build
-document_context_change
-document_contexts_to_pop
-
-to check
-document_global_context
-ignore_notice
-+ html_document_context
+no_arg_formatted_cmd_translated
+reset_target_commands
+file_changed_counter
Bugs
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 76ae03ee07..7f4fc77fe2 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -181,6 +181,7 @@ html_finalize_output_state (SV *converter_in)
build_html_formatting_state (self, self->modified_state);
self->modified_state = 0;
}
+ html_check_transfer_state_finalization (self);
}
void
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 6948b5bdef..5b1c75b4b6 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -2549,6 +2549,48 @@ html_finalize_output_state (CONVERTER *self)
}
html_pop_document_context (self);
+
+ /* could change to 0 in releases? */
+ if (1)
+ {
+ if (self->html_document_context.top > 0)
+ fprintf (stderr, "BUG: document context top > 0: %zu\n",
+ self->html_document_context.top);
+ if (self->document_global_context)
+ fprintf (stderr, "BUG: document_global_context: %d\n",
+ self->document_global_context);
+ if (self->ignore_notice)
+ fprintf (stderr, "BUG: ignore_notice: %d\n",
+ self->ignore_notice);
+
+ }
+}
+
+void
+html_check_transfer_state_finalization (CONVERTER *self)
+{
+ /* could change to 0 in releases? */
+ if (1)
+ {
+ /* check that all the state change have been transmitted */
+ if (self->tree_to_build)
+ fprintf (stderr, "BUG: tree_to_build set\n");
+ if (self->document_context_change)
+ fprintf (stderr, "BUG: document_context_change: %d\n",
+ self->document_context_change);
+ if (self->document_contexts_to_pop)
+ fprintf (stderr, "BUG: document_contexts_to_pop: %d\n",
+ self->document_contexts_to_pop);
+ if (self->no_arg_formatted_cmd_translated.number)
+ fprintf (stderr, "BUG: no_arg_formatted_cmd_translated: %zu\n",
+ self->no_arg_formatted_cmd_translated.number);
+ if (self->reset_target_commands.number)
+ fprintf (stderr, "BUG: reset_target_commands: %zu\n",
+ self->reset_target_commands.number);
+ if (self->file_changed_counter.number)
+ fprintf (stderr, "BUG: file_changed_counter: %zu\n",
+ self->file_changed_counter.number);
+ }
}
char *
@@ -2812,6 +2854,9 @@ html_translate_names (CONVERTER *self)
/* delete the tree and formatted results for special elements
such that they are redone with the new tree when needed. */
+ /* if reset_target_commands was still set, we will fill with the
+ same elements again, but it is not a big deal as we need to go
+ through the loop anyway and the memory will be reused */
self->reset_target_commands.number = 0;
for (j = 0; j < special_unit_varieties->number; j++)
{
diff --git a/tp/Texinfo/XS/convert/convert_html.h
b/tp/Texinfo/XS/convert/convert_html.h
index 033c7742b3..75077c3cb0 100644
--- a/tp/Texinfo/XS/convert/convert_html.h
+++ b/tp/Texinfo/XS/convert/convert_html.h
@@ -55,4 +55,5 @@ char *html_convert_output (CONVERTER *self, ELEMENT *root,
int special_units_descriptor,
char *output_file, char *destination_directory,
char *output_filename, char *document_name);
+void html_check_transfer_state_finalization (CONVERTER *self);
#endif
diff --git a/tp/Texinfo/XS/main/converter_types.h
b/tp/Texinfo/XS/main/converter_types.h
index 9e49b511b1..a0f43b5822 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -370,16 +370,21 @@ typedef struct HTML_DOCUMENT_CONTEXT_STACK {
typedef struct CONVERTER {
int converter_descriptor;
+ /* perl converter. This should be HV *hv,
+ but we don't want to include the Perl headers everywhere; */
+ void *hv;
+
OPTIONS *conf;
OPTIONS *init_conf;
- struct DOCUMENT *document;
- int document_units_descriptor;
+ EXPANDED_FORMAT *expanded_formats;
+ TRANSLATED_COMMAND *translated_commands;
ERROR_MESSAGE_LIST error_messages;
+
+ struct DOCUMENT *document;
MERGED_INDEX *index_entries;
INDEX_SORTED_BY_LETTER *index_entries_by_letter;
- TRANSLATED_COMMAND *translated_commands;
- EXPANDED_FORMAT *expanded_formats;
+ int document_units_descriptor;
/* output unit files API */
FILE_NAME_PATH_COUNTER_LIST output_unit_files;
@@ -387,10 +392,6 @@ typedef struct CONVERTER {
/* API to open, set encoding and register files */
OUTPUT_FILES_INFORMATION output_files_information;
- /* perl converter. This should be HV *hv,
- but we don't want to include the Perl headers everywhere; */
- void *hv;
-
/* maybe HTML specific */
char *title_titlepage;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/convert/ConvertXS.xs (html_finalize_output_state), tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state) (html_check_transfer_state_finalization): add checks on final converter output state and on state used to sync perl converter state after the last sync of perl state.,
Patrice Dumas <=