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

Re: [RFC/PATCH] fast-import: Fix compile warnings

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 8, 2007, 07:03 UTC
Message-ID
<20070208070342.GA3746@spearce.org>
In-Reply-To
<Pine.LNX.4.63.0702071237360.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Not on all platforms are size_t and unsigned long equivalent.
> Since I do not know how portable %z is, I play safe, and just
> cast the respective variables to unsigned long.

We do this elsewhere in Git. blobs are using unsigned long in sha1_file.c for their length; I chose to size_t in gfi as that's what the type is for... but then look at the mess.

I applied this patch to my tree and pushed it to repo.or.cz.
This last hunk:
 
Show 10 quoted lines
> @@ -2028,7 +2030,8 @@ int main(int argc, const char **argv)
>  	fprintf(stderr, "      marks:     %10ju (%10ju unique    )\n", (((uintmax_t)1) << marks->shift) * 1024, marks_set_count);
>  	fprintf(stderr, "      atoms:     %10u\n", atom_cnt);
>  	fprintf(stderr, "Memory total:    %10ju KiB\n", (total_allocd + alloc_count*sizeof(struct object_entry))/1024);
> -	fprintf(stderr, "       pools:    %10lu KiB\n", total_allocd/1024);
> +	fprintf(stderr, "       pools:    %10lu KiB\n",
> +		(unsigned long)(total_allocd / 1024));
>  	fprintf(stderr, "     objects:    %10ju KiB\n", (alloc_count*sizeof(struct object_entry))/1024);
>  	fprintf(stderr, "---------------------------------------------------------------------\n");
>  	pack_report();

was the only part that did not apply cleanly, but that was easily fixed by tossing an extra tab at the start of each line, as this hunk was shifted in one level by a recent commit that Junio has not pushed out to master.

-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “fast-import: Fix compile warnings”
  1. fast-import: Fix compile warningsJohannes Schindelin, Feb 7, 2007
  2. Alex RiesenFeb 7, 2007
  3. Junio C HamanoFeb 7, 2007
  4. Johannes SchindelinFeb 7, 2007
  5. Junio C HamanoFeb 7, 2007
  6. Shawn O. PearceFeb 8, 2007
  7. Junio C HamanoFeb 8, 2007
  8. Shawn O. PearceFeb 8, 2007

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.