diff options
author | 2010-07-01 20:30:05 +0000 | |
---|---|---|
committer | 2010-07-01 20:30:05 +0000 | |
commit | 95fb0f09e8795ffe34fcbd7ab08e03fb7a94deb8 (patch) | |
tree | 0f77d735b63de1d582f12a7a24f81df469317005 | |
parent | remove unused variables (diff) | |
download | wireguard-openbsd-95fb0f09e8795ffe34fcbd7ab08e03fb7a94deb8.tar.xz wireguard-openbsd-95fb0f09e8795ffe34fcbd7ab08e03fb7a94deb8.zip |
Kill a couple of macros, move a few bits around in header.
-rw-r--r-- | usr.bin/tip/cmds.c | 6 | ||||
-rw-r--r-- | usr.bin/tip/tip.h | 18 |
2 files changed, 6 insertions, 18 deletions
diff --git a/usr.bin/tip/cmds.c b/usr.bin/tip/cmds.c index c8762c449ee..cc8b6773ba1 100644 --- a/usr.bin/tip/cmds.c +++ b/usr.bin/tip/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.38 2010/07/01 20:24:19 chl Exp $ */ +/* $OpenBSD: cmds.c,v 1.39 2010/07/01 20:30:05 nicm Exp $ */ /* $NetBSD: cmds.c,v 1.7 1997/02/11 09:24:03 mrg Exp $ */ /* @@ -350,7 +350,7 @@ transmit(FILE *fp, char *eofchars, char *command) printf("\r%d", ++lcount); if (boolean(value(ECHOCHECK))) { timedout = 0; - alarm((unsigned int)lvalue(ETIMEOUT)); + alarm((unsigned int)number(value(ETIMEOUT))); do { /* wait for prompt */ read(FD, (char *)&c, 1); if (timedout || stop) { @@ -438,7 +438,7 @@ send(int c) } tryagain: timedout = 0; - alarm((unsigned int)lvalue(ETIMEOUT)); + alarm((unsigned int)number(value(ETIMEOUT))); read(FD, &cc, 1); alarm(0); if (timedout) { diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h index e45a0e6a954..09d598a1030 100644 --- a/usr.bin/tip/tip.h +++ b/usr.bin/tip/tip.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tip.h,v 1.46 2010/06/30 00:26:49 nicm Exp $ */ +/* $OpenBSD: tip.h,v 1.47 2010/07/01 20:30:05 nicm Exp $ */ /* $NetBSD: tip.h,v 1.7 1997/04/20 00:02:46 mellon Exp $ */ /* @@ -56,15 +56,14 @@ #include <err.h> #include <limits.h> -/* - * String value table - */ +/* Variable table entry. */ typedef struct { char *v_name; /* variable name */ int v_flags; /* type and flags */ char *v_abbrev; /* possible abbreviation */ char *v_value; /* casted to a union later */ } value_t; +extern value_t vtable[]; /* variable table */ #define V_STRING 01 /* string valued */ #define V_BOOL 02 /* true-false value */ @@ -76,25 +75,15 @@ typedef struct { #define V_READONLY 040 /* variable is not writable */ #define V_INIT 0100 /* static data space used for initialization */ -/* - * variable manipulation stuff -- - * if we defined the value entry in value_t, then we couldn't - * initialize it in vars.c, so we cast it as needed to keep lint - * happy. - */ - #define value(v) vtable[v].v_value -#define lvalue(v) (long)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 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) /* * Escape command table definitions -- @@ -112,7 +101,6 @@ typedef extern int vflag; /* verbose during reading of .tiprc file */ extern int noesc; /* no escape `~' char */ -extern value_t vtable[]; /* variable table */ /* * Definition of indices into variable table so |