diff options
-rw-r--r-- | package/cfgfs/src/adler.h | 2 | ||||
-rw-r--r-- | package/cfgfs/src/compress.h | 4 | ||||
-rw-r--r-- | package/cfgfs/src/cpr_get.c | 4 | ||||
-rw-r--r-- | package/cfgfs/src/ft_creat.c | 22 | ||||
-rw-r--r-- | package/cfgfs/src/header.c | 9 | ||||
-rw-r--r-- | package/cfgfs/src/minilzop.c | 22 | ||||
-rw-r--r-- | package/cfgfs/src/pack.h | 14 | ||||
-rw-r--r-- | package/cfgfs/src/sysdeps.h | 4 | ||||
-rw-r--r-- | package/cfgfs/src/unwraps.c | 8 | ||||
-rw-r--r-- | package/cfgfs/src/wraps.c | 2 |
10 files changed, 41 insertions, 50 deletions
diff --git a/package/cfgfs/src/adler.h b/package/cfgfs/src/adler.h index a1608705f..751aa928d 100644 --- a/package/cfgfs/src/adler.h +++ b/package/cfgfs/src/adler.h @@ -45,7 +45,7 @@ by the 'buffer' argument, size expected in 'len' which is TRASHED; stores the result in s1 and s2 */ #define ADLER_CALC(buffer) do { \ - const uint8_t *adler_buf = (const uint8_t *)(buffer); \ + const u_int8_t *adler_buf = (const u_int8_t *)(buffer); \ while (len) { \ len -= (n = MIN(len, ADLER_NMAX)); \ while (n--) { \ diff --git a/package/cfgfs/src/compress.h b/package/cfgfs/src/compress.h index c0f92380b..d4dba74a0 100644 --- a/package/cfgfs/src/compress.h +++ b/package/cfgfs/src/compress.h @@ -28,7 +28,7 @@ typedef struct FWCF_COMPRESSOR { fwcf_compress_work_func compress; fwcf_compress_rev_func decompress; const char *name; - uint8_t code; + u_int8_t code; } fwcf_compressor; /* 0=success 1=EINVAL 2=slot already used */ @@ -41,7 +41,7 @@ fwcf_compressor *compress_enumerate(void); int compress_list(void); /* high-level */ -fwcf_compressor *compressor_get(uint8_t); +fwcf_compressor *compressor_get(u_int8_t); int compressor_getbyname(const char *); int list_compressors(void); diff --git a/package/cfgfs/src/cpr_get.c b/package/cfgfs/src/cpr_get.c index 71e414130..894abb347 100644 --- a/package/cfgfs/src/cpr_get.c +++ b/package/cfgfs/src/cpr_get.c @@ -29,10 +29,8 @@ #include "defs.h" #include "compress.h" -__RCSID("$MirOS: contrib/hosted/fwcf/cpr_get.c,v 1.4 2007/03/09 22:35:13 tg Exp $"); - fwcf_compressor * -compressor_get(uint8_t algo) +compressor_get(u_int8_t algo) { fwcf_compressor *list; diff --git a/package/cfgfs/src/ft_creat.c b/package/cfgfs/src/ft_creat.c index e9424e159..4faf3c55c 100644 --- a/package/cfgfs/src/ft_creat.c +++ b/package/cfgfs/src/ft_creat.c @@ -35,12 +35,10 @@ #include "defs.h" #include "pack.h" -__RCSID("$MirOS: contrib/hosted/fwcf/ft_creat.c,v 1.2 2006/09/23 23:21:04 tg Exp $"); - static size_t ft_creat(char *); -static void make_directory(char *, uint32_t, uint32_t, uint32_t, time_t); -static void make_file(char *, uint8_t *, size_t); -static void make_symlink(char *, uint8_t *, size_t); +static void make_directory(char *, u_int32_t, u_int32_t, u_int32_t, time_t); +static void make_file(char *, u_int8_t *, size_t); +static void make_symlink(char *, u_int8_t *, size_t); static void pop_directories(void); static void do_chown(char *, uid_t, gid_t); static void do_chmod(char *, mode_t); @@ -74,14 +72,14 @@ ft_creatm(char *buf, const char *pathname) static size_t ft_creat(char *buf) { - uint8_t c, *p; + u_int8_t c, *p; char *fname; size_t i, type = 0, size = 0; - uint32_t x_uid = 0, x_gid = 0, x_mode = 0; + u_int32_t x_uid = 0, x_gid = 0, x_mode = 0; time_t x_mtime = 0; i = strlen(buf) + 1; - p = (uint8_t *)buf + i; + p = (u_int8_t *)buf + i; fname = pfxname(buf); while (*p) switch (c = *p++) { @@ -183,11 +181,11 @@ ft_creat(char *buf) if (type != 3) free(fname); - return ((p - (uint8_t *)buf) + size); + return ((p - (u_int8_t *)buf) + size); } static void -make_directory(char *n, uint32_t m, uint32_t u, uint32_t g, time_t t) +make_directory(char *n, u_int32_t m, u_int32_t u, u_int32_t g, time_t t) { struct a_directory *newdir; @@ -209,7 +207,7 @@ make_directory(char *n, uint32_t m, uint32_t u, uint32_t g, time_t t) } static void -make_file(char *n, uint8_t *buf, size_t len) +make_file(char *n, u_int8_t *buf, size_t len) { int fd; @@ -228,7 +226,7 @@ make_file(char *n, uint8_t *buf, size_t len) } static void -make_symlink(char *n, uint8_t *buf, size_t len) +make_symlink(char *n, u_int8_t *buf, size_t len) { char target[len + 1]; diff --git a/package/cfgfs/src/header.c b/package/cfgfs/src/header.c index b3db0ce21..146b7ce39 100644 --- a/package/cfgfs/src/header.c +++ b/package/cfgfs/src/header.c @@ -33,12 +33,9 @@ #include "adler.h" #include "pack.h" -__RCSID("$MirOS: contrib/hosted/fwcf/header.c,v 1.7 2006/09/26 10:25:03 tg Exp $" - "\t" ADLER_H); - char * -mkheader(char *f_header, size_t hdrsize, uint32_t outer_len, - uint32_t inner_len, uint8_t algo) +mkheader(char *f_header, size_t hdrsize, u_int32_t outer_len, + u_int32_t inner_len, u_int8_t algo) { char *hdrptr = f_header; size_t hdrleft = hdrsize; @@ -68,7 +65,7 @@ mktrailer(char *data, size_t len) size_t hdrleft = 4; ADLER_DECL; #ifdef DEBUG_ADLER - uint32_t adler = adler32(1, (uint8_t *)data, len); + u_int32_t adler = adler32(1, (u_int8_t *)data, len); #endif ADLER_CALC(data); diff --git a/package/cfgfs/src/minilzop.c b/package/cfgfs/src/minilzop.c index 51935185c..6f0f6281b 100644 --- a/package/cfgfs/src/minilzop.c +++ b/package/cfgfs/src/minilzop.c @@ -32,19 +32,17 @@ #include "compress.h" #include "minilzop.h" -__RCSID("$MirOS: contrib/hosted/fwcf/minilzop.c,v 1.2 2007/03/09 22:25:45 tg Exp $"); - #define lodsw(s) __extension__({ \ - const uint8_t *lodsw_buf = (const uint8_t *)(s);\ - uint16_t lodsw_val; \ + const u_int8_t *lodsw_buf = (const u_int8_t *)(s);\ + u_int16_t lodsw_val; \ \ lodsw_val = lodsw_buf[0]; \ lodsw_val |= lodsw_buf[1] << 8; \ (lodsw_val); \ }) #define lodsd(s) __extension__({ \ - const uint8_t *lodsd_buf = (const uint8_t *)(s);\ - uint32_t lodsd_val; \ + const u_int8_t *lodsd_buf = (const u_int8_t *)(s);\ + u_int32_t lodsd_val; \ \ lodsd_val = lodsd_buf[0]; \ lodsd_val |= lodsd_buf[1] << 8; \ @@ -53,15 +51,15 @@ __RCSID("$MirOS: contrib/hosted/fwcf/minilzop.c,v 1.2 2007/03/09 22:25:45 tg Exp (lodsd_val); \ }) #define stosw(s,w) do { \ - uint8_t *stosw_buf = (uint8_t *)(s); \ - uint16_t stosw_val = (w); \ + u_int8_t *stosw_buf = (u_int8_t *)(s); \ + u_int16_t stosw_val = (w); \ \ stosw_buf[0] = stosw_val & 0xFF; \ stosw_buf[1] = (stosw_val >> 8) & 0xFF; \ } while (0) #define stosd(s,dw) do { \ - uint8_t *stosd_buf = (uint8_t *)(s); \ - uint32_t stosd_val = (dw); \ + u_int8_t *stosd_buf = (u_int8_t *)(s); \ + u_int32_t stosd_val = (dw); \ \ stosd_buf[0] = stosd_val & 0xFF; \ stosd_buf[1] = (stosd_val >> 8) & 0xFF; \ @@ -73,7 +71,7 @@ void read_aszdata(int dfd, char **dbuf, size_t *dlen) { size_t len; - uint8_t hdrbuf[8]; + u_int8_t hdrbuf[8]; ADLER_DECL; if (read(dfd, hdrbuf, 8) != 8) @@ -97,7 +95,7 @@ void write_aszdata(int dfd, const char *dbuf, size_t dlen) { size_t len; - uint8_t hdrbuf[8]; + u_int8_t hdrbuf[8]; ADLER_DECL; stosd(hdrbuf + 4, dlen); diff --git a/package/cfgfs/src/pack.h b/package/cfgfs/src/pack.h index 3b6e518fd..f81584b48 100644 --- a/package/cfgfs/src/pack.h +++ b/package/cfgfs/src/pack.h @@ -51,16 +51,16 @@ typedef struct FTSF_ENTRY ftsf_entry; } while (0) #define LOADW(x) __extension__({ \ - uint8_t *lwbf = (uint8_t *)(x); \ - uint32_t res = 0; \ + u_int8_t *lwbf = (u_int8_t *)(x); \ + u_int32_t res = 0; \ res = (res << 8) | lwbf[1]; \ res = (res << 8) | lwbf[0]; \ res; \ }) #define LOADT(x) __extension__({ \ - uint8_t *lwbf = (uint8_t *)(x); \ - uint32_t res = 0; \ + u_int8_t *lwbf = (u_int8_t *)(x); \ + u_int32_t res = 0; \ res = (res << 8) | lwbf[2]; \ res = (res << 8) | lwbf[1]; \ res = (res << 8) | lwbf[0]; \ @@ -68,8 +68,8 @@ typedef struct FTSF_ENTRY ftsf_entry; }) #define LOADD(x) __extension__({ \ - uint8_t *lwbf = (uint8_t *)(x); \ - uint32_t res = 0; \ + u_int8_t *lwbf = (u_int8_t *)(x); \ + u_int32_t res = 0; \ res = (res << 8) | lwbf[3]; \ res = (res << 8) | lwbf[2]; \ res = (res << 8) | lwbf[1]; \ @@ -80,7 +80,7 @@ typedef struct FTSF_ENTRY ftsf_entry; char *ft_pack(ftsf_entry *); char *ft_packm(void); -char *mkheader(char *, size_t, uint32_t, uint32_t, uint8_t); +char *mkheader(char *, size_t, u_int32_t, u_int32_t, u_int8_t); char *mktrailer(char *, size_t); void ft_dump(char *); diff --git a/package/cfgfs/src/sysdeps.h b/package/cfgfs/src/sysdeps.h index 8c248139f..e0849b9c2 100644 --- a/package/cfgfs/src/sysdeps.h +++ b/package/cfgfs/src/sysdeps.h @@ -9,7 +9,7 @@ #ifndef SYSDEPS_H #define SYSDEPS_H -void pull_rndata(uint8_t *, size_t); -void push_rndata(uint8_t *, size_t); +void pull_rndata(u_int8_t *, size_t); +void push_rndata(u_int8_t *, size_t); #endif diff --git a/package/cfgfs/src/unwraps.c b/package/cfgfs/src/unwraps.c index 37117d6e6..51452a56e 100644 --- a/package/cfgfs/src/unwraps.c +++ b/package/cfgfs/src/unwraps.c @@ -41,7 +41,7 @@ __RCSID("$MirOS: contrib/hosted/fwcf/unwraps.c,v 1.10 2006/09/26 10:25:03 tg Exp char * fwcf_unpack(int fd, size_t *inner) { - uint8_t c, hdrbuf[12]; + u_int8_t c, hdrbuf[12]; size_t outer, x_inner, x, len, maxln; char *cdata, *udata; ADLER_DECL; @@ -77,15 +77,15 @@ fwcf_unpack(int fd, size_t *inner) if ((s1 != LOADW(cdata + outer - 4)) || (s2 != LOADW(cdata + outer - 2))) errx(1, "crc mismatch: %02X%02X%02X%02X != %04X%04X", - (uint8_t)cdata[outer - 1], (uint8_t)cdata[outer - 2], - (uint8_t)cdata[outer - 3], (uint8_t)cdata[outer - 4], + (u_int8_t)cdata[outer - 1], (u_int8_t)cdata[outer - 2], + (u_int8_t)cdata[outer - 3], (u_int8_t)cdata[outer - 4], s2, s1); if ((x = compressor_get(c)->decompress(udata, *inner, cdata + 12, outer - 16)) != *inner) errx(1, "size mismatch: decompressed %lu, want %lu", (unsigned long)x, (unsigned long)*inner); - push_rndata((uint8_t *)cdata + outer, maxln - outer); + push_rndata((u_int8_t *)cdata + outer, maxln - outer); free(cdata); #ifdef DEBUG fprintf(stderr, "fwcf_unpack: decompressed outer %lu inner %lu\n", diff --git a/package/cfgfs/src/wraps.c b/package/cfgfs/src/wraps.c index 923aecbd8..288f6dbab 100644 --- a/package/cfgfs/src/wraps.c +++ b/package/cfgfs/src/wraps.c @@ -92,6 +92,6 @@ fwcf_pack(char *odata, size_t i, int algo, size_t *dstsz) data[k++] = 0; mktrailer(data, k); k += 4; - pull_rndata((uint8_t *)data + k, *dstsz - k); + pull_rndata((u_int8_t *)data + k, *dstsz - k); return (data); } |