From: Martin Mares Date: Tue, 5 Dec 2000 22:45:42 +0000 (+0000) Subject: Squashed a couple of warnings. X-Git-Tag: holmes-import~1620 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=82434b9e8d257be287b88a4f0d4e6f4a993106e2;p=libucw.git Squashed a couple of warnings. --- diff --git a/lib/fastbuf.c b/lib/fastbuf.c index 717372fd..1a5544fb 100644 --- a/lib/fastbuf.c +++ b/lib/fastbuf.c @@ -44,8 +44,6 @@ inline void bsetpos(struct fastbuf *f, sh_off_t pos) void bseek(struct fastbuf *f, sh_off_t pos, int whence) { - sh_off_t l; - switch (whence) { case SEEK_SET: diff --git a/lib/fastbuf.h b/lib/fastbuf.h index d5ca3e71..c62ed4cd 100644 --- a/lib/fastbuf.h +++ b/lib/fastbuf.h @@ -66,30 +66,30 @@ void bflush(struct fastbuf *f); void bseek(struct fastbuf *f, sh_off_t pos, int whence); void bsetpos(struct fastbuf *f, sh_off_t pos); -extern inline sh_off_t btell(struct fastbuf *f) +static inline sh_off_t btell(struct fastbuf *f) { return f->pos + (f->bptr - f->buffer); } int bgetc_slow(struct fastbuf *f); -extern inline int bgetc(struct fastbuf *f) +static inline int bgetc(struct fastbuf *f) { return (f->bptr < f->bstop) ? (int) *f->bptr++ : bgetc_slow(f); } int bpeekc_slow(struct fastbuf *f); -extern inline int bpeekc(struct fastbuf *f) +static inline int bpeekc(struct fastbuf *f) { return (f->bptr < f->bstop) ? (int) *f->bptr : bpeekc_slow(f); } -extern inline void bungetc(struct fastbuf *f, byte c) +static inline void bungetc(struct fastbuf *f, byte c) { *--f->bptr = c; } void bputc_slow(struct fastbuf *f, byte c); -extern inline void bputc(struct fastbuf *f, byte c) +static inline void bputc(struct fastbuf *f, byte c) { if (f->bptr < f->bufend) *f->bptr++ = c; @@ -98,7 +98,7 @@ extern inline void bputc(struct fastbuf *f, byte c) } word bgetw_slow(struct fastbuf *f); -extern inline word bgetw(struct fastbuf *f) +static inline word bgetw(struct fastbuf *f) { word w; if (f->bptr + 2 <= f->bstop) @@ -121,7 +121,7 @@ extern inline word bgetw(struct fastbuf *f) } u32 bgetl_slow(struct fastbuf *f); -extern inline u32 bgetl(struct fastbuf *f) +static inline u32 bgetl(struct fastbuf *f) { u32 l; if (f->bptr + 4 <= f->bstop) @@ -144,7 +144,7 @@ extern inline u32 bgetl(struct fastbuf *f) } u64 bgetq_slow(struct fastbuf *f); -extern inline u64 bgetq(struct fastbuf *f) +static inline u64 bgetq(struct fastbuf *f) { if (f->bptr + 8 <= f->bstop) { @@ -158,7 +158,7 @@ extern inline u64 bgetq(struct fastbuf *f) } u64 bget5_slow(struct fastbuf *f); -extern inline u64 bget5(struct fastbuf *f) +static inline u64 bget5(struct fastbuf *f) { u64 l; if (f->bptr + 5 <= f->bstop) @@ -177,7 +177,7 @@ extern inline u64 bget5(struct fastbuf *f) } void bputw_slow(struct fastbuf *f, word w); -extern inline void bputw(struct fastbuf *f, word w) +static inline void bputw(struct fastbuf *f, word w) { if (f->bptr + 2 <= f->bufend) { @@ -200,7 +200,7 @@ extern inline void bputw(struct fastbuf *f, word w) } void bputl_slow(struct fastbuf *f, u32 l); -extern inline void bputl(struct fastbuf *f, u32 l) +static inline void bputl(struct fastbuf *f, u32 l) { if (f->bptr + 4 <= f->bufend) { @@ -227,7 +227,7 @@ extern inline void bputl(struct fastbuf *f, u32 l) } void bputq_slow(struct fastbuf *f, u64 l); -extern inline void bputq(struct fastbuf *f, u64 l) +static inline void bputq(struct fastbuf *f, u64 l) { if (f->bptr + 8 <= f->bufend) { @@ -239,7 +239,7 @@ extern inline void bputq(struct fastbuf *f, u64 l) } void bput5_slow(struct fastbuf *f, u64 l); -extern inline void bput5(struct fastbuf *f, u64 l) +static inline void bput5(struct fastbuf *f, u64 l) { if (f->bptr + 5 <= f->bufend) { @@ -265,7 +265,7 @@ extern inline void bput5(struct fastbuf *f, u64 l) } void bread_slow(struct fastbuf *f, void *b, uns l); -extern inline void bread(struct fastbuf *f, void *b, uns l) +static inline void bread(struct fastbuf *f, void *b, uns l) { if (f->bptr + l <= f->bstop) { @@ -277,7 +277,7 @@ extern inline void bread(struct fastbuf *f, void *b, uns l) } void bwrite_slow(struct fastbuf *f, void *b, uns l); -extern inline void bwrite(struct fastbuf *f, void *b, uns l) +static inline void bwrite(struct fastbuf *f, void *b, uns l) { if (f->bptr + l <= f->bufend) { @@ -290,13 +290,13 @@ extern inline void bwrite(struct fastbuf *f, void *b, uns l) byte *bgets(struct fastbuf *f, byte *b, uns l); /* Non-std */ -extern inline void +static inline void bputs(struct fastbuf *f, byte *b) { bwrite(f, b, strlen(b)); } -extern inline void +static inline void bputsn(struct fastbuf *f, byte *b) { bputs(f, b); diff --git a/lib/fb-file.c b/lib/fb-file.c index 5fca69da..c111ab75 100644 --- a/lib/fb-file.c +++ b/lib/fb-file.c @@ -66,7 +66,7 @@ bfd_close(struct fastbuf *f) close(f->fd); } -struct fastbuf * +static struct fastbuf * bfdopen_internal(int fd, uns buflen, byte *name) { int namelen = strlen(name) + 1; diff --git a/lib/fb-mem.c b/lib/fb-mem.c index 2000a35f..4248c2fd 100644 --- a/lib/fb-mem.c +++ b/lib/fb-mem.c @@ -22,7 +22,7 @@ struct msblock { byte data[0]; }; -int +static int fbmem_refill(struct fastbuf *f) { struct memstream *s = f->lldata; @@ -52,7 +52,7 @@ fbmem_refill(struct fastbuf *f) return 1; } -void +static void fbmem_spout(struct fastbuf *f) { struct memstream *s = f->lldata; @@ -78,7 +78,7 @@ fbmem_spout(struct fastbuf *f) f->llpos = bb; } -void +static void fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) { struct memstream *m = f->lldata; @@ -103,7 +103,7 @@ fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) die("fbmem_seek to invalid offset"); } -void +static void fbmem_close(struct fastbuf *f) { struct memstream *m = f->lldata; diff --git a/lib/lfs.h b/lib/lfs.h index 44ba65c5..1b232119 100644 --- a/lib/lfs.h +++ b/lib/lfs.h @@ -39,7 +39,7 @@ #endif #endif -extern inline int +static inline int sh_open(char *name, int flags, int mode) { return open(name, flags | O_LARGEFILE, mode); @@ -54,7 +54,7 @@ sh_open(char *name, int flags, int mode) _syscall5(int, _llseek, int, fd, int, hi, int, lo, loff_t *, result, int, whence); -extern inline loff_t sh_seek(int fd, sh_off_t pos, int whence) +static inline loff_t sh_seek(int fd, sh_off_t pos, int whence) { loff_t result; int err; diff --git a/lib/pools.h b/lib/pools.h index 54658cf7..981dc3eb 100644 --- a/lib/pools.h +++ b/lib/pools.h @@ -20,7 +20,7 @@ void free_pool(struct mempool *); void flush_pool(struct mempool *); void *pool_alloc(struct mempool *, uns); -extern inline void *fast_alloc(struct mempool *p, uns l) +static inline void *fast_alloc(struct mempool *p, uns l) { byte *f = (void *) (((uns) p->free + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1)); byte *ee = f + l; @@ -30,7 +30,7 @@ extern inline void *fast_alloc(struct mempool *p, uns l) return f; } -extern inline void *fast_alloc_noalign(struct mempool *p, uns l) +static inline void *fast_alloc_noalign(struct mempool *p, uns l) { byte *f = p->free; byte *ee = f + l; diff --git a/lib/url.c b/lib/url.c index 3c1a0b8b..480ba180 100644 --- a/lib/url.c +++ b/lib/url.c @@ -302,7 +302,6 @@ copy: /* Combine part of old URL with the new one */ int url_normalize(struct url *u, struct url *b) { - byte *k; int err; /* Basic checks */ @@ -382,7 +381,7 @@ url_canonicalize(struct url *u) /* Pack a broken-down URL */ -byte * +static byte * append(byte *d, byte *s, byte *e) { if (d)