lib: fixes for warnings that clang has for libraries.

This commit is contained in:
Ben Gras 2010-07-06 12:08:22 +00:00
parent f6f814cb02
commit 68db8ed0b9
36 changed files with 65 additions and 45 deletions

View file

@ -181,7 +181,7 @@ parseRule(register char *buf, register const char *p)
if (*p == '/') {
q = ++p;
if (!(p = parseTime(&time, p, &dstend))) return NULL;
while(*buf++ = *q++);
while((*buf++ = *q++));
}
if (*p) return NULL;
return p;

View file

@ -15,7 +15,7 @@ sighandler_t disp; /* signal handler, or SIG_DFL, or SIG_IGN */
errno = EINVAL;
return(SIG_ERR);
}
sigemptyset(&sa.sa_mask);
(void) sigemptyset(&sa.sa_mask);
#ifdef WANT_UNRELIABLE_SIGNALS
/* Allow the signal being handled to interrupt the signal handler. */

View file

@ -47,7 +47,7 @@ getnetbyaddr(net, type)
register struct netent *p;
setnetent(_net_stayopen);
while (p = getnetent())
while ((p = getnetent()))
if (p->n_addrtype == type && p->n_net == net)
break;
if (!_net_stayopen)

View file

@ -48,7 +48,7 @@ getnetbyname(name)
register char **cp;
setnetent(_net_stayopen);
while (p = getnetent()) {
while ((p = getnetent())) {
if (strcmp(p->n_name, name) == 0)
break;
for (cp = p->n_aliases; *cp != 0; cp++)

View file

@ -37,7 +37,7 @@ getprotobynumber(proto)
register struct protoent *p;
setprotoent(_proto_stayopen);
while (p = getprotoent())
while ((p = getprotoent()))
if (p->p_proto == proto)
break;
if (!_proto_stayopen)

View file

@ -114,7 +114,7 @@ any(cp, match)
{
register char *mp, c;
while (c = *cp) {
while ((c = *cp)) {
for (mp = match; *mp; mp++)
if (*mp == c)
return (cp);

View file

@ -115,7 +115,7 @@ any(cp, match)
{
register char *mp, c;
while (c = *cp) {
while ((c = *cp)) {
for (mp = match; *mp; mp++)
if (*mp == c)
return (cp);

View file

@ -35,7 +35,7 @@ getservbyname(name, proto)
register char **cp;
setservent(_serv_stayopen);
while (p = getservent()) {
while ((p = getservent())) {
if (strcmp(name, p->s_name) == 0)
goto gotname;
for (cp = p->s_aliases; *cp; cp++)

View file

@ -38,7 +38,7 @@ getservbyport(port, proto)
register struct servent *p;
setservent(_serv_stayopen);
while (p = getservent()) {
while ((p = getservent())) {
if (p->s_port != port)
continue;
if (proto == 0 || strcmp(p->s_proto, proto) == 0)

View file

@ -62,7 +62,7 @@ again:
base = 8, cp++;
if (*cp == 'x' || *cp == 'X')
base = 16, cp++;
while (c = *cp) {
while ((c = *cp)) {
if (isdigit(c)) {
val = (val * base) + (c - '0');
cp++;

View file

@ -58,6 +58,7 @@ static int dn_find();
* 'exp_dn' is a pointer to a buffer of size 'length' for the result.
* Return size of compressed name or -1 if there was an error.
*/
int
dn_expand(msg, eomorig, comp_dn, exp_dn, length)
CONST u_char *msg, *eomorig, *comp_dn;
u_char *exp_dn;
@ -75,7 +76,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
/*
* fetch next label in domain name
*/
while (n = *cp++) {
while ((n = *cp++)) {
/*
* Check for indirection
*/
@ -220,6 +221,7 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
/*
* Skip over a compressed domain name. Return the size or -1.
*/
int
dn_skipname(comp_dn, eom)
CONST u_char *comp_dn, *eom;
{
@ -264,7 +266,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
dn = exp_dn;
sp = cp = *cpp;
while (n = *cp++) {
while ((n = *cp++)) {
/*
* check for indirection
*/

View file

@ -55,6 +55,7 @@ static char sccsid[] = "@(#)res_mkquery.c 6.12 (Berkeley) 6/1/90";
* Form all types of queries.
* Returns the size of the result or -1.
*/
int
res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
int op; /* opcode of query */
_CONST char *dname; /* domain name */

View file

@ -154,6 +154,7 @@ res_query(name, class, type, answer, anslen)
* Only useful for queries in the same name hierarchy as the local host
* (not, for example, for host address-to-name lookups in domain in-addr.arpa).
*/
int
res_search(name, class, type, answer, anslen)
char *name; /* domain name */
int class, type; /* class and type of query */

View file

@ -105,6 +105,7 @@ static struct sockaddr no_addr;
#endif /* FD_SET */
#endif /* _MINIX */
int
res_send(buf, buflen, answer, anslen)
const char *buf;
int buflen;

View file

@ -61,18 +61,18 @@ static int match(const char *word, const char *pattern)
#define lc(c, d) ((((c)= (d)) - 'A') <= ('Z' - 'A') ? (c)+= ('a' - 'A') : 0)
for (;;) {
lc(cw, *word);
lc(cp, *pattern);
(void) lc(cw, *word);
(void) lc(cp, *pattern);
if (cp == '*') {
do pattern++; while (*pattern == '*');
lc(cp, *pattern);
(void) lc(cp, *pattern);
if (cp == 0) return 1;
while (cw != 0) {
if (cw == cp && match(word+1, pattern+1)) return 1;
word++;
lc(cw, *word);
(void) lc(cw, *word);
}
return 0;
} else

View file

@ -96,18 +96,18 @@ static int match(const char *word, const char *pattern)
#define lc(c, d) ((((c)= (d)) - 'A') <= ('Z' - 'A') ? (c)+= ('a' - 'A') : 0)
for (;;) {
lc(cw, *word);
lc(cp, *pattern);
(void) lc(cw, *word);
(void) lc(cp, *pattern);
if (cp == '*') {
do pattern++; while (*pattern == '*');
lc(cp, *pattern);
(void) lc(cp, *pattern);
if (cp == 0) return 1;
while (cw != 0) {
if (cw == cp && match(word+1, pattern+1)) return 1;
word++;
lc(cw, *word);
(void) lc(cw, *word);
}
return 0;
} else

View file

@ -15,6 +15,7 @@
#include <minix/type.h>
#include <minix/const.h>
#include <stdio.h>
#include <stdlib.h>
#include <machine/archtypes.h>
#include "../../../kernel/proc.h"

View file

@ -65,7 +65,7 @@ int mountflags;
sprintf(label, "fs_%.12s", p);
} else {
if (stat(name, &statbuf) < 0) return -1;
sprintf(label, "fs_%04x%x", statbuf.st_dev, statbuf.st_ino);
sprintf(label, "fs_%04x%lx", statbuf.st_dev, statbuf.st_ino);
}
/* Tell VFS that we are passing in a 16-byte label. */

View file

@ -12,7 +12,6 @@ struct complex {
};
_PROTOTYPE(double hypot, (double x, double y ));
_PROTOTYPE(double cabs, (struct complex p_compl ));
/* $Header$ */
@ -34,9 +33,14 @@ hypot(double x, double y)
return y*sqrt(x*x+1.0);
}
#if 0
_PROTOTYPE(double cabs, (struct complex p_compl ));
double
cabs(p_compl)
struct complex p_compl;
{
return hypot(p_compl.r, p_compl.i);
}
#endif

View file

@ -26,7 +26,7 @@ char *name;
if (!name) return 0;
if (*_penviron == NULL) return 1;
if (r = strchr(name, '=')) {
if ((r = strchr(name, '='))) {
register _CONST char *p, *q;
*r = '\0';
@ -65,7 +65,7 @@ char *name;
size = i;
p = *_penviron;
*_penviron = v;
while (*v++ = *p++); /* copy the environment */
while ((*v++ = *p++)); /* copy the environment */
v = *_penviron;
} else if (!(size % ENTRY_INC)) {
if (!(v = realloc(*_penviron, rounded(size) * sizeof(char **))))

View file

@ -16,7 +16,7 @@ register FILE *stream;
register char *p = (char *) &w;
while (cnt--) {
putc(*p++, stream);
(void) putc(*p++, stream);
}
if (ferror(stream)) return EOF;
return w;

View file

@ -47,6 +47,7 @@ char *__findenv(const char *, int *);
* Set the value of the environmental variable "name" to be
* "value". If rewrite is set, replace any current value.
*/
int
setenv(name, value, rewrite)
register const char *name;
register const char *value;
@ -64,7 +65,7 @@ setenv(name, value, rewrite)
if (!rewrite)
return (0);
if (strlen(c) >= l_value) { /* old larger; copy over */
while (*c++ = *value++);
while ((*c++ = *value++));
return (0);
}
} else { /* create new slot */
@ -94,7 +95,7 @@ setenv(name, value, rewrite)
malloc((size_t)((int)(c - name) + l_value + 2))))
return (-1);
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
for (*c++ = '='; *c++ = *value++;);
for (*c++ = '='; (*c++ = *value++););
return (0);
}

View file

@ -686,6 +686,7 @@ sopno lev; /* PLUS nesting level */
/* "can't happen" */
assert(nope);
/* NOTREACHED */
_exit(1);
}
/*

View file

@ -53,6 +53,7 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <unistd.h>
#ifdef __minix_vmd
#include <bsd/asciictype.h>
#else

View file

@ -131,7 +131,7 @@ _doprnt(register const char *fmt, va_list ap, FILE *stream)
const char *oldfmt;
char *s1, buf[1025];
while (c = *fmt++) {
while ((c = *fmt++)) {
if (c != '%') {
#ifdef CPM
if (c == '\n') {

View file

@ -46,6 +46,7 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
static int _gettemp(char*,int*);
int
mkstemp(path)
char *path;
{
@ -61,7 +62,7 @@ mktemp(path)
return(_gettemp(path, (int *)NULL) ? path : (char *)NULL);
}
static
static int
_gettemp(path, doopen)
char *path;
register int *doopen;

View file

@ -22,7 +22,7 @@ vsnprintf(char *s, size_t n, const char *format, va_list arg)
retval = _doprnt(format, arg, &tmp_stream);
tmp_stream._count = 1;
putc('\0',&tmp_stream);
(void) putc('\0',&tmp_stream);
return retval;
}

View file

@ -48,7 +48,7 @@ char *s;
void outc(c)
int c;
{
putchar(c);
(void) putchar(c);
}
/* Move cursor to r,c */

View file

@ -58,7 +58,7 @@ int ch;
{
if ((_cursvar.cursrow < LINES) || (_cursvar.curscol < COLS)) {
newattr(ch);
putchar(ch);
(void) putchar(ch);
}
}

View file

@ -17,7 +17,7 @@ WINDOW *win;
}
inp = getchar();
if (_cursvar.echoit) {
mvwaddch(curscr, win->_cury + win->_begy,
(void) mvwaddch(curscr, win->_cury + win->_begy,
win->_curx + win->_begx, inp);
waddch(win, inp);
}

View file

@ -5,6 +5,8 @@
#include <signal.h>
#include <errno.h>
#include <ctype.h>
#include <termcap.h>
#include <unistd.h>
/*
** Manifest constants.

View file

@ -18,12 +18,8 @@ PUBLIC void panic(const char *fmt, ...)
endpoint_t me = NONE;
char name[20];
void (*suicide)(void);
static int panicing= 0;
va_list args;
if(panicing) return;
panicing= 1;
if(sys_whoami(&me, name, sizeof(name)) == OK && me != NONE)
printf("%s(%d): panic: ", name, me);
else

View file

@ -166,6 +166,7 @@ PUBLIC void _exit(int status)
{
/* Make exit() an alias for sef_exit() for system services. */
sef_exit(status);
panic("sef_exit failed");
}
/*===========================================================================*
@ -175,6 +176,7 @@ PUBLIC void __exit(int status)
{
/* Make exit() an alias for sef_exit() for system services. */
sef_exit(status);
panic("sef_exit failed");
}
/*===========================================================================*

View file

@ -3,6 +3,8 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include <unistd.h>
#include "gzguts.h"
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0

View file

@ -3,6 +3,8 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include <unistd.h>
#include "gzguts.h"
/* Local functions */
@ -167,12 +169,12 @@ local int gz_head(state)
gz_error(state, Z_DATA_ERROR, "unknown header flags set");
return -1;
}
NEXT(); /* modification time */
NEXT();
NEXT();
NEXT();
NEXT(); /* extra flags */
NEXT(); /* operating system */
(void) NEXT(); /* modification time */
(void) NEXT();
(void) NEXT();
(void) NEXT();
(void) NEXT(); /* extra flags */
(void) NEXT(); /* operating system */
if (flags & 4) { /* extra field */
len = (unsigned)NEXT();
len += (unsigned)NEXT() << 8;
@ -187,8 +189,8 @@ local int gz_head(state)
while (NEXT() > 0)
;
if (flags & 2) { /* header crc */
NEXT();
NEXT();
(void) NEXT();
(void) NEXT();
}
/* an unexpected end of file is not checked for here -- it will be
noticed on the first request for uncompressed data */

View file

@ -5,6 +5,8 @@
#include "gzguts.h"
#include <unistd.h>
/* Local functions */
local int gz_init OF((gz_statep));
local int gz_comp OF((gz_statep, int));