Skip to content

Commit 8891566

Browse files
Philip Oakleydscho
authored andcommitted
xcrc32: use xcrc32 wrapper
Zero length initialisations are not converted. Signed-off-by: Philip Oakley <[email protected]>
1 parent 21d51c0 commit 8891566

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

archive-zip.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int write_zip_entry(struct archiver_args *args,
352352
if (!buffer)
353353
return error(_("cannot read %s"),
354354
oid_to_hex(oid));
355-
crc = crc32(crc, buffer, size);
355+
crc = xcrc32(crc, buffer, size);
356356
is_binary = entry_is_binary(args->repo->index,
357357
path_without_prefix,
358358
buffer, size);
@@ -428,7 +428,7 @@ static int write_zip_entry(struct archiver_args *args,
428428
readlen = read_istream(stream, buf, sizeof(buf));
429429
if (readlen <= 0)
430430
break;
431-
crc = crc32(crc, buf, readlen);
431+
crc = xcrc32(crc, buf, readlen);
432432
if (is_binary == -1)
433433
is_binary = entry_is_binary(args->repo->index,
434434
path_without_prefix,
@@ -461,7 +461,7 @@ static int write_zip_entry(struct archiver_args *args,
461461
readlen = read_istream(stream, buf, sizeof(buf));
462462
if (readlen <= 0)
463463
break;
464-
crc = crc32(crc, buf, readlen);
464+
crc = xcrc32(crc, buf, readlen);
465465
if (is_binary == -1)
466466
is_binary = entry_is_binary(args->repo->index,
467467
path_without_prefix,

builtin/index-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static void use(int bytes)
278278
{
279279
if (bytes > input_len)
280280
die(_("used more bytes than were available"));
281-
input_crc32 = crc32(input_crc32, input_buffer + input_offset, bytes);
281+
input_crc32 = xcrc32(input_crc32, input_buffer + input_offset, bytes);
282282
input_len -= bytes;
283283
input_offset += bytes;
284284

csum-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void hashwrite(struct hashfile *f, const void *buf, unsigned int count)
9595
const void *data;
9696

9797
if (f->do_crc)
98-
f->crc32 = crc32(f->crc32, buf, nr);
98+
f->crc32 = xcrc32(f->crc32, buf, nr);
9999

100100
if (nr == sizeof(f->buffer)) {
101101
/* process full buffer directly without copy */

pack-check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,
3737
void *data = use_pack(p, w_curs, offset, &avail);
3838
if (avail > len)
3939
avail = len;
40-
data_crc = crc32(data_crc, data, avail);
40+
data_crc = xcrc32(data_crc, data, avail);
4141
offset += avail;
4242
len -= avail;
4343
} while (len);

0 commit comments

Comments
 (0)