Skip to content

Commit 83dff3e

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 72c4083 commit 83dff3e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ref-filter.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,10 +1210,10 @@ static void grab_person(const char *who, struct atom_value *val, int deref, void
12101210
}
12111211

12121212
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)
12171217
{
12181218
const char *eol;
12191219
/* 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)
12851285
{
12861286
int i;
12871287
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;
12891289

12901290
for (i = 0; i < used_atom_cnt; i++) {
12911291
struct used_atom *atom = &used_atom[i];

0 commit comments

Comments
 (0)