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

Re: [Patch size_t V3 00/19] use size_t

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2017, 21:33 UTC
Message-ID
<xmqq1sobjiyn.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1502914591-26215-1-git-send-email-martin@mail.zuhause>
Martin Koegler <martin.koegler@chello.at> writes:
Show 6 quoted lines
> From: Martin Koegler <martin.koegler@chello.at>
>
> This patchset is for next [24db08a6e8fed761d3bace7f2d5997806e20b9f7].
> Its a complete collection of all patches. Some errors were fixed and
> it sticks with off_t for length in (pack) files. Object sizes are handled
> as size_t.
Thanks for an update.

I am in the middle of today's integration cycle already, so I won't be able to apply them to my tree, see how it interacts with various other topics, and if I can rebase it off of 'next' as of yesterday (I am hoping that I can update 'next' with a few new topics today) to give it a more appropriate base, at least until late this evening.

Making it "a complete collection" is very much appreciated, as I can forget about random pieces that were picked up so far. I haven't looked at the patch text, but I agree that the use of off_t for something that could become a location in a file and use of size_t for objects that we handle in-core would be a good place to start (and probably a good place to stop, at least for now).

Show 20 quoted lines
> Martin Koegler (19):
>   delta: fix enconding size larger than an "uint" can hold
>   Convert size datatype to size_t
>   Convert zlib.c to size_t
>   delta: Fix offset overflows
>   Convert sha1_file.c to size_t
>   Use size_t for sha1
>   Convert parse_X_buffer to size_t
>   Convert fsck.c & commit.c to size_t
>   Convert cache functions to size_t
>   Add overflow check to get_delta_hdr_size
>   Use size_t for config parsing
>   Convert pack-objects to size_t
>   Convert index-pack to size_t
>   Convert unpack-objects to size_t
>   Convert archive functions to size_t
>   Convert various things to size_t
>   Convert ref-filter to size_t
>   Convert tree-walk to size_t
>   Convert xdiff-interface to size_t
Usually we try to make these more like
    delta: fix enconding size larger than an "uint" can hold
    pack-objects: use size_t for sizes, not ulong
    tree-walk: use size_t for sizes, not ulong
or (perhaps even better for this series)
    size_t: convert pack-objects away from ulong
    size_t: convert tree-walk away from ulong
    ...

so that readers of "git shortlog --no-merges" can visually spot a group of patches that are around the same theme.

>  95 files changed, 525 insertions(+), 489 deletions(-)
That's a lot of changes.  Let's see how well it goes.
Thanks.
Previous: Martin KoeglerNext: Torsten Bögershausen
Message 31 of 33 in “use size_t”
  1. 00/19 use size_tMartin Koegler, Aug 16, 2017
  2. 03/19 Convert zlib.c to size_tMartin Koegler, Aug 16, 2017
  3. 01/19 delta: fix enconding size larger than an "uint" can holdMartin Koegler, Aug 16, 2017
  4. Torsten BögershausenAug 17, 2017
  5. 08/19 Convert fsck.c & commit.c to size_tMartin Koegler, Aug 16, 2017
  6. 11/19 Use size_t for config parsingMartin Koegler, Aug 16, 2017
  7. Johannes SixtAug 24, 2017
  8. 04/19 delta: Fix offset overflowsMartin Koegler, Aug 16, 2017
  9. 12/19 Convert pack-objects to size_tMartin Koegler, Aug 16, 2017
  10. 19/19 Convert xdiff-interface to size_tMartin Koegler, Aug 16, 2017
  11. Junio C HamanoAug 17, 2017
  12. 17/19 Convert ref-filter to size_tMartin Koegler, Aug 16, 2017
  13. Junio C HamanoAug 17, 2017
  14. Junio C HamanoAug 17, 2017
  15. 10/19 Add overflow check to get_delta_hdr_sizeMartin Koegler, Aug 16, 2017
  16. 18/19 Convert tree-walk to size_tMartin Koegler, Aug 16, 2017
  17. Junio C HamanoAug 17, 2017
  18. 16/19 Convert various things to size_tMartin Koegler, Aug 16, 2017
  19. Junio C HamanoAug 21, 2017
  20. 15/19 Convert archive functions to size_tMartin Koegler, Aug 16, 2017
  21. Junio C HamanoAug 21, 2017
  22. brian m. carlsonAug 22, 2017
  23. 07/19 Convert parse_X_buffer to size_tMartin Koegler, Aug 16, 2017
  24. 14/19 Convert unpack-objects to size_tMartin Koegler, Aug 16, 2017
  25. 13/19 Convert index-pack to size_tMartin Koegler, Aug 16, 2017
  26. Ramsay JonesAug 16, 2017
  27. 02/19 Convert size datatype to size_tMartin Koegler, Aug 16, 2017
  28. 09/19 Convert cache functions to size_tMartin Koegler, Aug 16, 2017
  29. 05/19 Convert sha1_file.c to size_tMartin Koegler, Aug 16, 2017
  30. 06/19 Use size_t for sha1Martin Koegler, Aug 16, 2017
  31. Junio C HamanoAug 16, 2017
  32. Torsten BögershausenAug 17, 2017
  33. Martin KoeglerAug 18, 2017

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.