[PATCH 2/2] hesiod: use booleans in parser macro calls

H.J. Lu hjl.tools@gmail.com
Fri May 29 12:37:09 GMT 2026


On Fri, May 29, 2026 at 4:31 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> The swallow argument in the INT_FIELD and STRING_FIELD macros is used as a
> boolean, change all callers to use false and true instead of 0 and 1.
> ---
>  hesiod/nss_hesiod/hesiod-proto.c   | 4 ++--
>  hesiod/nss_hesiod/hesiod-service.c | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hesiod/nss_hesiod/hesiod-proto.c b/hesiod/nss_hesiod/hesiod-proto.c
> index d47abca1fd9..a85769a74f8 100644
> --- a/hesiod/nss_hesiod/hesiod-proto.c
> +++ b/hesiod/nss_hesiod/hesiod-proto.c
> @@ -39,8 +39,8 @@ struct protoent_data {};
>  #include <nss/nss_files/files-parse.c>
>  LINE_PARSER
>  ("#",
> - STRING_FIELD (result->p_name, isspace, 1);
> - INT_FIELD (result->p_proto, isspace, 1, 10,);
> + STRING_FIELD (result->p_name, isspace, true);
> + INT_FIELD (result->p_proto, isspace, true, 10,);
>   )
>
>  enum nss_status
> diff --git a/hesiod/nss_hesiod/hesiod-service.c b/hesiod/nss_hesiod/hesiod-service.c
> index 11ee302853e..205ba69f4b0 100644
> --- a/hesiod/nss_hesiod/hesiod-service.c
> +++ b/hesiod/nss_hesiod/hesiod-service.c
> @@ -39,9 +39,9 @@ struct servent_data {};
>  #define ISSC_OR_SPACE(c)       ((c) ==  ';' || isspace (c))
>  LINE_PARSER
>  ("#",
> - STRING_FIELD (result->s_name, ISSC_OR_SPACE, 1);
> - STRING_FIELD (result->s_proto, ISSC_OR_SPACE, 1);
> - INT_FIELD (result->s_port, ISSC_OR_SPACE, 0, 10, htons);
> + STRING_FIELD (result->s_name, ISSC_OR_SPACE, true);
> + STRING_FIELD (result->s_proto, ISSC_OR_SPACE, true);
> + INT_FIELD (result->s_port, ISSC_OR_SPACE, false, 10, htons);
>   )
>
>  enum nss_status
> --
> 2.43.0
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

-- 
H.J.


More information about the Libc-alpha mailing list