This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] time: Introduce function to check correctness of nanoseconds value
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Joseph Myers <joseph at codesourcery dot com>, Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>
- Date: Thu, 24 Oct 2019 16:50:24 -0700
- Subject: Re: [PATCH] time: Introduce function to check correctness of nanoseconds value
- References: <20191024211441.28722-1-lukma@denx.de> <516f1ebd-535f-7455-334f-ba710bb0dbd1@cs.ucla.edu> <20191025000332.5fd9529a@jawa>
On 10/24/19 3:03 PM, Lukasz Majewski wrote:
Doesn't glibc prefer 'long int' to 'long'?
I've used the type from struct timespec definition (long tv_nsec;)
I can change it to long int if preferred.
Yes, that's the preferred style. See:
https://sourceware.org/glibc/wiki/Style_and_Conventions#Implicit_int
The question is if we do prefer ns < 1000000000 or ns <= 999999999 ?
I mildly prefer the former, to remind the reader that there are one
billion valid values.