ref-filter: switch some uses of unsigned long to size_t

In the future, we'll want to pass some of the arguments of find_subpos to strbuf_detach, which takes a size_t. This is fine on systems where that's the same size as unsigned long, but that isn't the case on all systems. Moreover, size_t makes sense since it's not possible to use a buffer here that's larger than memory anyway. Let's switch each use to size_t for these lengths in grab_sub_body_contents and find_subpos. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Jan 18, 2021 at 23:49 UTC 83dff3eb2ed9cd750ec89f3dc5bab44b16119743
1 file changed +5 -5
ref-filter.c
+5 -5
@@ -1210,10 +1210,10 @@ static void grab_person(const char *who, struct atom_value *val, int deref, void
1210 }
1211
1212 static void find_subpos(const char *buf,
1213 - const char **sub, unsigned long *sublen,
1214 - const char **body, unsigned long *bodylen,
1215 - unsigned long *nonsiglen,
1216 - const char **sig, unsigned long *siglen)
1213 + const char **sub, size_t *sublen,
1214 + const char **body, size_t *bodylen,
1215 + size_t *nonsiglen,
1216 + const char **sig, size_t *siglen)
1217 {
1218 const char *eol;
1219 /* skip past header until we hit empty line */
@@ -1285,7 +1285,7 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, void *buf)
1285 {
1286 int i;
1287 const char *subpos = NULL, *bodypos = NULL, *sigpos = NULL;
1288 - unsigned long sublen = 0, bodylen = 0, nonsiglen = 0, siglen = 0;
1288 + size_t sublen = 0, bodylen = 0, nonsiglen = 0, siglen = 0;
1289
1290 for (i = 0; i < used_atom_cnt; i++) {
1291 struct used_atom *atom = &used_atom[i];