Pass a little lint.
This commit is contained in:
parent
29dc02e572
commit
c4341bc3e1
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hayes.c,v 1.12 2006/04/03 02:25:27 perry Exp $ */
|
||||
/* $NetBSD: hayes.c,v 1.13 2006/04/03 04:53:59 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: hayes.c,v 1.12 2006/04/03 02:25:27 perry Exp $");
|
||||
__RCSID("$NetBSD: hayes.c,v 1.13 2006/04/03 04:53:59 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -69,12 +69,6 @@ static jmp_buf timeoutbuf;
|
||||
#define DUMBUFLEN 40
|
||||
static char dumbuf[DUMBUFLEN];
|
||||
|
||||
#define DIALING 1
|
||||
#define IDLE 2
|
||||
#define CONNECTED 3
|
||||
#define FAILED 4
|
||||
static int state = IDLE;
|
||||
|
||||
static void error_rep(char);
|
||||
static char gobble(const char *);
|
||||
static void goodbye(void);
|
||||
@ -82,6 +76,7 @@ static int hay_sync(void);
|
||||
static void sigALRM(int);
|
||||
|
||||
int
|
||||
/*ARGSUSED*/
|
||||
hay_dialer(char *num, char *acu)
|
||||
{
|
||||
char *cp;
|
||||
@ -106,7 +101,6 @@ hay_dialer(char *num, char *acu)
|
||||
if (*cp == '=')
|
||||
*cp = ',';
|
||||
write(FD, num, strlen(num));
|
||||
state = DIALING;
|
||||
write(FD, "\r", 1);
|
||||
connected = 0;
|
||||
if (gobble("\r")) {
|
||||
@ -115,12 +109,8 @@ hay_dialer(char *num, char *acu)
|
||||
else
|
||||
connected = 1;
|
||||
}
|
||||
if (connected)
|
||||
state = CONNECTED;
|
||||
else {
|
||||
state = FAILED;
|
||||
if (!connected)
|
||||
return (connected); /* lets get out of here.. */
|
||||
}
|
||||
tcflush(FD, TCIOFLUSH);
|
||||
if (timeout)
|
||||
hay_disconnect(); /* insurance */
|
||||
@ -151,6 +141,7 @@ hay_abort(void)
|
||||
}
|
||||
|
||||
static void
|
||||
/*ARGSUSED*/
|
||||
sigALRM(int dummy)
|
||||
{
|
||||
|
||||
@ -180,7 +171,7 @@ gobble(const char *match)
|
||||
signal(SIGALRM, f);
|
||||
return (0);
|
||||
}
|
||||
alarm(number(value(DIALTIMEOUT)));
|
||||
alarm((unsigned int)number(value(DIALTIMEOUT)));
|
||||
read(FD, &c, 1);
|
||||
alarm(0);
|
||||
c &= 0177;
|
||||
@ -294,7 +285,7 @@ hay_sync(void)
|
||||
sleep(1);
|
||||
ioctl(FD, FIONREAD, &len);
|
||||
if (len) {
|
||||
len = read(FD, dumbuf, min(len, DUMBUFLEN));
|
||||
len = read(FD, dumbuf, (size_t)min(len, DUMBUFLEN));
|
||||
if (strchr(dumbuf, '0') ||
|
||||
(strchr(dumbuf, 'O') && strchr(dumbuf, 'K')))
|
||||
return(1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cmds.c,v 1.23 2006/04/03 04:25:30 perry Exp $ */
|
||||
/* $NetBSD: cmds.c,v 1.24 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: cmds.c,v 1.23 2006/04/03 04:25:30 perry Exp $");
|
||||
__RCSID("$NetBSD: cmds.c,v 1.24 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "tip.h"
|
||||
@ -174,7 +174,7 @@ transfer(char *buf, int fd, const 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 (write(fd, buffer, (size_t)cnt) != cnt) {
|
||||
printf("\r\nwrite error\r\n");
|
||||
quit = 1;
|
||||
}
|
||||
@ -182,15 +182,15 @@ transfer(char *buf, int fd, const char *eofchars)
|
||||
}
|
||||
}
|
||||
if ((cnt = (p-buffer)) != 0)
|
||||
if (write(fd, buffer, cnt) != cnt)
|
||||
if (write(fd, buffer, (size_t)cnt) != cnt)
|
||||
printf("\r\nwrite error\r\n");
|
||||
|
||||
if (boolean(value(VERBOSE)))
|
||||
prtime(" lines transferred in ", time(0)-start);
|
||||
tcsetattr(0, TCSAFLUSH, &term);
|
||||
write(fildes[1], (char *)&ccc, 1);
|
||||
signal(SIGINT, f);
|
||||
close(fd);
|
||||
(void)tcsetattr(0, TCSAFLUSH, &term);
|
||||
(void)write(fildes[1], (char *)&ccc, 1);
|
||||
(void)signal(SIGINT, f);
|
||||
(void)close(fd);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -294,7 +294,8 @@ transmit(FILE *fd, const char *eofchars, char *command)
|
||||
{
|
||||
const char *pc;
|
||||
char lastc;
|
||||
int c, ccount, lcount;
|
||||
int c;
|
||||
int ccount, lcount;
|
||||
time_t start_t, stop_t;
|
||||
sig_t f;
|
||||
|
||||
@ -305,9 +306,9 @@ transmit(FILE *fd, const char *eofchars, char *command)
|
||||
read(repdes[0], (char *)&ccc, 1);
|
||||
if (command != NULL) {
|
||||
for (pc = command; *pc; pc++)
|
||||
send(*pc);
|
||||
sendchar(*pc);
|
||||
if (boolean(value(ECHOCHECK)))
|
||||
read(FD, (char *)&c, 1); /* trailing \n */
|
||||
(void)read(FD, &c, (size_t)1); /* trailing \n */
|
||||
else {
|
||||
tcdrain(FD);
|
||||
sleep(5); /* wait for remote stty to take effect */
|
||||
@ -336,9 +337,9 @@ transmit(FILE *fd, const char *eofchars, char *command)
|
||||
else if (c == '\t') {
|
||||
if (!boolean(value(RAWFTP))) {
|
||||
if (boolean(value(TABEXPAND))) {
|
||||
send(' ');
|
||||
sendchar(' ');
|
||||
while ((++ccount % 8) != 0)
|
||||
send(' ');
|
||||
sendchar(' ');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -346,7 +347,7 @@ transmit(FILE *fd, const char *eofchars, char *command)
|
||||
if (!boolean(value(RAWFTP)))
|
||||
continue;
|
||||
}
|
||||
send(c);
|
||||
sendchar(c);
|
||||
} while (c != '\r' && !boolean(value(RAWFTP)));
|
||||
if (boolean(value(VERBOSE)))
|
||||
printf("\r%d", ++lcount);
|
||||
@ -354,7 +355,7 @@ transmit(FILE *fd, const char *eofchars, char *command)
|
||||
timedout = 0;
|
||||
alarm((unsigned int)value(ETIMEOUT));
|
||||
do { /* wait for prompt */
|
||||
read(FD, (char *)&c, 1);
|
||||
read(FD, &c, (size_t)1);
|
||||
if (timedout || stop) {
|
||||
if (timedout)
|
||||
printf(
|
||||
@ -368,10 +369,10 @@ transmit(FILE *fd, const char *eofchars, char *command)
|
||||
}
|
||||
out:
|
||||
if (lastc != '\n' && !boolean(value(RAWFTP)))
|
||||
send('\r');
|
||||
sendchar('\r');
|
||||
if (eofchars) {
|
||||
for (pc = eofchars; *pc; pc++)
|
||||
send(*pc);
|
||||
sendchar(*pc);
|
||||
}
|
||||
stop_t = time(0);
|
||||
fclose(fd);
|
||||
@ -423,7 +424,7 @@ cu_put(char dummy)
|
||||
* wait for echo & handle timeout
|
||||
*/
|
||||
void
|
||||
send(char c)
|
||||
sendchar(char c)
|
||||
{
|
||||
char cc;
|
||||
int retry = 0;
|
||||
@ -625,7 +626,7 @@ setscript(void)
|
||||
*/
|
||||
read(repdes[0], &c, 1);
|
||||
if (c == 'n')
|
||||
printf("can't create %s\r\n", value(RECORD));
|
||||
printf("can't create %s\r\n", (char *)value(RECORD));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -930,7 +931,7 @@ anyof(char *s1, const char *s2)
|
||||
{
|
||||
int c;
|
||||
|
||||
while ((c = *s1++))
|
||||
while ((c = *s1++) != '\0')
|
||||
if (any(c, s2))
|
||||
return(1);
|
||||
return(0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cu.c,v 1.16 2006/04/03 02:25:27 perry Exp $ */
|
||||
/* $NetBSD: cu.c,v 1.17 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -36,7 +36,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: cu.c,v 1.16 2006/04/03 02:25:27 perry Exp $");
|
||||
__RCSID("$NetBSD: cu.c,v 1.17 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "tip.h"
|
||||
@ -50,7 +50,7 @@ static void cuusage(void);
|
||||
void
|
||||
cumain(int argc, char *argv[])
|
||||
{
|
||||
int i, phonearg = 0;
|
||||
int c, i, phonearg = 0;
|
||||
int parity = 0; /* 0 is no parity */
|
||||
int flow = -1; /* -1 is "tandem" ^S/^Q */
|
||||
static int helpme = 0, nostop = 0;
|
||||
@ -81,12 +81,12 @@ cumain(int argc, char *argv[])
|
||||
DV = NULL;
|
||||
BR = DEFBR;
|
||||
|
||||
while((ch = getopt_long(argc, argv,
|
||||
while((c = getopt_long(argc, argv,
|
||||
"E:F:P:a:p:c:l:s:heot0123456789", longopts, NULL)) != -1) {
|
||||
|
||||
if (helpme == 1) cuhelp();
|
||||
|
||||
switch(ch) {
|
||||
switch(c) {
|
||||
|
||||
case 'E':
|
||||
if(strlen(optarg) > 1)
|
||||
@ -156,7 +156,7 @@ cumain(int argc, char *argv[])
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
snprintf(brbuf, sizeof(brbuf) -1, "%s%c",
|
||||
brbuf, ch);
|
||||
brbuf, c);
|
||||
BR = atoi(brbuf);
|
||||
break;
|
||||
default:
|
||||
@ -248,7 +248,7 @@ cumain(int argc, char *argv[])
|
||||
if (HD)
|
||||
setboolean(value(LECHO), TRUE);
|
||||
if (HW) {
|
||||
if (ttysetup(BR) != 0) {
|
||||
if (ttysetup((speed_t)BR) != 0) {
|
||||
errx(3, "unsupported speed %ld", BR);
|
||||
}
|
||||
}
|
||||
@ -256,7 +256,7 @@ cumain(int argc, char *argv[])
|
||||
errx(1, "Connect failed");
|
||||
}
|
||||
if (!HW) {
|
||||
if (ttysetup(BR) != 0) {
|
||||
if (ttysetup((speed_t)BR) != 0) {
|
||||
errx(3, "unsupported speed %ld", BR);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hunt.c,v 1.13 2006/04/03 02:01:28 perry Exp $ */
|
||||
/* $NetBSD: hunt.c,v 1.14 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: hunt.c,v 1.13 2006/04/03 02:01:28 perry Exp $");
|
||||
__RCSID("$NetBSD: hunt.c,v 1.14 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "tip.h"
|
||||
@ -45,6 +45,7 @@ static int deadfl;
|
||||
void dead(int);
|
||||
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
dead(int dummy)
|
||||
{
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tip.c,v 1.38 2006/04/03 04:25:30 perry Exp $ */
|
||||
/* $NetBSD: tip.c,v 1.39 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: tip.c,v 1.38 2006/04/03 04:25:30 perry Exp $");
|
||||
__RCSID("$NetBSD: tip.c,v 1.39 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -160,7 +160,7 @@ notnumber:
|
||||
* (this is particularly true of things like a DF03-AC)
|
||||
*/
|
||||
if (HW) {
|
||||
if (ttysetup(i) != 0) {
|
||||
if (ttysetup((speed_t)i) != 0) {
|
||||
errx(3, "bad baud rate %d",
|
||||
(int)number(value(BAUDRATE)));
|
||||
}
|
||||
@ -169,7 +169,7 @@ notnumber:
|
||||
errx(1, "\07%s\n[EOT]\n", q);
|
||||
}
|
||||
if (!HW) {
|
||||
if (ttysetup(i) != 0) {
|
||||
if (ttysetup((speed_t)i) != 0) {
|
||||
errx(3, "bad baud rate %d",
|
||||
(int)number(value(BAUDRATE)));
|
||||
}
|
||||
@ -232,11 +232,12 @@ cucommon:
|
||||
}
|
||||
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
cleanup(int dummy)
|
||||
{
|
||||
|
||||
if (odisc)
|
||||
ioctl(0, TIOCSETD, (char *)&odisc);
|
||||
ioctl(0, TIOCSETD, &odisc);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@ -300,6 +301,7 @@ prompt(const char *s, char *p, size_t l)
|
||||
* Interrupt service routine during prompting
|
||||
*/
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
intprompt(int dummy)
|
||||
{
|
||||
|
||||
@ -329,7 +331,7 @@ tipin(void)
|
||||
setscript();
|
||||
}
|
||||
|
||||
while (1) {
|
||||
for (;;) {
|
||||
gch = getchar()&STRIP_PAR;
|
||||
if ((gch == character(value(ESCAPE))) && bol) {
|
||||
if (!(gch = escape()))
|
||||
@ -455,7 +457,7 @@ help(char c)
|
||||
* Set up the "remote" tty's state
|
||||
*/
|
||||
int
|
||||
ttysetup(int spd)
|
||||
ttysetup(speed_t spd)
|
||||
{
|
||||
struct termios cntrl;
|
||||
|
||||
@ -515,7 +517,7 @@ setparity(const char *defparity)
|
||||
const char *parity;
|
||||
static char *curpar;
|
||||
|
||||
if (value(PARITY) == NULL || (value(PARITY))[0] == '\0') {
|
||||
if (value(PARITY) == NULL || ((char *)value(PARITY))[0] == '\0') {
|
||||
if (curpar != NULL)
|
||||
free(curpar);
|
||||
value(PARITY) = curpar = strdup(defparity);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tip.h,v 1.24 2006/04/03 04:25:30 perry Exp $ */
|
||||
/* $NetBSD: tip.h,v 1.25 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -79,8 +79,8 @@ char *HO; /* host name */
|
||||
long BR; /* line speed for conversation */
|
||||
long FS; /* frame size for transfers */
|
||||
|
||||
int DU; /* this host is dialed up */
|
||||
int HW; /* this device is hardwired, see hunt.c */
|
||||
long DU; /* this host is dialed up */
|
||||
long HW; /* this device is hardwired, see hunt.c */
|
||||
char *ES; /* escape character */
|
||||
char *EX; /* exceptions */
|
||||
char *FO; /* force (literal next) char*/
|
||||
@ -90,7 +90,7 @@ char *PR; /* remote prompt */
|
||||
long DL; /* line delay for file transfers to remote */
|
||||
long CL; /* char delay for file transfers to remote */
|
||||
long ET; /* echocheck timeout */
|
||||
int HD; /* this host is half duplex - do local echo */
|
||||
long HD; /* this host is half duplex - do local echo */
|
||||
char DC; /* this host is directly connected. */
|
||||
|
||||
/*
|
||||
@ -99,10 +99,10 @@ char DC; /* this host is directly connected. */
|
||||
typedef
|
||||
struct {
|
||||
const char *v_name; /* whose name is it */
|
||||
char v_type; /* for interpreting set's */
|
||||
char v_access; /* protection of touchy ones */
|
||||
uint8_t v_type; /* for interpreting set's */
|
||||
uint8_t v_access; /* protection of touchy ones */
|
||||
const char *v_abrev; /* possible abreviation */
|
||||
char *v_value; /* casted to a union later */
|
||||
void *v_value; /* casted to a union later */
|
||||
/*
|
||||
* XXX: this assumes that the storage space
|
||||
* of a pointer >= that of a long
|
||||
@ -154,15 +154,15 @@ typedef
|
||||
|
||||
#define value(v) vtable[v].v_value
|
||||
|
||||
#define number(v) ((long)(v))
|
||||
#define boolean(v) ((short)(long)(v))
|
||||
#define character(v) ((char)(long)(v))
|
||||
#define address(v) ((long *)(v))
|
||||
#define number(v) ((int)(intptr_t)(v))
|
||||
#define boolean(v) ((short)(intptr_t)(v))
|
||||
#define character(v) ((char)(intptr_t)(v))
|
||||
#define address(v) ((long *)(intptr_t)(v))
|
||||
|
||||
#define setnumber(v,n) do { (v) = (char *)(long)(n); } while (0)
|
||||
#define setboolean(v,n) do { (v) = (char *)(long)(n); } while (0)
|
||||
#define setcharacter(v,n) do { (v) = (char *)(long)(n); } while (0)
|
||||
#define setaddress(v,n) do { (v) = (char *)(n); } while (0)
|
||||
#define setnumber(v,n) do { (v) = (char *)(intptr_t)(n); } while (/*CONSTCOND*/0)
|
||||
#define setboolean(v,n) do { (v) = (char *)(intptr_t)(n); } while (/*CONSTCOND*/0)
|
||||
#define setcharacter(v,n) do { (v) = (char *)(intptr_t)(n); } while (/*CONSTCOND*/0)
|
||||
#define setaddress(v,n) do { (v) = (char *)(intptr_t)(n); } while (/*CONSTCOND*/0)
|
||||
|
||||
/*
|
||||
* Escape command table definitions --
|
||||
@ -288,7 +288,7 @@ void pipeout(char);
|
||||
int prompt(const char *, char *, size_t);
|
||||
void xpwrite(int, char *, size_t);
|
||||
void raw(void);
|
||||
void send(char);
|
||||
void sendchar(char);
|
||||
void sendfile(char);
|
||||
void setparity(const char *);
|
||||
void setscript(void);
|
||||
@ -297,7 +297,7 @@ void suspend(char);
|
||||
void tandem(const char *);
|
||||
void tipabort(const char *);
|
||||
void tipout(void);
|
||||
int ttysetup(int);
|
||||
int ttysetup(speed_t);
|
||||
void unraw(void);
|
||||
void variable(char);
|
||||
void vinit(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tipout.c,v 1.10 2006/04/03 00:51:13 perry Exp $ */
|
||||
/* $NetBSD: tipout.c,v 1.11 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: tipout.c,v 1.10 2006/04/03 00:51:13 perry Exp $");
|
||||
__RCSID("$NetBSD: tipout.c,v 1.11 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "tip.h"
|
||||
@ -57,6 +57,7 @@ void intTERM(int);
|
||||
* sent by TIPIN when it wants to posses the remote host
|
||||
*/
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
intIOT(int dummy)
|
||||
{
|
||||
|
||||
@ -70,6 +71,7 @@ intIOT(int dummy)
|
||||
* accepts script file name over the pipe and acts accordingly
|
||||
*/
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
intEMT(int dummy)
|
||||
{
|
||||
char c, line[256];
|
||||
@ -100,6 +102,7 @@ intEMT(int dummy)
|
||||
}
|
||||
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
intTERM(int dummy)
|
||||
{
|
||||
|
||||
@ -109,6 +112,7 @@ intTERM(int dummy)
|
||||
}
|
||||
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
intSYS(int dummy)
|
||||
{
|
||||
|
||||
@ -150,10 +154,10 @@ tipout(void)
|
||||
omask = sigblock(ALLSIGS);
|
||||
for (cp = buf; cp < buf + cnt; cp++)
|
||||
*cp &= STRIP_PAR;
|
||||
write(1, buf, cnt);
|
||||
write(1, buf, (size_t)cnt);
|
||||
if (boolean(value(SCRIPT)) && fscript != NULL) {
|
||||
if (!boolean(value(BEAUTIFY))) {
|
||||
fwrite(buf, 1, cnt, fscript);
|
||||
fwrite(buf, 1, (size_t)cnt, fscript);
|
||||
continue;
|
||||
}
|
||||
for (cp = buf; cp < buf + cnt; cp++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: value.c,v 1.12 2006/04/03 00:51:13 perry Exp $ */
|
||||
/* $NetBSD: value.c,v 1.13 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)value.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: value.c,v 1.12 2006/04/03 00:51:13 perry Exp $");
|
||||
__RCSID("$NetBSD: value.c,v 1.13 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "tip.h"
|
||||
@ -43,7 +43,7 @@ __RCSID("$NetBSD: value.c,v 1.12 2006/04/03 00:51:13 perry Exp $");
|
||||
|
||||
static int col = 0;
|
||||
|
||||
static int vaccess(unsigned, unsigned);
|
||||
static int vaccess(int, int);
|
||||
static void vassign(value_t *, char *);
|
||||
static value_t *vlookup(const char *);
|
||||
static void vprint(value_t *);
|
||||
@ -71,7 +71,7 @@ vinit(void)
|
||||
* Read the .tiprc file in the HOME directory
|
||||
* for sets
|
||||
*/
|
||||
snprintf(file, sizeof(file), "%s/.tiprc", value(HOME));
|
||||
snprintf(file, sizeof(file), "%s/.tiprc", (char *)value(HOME));
|
||||
if ((f = fopen(file, "r")) != NULL) {
|
||||
char *tp;
|
||||
|
||||
@ -94,7 +94,7 @@ void
|
||||
vassign(value_t *p, char *v)
|
||||
{
|
||||
|
||||
if (!vaccess(p->v_access, WRITE)) {
|
||||
if (!vaccess(p->v_access, (unsigned int)WRITE)) {
|
||||
printf("access denied\r\n");
|
||||
return;
|
||||
}
|
||||
@ -218,7 +218,6 @@ vprint(value_t *p)
|
||||
printf("%s=", p->v_name);
|
||||
col++;
|
||||
if (p->v_value) {
|
||||
/*###226 [cc] warning: passing arg 1 of `interp' discards qualifiers from pointer target type%%%*/
|
||||
cp = interp(p->v_value);
|
||||
col += strlen(cp);
|
||||
printf("%s", cp);
|
||||
@ -249,7 +248,7 @@ vprint(value_t *p)
|
||||
|
||||
|
||||
static int
|
||||
vaccess(unsigned mode, unsigned rw)
|
||||
vaccess(int mode, int rw)
|
||||
{
|
||||
|
||||
if (mode & (rw<<PUBLIC))
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vars.c,v 1.11 2006/04/03 02:25:27 perry Exp $ */
|
||||
/* $NetBSD: vars.c,v 1.12 2006/04/03 04:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)vars.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: vars.c,v 1.11 2006/04/03 02:25:27 perry Exp $");
|
||||
__RCSID("$NetBSD: vars.c,v 1.12 2006/04/03 04:53:58 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "tip.h"
|
||||
@ -46,70 +46,70 @@ static char path_bshell[] = _PATH_BSHELL;
|
||||
*/
|
||||
value_t vtable[] = {
|
||||
{ "beautify", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"be", (char *)TRUE },
|
||||
"be", (void *)TRUE },
|
||||
{ "baudrate", NUMBER|IREMOTE|INIT, (READ<<PUBLIC)|(WRITE<<ROOT),
|
||||
"ba", (char *)&BR },
|
||||
"ba", &BR },
|
||||
{ "dialtimeout",NUMBER, (READ<<PUBLIC)|(WRITE<<ROOT),
|
||||
"dial", (char *)60 },
|
||||
"dial", (void *)60 },
|
||||
{ "eofread", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"eofr", (char *)&IE },
|
||||
"eofr", &IE },
|
||||
{ "eofwrite", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"eofw", (char *)&OE },
|
||||
"eofw", &OE },
|
||||
{ "eol", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
NULL, (char *)&EL },
|
||||
NULL, &EL },
|
||||
{ "escape", CHAR, (READ|WRITE)<<PUBLIC,
|
||||
"es", (char *)'~' },
|
||||
"es", (void *)'~' },
|
||||
{ "exceptions", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
|
||||
"ex", (char *)&EX },
|
||||
"ex", &EX },
|
||||
{ "force", CHAR, (READ|WRITE)<<PUBLIC,
|
||||
"fo", NULL },
|
||||
{ "framesize", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"fr", (char *)&FS },
|
||||
"fr", &FS },
|
||||
{ "host", STRING|IREMOTE|INIT, READ<<PUBLIC,
|
||||
"ho", (char *)&HO },
|
||||
"ho", &HO },
|
||||
{ "phones", STRING|INIT|IREMOTE, READ<<PUBLIC,
|
||||
NULL, (char *)&PH },
|
||||
NULL, &PH },
|
||||
{ "prompt", CHAR, (READ|WRITE)<<PUBLIC,
|
||||
"pr", (char *)'\n' },
|
||||
"pr", (void *)'\n' },
|
||||
{ "raise", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"ra", (char *)FALSE },
|
||||
"ra", (void *)FALSE },
|
||||
{ "raisechar", CHAR, (READ|WRITE)<<PUBLIC,
|
||||
"rc", NULL },
|
||||
{ "record", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
|
||||
"rec", (char *)&RE },
|
||||
"rec", &RE },
|
||||
{ "remote", STRING|INIT|IREMOTE, READ<<PUBLIC,
|
||||
NULL, (char *)&RM },
|
||||
NULL, &RM },
|
||||
{ "script", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"sc", (char *)FALSE },
|
||||
"sc", FALSE },
|
||||
{ "tabexpand", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"tab", (char *)FALSE },
|
||||
"tab", (void *)FALSE },
|
||||
{ "verbose", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"verb", (char *)TRUE },
|
||||
"verb", (void *)TRUE },
|
||||
{ "SHELL", STRING|ENVIRON|INIT, (READ|WRITE)<<PUBLIC,
|
||||
NULL, path_bshell },
|
||||
{ "HOME", STRING|ENVIRON, (READ|WRITE)<<PUBLIC,
|
||||
NULL, NULL },
|
||||
{ "echocheck", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"ec", (char *)FALSE },
|
||||
"ec", (void *)FALSE },
|
||||
{ "disconnect", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"di", (char *)&DI },
|
||||
"di", &DI },
|
||||
{ "tandem", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"ta", (char *)TRUE },
|
||||
"ta", (void *)TRUE },
|
||||
{ "linedelay", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"ldelay", (char *)&DL },
|
||||
"ldelay", &DL },
|
||||
{ "chardelay", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"cdelay", (char *)&CL },
|
||||
"cdelay", &CL },
|
||||
{ "etimeout", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
|
||||
"et", (char *)&ET },
|
||||
"et", &ET },
|
||||
{ "rawftp", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"raw", (char *)FALSE },
|
||||
"raw", (void *)FALSE },
|
||||
{ "halfduplex", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"hdx", (char *)FALSE },
|
||||
"hdx", (void *)FALSE },
|
||||
{ "localecho", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"le", (char *)FALSE },
|
||||
"le", (void *)FALSE },
|
||||
{ "parity", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
|
||||
"par", (char *)&PA },
|
||||
"par", &PA },
|
||||
{ "hardwareflow", BOOL, (READ|WRITE)<<PUBLIC,
|
||||
"hf", (char *)FALSE },
|
||||
"hf", (void *)FALSE },
|
||||
{ NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user