[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 29 Sep 2024 04:31:40 -0400 (EDT) |
branch: master
commit 373a8f3b87dbada5b9810ca96451e59f159bfbdc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jun 8 23:31:44 2024 +0200
* tp/Texinfo/XS/main/build_perl_info.c (setup_info_hv)
(store_info_element, store_info_string, element_to_perl_hash): add
setup_info_hv that only sets up the info hash in the Perl element.
Remove store_info_sv and call hv_store in the functions that called
store_info_sv before.
---
ChangeLog | 8 ++++++++
tp/Texinfo/XS/main/build_perl_info.c | 18 +++++++++---------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index df3e15e97b..b10a5a188a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,14 @@
tp/Texinfo/XS/structuring_transfo/structuring.c (new_node_menu_entry):
use the union e name.
+2024-06-08 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/build_perl_info.c (setup_info_hv)
+ (store_info_element, store_info_string, element_to_perl_hash): add
+ setup_info_hv that only sets up the info hash in the Perl element.
+ Remove store_info_sv and call hv_store in the functions that called
+ store_info_sv before.
+
2024-06-08 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/build_perl_info.c (store_info_sv)
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index 2695d5f5f0..0fb6e332c8 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -543,8 +543,7 @@ store_source_mark_list (const ELEMENT *e)
}
static void
-store_info_sv (ELEMENT *e, const char *type_key, const char *key,
- SV *sv, HV **info_hv)
+setup_info_hv (ELEMENT *e, const char *type_key, HV **info_hv)
{
dTHX;
@@ -554,8 +553,6 @@ store_info_sv (ELEMENT *e, const char *type_key, const char
*key,
hv_store (e->hv, type_key, strlen (type_key),
newRV_inc ((SV *)*info_hv), 0);
}
-
- hv_store (*info_hv, key, strlen (key), sv, 0);
}
static void
@@ -567,8 +564,9 @@ store_info_element (ELEMENT *e, ELEMENT *info_element,
const char *type_key,
if (!info_element->hv || !avoid_recursion)
element_to_perl_hash (info_element, avoid_recursion);
- store_info_sv (e, type_key, key,
- newRV_inc ((SV *)info_element->hv), info_hv);
+ setup_info_hv (e, type_key, info_hv);
+ hv_store (*info_hv, key, strlen (key),
+ newRV_inc ((SV *)info_element->hv), 0);
}
static void
@@ -577,8 +575,9 @@ store_info_string (ELEMENT *e, const char *string, const
char *type_key,
{
dTHX;
- store_info_sv (e, type_key, key,
- newSVpv_utf8 (string, strlen (string)), info_hv);
+ setup_info_hv (e, type_key, info_hv);
+ hv_store (*info_hv, key, strlen (key),
+ newSVpv_utf8 (string, strlen (string)), 0);
}
static int hashes_ready = 0;
@@ -675,7 +674,8 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
if (e->flags & EF_inserted)
{
- store_info_sv (e, "info", "inserted", newSViv (1), &info_hv);
+ setup_info_hv (e, "info", &info_hv);
+ hv_store (info_hv, "inserted", strlen ("inserted"), newSViv (1), 0);
}
if (type_data[e->type].flags & TF_text)