changing bz2's u_char to uint8_t from <stdint.h>
authorMatthew Endsley <mendsley@gmail.com>
Fri, 11 May 2012 23:33:51 +0000 (16:33 -0700)
committerMatthew Endsley <mendsley@gmail.com>
Mon, 14 May 2012 08:04:24 +0000 (01:04 -0700)
bsdiff.c

index 2ff30c1..960f1e9 100644 (file)
--- a/bsdiff.c
+++ b/bsdiff.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD: src/usr.bin/bsdiff/bsdiff/bsdiff.c,v 1.1 2005/08/06 01:59:05
 #include <bzlib.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -137,7 +138,7 @@ static void split(off_t *I,off_t *V,off_t start,off_t len,off_t h)
        if(start+len>kk) split(I,V,kk,start+len-kk,h);
 }
 
-static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize)
+static void qsufsort(off_t *I,off_t *V,uint8_t *old,off_t oldsize)
 {
        off_t buckets[256];
        off_t i,h,len;
@@ -175,7 +176,7 @@ static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize)
        for(i=0;i<oldsize+1;i++) I[V[i]]=i;
 }
 
-static off_t matchlen(u_char *old,off_t oldsize,u_char *new,off_t newsize)
+static off_t matchlen(uint8_t *old,off_t oldsize,uint8_t *new,off_t newsize)
 {
        off_t i;
 
@@ -185,8 +186,8 @@ static off_t matchlen(u_char *old,off_t oldsize,u_char *new,off_t newsize)
        return i;
 }
 
-static off_t search(off_t *I,u_char *old,off_t oldsize,
-               u_char *new,off_t newsize,off_t st,off_t en,off_t *pos)
+static off_t search(off_t *I,uint8_t *old,off_t oldsize,
+               uint8_t *new,off_t newsize,off_t st,off_t en,off_t *pos)
 {
        off_t x,y;
 
@@ -211,7 +212,7 @@ static off_t search(off_t *I,u_char *old,off_t oldsize,
        };
 }
 
-static void offtout(off_t x,u_char *buf)
+static void offtout(off_t x,uint8_t *buf)
 {
        off_t y;
 
@@ -229,7 +230,7 @@ static void offtout(off_t x,u_char *buf)
        if(x<0) buf[7]|=0x80;
 }
 
-int bsdiff(u_char* old, off_t oldsize, u_char* new, off_t newsize, FILE* pf)
+int bsdiff(uint8_t* old, off_t oldsize, uint8_t* new, off_t newsize, FILE* pf)
 {
        off_t *I,*V;
        off_t scan,pos,len;
@@ -239,9 +240,9 @@ int bsdiff(u_char* old, off_t oldsize, u_char* new, off_t newsize, FILE* pf)
        off_t overlap,Ss,lens;
        off_t i;
        off_t dblen,eblen;
-       u_char *db,*eb;
-       u_char buf[8];
-       u_char header[32];
+       uint8_t *db,*eb;
+       uint8_t buf[8];
+       uint8_t header[32];
        BZFILE * pfbz2;
        int bz2err;
 
@@ -410,7 +411,7 @@ int bsdiff(u_char* old, off_t oldsize, u_char* new, off_t newsize, FILE* pf)
 int main(int argc,char *argv[])
 {
        int fd;
-       u_char *old,*new;
+       uint8_t *old,*new;
        off_t oldsize,newsize;
        FILE * pf;