[PATCH v2 3/7] manual: __is_last is no longer part of iconv internals

DJ Delorie dj@redhat.com
Fri Sep 20 00:15:48 GMT 2024


Florian Weimer <fweimer@redhat.com> writes:
> The __is_last field was replaced with a bitmask in
> commit 85830c4c4688b30d3d76111aa9a26745c7b141d6 in 2000,
> and multiple bits are in use today.

LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>

>  
> -@item int __is_last
> -This element is nonzero if this conversion step is the last one.  This
> -information is necessary for the recursion.  See the description of the
> -conversion function internals below.  This element must never be
> -modified.
> +@item int __flags
> +This field is a set of flags.  The @code{__GCONV_IS_LAST} bit is set if
> +this conversion step is the last one.  This information is necessary for
> +the recursion.  See the description of the conversion function internals
> +below.  This element must never be modified.

Ok.

>  object into the initial state.  Once this all happened the other
>  conversion modules in the chain of conversions have to get the same
>  chance.  Whether another step follows can be determined from the
> -@code{__is_last} element of the step data structure to which the first
> -parameter points.
> +@code{__GCONV_IS_LAST} flag in the @code{__flags} field of the step
> +data structure to which the first parameter points.

Ok.

>        /* @r{Call the steps down the chain if there are any but only}
>           @r{if we successfully emitted the escape sequence.}  */
> -      if (status == __GCONV_OK && ! data->__is_last)
> +      if (status == __GCONV_OK && ! (data->__flags & __GCONV_IS_LAST))
>          status = fct (next_step, next_data, NULL, NULL,
>                        written, 1);

Ok.

>            /* @r{If this is the last step, leave the loop.  There is}
>               @r{nothing we can do.}  */
> -          if (data->__is_last)
> +          if (data->__flags & __GCONV_IS_LAST)
>              @{

Ok.



More information about the Libc-alpha mailing list