mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-23 15:55:21 -05:00
blame: widen struct blame_scoreboard.final_buf_size to size_t
Continue the size_t evacuation. final_buf_size is fed either from textconv_object()'s now-size_t out-parameter, from odb_read_object()'s size_t out-parameter (both bridged today through a final_buf_size_st local + cast_size_t_to_ulong()), or from o->file.size (mmfile_t, long). Widen the struct field, point both producers straight at it, and drop the bridge variable along with the cast. builtin/blame.c only reads the field for pointer arithmetic and comparisons, which promote cleanly. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
6
blame.c
6
blame.c
@@ -2861,20 +2861,18 @@ void setup_scoreboard(struct blame_scoreboard *sb,
|
||||
sb->final_buf_size = o->file.size;
|
||||
}
|
||||
else {
|
||||
size_t final_buf_size_st = 0;
|
||||
o = get_origin(sb->final, sb->path);
|
||||
if (fill_blob_sha1_and_mode(sb->repo, o))
|
||||
die(_("no such path %s in %s"), sb->path, final_commit_name);
|
||||
|
||||
if (sb->revs->diffopt.flags.allow_textconv &&
|
||||
textconv_object(sb->repo, sb->path, o->mode, &o->blob_oid, 1, (char **) &sb->final_buf,
|
||||
&final_buf_size_st))
|
||||
&sb->final_buf_size))
|
||||
;
|
||||
else
|
||||
sb->final_buf = odb_read_object(the_repository->objects,
|
||||
&o->blob_oid, &type,
|
||||
&final_buf_size_st);
|
||||
sb->final_buf_size = cast_size_t_to_ulong(final_buf_size_st);
|
||||
&sb->final_buf_size);
|
||||
|
||||
if (!sb->final_buf)
|
||||
die(_("cannot read blob %s for path %s"),
|
||||
|
||||
Reference in New Issue
Block a user