strvec: rename struct fields
The "argc" and "argv" names made sense when the struct was argv_array, but now they're just confusing. Let's rename them to "nr" (which we use for counts elsewhere) and "v" (which is rather terse, but reads well when combined with typical variable names like "args.v"). Note that we have to update all of the callers immediately. Playing tricks with the preprocessor is hard here, because we wouldn't want to rewrite unrelated tokens. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
b5eb741a00
commit
d70a9eb611
16
connect.c
16
connect.c
@@ -70,9 +70,9 @@ int server_supports_v2(const char *c, int die_on_error)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < server_capabilities_v2.argc; i++) {
|
||||
for (i = 0; i < server_capabilities_v2.nr; i++) {
|
||||
const char *out;
|
||||
if (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&
|
||||
if (skip_prefix(server_capabilities_v2.v[i], c, &out) &&
|
||||
(!*out || *out == '='))
|
||||
return 1;
|
||||
}
|
||||
@@ -87,9 +87,9 @@ int server_feature_v2(const char *c, const char **v)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < server_capabilities_v2.argc; i++) {
|
||||
for (i = 0; i < server_capabilities_v2.nr; i++) {
|
||||
const char *out;
|
||||
if (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&
|
||||
if (skip_prefix(server_capabilities_v2.v[i], c, &out) &&
|
||||
(*out == '=')) {
|
||||
*v = out + 1;
|
||||
return 1;
|
||||
@@ -103,9 +103,9 @@ int server_supports_feature(const char *c, const char *feature,
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < server_capabilities_v2.argc; i++) {
|
||||
for (i = 0; i < server_capabilities_v2.nr; i++) {
|
||||
const char *out;
|
||||
if (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&
|
||||
if (skip_prefix(server_capabilities_v2.v[i], c, &out) &&
|
||||
(!*out || *(out++) == '=')) {
|
||||
if (parse_feature_request(out, feature))
|
||||
return 1;
|
||||
@@ -488,9 +488,9 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
|
||||
if (!for_push)
|
||||
packet_write_fmt(fd_out, "peel\n");
|
||||
packet_write_fmt(fd_out, "symrefs\n");
|
||||
for (i = 0; ref_prefixes && i < ref_prefixes->argc; i++) {
|
||||
for (i = 0; ref_prefixes && i < ref_prefixes->nr; i++) {
|
||||
packet_write_fmt(fd_out, "ref-prefix %s\n",
|
||||
ref_prefixes->argv[i]);
|
||||
ref_prefixes->v[i]);
|
||||
}
|
||||
packet_flush(fd_out);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user