Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit bfa3436

Browse files
Fix MSVC warning
1 parent d0e8c38 commit bfa3436

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/c/bsdiff/bsdiff.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ int bsdiff(const char* error, const char* oldfile, const char* newfile, const ch
314314
?? ?? Bzip2ed diff block
315315
?? ?? Bzip2ed extra block */
316316
memcpy(header.magic,"BSDIFF40",8);
317-
offtout(0, &header.bzctrllen);
318-
offtout(0, &header.bzdatalen);
319-
offtout(newsize, &header.newsize);
317+
offtout(0, (u_char*)&header.bzctrllen);
318+
offtout(0, (u_char*)&header.bzdatalen);
319+
offtout(newsize, (u_char*)&header.newsize);
320320
if(fwrite(&header, 32, 1, pf) != 1)
321321
{
322322
sprintf((char*)error, "\"%s\" %s", patchfile, strerror(errno));
@@ -448,7 +448,7 @@ int bsdiff(const char* error, const char* oldfile, const char* newfile, const ch
448448
sprintf((char*)error, "\"ftell\" %s", strerror(errno));
449449
return -1;
450450
}
451-
offtout(len-32, &header.bzctrllen);
451+
offtout(len-32, (u_char*)&header.bzctrllen);
452452

453453
/* Write compressed diff data */
454454
if ((pfbz2 = BZ2_bzWriteOpen(&bz2err, pf, 9, 0, 0)) == NULL)
@@ -477,7 +477,7 @@ int bsdiff(const char* error, const char* oldfile, const char* newfile, const ch
477477
sprintf((char*)error, "\"ftell\" %s", strerror(errno));
478478
return -1;
479479
}
480-
offtout(newsize - len, &header.bzdatalen);
480+
offtout(newsize - len, (u_char*)&header.bzdatalen);
481481

482482
/* Write compressed extra data */
483483
if ((pfbz2 = BZ2_bzWriteOpen(&bz2err, pf, 9, 0, 0)) == NULL)

src/c/bspatch/bspatch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ int bspatch(const char* error, const char* oldfile, const char* newfile, const c
100100
}
101101

102102
/* Read lengths from header */
103-
header.bzctrllen = offtin(&header.bzctrllen);
104-
header.bzdatalen = offtin(&header.bzdatalen);
105-
header.newsize = offtin(&header.newsize);
103+
header.bzctrllen = offtin((u_char*)&header.bzctrllen);
104+
header.bzdatalen = offtin((u_char*)&header.bzdatalen);
105+
header.newsize = offtin((u_char*)&header.newsize);
106106

107107
/* Close patch file and re-open it via libbzip2 at the right places */
108108
if (fclose(f))

0 commit comments

Comments
 (0)