Re: [PATCH v5 8/8] Use uintmax_t for timestamps
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 26, 2017, 19:09 UTC
- Message-ID
- <alpine.DEB.2.20.1704262108160.3480@virtualbox>
- In-Reply-To
- <02b74d66-97e6-c633-888a-0c6a628cc5bd@kdbg.org>
Hi Hannes,
On Wed, 26 Apr 2017, Johannes Sixt wrote:
Show 41 quoted lines
> Am 24.04.2017 um 15:58 schrieb Johannes Schindelin: > > #define PRIo32 "o" > > #endif > > > > -typedef unsigned long timestamp_t; > > -#define PRItime "lu" > > -#define parse_timestamp strtoul > > +typedef uintmax_t timestamp_t; > > +#define PRItime PRIuMAX > > +#define parse_timestamp strtoumax > > +#ifdef ULLONG_MAX > > +#define TIME_MAX ULLONG_MAX > > +#else > > #define TIME_MAX ULONG_MAX > > +#endif > > > > #ifndef PATH_SEP > > #define PATH_SEP ':' > > > > I think you should squash in this: > > diff --git a/git-compat-util.h b/git-compat-util.h > index 26d2643667..b5f4a7bb2f 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -322,11 +322,7 @@ extern char *gitdirname(char *); > typedef uintmax_t timestamp_t; > #define PRItime PRIuMAX > #define parse_timestamp strtoumax > -#ifdef ULLONG_MAX > -#define TIME_MAX ULLONG_MAX > -#else > -#define TIME_MAX ULONG_MAX > -#endif > +#define TIME_MAX UINTMAX_MAX > > #ifndef PATH_SEP > #define PATH_SEP ':' > > UINTMAX_MAX is already used git-compat-util.h
Good point. I very much appreciate your fresh eyes here, as I simply overlooked this in the humongous task to convert v1 to use uintmax_t instead of time_t.
Ciao, Dscho