git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] archive-tar: add UL type suffix to unsigned long constant

From
Jeff King <peff@peff.net>
Date
Jun 17, 2016, 23:40 UTC
Message-ID
<20160617234041.GC26564@sigill.intra.peff.net>
In-Reply-To
<57646646.9060407@ramsayjones.plus.com>
On Fri, Jun 17, 2016 at 10:06:14PM +0100, Ramsay Jones wrote:
Show 22 quoted lines
> If you need to re-roll your 'jk/big-and-old-archive-tar' branch, could
> you please squash this into the relevant patch (commit 8035a1e3,
> "archive-tar: write extended headers for far-future mtime", 16-06-2016).
> 
> Thanks!
> 
> ATB,
> Ramsay Jones
> 
>  archive-tar.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/archive-tar.c b/archive-tar.c
> index 749722f..c7b85fd 100644
> --- a/archive-tar.c
> +++ b/archive-tar.c
> @@ -187,7 +187,7 @@ static inline unsigned long ustar_size(uintmax_t size)
>  
>  static inline unsigned long ustar_mtime(time_t mtime)
>  {
> -	if (mtime < 077777777777)
> +	if (mtime < 077777777777UL)
Whoops. I even got it right in the similar line above. :-/

This did make me wonder how the whole thing fares on a system where "unsigned long" is 32-bit (AIUI, Git for Windows is such a system).

The sizes passed around (here and all through git) are "unsigned long", so I don't think we're making anything _worse_.

-Peff
Previous: Ramsay JonesNext: Ramsay Jones
Message 2 of 3 in “archive-tar: add UL type suffix to unsigned long constant”
  1. archive-tar: add UL type suffix to unsigned long constantRamsay Jones, Jun 17, 2016
  2. Jeff KingJun 17, 2016
  3. Ramsay JonesJun 18, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.