bsdiff: add bsdiff and bspatch tool package
[openwrt/staging/yousong.git] / package / utils / bsdiff / patches / 001-musl.patch
1 --- a/bsdiff.c 2005-08-17 00:13:52.000000000 +0200
2 +++ b/bsdiff.c 2016-02-21 01:39:31.157915765 +0100
3 @@ -101,7 +101,7 @@
4 if(start+len>kk) split(I,V,kk,start+len-kk,h);
5 }
6
7 -static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize)
8 +static void qsufsort(off_t *I,off_t *V,unsigned char *old,off_t oldsize)
9 {
10 off_t buckets[256];
11 off_t i,h,len;
12 @@ -139,7 +139,7 @@
13 for(i=0;i<oldsize+1;i++) I[V[i]]=i;
14 }
15
16 -static off_t matchlen(u_char *old,off_t oldsize,u_char *new,off_t newsize)
17 +static off_t matchlen(unsigned char *old,off_t oldsize,unsigned char *new,off_t newsize)
18 {
19 off_t i;
20
21 @@ -149,8 +149,8 @@
22 return i;
23 }
24
25 -static off_t search(off_t *I,u_char *old,off_t oldsize,
26 - u_char *new,off_t newsize,off_t st,off_t en,off_t *pos)
27 +static off_t search(off_t *I,unsigned char *old,off_t oldsize,
28 + unsigned char *new,off_t newsize,off_t st,off_t en,off_t *pos)
29 {
30 off_t x,y;
31
32 @@ -175,7 +175,7 @@
33 };
34 }
35
36 -static void offtout(off_t x,u_char *buf)
37 +static void offtout(off_t x,unsigned char *buf)
38 {
39 off_t y;
40
41 @@ -196,7 +196,7 @@
42 int main(int argc,char *argv[])
43 {
44 int fd;
45 - u_char *old,*new;
46 + unsigned char *old,*new;
47 off_t oldsize,newsize;
48 off_t *I,*V;
49 off_t scan,pos,len;
50 @@ -206,9 +206,9 @@
51 off_t overlap,Ss,lens;
52 off_t i;
53 off_t dblen,eblen;
54 - u_char *db,*eb;
55 - u_char buf[8];
56 - u_char header[32];
57 + unsigned char *db,*eb;
58 + unsigned char buf[8];
59 + unsigned char header[32];
60 FILE * pf;
61 BZFILE * pfbz2;
62 int bz2err;
63 --- a/bspatch.c 2005-08-17 00:14:00.000000000 +0200
64 +++ b/bspatch.c 2016-02-21 01:39:29.753859970 +0100
65 @@ -36,7 +36,7 @@
66 #include <unistd.h>
67 #include <fcntl.h>
68
69 -static off_t offtin(u_char *buf)
70 +static off_t offtin(unsigned char *buf)
71 {
72 off_t y;
73
74 @@ -62,8 +62,8 @@
75 int fd;
76 ssize_t oldsize,newsize;
77 ssize_t bzctrllen,bzdatalen;
78 - u_char header[32],buf[8];
79 - u_char *old, *new;
80 + unsigned char header[32],buf[8];
81 + unsigned char *old, *new;
82 off_t oldpos,newpos;
83 off_t ctrl[3];
84 off_t lenread;