[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/document.c (new_document) (d
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/document.c (new_document) (destroy_document_information_except_tree, clear_document_errors) (clear_document_parser_errors), tp/Texinfo/XS/main/document_types.h (DOCUMENT), tp/Texinfo/XS/main/DocumentXS.xs, tp/Texinfo/XS/main/build_perl_info.c, tp/Texinfo/XS/main/translations.c, tp/Texinfo/XS/parsetexi/errors_parser.c, tp/Texinfo/XS/structuring_transfo/structuring.c, tp/Texinfo/XS/structuring_transfo/transformations.c: put error_messages and parser_error_messages direct [...] |
Date: |
Sat, 18 May 2024 15:44:47 -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 73529e1c7b * tp/Texinfo/XS/main/document.c (new_document)
(destroy_document_information_except_tree, clear_document_errors)
(clear_document_parser_errors), tp/Texinfo/XS/main/document_types.h (DOCUMENT),
tp/Texinfo/XS/main/DocumentXS.xs, tp/Texinfo/XS/main/build_perl_info.c,
tp/Texinfo/XS/main/translations.c, tp/Texinfo/XS/parsetexi/errors_parser.c,
tp/Texinfo/XS/structuring_transfo/structuring.c,
tp/Texinfo/XS/structuring_transfo/transformations.c: put error_messages and
parser_ [...]
73529e1c7b is described below
commit 73529e1c7b4eab364aca896bcc743cf37d9cae8e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat May 18 21:44:45 2024 +0200
* tp/Texinfo/XS/main/document.c (new_document)
(destroy_document_information_except_tree, clear_document_errors)
(clear_document_parser_errors), tp/Texinfo/XS/main/document_types.h
(DOCUMENT), tp/Texinfo/XS/main/DocumentXS.xs,
tp/Texinfo/XS/main/build_perl_info.c,
tp/Texinfo/XS/main/translations.c,
tp/Texinfo/XS/parsetexi/errors_parser.c,
tp/Texinfo/XS/structuring_transfo/structuring.c,
tp/Texinfo/XS/structuring_transfo/transformations.c: put
error_messages and parser_error_messages directly in DOCUMENT, not as
a pointer.
---
ChangeLog | 14 ++++++++++++++
tp/Texinfo/XS/main/DocumentXS.xs | 6 +++---
tp/Texinfo/XS/main/build_perl_info.c | 4 ++--
tp/Texinfo/XS/main/document.c | 15 ++++-----------
tp/Texinfo/XS/main/document_types.h | 4 ++--
tp/Texinfo/XS/main/translations.c | 4 ++--
tp/Texinfo/XS/parsetexi/errors_parser.c | 2 +-
tp/Texinfo/XS/structuring_transfo/structuring.c | 16 ++++++++--------
tp/Texinfo/XS/structuring_transfo/transformations.c | 10 ++++------
9 files changed, 40 insertions(+), 35 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9603c7c067..7e0c723d1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-05-18 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/document.c (new_document)
+ (destroy_document_information_except_tree, clear_document_errors)
+ (clear_document_parser_errors), tp/Texinfo/XS/main/document_types.h
+ (DOCUMENT), tp/Texinfo/XS/main/DocumentXS.xs,
+ tp/Texinfo/XS/main/build_perl_info.c,
+ tp/Texinfo/XS/main/translations.c,
+ tp/Texinfo/XS/parsetexi/errors_parser.c,
+ tp/Texinfo/XS/structuring_transfo/structuring.c,
+ tp/Texinfo/XS/structuring_transfo/transformations.c: put
+ error_messages and parser_error_messages directly in DOCUMENT, not as
+ a pointer.
+
2024-05-18 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/document.c (new_document)
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index 883a25c1b8..007d4c2a14 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -116,7 +116,7 @@ document_errors (SV *document_in)
PPCODE:
document = get_sv_document_document (document_in, 0);
if (document)
- error_messages = document->error_messages;
+ error_messages = &document->error_messages;
pass_errors_to_registrar (error_messages, document_in,
&errors_warnings_sv,
@@ -277,7 +277,7 @@ setup_indices_sort_strings (SV *document_in, ...)
document = get_sv_document_document (document_in,
"setup_indices_sort_strings");
if (document)
- document_indices_sort_strings (document, document->error_messages,
+ document_indices_sort_strings (document, &document->error_messages,
document->options);
# customization_information
@@ -294,7 +294,7 @@ indices_sort_strings (SV *document_in, ...)
"indices_sort_strings");
if (document)
indices_sort_strings
- = document_indices_sort_strings (document, document->error_messages,
+ = document_indices_sort_strings (document,
&document->error_messages,
document->options);
if (indices_sort_strings)
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index 485224330d..042256ee21 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -1363,9 +1363,9 @@ pass_document_parser_errors_to_registrar (int
document_descriptor,
if (!document)
return;
- pass_errors_to_registrar (document->parser_error_messages, parser_sv,
+ pass_errors_to_registrar (&document->parser_error_messages, parser_sv,
&errors_warnings_sv, &error_nrs_sv);
- clear_error_message_list (document->parser_error_messages);
+ clear_error_message_list (&document->parser_error_messages);
}
diff --git a/tp/Texinfo/XS/main/document.c b/tp/Texinfo/XS/main/document.c
index 8045c42b3d..e49e4160f0 100644
--- a/tp/Texinfo/XS/main/document.c
+++ b/tp/Texinfo/XS/main/document.c
@@ -86,11 +86,6 @@ new_document (void)
so just keep them all here, and free them all together at the end. */
document->small_strings = new_string_list ();
- document->parser_error_messages = malloc (sizeof (ERROR_MESSAGE_LIST));
- memset (document->parser_error_messages, 0, sizeof (ERROR_MESSAGE_LIST));
- document->error_messages = malloc (sizeof (ERROR_MESSAGE_LIST));
- memset (document->error_messages, 0, sizeof (ERROR_MESSAGE_LIST));
-
document->modified_information |= F_DOCM_tree | F_DOCM_index_names
| F_DOCM_floats | F_DOCM_internal_references | F_DOCM_labels_list
| F_DOCM_identifiers_target | F_DOCM_global_info
@@ -402,10 +397,8 @@ destroy_document_information_except_tree (DOCUMENT
*document)
free (document->labels_list.list);
free (document->identifiers_target.list);
free_indices_info (&document->indices_info);
- wipe_error_message_list (document->error_messages);
- free (document->error_messages);
- wipe_error_message_list (document->parser_error_messages);
- free (document->parser_error_messages);
+ wipe_error_message_list (&document->error_messages);
+ wipe_error_message_list (&document->parser_error_messages);
if (document->nodes_list)
destroy_list (document->nodes_list);
if (document->sections_list)
@@ -528,7 +521,7 @@ clear_document_errors (int document_descriptor)
{
DOCUMENT *document = retrieve_document (document_descriptor);
if (document)
- wipe_error_message_list (document->error_messages);
+ wipe_error_message_list (&document->error_messages);
}
void
@@ -536,5 +529,5 @@ clear_document_parser_errors (int document_descriptor)
{
DOCUMENT *document = retrieve_document (document_descriptor);
if (document)
- wipe_error_message_list (document->parser_error_messages);
+ wipe_error_message_list (&document->parser_error_messages);
}
diff --git a/tp/Texinfo/XS/main/document_types.h
b/tp/Texinfo/XS/main/document_types.h
index 43a617098c..e1a73a07b1 100644
--- a/tp/Texinfo/XS/main/document_types.h
+++ b/tp/Texinfo/XS/main/document_types.h
@@ -191,10 +191,10 @@ typedef struct DOCUMENT {
GLOBAL_INFO global_info;
GLOBAL_COMMANDS global_commands;
STRING_LIST *small_strings;
+ ERROR_MESSAGE_LIST error_messages;
+ ERROR_MESSAGE_LIST parser_error_messages;
ELEMENT_LIST *nodes_list;
ELEMENT_LIST *sections_list;
- ERROR_MESSAGE_LIST *error_messages;
- ERROR_MESSAGE_LIST *parser_error_messages;
struct OPTIONS *options; /* for options used in structuring */
struct TEXT_OPTIONS *convert_index_text_options; /* for index
sorting without converter */
diff --git a/tp/Texinfo/XS/main/translations.c
b/tp/Texinfo/XS/main/translations.c
index e561b4e5a9..c082de04d6 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -487,9 +487,9 @@ replace_convert_substrings (char *translated_string,
fprintf (stderr, "XS|IN TR PARSER '%s'\n", texinfo_line);
document = retrieve_document (document_descriptor);
- if (document->parser_error_messages->number > 0)
+ if (document->parser_error_messages.number > 0)
{
- ERROR_MESSAGE_LIST *error_messages = document->parser_error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->parser_error_messages;
fprintf (stderr, "translation %zu error(s)\n",
error_messages->number);
fprintf (stderr, "translated string: %s\n", translated_string);
diff --git a/tp/Texinfo/XS/parsetexi/errors_parser.c
b/tp/Texinfo/XS/parsetexi/errors_parser.c
index eca9932439..96d44af5e8 100644
--- a/tp/Texinfo/XS/parsetexi/errors_parser.c
+++ b/tp/Texinfo/XS/parsetexi/errors_parser.c
@@ -43,7 +43,7 @@ line_error_internal (enum error_type type, int continuation,
const SOURCE_INFO *cmd_source_info,
const char *format, va_list v)
{
- vmessage_list_line_error (parsed_document->parser_error_messages,
+ vmessage_list_line_error (&parsed_document->parser_error_messages,
type, continuation, debug_output, cmd_source_info,
0, format, v);
}
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 3d3d0b9981..bd310cede2 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -80,7 +80,7 @@ ELEMENT_LIST *
sectioning_structure (DOCUMENT *document)
{
ELEMENT *root = document->tree;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
ELEMENT *sec_root = 0;
@@ -396,7 +396,7 @@ void
warn_non_empty_parts (DOCUMENT *document)
{
const GLOBAL_COMMANDS *global_commands = &document->global_commands;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
int i;
@@ -414,7 +414,7 @@ void
check_menu_entry (DOCUMENT *document, enum command_id cmd,
ELEMENT *menu_content, ELEMENT *menu_entry_node)
{
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
LABEL_LIST *identifiers_target = &document->identifiers_target;
OPTIONS *options = document->options;
@@ -574,7 +574,7 @@ check_nodes_are_referenced (DOCUMENT *document)
ELEMENT_LIST *nodes_list = document->nodes_list;
LABEL_LIST *identifiers_target = &document->identifiers_target;
ELEMENT_LIST *refs = &document->internal_references;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
char **referenced_identifiers;
@@ -805,7 +805,7 @@ set_menus_node_directions (DOCUMENT *document)
GLOBAL_COMMANDS *global_commands = &document->global_commands;
ELEMENT_LIST *nodes_list = document->nodes_list;
LABEL_LIST *identifiers_target = &document->identifiers_target;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
int check_menu_entries = 1;
@@ -1001,7 +1001,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
{
ELEMENT_LIST *nodes_list = document->nodes_list;
LABEL_LIST *identifiers_target = &document->identifiers_target;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
int i;
@@ -1314,7 +1314,7 @@ nodes_tree (DOCUMENT *document)
{
LABEL_LIST *identifiers_target = &document->identifiers_target;
ELEMENT *root = document->tree;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
ELEMENT *top_node = 0;
@@ -1506,7 +1506,7 @@ associate_internal_references (DOCUMENT *document)
{
LABEL_LIST *identifiers_target = &document->identifiers_target;
ELEMENT_LIST *refs = &document->internal_references;
- ERROR_MESSAGE_LIST *error_messages = document->error_messages;
+ ERROR_MESSAGE_LIST *error_messages = &document->error_messages;
OPTIONS *options = document->options;
int i;
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index f51d67f266..712887af64 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -791,7 +791,7 @@ insert_nodes_for_sectioning_commands (DOCUMENT *document)
new_node_tree = copy_contents (content->args.list[0],
ET_NONE);
}
- added_node = new_node (document->error_messages, new_node_tree,
+ added_node = new_node (&document->error_messages, new_node_tree,
document);
destroy_element (new_node_tree);
if (added_node)
@@ -1152,7 +1152,7 @@ regenerate_master_menu (DOCUMENT *document, int
use_sections)
else
return 0;
- new_detailmenu_e = new_detailmenu (document->error_messages,
+ new_detailmenu_e = new_detailmenu (&document->error_messages,
document->options, identifiers_target,
menus, use_sections);
@@ -1325,13 +1325,11 @@ protect_hashchar_at_line_beginning_internal (const char
*type,
&& parent_for_warn->source_info.line_nr)
{
DOCUMENT *document = (DOCUMENT *) argument;
- ERROR_MESSAGE_LIST *error_messages
- = document->error_messages;
const OPTIONS *options = document->options;
message_list_command_warn (
- error_messages, options,
- parent_for_warn, 0,
+ &document->error_messages,
+ options, parent_for_warn, 0,
"could not protect hash character in @%s",
builtin_command_name (parent_for_warn->cmd));
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/document.c (new_document) (destroy_document_information_except_tree, clear_document_errors) (clear_document_parser_errors), tp/Texinfo/XS/main/document_types.h (DOCUMENT), tp/Texinfo/XS/main/DocumentXS.xs, tp/Texinfo/XS/main/build_perl_info.c, tp/Texinfo/XS/main/translations.c, tp/Texinfo/XS/parsetexi/errors_parser.c, tp/Texinfo/XS/structuring_transfo/structuring.c, tp/Texinfo/XS/structuring_transfo/transformations.c: put error_messages and parser_error_messages direct [...],
Patrice Dumas <=