From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 432B42156B for ; Wed, 17 Apr 2024 02:09:50 +0200 (CEST) Received: (qmail 20335 invoked by uid 550); 17 Apr 2024 00:09:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 20288 invoked from network); 17 Apr 2024 00:09:42 -0000 Date: Tue, 16 Apr 2024 20:09:55 -0400 From: Rich Felker To: Viktor Reznov Cc: musl@lists.openwall.com Message-ID: <20240417000954.GM32430@brightrain.aerifal.cx> References: <20240416143837.GI4163@brightrain.aerifal.cx> <20240416165502.GL32430@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [musl] Re: [PATCH] Decreasing the number of divisions Can you clarify what's up with your email address? It appears to be a sentence about another person, and I have no idea what the backstory on that is, but I'm hesitant to accept it into the immutable commit history in the author field. On Tue, Apr 16, 2024 at 08:05:38PM +0300, Viktor Reznov wrote: > Yes. > > On Tuesday, April 16, 2024, Rich Felker wrote: > > > On Tue, Apr 16, 2024 at 07:34:32PM +0300, Viktor Reznov wrote: > > > > Is there a reason you put the if at the top > > > > rather than making the last line the following? > > > > > > No. > > > > Ok. Can I make that simplifying change and still attribute you as > > commit author? > > > > > On Tue, Apr 16, 2024 at 5:38 PM Rich Felker wrote: > > > > > > > > On Tue, Apr 16, 2024 at 04:29:05PM +0300, Viktor Reznov wrote: > > > > > diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c > > > > > index 497c5e19..0f9a1e6a 100644 > > > > > --- a/src/stdio/vfprintf.c > > > > > +++ b/src/stdio/vfprintf.c > > > > > @@ -165,8 +165,10 @@ static char *fmt_o(uintmax_t x, char *s) > > > > > static char *fmt_u(uintmax_t x, char *s) > > > > > { > > > > > unsigned long y; > > > > > + if (x == 0) return s; > > > > > for ( ; x>ULONG_MAX; x/=10) *--s = '0' + x%10; > > > > > - for (y=x; y; y/=10) *--s = '0' + y%10; > > > > > + for (y=x; y>=10; y/=10) *--s = '0' + y%10; > > > > > + *--s = '0' + y; > > > > > return s; > > > > > } > > > > > > > > Seems like a good change. Is there a reason you put the if at the top > > > > rather than making the last line the following? > > > > > > > > if (y) *--s = '0' + y; > > > > > > > > That would keep the overall flow the same as before and avoid a burden > > > > to reason about if/why it's the same. > > > > > > > > Rich > >