On Sat, Jun 27, 2026 at 02:25:05PM +0200, Patrice Dumas wrote:
> On Sat, Jun 27, 2026 at 01:15:12PM +0100, Gavin Smith wrote:
> > On Sat, Jun 27, 2026 at 11:24:22AM +0200, Patrice Dumas wrote:
> > > > * The CONVERTER object could have sub-objects for each output format
> > > > (this would be close to what we have already). I'd prefer to avoid that
> > > > if possible.
> > >
> > > See above, I think that it is not such a bad solution.
> >
> > I'm starting work on this approach.
> >
> > I put the HTML-specific fields in a separate object, with a field of this
> > object type. Then wherever these fields are access on the CONVERTER type,
> > I'm adding a separate pointer variable holding a pointer to the separate
> > object:
> >
> > HTML_CONVERTER_STATE *self_html = &self->html_converter;
> >
> > I'm then updating the field accesses that would use the 'self' pointer
> > to use 'self_html' instead:
>
> Looks good to me.
>
> > --- a/tta/C/convert/build_html_perl_state.c
> > +++ b/tta/C/convert/build_html_perl_state.c
> > @@ -191,6 +191,7 @@ build_html_translated_names (HV *converter_hv,
> > CONVERTER *converter)
> > void
> > build_html_formatting_state (CONVERTER *converter)
> > {
> > + HTML_CONVERTER_STATE *self_html = &converter->html_converter;
> > HV *converter_hv;
> > unsigned long flags;
> >
> > @@ -201,7 +202,7 @@ build_html_formatting_state (CONVERTER *converter)
> > if (!flags)
> > return;
> >
> > - if (converter->external_references_number <= 0)
> > + if (self_html->external_references_number <= 0)
> > {
> > converter->modified_state = 0;
> > return;
> >
> > This should be a fairly straightforward change for me to make, although
> > it will take me several hours to do due to the volume of the HTML conversion
> > code (there are between 100 and 200 such fields like
> > 'external_references_number').
>
> Indeed. Do not hesitate to leave some of that work to me.
>
> > Can you please avoid touching any of the HTML C conversion code for the next
> > few days, until I say I have finished?
>
> Can I pass a last commit before that that is ready or not? I can also
> only pass the Perl part.
Please keep it to just one commit.
I'm making good progress and have converted a couple of .c files already.