summaryrefslogtreecommitdiff
path: root/usr.bin/tip/tip.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-04-02 01:47:09 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-04-02 01:47:09 +0000
commit030dcde987345aefe1f3a302590b3bea15bb9d9f (patch)
tree131fa6470d49f58f09aadf2d0a48750242c5ff14 /usr.bin/tip/tip.h
parent7bb2316828ce1d059124018af00067d5020f2397 (diff)
Merge in good changes from NetBSD:
Compile in strcict ansi (some day I'll get around to -Wall) use set* functions instead of modifying the lvalue Change a few sprintf() to snprintf() where it coudl possibly matter. Replace zzhack stuff with something saner to make tip work on alpha
Diffstat (limited to 'usr.bin/tip/tip.h')
-rw-r--r--usr.bin/tip/tip.h32
1 files changed, 10 insertions, 22 deletions
diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h
index f2425a95812..86d0e4a913c 100644
--- a/usr.bin/tip/tip.h
+++ b/usr.bin/tip/tip.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: tip.h,v 1.4 1996/10/15 23:47:22 millert Exp $ */
-/* $NetBSD: tip.h,v 1.4 1995/10/29 00:49:43 pk Exp $ */
+/* $OpenBSD: tip.h,v 1.5 1997/04/02 01:47:03 millert Exp $ */
+/* $NetBSD: tip.h,v 1.5 1996/12/29 10:34:11 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -144,30 +144,18 @@ typedef
* initialize it in vars.c, so we cast it as needed to keep lint
* happy.
*/
-typedef
- union {
- int zz_number;
- short zz_boolean[2];
- char zz_character[4];
- int *zz_address;
- }
- zzhack;
#define value(v) vtable[v].v_value
-#define number(v) ((((zzhack *)(&(v))))->zz_number)
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[0])
-#define character(v) ((((zzhack *)(&(v))))->zz_character[0])
-#endif
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[1])
-#define character(v) ((((zzhack *)(&(v))))->zz_character[3])
-#endif
+#define number(v) ((long)(v))
+#define boolean(v) ((short)(long)(v))
+#define character(v) ((char)(long)(v))
+#define address(v) ((long *)(v))
-#define address(v) ((((zzhack *)(&(v))))->zz_address)
+#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 --