Merge branch 'ab/string-list-count-in-size-t'

Count string_list items in size_t, not "unsigned int".

* ab/string-list-count-in-size-t:
  string-list API: change "nr" and "alloc" to "size_t"
  gettext API users: don't explicitly cast ngettext()'s "n"
This commit is contained in:
Junio C Hamano
2022-03-16 17:53:09 -07:00
12 changed files with 39 additions and 35 deletions

View File

@ -813,13 +813,14 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,
proc.trace2_hook_name = hook_name;
if (feed_state->push_options) {
int i;
size_t i;
for (i = 0; i < feed_state->push_options->nr; i++)
strvec_pushf(&proc.env_array,
"GIT_PUSH_OPTION_%d=%s", i,
"GIT_PUSH_OPTION_%"PRIuMAX"=%s",
(uintmax_t)i,
feed_state->push_options->items[i].string);
strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%d",
feed_state->push_options->nr);
strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
(uintmax_t)feed_state->push_options->nr);
} else
strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT");