[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/tree_types.h (INDEX), tp/Tex
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/tree_types.h (INDEX), tp/Texinfo/XS/main/converter_types.h (MERGED_INDEX) (LETTER_INDEX_ENTRIES, INDEX_SORTED_BY_LETTER): rename structure fields related to index numberof entries or space for entries and letter number. Update code using those structures. |
Date: |
Sat, 11 Nov 2023 03:48:16 -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 1286d383c4 * tp/Texinfo/XS/main/tree_types.h (INDEX),
tp/Texinfo/XS/main/converter_types.h (MERGED_INDEX) (LETTER_INDEX_ENTRIES,
INDEX_SORTED_BY_LETTER): rename structure fields related to index numberof
entries or space for entries and letter number. Update code using those
structures.
1286d383c4 is described below
commit 1286d383c4eff78c70443ea239845b27e1c2d75c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Nov 11 09:48:09 2023 +0100
* tp/Texinfo/XS/main/tree_types.h (INDEX),
tp/Texinfo/XS/main/converter_types.h (MERGED_INDEX)
(LETTER_INDEX_ENTRIES, INDEX_SORTED_BY_LETTER): rename structure
fields related to index numberof entries or space for entries and
letter number. Update code using those structures.
* tp/Texinfo/XS/main/build_perl_info.c (build_single_index_data):
rename i as index.
* tp/Texinfo/XS/convert/convert_html.c: reindent.
---
ChangeLog | 13 +++++++++++++
tp/Texinfo/XS/convert/convert_html.c | 22 +++++++++++++---------
tp/Texinfo/XS/convert/indices_in_conversion.c | 16 ++++++++--------
tp/Texinfo/XS/main/build_perl_info.c | 20 ++++++++++----------
tp/Texinfo/XS/main/converter_types.h | 6 +++---
tp/Texinfo/XS/main/get_perl_info.c | 6 +++---
tp/Texinfo/XS/main/tree_types.h | 4 ++--
tp/Texinfo/XS/parsetexi/indices.c | 18 +++++++++---------
.../XS/structuring_transfo/transformations.c | 2 +-
9 files changed, 62 insertions(+), 45 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e11a4247fb..52cc268b34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2023-11-11 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/tree_types.h (INDEX),
+ tp/Texinfo/XS/main/converter_types.h (MERGED_INDEX)
+ (LETTER_INDEX_ENTRIES, INDEX_SORTED_BY_LETTER): rename structure
+ fields related to index numberof entries or space for entries and
+ letter number. Update code using those structures.
+
+ * tp/Texinfo/XS/main/build_perl_info.c (build_single_index_data):
+ rename i as index.
+
+ * tp/Texinfo/XS/convert/convert_html.c: reindent.
+
2023-11-10 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/ConvertXS.xs
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 586cacecba..4590467e3b 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -570,7 +570,8 @@ prepare_special_units (CONVERTER *self, int
output_units_descriptor,
= self->document->global_commands->top;
if (section_top->associated_unit)
- associated_output_unit =
section_top->associated_unit;
+ associated_output_unit
+ = section_top->associated_unit;
}
if (!associated_output_unit)
continue;
@@ -578,7 +579,8 @@ prepare_special_units (CONVERTER *self, int
output_units_descriptor,
else if (!strcmp (contents_location, "inline"))
{
ELEMENT *global_command
- = get_cmd_global_command
(self->document->global_commands, cmd);
+ = get_cmd_global_command (
+ self->document->global_commands, cmd);
if (global_command->contents.number > 0)
{
int i;
@@ -1266,10 +1268,10 @@ prepare_index_entries_targets (CONVERTER *self)
for (i = sorted_index_names; (idx = *i); i++)
{
- if (idx->index_number > 0)
+ if (idx->entries_number > 0)
{
int j;
- for (j = 0; j < idx->index_number; j++)
+ for (j = 0; j < idx->entries_number; j++)
{
INDEX_ENTRY *index_entry;
ELEMENT *main_entry_element;
@@ -1286,10 +1288,12 @@ prepare_index_entries_targets (CONVERTER *self)
index_entry = &idx->index_entries[j];
main_entry_element = index_entry->entry_element;
- seeentry = lookup_extra_element (main_entry_element,
"seeentry");
+ seeentry = lookup_extra_element (main_entry_element,
+ "seeentry");
if (seeentry)
continue;
- seealso = lookup_extra_element (main_entry_element,
"seealso");
+ seealso = lookup_extra_element (main_entry_element,
+ "seealso");
if (seealso)
continue;
@@ -1308,9 +1312,9 @@ prepare_index_entries_targets (CONVERTER *self)
if (subentries_tree)
{
insert_slice_into_contents (normalize_index_element,
-
normalize_index_element->contents.number,
- subentries_tree, 0,
- subentries_tree->contents.number);
+
normalize_index_element->contents.number,
+ subentries_tree, 0,
+ subentries_tree->contents.number);
}
normalized_index
= normalize_transliterate_texinfo (normalize_index_element,
diff --git a/tp/Texinfo/XS/convert/indices_in_conversion.c
b/tp/Texinfo/XS/convert/indices_in_conversion.c
index 122548796d..3e628426bd 100644
--- a/tp/Texinfo/XS/convert/indices_in_conversion.c
+++ b/tp/Texinfo/XS/convert/indices_in_conversion.c
@@ -40,7 +40,7 @@ merge_indices (INDEX **index_names)
for (i = index_names; (idx = *i); i++)
{
- if (idx->index_entries && idx->index_number)
+ if (idx->index_entries && idx->entries_number)
{
size_t j;
INDEX *ultimate_idx;
@@ -74,23 +74,23 @@ merge_indices (INDEX **index_names)
}
merged_idx = &merged_indices[merged_indices_number];
merged_idx->name = in_idx_name;
- merged_idx->index_number = ultimate_idx->index_number;
+ merged_idx->entries_number = ultimate_idx->entries_number;
merged_idx->index_entries
- = malloc (sizeof (INDEX_ENTRY) * merged_idx->index_number);
+ = malloc (sizeof (INDEX_ENTRY) * merged_idx->entries_number);
memcpy (merged_idx->index_entries, ultimate_idx->index_entries,
- ultimate_idx->index_number * sizeof (INDEX_ENTRY));
+ ultimate_idx->entries_number * sizeof (INDEX_ENTRY));
merged_indices_number++;
}
if (idx->merged_in)
{
merged_idx->index_entries = realloc (merged_idx->index_entries,
- (idx->index_number + merged_idx->index_number) *
+ (idx->entries_number + merged_idx->entries_number) *
sizeof (INDEX_ENTRY));
- memcpy (merged_idx->index_entries + merged_idx->index_number,
+ memcpy (merged_idx->index_entries + merged_idx->entries_number,
idx->index_entries,
- idx->index_number * sizeof (INDEX_ENTRY));
- merged_idx->index_number += idx->index_number;
+ idx->entries_number * sizeof (INDEX_ENTRY));
+ merged_idx->entries_number += idx->entries_number;
}
}
}
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index dc25266cbb..9df83186be 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -769,7 +769,7 @@ build_float_types_list (FLOAT_RECORD *floats_list, size_t
floats_number)
/* returns a hash for a single entry in $self->{'index_names'}, containing
information about a single index. */
static HV *
-build_single_index_data (INDEX *i)
+build_single_index_data (INDEX *index)
{
#define STORE(key, value) hv_store (hv, key, strlen (key), value, 0)
@@ -782,32 +782,32 @@ build_single_index_data (INDEX *i)
hv = newHV ();
- STORE("name", newSVpv_utf8 (i->name, 0));
- STORE("in_code", i->in_code ? newSViv(1) : newSViv(0));
+ STORE("name", newSVpv_utf8 (index->name, 0));
+ STORE("in_code", index->in_code ? newSViv(1) : newSViv(0));
- if (i->merged_in)
+ if (index->merged_in)
{
- STORE("merged_in", newSVpv_utf8 (i->merged_in->name, 0));
+ STORE("merged_in", newSVpv_utf8 (index->merged_in->name, 0));
}
- if (i->index_number > 0)
+ if (index->entries_number > 0)
{
entries = newAV ();
- av_unshift (entries, i->index_number);
+ av_unshift (entries, index->entries_number);
STORE("index_entries", newRV_noinc ((SV *) entries));
#undef STORE
entry_number = 1;
- for (j = 0; j < i->index_number; j++)
+ for (j = 0; j < index->entries_number; j++)
{
#define STORE2(key, value) hv_store (entry, key, strlen (key), value, 0)
HV *entry;
INDEX_ENTRY *e;
- e = &i->index_entries[j];
+ e = &index->index_entries[j];
entry = newHV ();
- STORE2("index_name", newSVpv_utf8 (i->name, 0));
+ STORE2("index_name", newSVpv_utf8 (index->name, 0));
STORE2("entry_element",
newRV_inc ((SV *)e->entry_element->hv));
if (e->entry_associated_element)
diff --git a/tp/Texinfo/XS/main/converter_types.h
b/tp/Texinfo/XS/main/converter_types.h
index c83cda284e..9e49b511b1 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -239,19 +239,19 @@ typedef struct HTML_TARGET_LIST {
typedef struct MERGED_INDEX {
char *name;
INDEX_ENTRY *index_entries;
- size_t index_number;
+ size_t entries_number;
} MERGED_INDEX;
typedef struct LETTER_INDEX_ENTRIES {
char *letter;
INDEX_ENTRY **entries;
- size_t number;
+ size_t entries_number;
} LETTER_INDEX_ENTRIES;
typedef struct INDEX_SORTED_BY_LETTER {
char *name;
LETTER_INDEX_ENTRIES *letter_entries;
- size_t number;
+ size_t letter_number;
} INDEX_SORTED_BY_LETTER;
typedef struct HTML_COMMAND_CONVERSION {
diff --git a/tp/Texinfo/XS/main/get_perl_info.c
b/tp/Texinfo/XS/main/get_perl_info.c
index 92b5dda206..fc76996dd2 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -531,7 +531,7 @@ get_sv_index_entries_sorted_by_letter (INDEX **index_names,
index_index_letters = &indices_entries_by_letter[j];
index_index_letters->name = strdup (idx_name);
- index_index_letters->number = letter_entries_nr;
+ index_index_letters->letter_number = letter_entries_nr;
index_index_letters->letter_entries
= (LETTER_INDEX_ENTRIES *)
malloc (letter_entries_nr * sizeof (LETTER_INDEX_ENTRIES));
@@ -565,7 +565,7 @@ get_sv_index_entries_sorted_by_letter (INDEX **index_names,
entries_av = (AV *) SvRV (*entries_sv);
entries_nr = av_top_index (entries_av) +1;
- letter_entries->number = entries_nr;
+ letter_entries->entries_number = entries_nr;
letter_entries->entries =
(INDEX_ENTRY **) malloc (entries_nr * sizeof (INDEX_ENTRY *));
for (k = 0; k < entries_nr; k++)
@@ -611,7 +611,7 @@ get_sv_index_entries_sorted_by_letter (INDEX **index_names,
{
if (!strcmp (idx->name, entry_index_name))
{
- if (entry_idx_in_index < idx->index_number)
+ if (entry_idx_in_index < idx->entries_number)
letter_entries->entries[k]
= &idx->index_entries[entry_number];
break;
diff --git a/tp/Texinfo/XS/main/tree_types.h b/tp/Texinfo/XS/main/tree_types.h
index 2a02db942e..9be477d138 100644
--- a/tp/Texinfo/XS/main/tree_types.h
+++ b/tp/Texinfo/XS/main/tree_types.h
@@ -230,8 +230,8 @@ typedef struct INDEX {
struct INDEX *merged_in; /* Index this index is merged into, if any. */
INDEX_ENTRY *index_entries;
- size_t index_number;
- size_t index_space;
+ size_t entries_number;
+ size_t entries_space;
} INDEX;
/* not used in parser */
diff --git a/tp/Texinfo/XS/parsetexi/indices.c
b/tp/Texinfo/XS/parsetexi/indices.c
index dc89ed6ebe..332f5f0861 100644
--- a/tp/Texinfo/XS/parsetexi/indices.c
+++ b/tp/Texinfo/XS/parsetexi/indices.c
@@ -179,7 +179,7 @@ init_index_commands (void)
},
"vr",
-
+
{X(defvr),
X(deftypevr),
X(defcv),
@@ -192,7 +192,7 @@ init_index_commands (void)
},
"tp",
-
+
{X(deftp),}
};
#undef X
@@ -251,19 +251,19 @@ enter_index_entry (enum command_id index_type_cmd,
TEXT ignored_chars;
idx = index_of_command (index_type_cmd);
- if (idx->index_number == idx->index_space)
+ if (idx->entries_number == idx->entries_space)
{
idx->index_entries = realloc (idx->index_entries,
- sizeof (INDEX_ENTRY) * (idx->index_space += 20));
+ sizeof (INDEX_ENTRY) * (idx->entries_space += 20));
if (!idx->index_entries)
fatal ("realloc failed");
}
- entry = &idx->index_entries[idx->index_number++];
+ entry = &idx->index_entries[idx->entries_number++];
memset (entry, 0, sizeof (INDEX_ENTRY));
entry->index_name = idx->name;
/* not needed, the position in the index is directly used
- entry->number = idx->index_number;
+ entry->number = idx->entries_number;
*/
entry->entry_element = element;
@@ -291,7 +291,7 @@ enter_index_entry (enum command_id index_type_cmd,
text_append (&e->text, idx->name);
add_to_element_contents (index_entry, e);
e = new_element (ET_NONE);
- add_extra_integer (e, "integer", idx->index_number);
+ add_extra_integer (e, "integer", idx->entries_number);
add_to_element_contents (index_entry, e);
add_extra_misc_args (element, "index_entry", index_entry);
}
@@ -390,10 +390,10 @@ complete_indices (int document_descriptor)
for (i = index_names; (idx = *i); i++)
{
- if (idx->index_number > 0)
+ if (idx->entries_number > 0)
{
int j;
- for (j = 0; j < idx->index_number; j++)
+ for (j = 0; j < idx->entries_number; j++)
{
INDEX_ENTRY *entry;
ELEMENT *main_entry_element;
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index bb4283109a..d37d052f12 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -65,7 +65,7 @@ lookup_index_entry (ELEMENT *index_entry_info, INDEX
**indices_information)
result = malloc (sizeof (INDEX_ENTRY_AND_INDEX));
result->index = index_info;
result->index_entry = 0;
- if (index_info->index_number && entry_number <= index_info->index_number)
+ if (index_info->entries_number && entry_number <= index_info->entries_number)
{
result->index_entry = &index_info->index_entries[entry_number -1];
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/tree_types.h (INDEX), tp/Texinfo/XS/main/converter_types.h (MERGED_INDEX) (LETTER_INDEX_ENTRIES, INDEX_SORTED_BY_LETTER): rename structure fields related to index numberof entries or space for entries and letter number. Update code using those structures.,
Patrice Dumas <=