Fix compilation warnings (up to level 3).

This commit is contained in:
ru 2006-08-31 19:19:44 +00:00
parent 5ffd88a18e
commit ede4b2e9ac
8 changed files with 14 additions and 12 deletions

View File

@ -177,7 +177,8 @@ gobble(char *match)
{
char c;
sig_t f;
int i, status = 0;
size_t i;
int status = 0;
f = signal(SIGALRM, sigALRM);
dialtimeout = 0;

View File

@ -176,7 +176,7 @@ struct vaconfig {
} vaconfig[] = {
{ "/dev/cua0",'4','0' },
{ "/dev/cua1",'4','1' },
{ 0 }
{ NULL, '\0', '\0' }
};
#define pc(x) (c = x, write(AC,&c,1))

View File

@ -184,8 +184,8 @@ transfer(char *buf, int fd, char *eofchars)
if (c == '\n' && boolean(value(VERBOSE)))
printf("\r%d", ++ct);
if ((cnt = (p-buffer)) == number(value(FRAMESIZE))) {
if (write(fd, buffer, cnt) != cnt) {
if ((cnt = (p-buffer)) == (size_t)number(value(FRAMESIZE))) {
if ((size_t)write(fd, buffer, cnt) != cnt) {
printf("\r\nwrite error\r\n");
quit = 1;
}
@ -193,7 +193,7 @@ transfer(char *buf, int fd, char *eofchars)
}
}
if ((cnt = (p-buffer)))
if (write(fd, buffer, cnt) != cnt)
if ((size_t)write(fd, buffer, cnt) != cnt)
printf("\r\nwrite error\r\n");
if (boolean(value(VERBOSE)))
@ -885,7 +885,7 @@ hardwareflow(char *option)
void
linedisc(char *option)
{
int ld = (int)value(LINEDISC);
int ld = (int)(intptr_t)value(LINEDISC);
ioctl(FD, TIOCSETD, &ld);
}

View File

@ -62,5 +62,5 @@ esctable_t etable[] = {
{ 'v', NORM, "list variables", listvariables },
{ '?', NORM, "get this summary", help },
{ '#', NORM, "send break", genbrk },
{ 0, 0, 0 }
{ '\0', 0, NULL, NULL }
};

View File

@ -233,7 +233,7 @@ main(int argc, char *argv[])
(void)signal(SIGALRM, timeout);
if (value(LINEDISC) != TTYDISC) {
int ld = (int)value(LINEDISC);
int ld = (int)(intptr_t)value(LINEDISC);
ioctl(FD, TIOCSETD, &ld);
}
@ -565,7 +565,7 @@ static char partab[0200];
void
parwrite(int fd, char *buf, size_t n)
{
int i;
size_t i;
char *bp;
bp = buf;

View File

@ -82,7 +82,7 @@ intEMT(int signo)
char reply;
read(fildes[0], &c, 1);
while (c != '\n' && pline - line < sizeof(line)) {
while (c != '\n' && (size_t)(pline - line) < sizeof(line)) {
*pline++ = c;
read(fildes[0], &c, 1);
}

View File

@ -49,6 +49,7 @@ static const char rcsid[] = "$OpenBSD: uucplock.c,v 1.11 2006/03/16 19:32:46 der
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include "tip.h"
#include "pathnames.h"
/*

View File

@ -172,7 +172,7 @@ vtoken(char *s)
if ((p = vlookup(s))) {
cp++;
if (p->v_type&NUMBER)
vassign(p, (char *)atoi(cp));
vassign(p, (char *)(intptr_t)atoi(cp));
else {
if (strcmp(s, "record") == 0)
cp = expand(cp);
@ -335,7 +335,7 @@ vstring(char *s, char *v)
if (p == 0)
return (1);
if (p->v_type&NUMBER)
vassign(p, (char *)atoi(v));
vassign(p, (char *)(intptr_t)atoi(v));
else {
if (strcmp(s, "record") == 0)
v = expand(v);