Re: [PATCH v5 8/8] Use uintmax_t for timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hannes,

On Wed, 26 Apr 2017, Johannes Sixt wrote:

> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]