Fix signed/unsigned warnings.
This commit is contained in:
parent
323a574dc3
commit
60ae17c7ae
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: devopen.c,v 1.5 2001/06/01 23:26:31 jdolecek Exp $ */
|
||||
/* $NetBSD: devopen.c,v 1.6 2003/08/31 22:40:13 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -85,7 +85,7 @@ dev2bios(devname, unit, biosdev)
|
|||
unsigned int unit;
|
||||
int *biosdev;
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < NUMBIOSDEVS; i++)
|
||||
if (!strcmp(devname, biosdevtab[i].name)) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: main.c,v 1.18 2001/07/05 00:58:45 itojun Exp $ */
|
||||
/* $NetBSD: main.c,v 1.19 2003/08/31 22:40:13 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 1997
|
||||
|
@ -228,7 +228,7 @@ print_banner(void)
|
|||
* xmsmem is a few kB less than the actual size, but
|
||||
* better than nothing.
|
||||
*/
|
||||
if (xmsmem > extmem)
|
||||
if ((int)xmsmem > extmem)
|
||||
extmem = xmsmem;
|
||||
s = "(xms) ";
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dosfile.c,v 1.8 2003/08/18 15:47:41 dsl Exp $ */
|
||||
/* $NetBSD: dosfile.c,v 1.9 2003/08/31 22:40:14 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -123,7 +123,7 @@ dos_read(f, addr, size, resid)
|
|||
|
||||
while (lsize > 0) {
|
||||
u_int tsize;
|
||||
int tgot;
|
||||
size_t tgot;
|
||||
|
||||
tsize = lsize;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: 3c509.c,v 1.6 1999/02/19 19:30:46 drochner Exp $ */
|
||||
/* $NetBSD: 3c509.c,v 1.7 2003/08/31 22:40:14 fvdl Exp $ */
|
||||
|
||||
/* stripped down from freebsd:sys/i386/netboot/3c509.c */
|
||||
|
||||
|
@ -40,7 +40,7 @@ Author: Martin Renters.
|
|||
#include "etherdrv.h"
|
||||
#include "3c509.h"
|
||||
|
||||
int ether_medium;
|
||||
unsigned ether_medium;
|
||||
unsigned short eth_base;
|
||||
|
||||
extern void epreset __P((void));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: 3c590.c,v 1.11 1999/11/05 22:57:39 drochner Exp $ */
|
||||
/* $NetBSD: 3c590.c,v 1.12 2003/08/31 22:40:14 fvdl Exp $ */
|
||||
|
||||
/* stripped down from freebsd:sys/i386/netboot/3c509.c */
|
||||
|
||||
|
@ -46,7 +46,7 @@ Author: Martin Renters.
|
|||
#define EP_W3_INTERNAL_CONFIG 0x00 /* 32 bits */
|
||||
#define EP_W3_RESET_OPTIONS 0x08 /* 16 bits */
|
||||
|
||||
int ether_medium;
|
||||
unsigned ether_medium;
|
||||
unsigned short eth_base;
|
||||
|
||||
extern void epreset __P((void));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: 3c90xb.c,v 1.8 2002/02/19 20:38:28 thorpej Exp $ */
|
||||
/* $NetBSD: 3c90xb.c,v 1.9 2003/08/31 22:40:14 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
|
@ -89,7 +89,7 @@ void *dmamem; /* virtual */
|
|||
|
||||
static int iobase;
|
||||
static u_char myethaddr[6];
|
||||
int ether_medium;
|
||||
unsigned ether_medium;
|
||||
|
||||
static struct {
|
||||
int did;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: etherdrv.h,v 1.5 1999/12/02 13:20:56 drochner Exp $ */
|
||||
/* $NetBSD: etherdrv.h,v 1.6 2003/08/31 22:40:15 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -37,7 +37,7 @@ int EtherSend __P((char *, int));
|
|||
int EtherReceive __P((char *, int));
|
||||
void EtherStop __P((void));
|
||||
|
||||
extern int ether_medium;
|
||||
extern unsigned ether_medium;
|
||||
#define ETHERMEDIUM_BNC 0
|
||||
#define ETHERMEDIUM_UTP 1
|
||||
#define ETHERMEDIUM_AUI 2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nfs.c,v 1.7 2003/08/18 15:47:43 dsl Exp $ */
|
||||
/* $NetBSD: nfs.c,v 1.8 2003/08/31 22:40:15 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993 John Brezak
|
||||
|
@ -118,7 +118,7 @@ nfs_getrootfh(d, path, fhp)
|
|||
char *path;
|
||||
u_char *fhp;
|
||||
{
|
||||
int len;
|
||||
size_t len;
|
||||
struct args {
|
||||
n_long len;
|
||||
char path[FNAME_SIZE];
|
||||
|
@ -135,7 +135,7 @@ nfs_getrootfh(d, path, fhp)
|
|||
n_long h[RPC_HEADER_WORDS];
|
||||
struct repl d;
|
||||
} rdata;
|
||||
size_t cc;
|
||||
ssize_t cc;
|
||||
|
||||
#ifdef NFS_DEBUG
|
||||
if (debug)
|
||||
|
@ -209,7 +209,7 @@ nfs_lookupfh(d, name, len, newfd)
|
|||
|
||||
memset(args, 0, sizeof(*args));
|
||||
memcpy(args->fh, d->fh, sizeof(args->fh));
|
||||
if (len > sizeof(args->name))
|
||||
if ((size_t)len > sizeof(args->name))
|
||||
len = sizeof(args->name);
|
||||
memcpy(args->name, name, len);
|
||||
args->len = htonl(len);
|
||||
|
@ -301,7 +301,7 @@ nfs_readdata(d, off, addr, len)
|
|||
n_long h[RPC_HEADER_WORDS];
|
||||
struct nfs_read_repl d;
|
||||
} rdata;
|
||||
size_t cc;
|
||||
ssize_t cc;
|
||||
long x;
|
||||
int hlen, rlen;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: arp.c,v 1.23 2002/09/27 15:37:48 provos Exp $ */
|
||||
/* $NetBSD: arp.c,v 1.24 2003/08/31 22:40:47 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -208,7 +208,7 @@ arprecv(d, pkt, len, tleft)
|
|||
|
||||
n = readether(d, pkt, len, tleft, &etype);
|
||||
errno = 0; /* XXX */
|
||||
if (n == -1 || n < sizeof(struct ether_arp)) {
|
||||
if (n == -1 || (size_t)n < sizeof(struct ether_arp)) {
|
||||
#ifdef ARP_DEBUG
|
||||
if (debug)
|
||||
printf("bad len=%ld\n", (signed long) n);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bootp.c,v 1.24 2003/03/12 14:51:31 drochner Exp $ */
|
||||
/* $NetBSD: bootp.c,v 1.25 2003/08/31 22:40:47 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -306,7 +306,7 @@ bootprecv(d, pkt, len, tleft)
|
|||
#endif
|
||||
|
||||
n = readudp(d, pkt, len, tleft);
|
||||
if (n == -1 || n < sizeof(struct bootp) - BOOTP_VENDSIZE)
|
||||
if (n == -1 || (size_t)n < sizeof(struct bootp) - BOOTP_VENDSIZE)
|
||||
goto bad;
|
||||
|
||||
bp = (struct bootp *)pkt;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dosfs.c,v 1.7 2003/08/18 15:45:27 dsl Exp $ */
|
||||
/* $NetBSD: dosfs.c,v 1.8 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 1998 Robert Nordier
|
||||
|
@ -132,9 +132,9 @@ static const struct direntry dot[2] = {
|
|||
#define okclus(fs, c) ((c) >= LOCLUS && (c) <= (fs)->xclus)
|
||||
|
||||
/* Get start cluster from directory entry */
|
||||
#define stclus(sz, de) ((sz) != 32 ? getushort((de)->deStartCluster) : \
|
||||
#define stclus(sz, de) ((sz) != 32 ? (u_int)getushort((de)->deStartCluster) : \
|
||||
((u_int)getushort((de)->deHighClust) << 16) | \
|
||||
getushort((de)->deStartCluster))
|
||||
(u_int)getushort((de)->deStartCluster))
|
||||
|
||||
static int dosunmount(DOS_FS *);
|
||||
static int parsebs(DOS_FS *, DOS_BS *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ether.c,v 1.17 2003/03/12 16:46:31 drochner Exp $ */
|
||||
/* $NetBSD: ether.c,v 1.18 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -81,7 +81,7 @@ sendether(d, pkt, len, dea, etype)
|
|||
eh->ether_type = htons(etype);
|
||||
|
||||
n = netif_put(d, eh, len);
|
||||
if (n == -1 || n < sizeof(*eh))
|
||||
if (n == -1 || (size_t)n < sizeof(*eh))
|
||||
return (-1);
|
||||
|
||||
n -= sizeof(*eh);
|
||||
|
@ -113,7 +113,7 @@ readether(d, pkt, len, tleft, etype)
|
|||
len += sizeof(*eh);
|
||||
|
||||
n = netif_get(d, eh, len, tleft);
|
||||
if (n == -1 || n < sizeof(*eh))
|
||||
if (n == -1 || (size_t)n < sizeof(*eh))
|
||||
return (-1);
|
||||
|
||||
/* Validate Ethernet address. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: exec.c,v 1.22 2003/08/07 16:32:27 agc Exp $ */
|
||||
/* $NetBSD: exec.c,v 1.23 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
|
@ -88,7 +88,7 @@ exec(path, loadaddr, howto)
|
|||
addr += sizeof(x);
|
||||
x.a_text -= sizeof(x);
|
||||
}
|
||||
if (read(io, (char *)addr, x.a_text) != x.a_text)
|
||||
if (read(io, (char *)addr, x.a_text) != (ssize_t)x.a_text)
|
||||
goto shread;
|
||||
addr += x.a_text;
|
||||
if (N_GETMAGIC(x) == ZMAGIC || N_GETMAGIC(x) == NMAGIC)
|
||||
|
@ -97,13 +97,13 @@ exec(path, loadaddr, howto)
|
|||
|
||||
/* Data */
|
||||
printf("+%ld", x.a_data);
|
||||
if (read(io, addr, x.a_data) != x.a_data)
|
||||
if (read(io, addr, x.a_data) != (ssize_t)x.a_data)
|
||||
goto shread;
|
||||
addr += x.a_data;
|
||||
|
||||
/* Bss */
|
||||
printf("+%ld", x.a_bss);
|
||||
for (i = 0; i < x.a_bss; i++)
|
||||
for (i = 0; i < (int)x.a_bss; i++)
|
||||
*addr++ = 0;
|
||||
|
||||
/* Symbols */
|
||||
|
@ -112,7 +112,7 @@ exec(path, loadaddr, howto)
|
|||
addr += sizeof(x.a_syms);
|
||||
if (x.a_syms) {
|
||||
printf("+[%ld", x.a_syms);
|
||||
if (read(io, addr, x.a_syms) != x.a_syms)
|
||||
if (read(io, addr, x.a_syms) != (ssize_t)x.a_syms)
|
||||
goto shread;
|
||||
addr += x.a_syms;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ffsv1.c,v 1.1 2003/04/11 11:28:54 dsl Exp $ */
|
||||
/* $NetBSD: ffsv1.c,v 1.2 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
#define LIBSA_FFSv1
|
||||
|
||||
|
@ -10,6 +10,6 @@
|
|||
#define ufs_stat ffsv1_stat
|
||||
|
||||
#define ufs_dinode ufs1_dinode
|
||||
#define indp_t uint32_t
|
||||
#define indp_t int32_t
|
||||
|
||||
#include "ufs.c"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ffsv2.c,v 1.1 2003/04/11 11:28:55 dsl Exp $ */
|
||||
/* $NetBSD: ffsv2.c,v 1.2 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
#define LIBSA_FFSv2
|
||||
|
||||
|
@ -10,6 +10,6 @@
|
|||
#define ufs_stat ffsv2_stat
|
||||
|
||||
#define ufs_dinode ufs2_dinode
|
||||
#define indp_t uint64_t
|
||||
#define indp_t int64_t
|
||||
|
||||
#include "ufs.c"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: loadfile_aout.c,v 1.5 2003/08/07 16:32:28 agc Exp $ */
|
||||
/* $NetBSD: loadfile_aout.c,v 1.6 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -144,7 +144,8 @@ loadfile_aout(fd, x, marks, flags)
|
|||
if (flags & LOAD_TEXT) {
|
||||
PROGRESS(("%ld", x->a_text));
|
||||
|
||||
if (READ(fd, maxp, x->a_text - sub) != x->a_text - sub) {
|
||||
if (READ(fd, maxp, x->a_text - sub) !=
|
||||
(ssize_t)(x->a_text - sub)) {
|
||||
WARN(("read text"));
|
||||
return 1;
|
||||
}
|
||||
|
@ -178,7 +179,7 @@ loadfile_aout(fd, x, marks, flags)
|
|||
if (flags & LOAD_DATA) {
|
||||
PROGRESS(("+%ld", x->a_data));
|
||||
|
||||
if (READ(fd, maxp, x->a_data) != x->a_data) {
|
||||
if (READ(fd, maxp, x->a_data) != (ssize_t)x->a_data) {
|
||||
WARN(("read data"));
|
||||
return 1;
|
||||
}
|
||||
|
@ -223,7 +224,7 @@ loadfile_aout(fd, x, marks, flags)
|
|||
if (flags & LOAD_SYM) {
|
||||
PROGRESS(("+[%ld", x->a_syms));
|
||||
|
||||
if (READ(fd, maxp, x->a_syms) != x->a_syms) {
|
||||
if (READ(fd, maxp, x->a_syms) != (ssize_t)x->a_syms) {
|
||||
WARN(("read symbols"));
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: loadfile_elf32.c,v 1.7 2002/02/11 20:25:56 reinoud Exp $ */
|
||||
/* $NetBSD: loadfile_elf32.c,v 1.8 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -272,7 +272,7 @@ ELFNAMEEND(loadfile)(fd, elf, marks, flags)
|
|||
Elf_Shdr *shp;
|
||||
Elf_Phdr *phdr;
|
||||
int i, j;
|
||||
size_t sz;
|
||||
ssize_t sz;
|
||||
int first;
|
||||
paddr_t minp = ~0, maxp = 0, pos = 0;
|
||||
paddr_t offset = marks[MARK_START], shpp, elfp = NULL;
|
||||
|
@ -321,7 +321,7 @@ ELFNAMEEND(loadfile)(fd, elf, marks, flags)
|
|||
return 1;
|
||||
}
|
||||
if (READ(fd, phdr[i].p_vaddr, phdr[i].p_filesz) !=
|
||||
phdr[i].p_filesz) {
|
||||
(ssize_t)phdr[i].p_filesz) {
|
||||
WARN(("read text"));
|
||||
FREE(phdr, sz);
|
||||
return 1;
|
||||
|
@ -397,7 +397,7 @@ ELFNAMEEND(loadfile)(fd, elf, marks, flags)
|
|||
case SHT_STRTAB:
|
||||
for (j = 0; j < elf->e_shnum; j++)
|
||||
if (shp[j].sh_type == SHT_SYMTAB &&
|
||||
shp[j].sh_link == i)
|
||||
shp[j].sh_link == (unsigned)i)
|
||||
goto havesym;
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
|
@ -416,7 +416,7 @@ ELFNAMEEND(loadfile)(fd, elf, marks, flags)
|
|||
return 1;
|
||||
}
|
||||
if (READ(fd, maxp, shp[i].sh_size) !=
|
||||
shp[i].sh_size) {
|
||||
(ssize_t)shp[i].sh_size) {
|
||||
WARN(("read symbols"));
|
||||
FREE(shp, sz);
|
||||
return 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: net.c,v 1.27 2000/10/25 01:49:55 thorpej Exp $ */
|
||||
/* $NetBSD: net.c,v 1.28 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -98,7 +98,7 @@ sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
|
|||
return -1;
|
||||
}
|
||||
cc = (*sproc)(d, sbuf, ssize);
|
||||
if (cc != -1 && cc < ssize)
|
||||
if (cc != -1 && (size_t)cc < ssize)
|
||||
panic("sendrecv: short write! (%d < %d)",
|
||||
cc, ssize);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nfs.c,v 1.32 2003/08/18 15:45:28 dsl Exp $ */
|
||||
/* $NetBSD: nfs.c,v 1.33 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993 John Brezak
|
||||
|
@ -144,7 +144,7 @@ nfs_getrootfh(d, path, fhp)
|
|||
n_long h[RPC_HEADER_WORDS];
|
||||
struct repl d;
|
||||
} rdata;
|
||||
size_t cc;
|
||||
ssize_t cc;
|
||||
|
||||
#ifdef NFS_DEBUG
|
||||
if (debug)
|
||||
|
@ -156,7 +156,7 @@ nfs_getrootfh(d, path, fhp)
|
|||
|
||||
bzero(args, sizeof(*args));
|
||||
len = strlen(path);
|
||||
if (len > sizeof(args->path))
|
||||
if ((size_t)len > sizeof(args->path))
|
||||
len = sizeof(args->path);
|
||||
args->len = htonl(len);
|
||||
bcopy(path, args->path, len);
|
||||
|
@ -222,7 +222,7 @@ nfs_lookupfh(d, name, len, newfd)
|
|||
|
||||
bzero(args, sizeof(*args));
|
||||
bcopy(d->fh, args->fh, sizeof(args->fh));
|
||||
if (len > sizeof(args->name))
|
||||
if ((size_t)len > sizeof(args->name))
|
||||
len = sizeof(args->name);
|
||||
bcopy(name, args->name, len);
|
||||
args->len = htonl(len);
|
||||
|
@ -314,9 +314,9 @@ nfs_readdata(d, off, addr, len)
|
|||
n_long h[RPC_HEADER_WORDS];
|
||||
struct nfs_read_repl d;
|
||||
} rdata;
|
||||
size_t cc;
|
||||
ssize_t cc;
|
||||
long x;
|
||||
int hlen, rlen;
|
||||
size_t hlen, rlen;
|
||||
|
||||
args = &sdata.d;
|
||||
repl = &rdata.d;
|
||||
|
@ -336,7 +336,7 @@ nfs_readdata(d, off, addr, len)
|
|||
/* errno was already set by rpc_call */
|
||||
return (-1);
|
||||
}
|
||||
if (cc < hlen) {
|
||||
if (cc < (ssize_t)hlen) {
|
||||
errno = EBADRPC;
|
||||
return (-1);
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ nfs_readdata(d, off, addr, len)
|
|||
}
|
||||
rlen = cc - hlen;
|
||||
x = ntohl(repl->count);
|
||||
if (rlen < x) {
|
||||
if (rlen < (size_t)x) {
|
||||
printf("nfsread: short packet, %d < %ld\n", rlen, x);
|
||||
errno = EBADRPC;
|
||||
return(-1);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rarp.c,v 1.21 2003/03/12 14:51:31 drochner Exp $ */
|
||||
/* $NetBSD: rarp.c,v 1.22 2003/08/31 22:40:48 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -193,7 +193,7 @@ rarprecv(d, pkt, len, tleft)
|
|||
|
||||
n = readether(d, pkt, len, tleft, &etype);
|
||||
errno = 0; /* XXX */
|
||||
if (n == -1 || n < sizeof(struct ether_arp)) {
|
||||
if (n == -1 || (size_t)n < sizeof(struct ether_arp)) {
|
||||
#ifdef RARP_DEBUG
|
||||
if (debug)
|
||||
printf("bad len=%d\n", n);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rpc.c,v 1.22 2003/03/12 14:51:32 drochner Exp $ */
|
||||
/* $NetBSD: rpc.c,v 1.23 2003/08/31 22:40:49 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -197,7 +197,7 @@ rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen)
|
|||
if (cc == -1)
|
||||
return (-1);
|
||||
|
||||
if (cc <= sizeof(*reply)) {
|
||||
if ((size_t)cc <= sizeof(*reply)) {
|
||||
errno = EBADRPC;
|
||||
return (-1);
|
||||
}
|
||||
|
@ -430,7 +430,7 @@ rpc_getport(d, prog, vers)
|
|||
|
||||
cc = rpc_call(d, PMAPPROG, PMAPVERS, PMAPPROC_GETPORT,
|
||||
args, sizeof(*args), res, sizeof(*res));
|
||||
if (cc < sizeof(*res)) {
|
||||
if ((size_t)cc < sizeof(*res)) {
|
||||
printf("getport: %s", strerror(errno));
|
||||
errno = EBADRPC;
|
||||
return (-1);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tftp.c,v 1.15 2003/08/18 15:45:29 dsl Exp $ */
|
||||
/* $NetBSD: tftp.c,v 1.16 2003/08/31 22:40:49 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -301,7 +301,8 @@ tftp_read(f, addr, size, resid)
|
|||
tftpfile = (struct tftp_handle *) f->f_fsdata;
|
||||
|
||||
while (size > 0) {
|
||||
int needblock, count;
|
||||
int needblock;
|
||||
size_t count;
|
||||
|
||||
#if !defined(LIBSA_NO_TWIDDLE)
|
||||
if (!(tc++ % 16))
|
||||
|
@ -334,7 +335,7 @@ tftp_read(f, addr, size, resid)
|
|||
}
|
||||
|
||||
if (tftpfile->currblock == needblock) {
|
||||
int offinblock, inbuffer;
|
||||
size_t offinblock, inbuffer;
|
||||
|
||||
offinblock = tftpfile->off % SEGSIZE;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: udp.c,v 1.2 2002/04/23 09:16:09 ragge Exp $ */
|
||||
/* $NetBSD: udp.c,v 1.3 2003/08/31 22:40:49 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
|
@ -129,7 +129,7 @@ sendudp(d, pkt, len)
|
|||
cc = sendether(d, ip, len, ea, ETHERTYPE_IP);
|
||||
if (cc == -1)
|
||||
return (-1);
|
||||
if (cc != len)
|
||||
if ((size_t)cc != len)
|
||||
panic("sendudp: bad write (%d != %d)", cc, len);
|
||||
return (cc - (sizeof(*ip) + sizeof(*uh)));
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ readudp(d, pkt, len, tleft)
|
|||
ip = (struct ip *)uh - 1;
|
||||
|
||||
n = readether(d, ip, len + sizeof(*ip) + sizeof(*uh), tleft, &etype);
|
||||
if (n == -1 || n < sizeof(*ip) + sizeof(*uh))
|
||||
if (n == -1 || (size_t)n < sizeof(*ip) + sizeof(*uh))
|
||||
return -1;
|
||||
|
||||
/* Ethernet address checks now in readether() */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ufs.c,v 1.41 2003/08/27 22:42:08 dsl Exp $ */
|
||||
/* $NetBSD: ufs.c,v 1.42 2003/08/31 22:40:49 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
|
@ -222,7 +222,7 @@ read_inode(ino_t inumber, struct open_file *f)
|
|||
struct file *fp = (struct file *)f->f_fsdata;
|
||||
struct fs *fs = fp->f_fs;
|
||||
char *buf;
|
||||
size_t rsize;
|
||||
ssize_t rsize;
|
||||
int rc;
|
||||
daddr_t inode_sector;
|
||||
#ifdef LIBSA_LFS
|
||||
|
@ -248,7 +248,7 @@ read_inode(ino_t inumber, struct open_file *f)
|
|||
inode_sector, fs->fs_bsize, buf, &rsize);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (rsize != fs->fs_bsize)
|
||||
if (rsize != (ssize_t)fs->fs_bsize)
|
||||
return EIO;
|
||||
|
||||
#ifdef LIBSA_LFS
|
||||
|
@ -281,10 +281,10 @@ block_map(struct open_file *f, indp_t file_block, indp_t *disk_block_p)
|
|||
{
|
||||
struct file *fp = (struct file *)f->f_fsdata;
|
||||
struct fs *fs = fp->f_fs;
|
||||
int level;
|
||||
unsigned level;
|
||||
indp_t ind_cache;
|
||||
indp_t ind_block_num;
|
||||
size_t rsize;
|
||||
ssize_t rsize;
|
||||
int rc;
|
||||
indp_t *buf = (void *)fp->f_buf;
|
||||
|
||||
|
@ -356,7 +356,7 @@ block_map(struct open_file *f, indp_t file_block, indp_t *disk_block_p)
|
|||
buf, &rsize);
|
||||
if (rc)
|
||||
return (rc);
|
||||
if (rsize != fs->fs_bsize)
|
||||
if (rsize != (ssize_t)fs->fs_bsize)
|
||||
return EIO;
|
||||
ind_block_num = buf[file_block >> level];
|
||||
if (level == 0)
|
||||
|
@ -394,7 +394,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
|
|||
#ifdef LIBSA_LFS
|
||||
block_size = dblksize(fs, &fp->f_di, file_block);
|
||||
#else
|
||||
block_size = sblksize(fs, fp->f_di.di_size, file_block);
|
||||
block_size = sblksize(fs, (int64_t)fp->f_di.di_size, file_block);
|
||||
#endif
|
||||
|
||||
if (file_block != fp->f_buf_blkno) {
|
||||
|
@ -451,7 +451,7 @@ search_directory(const char *name, int length, struct open_file *f,
|
|||
int rc;
|
||||
|
||||
fp->f_seekp = 0;
|
||||
while (fp->f_seekp < fp->f_di.di_size) {
|
||||
while (fp->f_seekp < (off_t)fp->f_di.di_size) {
|
||||
rc = buf_read_file(f, &buf, &buf_size);
|
||||
if (rc)
|
||||
return (rc);
|
||||
|
@ -570,7 +570,8 @@ ufs_open(const char *path, struct open_file *f)
|
|||
ffs_oldfscompat(fs);
|
||||
#endif
|
||||
|
||||
if (fs->fs_bsize > MAXBSIZE || fs->fs_bsize < sizeof(struct fs)) {
|
||||
if (fs->fs_bsize > MAXBSIZE ||
|
||||
(size_t)fs->fs_bsize < sizeof(struct fs)) {
|
||||
rc = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -767,7 +768,7 @@ ufs_read(struct open_file *f, void *start, size_t size, size_t *resid)
|
|||
char *addr = start;
|
||||
|
||||
while (size != 0) {
|
||||
if (fp->f_seekp >= fp->f_di.di_size)
|
||||
if (fp->f_seekp >= (off_t)fp->f_di.di_size)
|
||||
break;
|
||||
|
||||
rc = buf_read_file(f, &buf, &buf_size);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ustarfs.c,v 1.22 2003/08/18 15:45:30 dsl Exp $ */
|
||||
/* $NetBSD: ustarfs.c,v 1.23 2003/08/31 22:40:49 fvdl Exp $ */
|
||||
|
||||
/* [Notice revision 2.2]
|
||||
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
|
||||
|
@ -259,7 +259,7 @@ checksig(ustf)
|
|||
{
|
||||
int i, rcs;
|
||||
|
||||
for(i = rcs = 0; i < sizeof ustf->uas_1cyl; ++i)
|
||||
for(i = rcs = 0; i < (int)(sizeof ustf->uas_1cyl); ++i)
|
||||
rcs += ustf->uas_1cyl[i];
|
||||
return rcs;
|
||||
}
|
||||
|
@ -350,7 +350,8 @@ read512block(f, vda, block)
|
|||
tryagain:
|
||||
if(ustf->uas_init_window
|
||||
&& ustf->uas_windowbase <= vda && vda <
|
||||
ustf->uas_windowbase + sizeof ustf->uas_1cyl - ustf->uas_offset) {
|
||||
ustf->uas_windowbase +
|
||||
(int)(sizeof ustf->uas_1cyl) - ustf->uas_offset) {
|
||||
memcpy(block, ustf->uas_1cyl
|
||||
+ (vda - ustf->uas_windowbase)
|
||||
+ ustf->uas_offset, 512);
|
||||
|
@ -505,7 +506,7 @@ ustarfs_read(f, start, size, resid)
|
|||
readoffs,
|
||||
bufferoffset;
|
||||
size_t seg;
|
||||
int infile,
|
||||
size_t infile,
|
||||
inbuffer;
|
||||
|
||||
e = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: inftrees.c,v 1.6 2003/03/18 19:33:51 mycroft Exp $ */
|
||||
/* $NetBSD: inftrees.c,v 1.7 2003/08/31 22:40:49 fvdl Exp $ */
|
||||
|
||||
/* inftrees.c -- generate Huffman trees for efficient decoding
|
||||
* Copyright (C) 1995-2002 Mark Adler
|
||||
|
@ -215,7 +215,7 @@ uIntf *v; /* working area: values in order of bit length */
|
|||
|
||||
/* compute minimum size table less than or equal to l bits */
|
||||
z = g - w;
|
||||
z = z > (uInt)l ? l : z; /* table size upper limit */
|
||||
z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */
|
||||
if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
|
||||
{ /* too few codes for k-w bit table */
|
||||
f -= a + 1; /* deduct codes from patterns left */
|
||||
|
|
Loading…
Reference in New Issue