Patrick Steinhardt
5e7fe8a7b8
commit-reach: use size_t to track indices when computing merge bases
...
The functions `repo_get_merge_bases_many()` and friends accepts an array
of commits as well as a parameter that indicates how large that array
is. This parameter is using a signed integer, which leads to a couple of
warnings with -Wsign-compare.
Refactor the code to use `size_t` to track indices instead and adapt
callers accordingly. While most callers are trivial, there are two
callers that require a bit more scrutiny:
- builtin/merge-base.c:show_merge_base() subtracts `1` from the
`rev_nr` before calling `repo_get_merge_bases_many_dirty()`, so if
the variable was `0` it would wrap. This code is fine though because
its only caller will execute that code only when `argc >= 2`, and it
follows that `rev_nr >= 2`, as well.
- bisect.ccheck_merge_bases() similarly subtracts `1` from `rev_nr`.
Again, there is only a single caller that populates `rev_nr` with
`good_revs.nr`. And because a bisection always requires at least one
good revision it follws that `rev_nr >= 1`.
Mark the file as -Wsign-compare-clean.
Signed-off-by: Patrick Steinhardt <ps@pks.im >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2024-12-27 08:12:40 -08:00
..
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:03 +09:00
2024-10-25 14:02:36 -04:00
2024-09-13 14:32:24 -07:00
2024-10-11 09:37:18 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:05 +09:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:32:24 -07:00
2024-12-13 07:33:36 -08:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-09-23 10:35:09 -07:00
2024-12-03 12:38:49 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-09-13 14:32:24 -07:00
2024-11-26 10:36:08 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-11-26 10:36:08 +09:00
2024-12-04 08:21:54 +09:00
2024-09-13 14:32:24 -07:00
2024-11-01 12:53:19 -04:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:33:30 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:02 +09:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:02 +09:00
2024-12-23 09:32:11 -08:00
2024-09-23 10:35:09 -07:00
2024-09-23 10:35:09 -07:00
2024-12-06 20:20:04 +09:00
2024-12-04 08:21:54 +09:00
2024-12-06 20:20:02 +09:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:33:30 -07:00
2024-12-06 20:20:02 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-11-26 10:36:08 +09:00
2024-12-23 09:32:11 -08:00
2024-11-21 08:23:45 +09:00
2024-10-14 12:33:02 -04:00
2024-12-27 08:11:46 -08:00
2024-12-06 20:20:02 +09:00
2024-11-04 22:37:51 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-12-27 08:12:40 -08:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-12-04 10:32:20 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-11-26 10:36:08 +09:00
2024-12-23 09:32:11 -08:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:05 +09:00
2024-09-13 14:33:30 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:04 +09:00
2024-12-23 09:32:17 -08:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-12-04 10:14:47 +09:00
2024-09-13 14:33:30 -07:00
2024-09-13 14:33:30 -07:00
2024-12-23 09:32:11 -08:00
2024-12-23 09:32:11 -08:00
2024-11-21 07:59:14 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:03 +09:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-09-30 11:23:09 -07:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-12-23 09:32:12 -08:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-09-13 14:32:24 -07:00
2024-09-23 10:35:09 -07:00
2024-12-10 10:04:55 +09:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-09-23 10:35:09 -07:00
2024-12-23 09:32:11 -08:00
2024-09-23 10:35:09 -07:00