public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Noah Goldstein via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] Replace {u}int_fast{16|32} with {u}int32_t
Date: Tue, 12 Apr 2022 11:50:05 +0200	[thread overview]
Message-ID: <87lewahbqq.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20220411212315.2780090-1-goldstein.w.n@gmail.com> (Noah Goldstein via Libc-alpha's message of "Mon, 11 Apr 2022 16:23:15 -0500")

* Noah Goldstein via Libc-alpha:

> @@ -558,10 +558,10 @@ skip:
>  }
>  
>  
> -static uint_fast32_t
> +static uint32_t
>  dl_new_hash (const char *s)
>  {
> -  uint_fast32_t h = 5381;
> +  uint32_t h = 5381;
>    for (unsigned char c = *s; c != '\0'; c = *++s)
>      h = h * 33 + c;
>    return h & 0xffffffff;

I think you can remove the final masking.

> diff --git a/resolv/nss_dns/dns-canon.c b/resolv/nss_dns/dns-canon.c
> index 3151e50ae1..53230c5599 100644
> --- a/resolv/nss_dns/dns-canon.c
> +++ b/resolv/nss_dns/dns-canon.c
> @@ -118,7 +118,7 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen,
>  		goto unavail;
>  
>  	      /* Check whether type and class match.  */
> -	      uint_fast16_t type;
> +	      unsigned int type;
>  	      NS_GET16 (type, ptr);
>  	      if (type == qtypes[i])
>  		{

This should uint16_t because DNS record types are 16-bit only.

> diff --git a/timezone/zic.c b/timezone/zic.c
> index 2875b5544c..16d0cede65 100644
> --- a/timezone/zic.c
> +++ b/timezone/zic.c
> @@ -1789,7 +1789,7 @@ rulesub(struct rule *rp, const char *loyearp, const char *hiyearp,
>  }
>  
>  static void
> -convert(const int_fast32_t val, char *const buf)
> +convert(const int32_t val, char *const buf)
>  {
>  	register int	i;
>  	register int	shift;
> @@ -1811,7 +1811,7 @@ convert64(const zic_t val, char *const buf)
>  }
>  
>  static void
> -puttzcode(const int_fast32_t val, FILE *const fp)
> +puttzcode(const int32_t val, FILE *const fp)
>  {
>  	char	buf[4];

Has Paul commented on this?  This code is shared with the tz project.

Otherwise looks good.  Still builds on all architectures.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


  reply	other threads:[~2022-04-12  9:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 16:58 [PATCH v1] " Noah Goldstein
2022-04-11 18:07 ` Paul Eggert
2022-04-11 21:24   ` Noah Goldstein
     [not found]   ` <CAFUsyfJ7Zba--qet3yzROomaf8Zdq-qhXAgS6=534nobws8fJg@mail.gmail.com>
     [not found]     ` <92b7db75-0536-d28b-0618-34519305223b@cs.ucla.edu>
     [not found]       ` <CAFUsyfKg2ZD3JC9sCnoDa3qFtjCwzWVZaiW+5WeWrB_kOTWXuQ@mail.gmail.com>
2022-04-13 19:11         ` Paul Eggert
2022-04-13 23:28           ` Noah Goldstein
2022-04-13 23:38             ` Paul Eggert
2022-04-14  0:00               ` Noah Goldstein
2022-04-11 21:23 ` [PATCH v2] " Noah Goldstein
2022-04-12  9:50   ` Florian Weimer [this message]
2022-04-13 16:11     ` Noah Goldstein
2022-04-13 16:10 ` [PATCH v3] " Noah Goldstein
2022-04-13 23:28 ` [PATCH v4] " Noah Goldstein
2022-04-13 23:59 ` [PATCH v5] " Noah Goldstein
2022-04-14  0:41   ` Paul Eggert
2022-04-14  0:46     ` Noah Goldstein
2022-04-14  0:46 ` [PATCH v6] " Noah Goldstein
2022-04-14  1:13   ` Paul Eggert
2022-04-14  3:21     ` Noah Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lewahbqq.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).